@layer site {
/* Hälsokartan (RAD-012). No inline styles (CSP). Mobile first. */
.hk { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 16px; padding: 0; overflow-wrap: anywhere; }
.hk section { padding: 0; margin: 0; }
.hk [hidden] { display: none !important; }
.hk-controls { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.hk-field { display: block; /* not grid: in WebKit a native select in a grid track reports a wider scroll width and overflows a 320 px screen */ font-size: .88rem; font-weight: 700; color: var(--text-secondary); }
.hk-field select { margin-top: 4px; min-height: 44px; padding-block: 0; border-radius: 12px; border: 1px solid var(--separator); background-color: var(--bg-card); font: inherit; font-weight: 500; color: var(--text-primary); width: 100%; }
.hk-stations { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.hk-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--separator); background: var(--bg-card); font-size: .92rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.hk-chip:has(input:checked) { background: var(--primary-pale); border-color: var(--primary); color: var(--primary-dark); }
.hk-chip:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
.hk-chip input { width: 20px; height: 20px; accent-color: var(--primary); }
.hk-timebar { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 12px; align-items: center; background: var(--bg-card); border: 1px solid var(--separator); border-radius: 12px; padding: 8px 12px; }
.hk-range { display: grid; gap: 2px; font-size: .88rem; color: var(--text-secondary); }
.hk-range input { width: 100%; min-height: 32px; accent-color: var(--primary); }
.hk-btn { min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--separator); background: var(--bg-base); color: var(--primary-dark); font: inherit; font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; cursor: pointer; }
.hk-btn:focus-visible, .hk-rowbtn:focus-visible, .hk-close:focus-visible, .hk-field select:focus-visible, .hk-range input:focus-visible, .hk-stations input:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.hk-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
/* Map controls: MapLibre's own zoom control plus one custom control, all with 44 px targets. */
.hk .maplibregl-ctrl-group button, .hk .hk-viewctrl .hk-cbtn { width: 44px; height: 44px; }
.hk .hk-viewctrl .hk-cbtn { display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: #333; cursor: pointer; }
/* The hover tint MapLibre gives its own buttons (order 027: MapLibre is in the vendor layer, below this rule's transparent background). */
.hk .hk-viewctrl .hk-cbtn:not(:disabled):hover { background-color: rgb(0 0 0 / 5%); }
.hk .hk-viewctrl .hk-cbtn + .hk-cbtn { border-top: 1px solid #ddd; }
.hk .hk-viewctrl .hk-cbtn:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.hk-ico { width: 22px; height: 22px; } .hk-ico path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hk-note { margin: 0; }
.hk-ptoggle { min-height: 44px; margin: 4px 0 0; padding: 0 14px; border-radius: 12px; border: 1px solid var(--separator); background: var(--bg-base); color: var(--primary-dark); font: inherit; font-weight: 700; cursor: pointer; }
.hk-ptoggle:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.hk-explore { margin: 6px 0; }
.hk-panel:not(.is-open) .hk-pmore { display: none; }
.hk-map { position: relative; width: 100%; height: clamp(360px, 64dvh, 560px); border: 1px solid var(--separator); border-radius: 14px; overflow: hidden; background: var(--bg-base); }
.hk-map:focus-visible, .hk-map .maplibregl-canvas:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.hk-fallback { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--tertiary-pale); color: var(--text-secondary); }
.hk-legend { background: var(--bg-card); border: 1px solid var(--separator); border-radius: 12px; padding: 8px 12px; font-size: .85rem; }
.hk-legend__t { margin: 0 0 6px; font-weight: 700; color: var(--text-secondary); }
.hk-legend ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; }
.hk-legend li { margin: 0; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.hk-legend li::before { content: none; }
.hk-sw { width: 18px; height: 14px; border-radius: 3px; border: 1px solid #8A9487; display: inline-block; }
.hk-sw--0 { background: #EEF3F7; } .hk-sw--1 { background: #CFDFEA; } .hk-sw--2 { background: #A9C6DA; } .hk-sw--3 { background: #7FA8C5; } .hk-sw--4 { background: #52809F; } .hk-sw--5 { background: #2F5876; }
.hk-sw--none { background: repeating-linear-gradient(135deg, #F1F5F0 0 3px, #8A9487 3px 4px); }
.hk-panel { background: var(--bg-card); border: 1px solid var(--separator); border-radius: 14px; padding: 12px 14px; }
.hk-panel-subtitle { font-size: 1rem; margin: 12px 0 4px; }
.hk-phead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hk-panel .hk-ptitle { font-size: 1.1rem; margin: 0; }
.hk-pval { margin: 6px 0; font-weight: 700; }
.hk-hint, .hk-cap { margin: 4px 0; font-size: .86rem; color: var(--text-muted); }
.hk-close { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--separator); background: var(--bg-base); font: inherit; font-weight: 600; cursor: pointer; }
.hk-chart { display: block; width: 100%; max-width: 560px; height: auto; margin: 6px 0; }
.hk-chart text { font-family: inherit; fill: var(--text-secondary); }
.hk-tick { font-size: 10px; } .hk-ylab { font-size: 10px; font-weight: 700; }
.hk-grid { stroke: var(--separator); stroke-width: 1; } .hk-marker { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 2 2; }
.hk-key { list-style: none; margin: 4px 0; padding: 0; font-size: .86rem; display: grid; gap: 2px; }
.hk-key li { margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; } .hk-key li::before { content: none; }
.hk-key--compact { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hk-keysw { width: 30px; height: 8px; flex: none; }
.hk-table h2, .hk-stlist h2, .hk-sources h2 { font-size: 1.1rem; margin: 0 0 6px; }
.hk-tbl { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--bg-card); border-radius: 12px; overflow: hidden; }
.hk-tbl th, .hk-tbl td { text-align: left; padding: 4px 10px; border-bottom: 1px solid var(--separator); }
.hk-tbl td { font-variant-numeric: tabular-nums; }
.hk-table-scroll { overflow-x: auto; }
.hk-table-scroll:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; }
.hk-table-scroll .hk-tbl { font-size: .83rem; }
.hk-table-scroll .hk-tbl th, .hk-table-scroll .hk-tbl td { padding: 6px 5px; }
.hk-tbl--weather td, .hk-tbl--weather th[scope="row"] { white-space: nowrap; }
.hk-tbl tr[aria-current="true"] { background: var(--primary-pale); font-weight: 700; }
.hk-rowbtn { background: none; border: 0; padding: 8px 0; min-height: 44px; font: inherit; font-weight: 600; color: var(--primary-dark); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.hk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hk-sources ul { margin: 0; padding-left: 1.1rem; font-size: .9rem; display: grid; gap: 6px; }
.hk-stlist { display: grid; gap: 8px; }

/* Map controls and results share the same workspace at every width. */
.hk-stage { min-width: 0; }
.hk-panel { min-width: 0; align-self: start; }
.hk-meta { margin: 0; color: var(--primary-dark); font-weight: 700; }
.hk-point-value { font-size: .875rem; line-height: 1.35; }
.hk-map { height: clamp(280px, 38dvh, 430px); }
.hk-stlist { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.hk-range input { min-height: 44px; }
@media (min-width: 360px) {
  .hk-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .hk-stations, .hk-stlist { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .hk-ptoggle { display: none; }
  .hk-panel:not(.is-open) .hk-pmore { display: block; }
  .hk-controls, .hk-stage { grid-template-columns: minmax(0, 1fr) minmax(250px, 34%); }
  .hk-stage { align-items: start; }
  .hk-map, .hk-timebar, .hk-legend, .hk-note, .hk-placenote, .hk-fallback { grid-column: 1; }
  .hk-panel { grid-column: 2; grid-row: 1 / span 5; position: sticky; top: 76px; max-height: calc(100dvh - 92px); overflow: auto; }
  .hk-map { height: min(56dvh, 550px); }
}
@media (scripting: enabled) {
  /* Reserve the controls' space without passing hidden visibility down to native selects in WebKit. */
  .hk[data-hk-loading] .hk-controls[hidden] { display: grid !important; opacity: 0; }
  .hk[data-hk-loading] .hk-stations[hidden] { display: flex !important; visibility: hidden; }
  .hk[data-hk-loading] .hk-map[hidden] { display: block !important; visibility: hidden; }
}

/* Full screen (the browser's own, or this fixed layout where the browser has none, e.g. iPhone). */
.hk.is-fs, .hk:fullscreen { position: fixed; inset: 0; z-index: 100; background: var(--bg-base); padding: 10px; overflow: auto; margin: 0; grid-template-columns: 1fr; align-content: start; }
.hk:fullscreen { position: static; }
.hk.is-fs .hk-map, .hk:fullscreen .hk-map { height: 62dvh; }
.hk.is-fs .hk-table, .hk.is-fs .hk-sources, .hk.is-fs .hk-stlist, .hk:fullscreen .hk-table, .hk:fullscreen .hk-sources, .hk:fullscreen .hk-stlist { display: none; }
.hk.is-fs .hk-panel, .hk:fullscreen .hk-panel { grid-column: 1; position: static; max-height: 30dvh; overflow: auto; }
@media (min-width: 900px) {
  .hk.is-fs, .hk:fullscreen { grid-template-columns: minmax(0, 1fr); }
  .hk.is-fs .hk-map, .hk:fullscreen .hk-map { height: calc(100dvh - 190px); }
  .hk.is-fs .hk-panel, .hk:fullscreen .hk-panel { grid-column: 2; max-height: calc(100dvh - 190px); }
}
html.hk-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .hk * { transition: none !important; animation: none !important; } }
@media print { .hk-controls, .hk-timebar, .hk-stage, .hk-panel, .hk-stlist { display: none; } }

.hk-layer-targets { position: absolute; inset: 0 auto auto 0; }
.hk-layer-targets span {
  display: block;
  scroll-margin-top: 110px;
}

/* Moved from src/refinement.css (order 027, DES-011): this page type's rules from orders 020–024, after the file's own rules as before. */
[data-refined="healthmap"] .page-header { margin-bottom: 8px; }
[data-refined="healthmap"] .page-header h1 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
[data-refined="healthmap"] .hk { gap: 16px; }
.hk-workspace { min-width: 0; }
[data-refined="healthmap"] .hk-workspace:has(.hk-controls:not([hidden])), .hk[data-hk-loading] .hk-workspace {
  padding: 8px; border: 1px solid var(--line); border-radius: var(--panel-radius); background: #dde8e8;
}
[data-refined="healthmap"] .hk-controls {
  display: flex; flex-wrap: wrap; align-items: end; padding: 6px 4px 10px; gap: 8px 12px;
}
[data-refined="healthmap"] .hk-controls > .hk-field {
  flex: 1 1 min(100%, 9rem); min-width: 0; max-width: 100%;
}
[data-refined="healthmap"] .hk-stations { flex: 0 1 auto; }
[data-refined="healthmap"] .hk-stlist { flex-basis: 100%; }
@media (max-width: 639px) {
  [data-refined="healthmap"] .hk-controls:has(.place-pref details[open]) > .place-pref { flex-basis: 100%; }

}
[data-refined="healthmap"] .hk-field select { border-color: #a2b19d; border-radius: var(--control-radius); }
[data-refined="healthmap"] .hk-chip { gap: 6px; padding-inline: 10px; border-radius: var(--control-radius); }
[data-refined="healthmap"] .hk-map { border-radius: var(--control-radius) var(--control-radius) 0 0; height: clamp(330px, 51dvh, 640px); isolation: isolate; }
.hk-loading { display: none; }
@media (scripting: enabled) {
  .hk[data-hk-loading] .hk-loading {
    display: block; z-index: 1; position: absolute; inset: 0; width: fit-content; height: fit-content;
    margin: 18px; padding: 10px 16px; border-radius: var(--control-radius); background: var(--surface); color: var(--data-ink);
  }
}
[data-refined="healthmap"] .hk-panel { border-radius: var(--control-radius); padding: 16px; background: var(--surface); }
[data-refined="healthmap"] .hk-panel .hk-ptitle { font-size: 1.32rem; line-height: 1.15; }
[data-refined="healthmap"] .hk-panel .hk-pval { color: var(--data-ink); font-size: 1.22rem; font-variant-numeric: tabular-nums; }
[data-refined="healthmap"] .hk-panel .hk-hint { margin-top: 8px; line-height: 1.45; }
[data-refined="healthmap"] .hk-timebar {
  grid-template-columns: fit-content(48%) minmax(0, 1fr);
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--control-radius) var(--control-radius);
}
[data-refined="healthmap"] .hk-range { display: block; line-height: 1.3; }
[data-refined="healthmap"] .hk-range input { display: block; margin: 0; }
[data-refined="healthmap"] .hk-map[hidden] + .hk-attribution { display: none; }
.hk-attribution {
  display: flex; flex-wrap: wrap; column-gap: 12px; padding: 6px 10px;
  border-inline: 1px solid var(--line); background: #edf3f5;
  color: #294652; font-size: .75rem; line-height: 1.4; overflow-wrap: normal;
}
.guide .hk-attribution a { color: #294652; }
.hk-attribution:has(~ .hk-timebar[hidden]) { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--control-radius) var(--control-radius); }
[data-refined="healthmap"] .hk-note, [data-refined="healthmap"] .hk-placenote { padding-inline: 6px; }
[data-refined="healthmap"] .hk-legend { border-color: var(--line); border-radius: var(--control-radius); background: var(--surface); }
[data-refined="healthmap"] .hk-table { margin-top: 14px; }
[data-refined="healthmap"] .hk-sources { margin-bottom: 20px; }
[data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) { padding: 0 0 env(safe-area-inset-bottom); gap: 0; background: #dde8e8; }
[data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) .hk-workspace { border: 0; border-radius: 0; }
[data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) .hk-stlist:not([hidden]) { display: grid; }
[data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) .hk-controls { position: sticky; top: 0; z-index: 2; background: #dde8e8; }
[data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) .hk-map { min-height: 285px; height: 56dvh; }
[data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) .hk-panel { max-height: none; }
@media (max-width: 899px) {
  [data-refined="healthmap"] .hk-stage { gap: 8px; }
  [data-refined="healthmap"] .hk:not(.is-fs, :fullscreen) .hk-map { height: clamp(270px, 44dvh, 470px); }
  [data-refined="healthmap"] :is(.hk-attribution, .hk-timebar) { margin-top: -8px; }
}
@media (min-width: 900px) {
  [data-refined="healthmap"] .hk-stage {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 29%); gap: 0 8px;
    grid-template-rows: repeat(4, auto);
  }
  [data-refined="healthmap"] .hk-stage > .hk-panel {
    position: static; align-self: start; grid-row: 1 / span 4; max-height: clamp(400px, 68dvh, 740px);
  }
  [data-refined="healthmap"] .hk-legend { margin-top: 8px; }
  [data-refined="healthmap"] .hk-note, [data-refined="healthmap"] .hk-placenote { margin-top: 8px; }
  [data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) .hk-map {
    height: max(340px, calc(100dvh - 225px)); grid-column: 1 / -1; grid-row: 1;
  }
  [data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) .hk-panel {
    z-index: 1; grid-column: 2; grid-row: 1; position: relative; align-self: start; margin: 12px 62px 12px 0;
    max-height: calc(max(340px, 100dvh - 225px) - 48px); overflow: auto; box-shadow: var(--panel-shadow);
  }
  .hk-attribution { grid-column: 1; }
  [data-refined="healthmap"] .hk:is(.is-fs, :fullscreen) :is(.hk-attribution, .hk-timebar) { grid-column: 1 / -1; }
}
@media (scripting: enabled) {
  [data-refined="healthmap"] .hk[data-hk-loading] .hk-controls[hidden] { display: flex !important; }
}
[data-refined="healthmap"] .hk-workspace :where(.hk-panel, .hk-legend, .hk-note) { min-width: 0; }
}
