/* Habit Home variants (?home=1…5) and habit nav (?nav=habit).
   Panel system: 1px --line, 6px radius, --navy-1, 18px padding, 12px gaps,
   sentence-case titles, solid bars, one 34px button style. */

body.cardinal-home-variant-on .workspace-scroll > .home-view { display: none !important; }

.hv-root {
  --hv-gap: 12px;
  --hv-up: var(--positive, #5d9fd3);
  --hv-down: var(--negative, #d9776a);
  display: grid;
  gap: var(--hv-gap);
  width: 100%;
  padding: 20px 22px 32px;
  box-sizing: border-box;
  color: var(--text);
  font-family: var(--sans);
}
.hv-root *, .hv-root *::before, .hv-root *::after { box-sizing: border-box; }

.hv-grid { display: grid; gap: var(--hv-gap); min-width: 0; }
.hv-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hv-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hv-grid-map { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }

.hv-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--navy-1);
}
.hv-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.hv-panel-head h2 { margin: 0; color: var(--text); font-size: 14px; font-weight: 600; line-height: 20px; letter-spacing: 0; text-transform: none; }
.hv-hero .hv-panel-head h2 { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.01em; }
.hv-meta { flex: none; color: var(--faint); font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hv-lead { margin: -4px 0 0; color: var(--muted); font-size: 14px; line-height: 21px; max-width: 72ch; }
.hv-note, .hv-sub { margin: 0; color: var(--faint); font-size: 12px; line-height: 16px; }

.hv-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; line-height: 16px; }
.hv-stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 3px; }

.hv-list { display: grid; margin: 0; padding: 0; list-style: none; min-width: 0; }
.hv-list > li { min-width: 0; border-top: 1px solid var(--line); }
.hv-list > li:first-child { border-top: 0; }
.hv-list-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.hv-list-cols > li:nth-child(2) { border-top: 0; }

.hv-row, .hv-spot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 7px 6px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hv-list-dense .hv-row { min-height: 40px; padding-block: 5px; }
.hv-row:hover, .hv-spot:hover { background: var(--navy-2); }
.hv-row-static, .hv-row-static:hover { cursor: default; background: transparent; }
.hv-factor { color: var(--muted); font-size: 11px; line-height: 15px; white-space: nowrap; }
.hv-root :is(button, select, input):focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }

.hv-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hv-root .hv-flag { position: relative; inset: auto; flex: none; width: 20px; height: 14px; margin: 0; transform: none; }
.hv-name { display: grid; gap: 1px; min-width: 0; }
.hv-name b { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 500; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.hv-name small { overflow: hidden; color: var(--faint); font-size: 11px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; }

.hv-score { display: inline-flex; flex: none; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.hv-score b { min-width: 2ch; color: var(--text); font-size: 14px; font-weight: 600; text-align: right; }
.hv-then { color: var(--faint); font-size: 12px; }
.hv-arrow { color: var(--faint); font-size: 11px; }
.hv-rank, .hv-weight, .hv-pair { color: var(--muted); font-size: 12px; }
.hv-delta { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 2px; min-width: 36px; color: var(--faint); font-size: 12px; font-style: normal; }
.hv-delta i { font-size: 8px; font-style: normal; transform: translateY(-1px); }
.hv-delta-up { color: var(--hv-up); }
.hv-delta-down { color: var(--text); }
.hv-delta-none { color: var(--faint); }

.hv-empty { display: grid; justify-items: start; gap: 12px; padding: 4px 0; }
.hv-empty p { margin: 0; color: var(--muted); font-size: 13px; line-height: 19px; max-width: 52ch; }

.hv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hv-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 500 12px/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.hv-button:hover { border-color: var(--aqua); }
.hv-button-primary { border-color: transparent; background: #4b91b8; color: #04121c; }
.hv-button-primary:hover { border-color: transparent; background: #5ba1c7; }
.hv-link { padding: 0; border: 0; background: none; color: var(--aqua); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--aqua) 40%, transparent); text-underline-offset: 4px; }

.hv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hv-gap); }
.hv-tile {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  min-height: 84px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hv-tile:hover { border-color: var(--line-strong); background: var(--navy-2); }
.hv-tile small { color: var(--faint); font-size: 11px; line-height: 15px; }
.hv-tile b { overflow: hidden; color: var(--text); font-size: 14px; font-weight: 600; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }
.hv-tile span { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; color: var(--muted); font-size: 12px; line-height: 16px; }
.hv-tile .hv-delta { min-width: 0; }

.hv-bars { display: grid; gap: 8px; }
.hv-bar { display: grid; grid-template-columns: 92px minmax(0, 1fr) 28px; align-items: center; gap: 10px; }
.hv-bar > span { color: var(--muted); font-size: 12px; }
.hv-bar > i { position: relative; display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--line) 80%, transparent); }
.hv-bar > i > i { display: block; height: 100%; border-radius: 3px; background: var(--factor); }
.hv-bar > i > s { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; border-radius: 1px; background: var(--text); opacity: .55; }
.hv-bar > b { color: var(--text); font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.hv-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.hv-figure { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.hv-figure small { color: var(--muted); font-size: 12px; }
.hv-figure .hv-score b { font-size: 20px; }

.hv-blueprint { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; }
.hv-blueprint header small { color: var(--faint); font-size: 11px; }
.hv-blueprint h3 { margin: 2px 0 0; color: var(--text); font-size: 15px; font-weight: 600; }
.hv-weights { display: grid; gap: 6px; }
.hv-weights > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 8px; }
.hv-weights span { color: var(--muted); font-size: 12px; }
.hv-weights i { display: block; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--line) 80%, transparent); }
.hv-weights i i { height: 100%; background: var(--factor); }

.hv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hv-chip { min-height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--muted); font: 500 12px/1 var(--sans); cursor: pointer; }
.hv-chip[aria-checked="true"] { border-color: var(--aqua); background: color-mix(in srgb, var(--aqua) 14%, transparent); color: var(--text); }
.hv-hero-compact { gap: 10px; }

.hv-cells { display: inline-flex; flex: none; gap: 3px; }
.hv-cell { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 3px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Score squares, one rule across the platform (Nordisk, 4 Oct 2026): tinted with a full edge from 80, edged from 50,
   a neutral outline below. Never a solid fill. */
.hv-cell-solid { border: 1px solid var(--factor); background: color-mix(in srgb, var(--factor) 34%, transparent); color: var(--text); font-weight: 700; }
.hv-cell-tint { border: 1px solid color-mix(in srgb, var(--factor) 60%, var(--line)); color: var(--text); }
.hv-cell-line { border: 1px solid var(--line-strong); color: var(--muted); font-weight: 500; }

.hv-brief { display: grid; gap: 10px; margin: 0; padding: 0 0 0 20px; color: var(--muted); font-size: 14px; line-height: 21px; }
.hv-brief b { color: var(--text); font-weight: 600; }
.hv-brief li::marker { color: var(--faint); font-size: 12px; }
.hv-spot { padding: 4px 6px; margin: -4px -6px 2px; width: calc(100% + 12px); }

.hv-map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hv-map-controls label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.hv-map-controls select {
  appearance: none;
  min-height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--navy-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a4b3bd' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--text);
  font: 500 12px var(--sans);
  cursor: pointer;
}
.hv-map-controls select:hover { border-color: var(--aqua); }
.hv-colhead { display: flex; justify-content: space-between; margin: -4px 6px 0; color: var(--faint); font-size: 11px; line-height: 15px; }
.hv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; line-height: 15px; }
.hv-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hv-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--factor); }
.hv-toggle input { width: 16px; height: 16px; margin: 0; accent-color: #4b91b8; }
.hv-map { position: relative; width: 100%; height: clamp(320px, 52vh, 560px); }
.hv-map canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }

.hv-loading .hv-lead, .hv-loading .hv-stats { min-height: 21px; border-radius: 4px; background: var(--navy-2); }
.hv-loading-block { min-height: 320px; }

/* Skeletons (scripts/lib/home-skeleton.mjs): every nav page's layout in still placeholder shapes on the page's own
   background; the top progress bar below carries the motion. Home's row and table metrics match .hv-mrow / .hv-thead. */
.cardinal-load-state.is-shaped, html.cardinal-boot-shaped .cardinal-static-boot .cardinal-load-state { display: block; min-height: 0; padding: 0; border: 0; background: transparent; }
.cardinal-static-boot .cardinal-boot-skeleton:empty, html.cardinal-boot-shaped .cardinal-static-boot .cardinal-skeleton-table { display: none; }
.cardinal-load-state.is-shaped > .cardinal-load-line, html.cardinal-boot-shaped .cardinal-static-boot .cardinal-load-line {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
#cardinal-home-variant > .hv-skeleton { padding: 0; }
.hv-skeleton .hv-sk { display: block; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--line, #1d3447) 72%, var(--navy-1, #0b1824)); }
.hv-skeleton :is(.hv-sk-field, .hv-sk-box, .hv-sk-plot) { display: block; box-sizing: border-box; border: 1px solid color-mix(in srgb, var(--line, #1d3447) 85%, transparent); background: transparent; }
.hv-sk-field { height: 40px; width: 150px; border-radius: 6px; }
.hv-sk-field.hv-sk-button { width: 110px; }
.hv-sk-field.hv-sk-search { width: min(100%, 480px); }
.hv-sk-field.hv-sk-select { width: 200px; }
.hv-sk-field.hv-sk-icon { width: 32px; height: 32px; }
.hv-sk-box { width: 44px; height: 28px; border-radius: 3px; justify-self: center; }
.hv-sk-box.hv-sk-box-l { width: 52px; height: 40px; }
.hv-sk-plot { flex: 1; min-height: 260px; border-radius: 4px; border-style: dashed; opacity: .55; }
.hv-sk-plot.hv-sk-plot-s { min-height: 220px; }
.hv-sk-toolbar { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
section.hv-sk-toolbar { flex-direction: row; padding: 14px 18px; }
.hv-sk-grow { flex: 1; display: flex; justify-content: center; min-width: 0; }
.hv-sk-lines { display: grid; gap: 14px; padding-top: 6px; }
.hv-skeleton .hv-sk.hv-sk-line-s { height: 9px; }
.hv-sk-h-l { width: 210px; height: 16px !important; }
.hv-sk-display { width: 320px; height: 30px !important; }
.hv-sk-note { margin: 2px 0; }
.hv-sk-flush { padding: 0 0 6px; gap: 0; overflow: hidden; }
.hv-sk-brow { display: grid; grid-template-columns: 20px minmax(140px, 1.4fr) repeat(7, minmax(52px, .45fr)) repeat(var(--hv-sk-n, 4), minmax(56px, .5fr)); align-items: center; column-gap: 12px; min-height: 48px; padding: 0 16px; border-top: 1px solid var(--line); }
.hv-sk-screener .hv-sk-brow { --hv-sk-n: 4; } .hv-sk-watchlist .hv-sk-brow { --hv-sk-n: 5; }
.hv-sk-brow.hv-sk-bhead { min-height: 42px; border-top: 0; }
.hv-sk-brow .hv-sk-num { justify-self: end; }
.hv-sk-bhead .hv-sk-th-name { grid-column: 1 / 3; }
.hv-sk-company-head { flex-direction: row; align-items: center; gap: 12px; padding: 14px 18px; }
.hv-sk-company-head .hv-sk-name { gap: 8px; }
.hv-sk-tabs { display: flex; gap: 22px; padding: 4px 2px 6px; }
.hv-sk-tab { width: 70px; height: 9px !important; opacity: .8; }
.hv-sk-company-grid { grid-template-columns: minmax(260px, .9fr) minmax(0, 1.4fr) minmax(240px, .8fr); }
.hv-sk-meter { display: grid; grid-template-columns: 20px 80px minmax(0, 1fr) 24px; align-items: center; gap: 10px; min-height: 30px; }
.hv-sk-company-grid .hv-sk-meter { grid-template-columns: minmax(0, 1fr) 44px; min-height: 40px; border-top: 1px solid var(--line); }
.hv-sk-track { height: 4px !important; }
.hv-sk-builder-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 18px 0 8px; }
.hv-sk-builder-head .hv-sk-name { display: grid; gap: 14px; }
.hv-sk-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hv-sk-card { gap: 12px; min-height: 330px; }
.hv-sk-hub { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(240px, 300px); }
.hv-sk-chart { min-height: 340px; }
@media (width <= 1180px) { .hv-sk-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hv-sk-hub, .hv-sk-company-grid { grid-template-columns: minmax(0, 1fr); } }
@media (width <= 900px) { .hv-sk-brow { grid-template-columns: 20px minmax(120px, 1fr) repeat(7, 52px); } .hv-sk-brow > .hv-sk-num, .hv-sk-bhead > .hv-sk-th:nth-child(n + 9) { display: none; } }
@media (width <= 700px) { .hv-sk-cards { grid-template-columns: minmax(0, 1fr); } .hv-sk-toolbar > .hv-sk-field:nth-child(n + 3), .hv-sk-company-head > .hv-sk-field { display: none; } .hv-sk-display { width: 70%; } .hv-sk-builder-head > .hv-sk-field { display: none; } }
.hv-sk-globe-space { display: block; min-height: 300px; }

/* Home progress bar (Fiscal-style): a 2px line along the top of the window that runs left to right while Home
   loads, eases towards 90 % and completes when the data is on screen (CardinalHomeProgress in home-variants.js).
   Shown from the first paint of every /app load (html.cardinal-booting) or when a view opens without its data. */
.cardinal-home-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 300; height: 2px; pointer-events: none; display: none; }
html.cardinal-booting .cardinal-home-progress, .cardinal-home-progress.is-on { display: block; }
/* While the bar runs, every route's loading view behaves like Home's: skeletons hold still and the old text
   progress line ("Läser in N bolag…") is kept for screen readers only. */
html.cardinal-booting :is(.cardinal-skeleton-row, .screener-load-skeleton i) { animation: none !important; }
/* Skeletons hold still everywhere, not only while booting (owner's loading pattern, 3 Oct; UI audit 4 Oct). */
:is(.cardinal-skeleton-row, .screener-load-skeleton i) { animation: none !important; }
html.cardinal-booting .cardinal-load-line {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 !important;
}
.cardinal-home-progress > i {
  display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, #4b91b8, #55a7a0 55%, #68aa83);
  box-shadow: 0 0 8px rgba(85, 167, 160, .4);
  animation: cardinal-home-progress 12s cubic-bezier(.1, .65, .2, 1) forwards;
}
@keyframes cardinal-home-progress { 0% { transform: scaleX(0); } 8% { transform: scaleX(.3); } 35% { transform: scaleX(.62); } 100% { transform: scaleX(.92); } }
.cardinal-home-progress.is-done { opacity: 0; transition: opacity .35s ease .3s; }
.cardinal-home-progress.is-done > i { transition: transform .3s ease-out; }
.hv-skeleton .hv-panel-head { align-items: center; min-height: 26px; }
.hv-sk-title { width: 190px; height: 18px !important; }
.hv-sk-h { width: 150px; height: 13px !important; }
.hv-sk-meta { width: 76px; height: 9px !important; opacity: .7; }
.hv-sk-meta-s { width: 112px; }
.hv-sk-side { display: flex; align-items: center; gap: 14px; }
.hv-sk-summary { display: grid; gap: 12px; min-width: 0; }
.hv-sk-line { height: 16px !important; }
.hv-sk-summary > .hv-grid { margin-top: 10px; column-gap: 28px; }
.hv-sk-chips { display: flex; gap: 18px; margin-top: 4px; }
.hv-sk-pill { width: 54px; height: 9px !important; opacity: .7; }
.hv-sk-table { display: grid; min-width: 0; }
.hv-sk-thead, .hv-sk-row { display: grid; grid-template-columns: 14px 20px minmax(0, 1fr) 48px 48px 66px; align-items: center; column-gap: 12px; padding: 0 6px; }
.hv-sk-thead { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hv-sk-th { width: 70%; height: 7px !important; justify-self: end; opacity: .55; }
.hv-sk-th-name { grid-column: 3; justify-self: start; width: 46px; }
.hv-sk-row { min-height: 46px; border-top: 1px solid var(--line); }
.hv-sk-thead + .hv-sk-row { border-top: 0; }
.hv-sk-idx { width: 7px; height: 8px !important; justify-self: end; opacity: .6; }
.hv-sk-flag { width: 20px; height: 14px !important; border-radius: 2px !important; }
.hv-sk-name { display: grid; gap: 6px; min-width: 0; }
.hv-sk-sub { width: 38px; height: 7px !important; opacity: .6; }
.hv-sk-num { width: 22px; justify-self: end; }
.hv-sk-chip { width: 52px; height: 22px !important; justify-self: end; border-radius: 4px !important; }
.hv-sk-w50 { width: 50%; } .hv-sk-w54 { width: 54%; } .hv-sk-w58 { width: 58%; } .hv-sk-w62 { width: 62%; }
.hv-sk-w64 { width: 64%; } .hv-sk-w66 { width: 66%; } .hv-sk-w72 { width: 72%; } .hv-sk-w92 { width: 92%; }
@media (width <= 900px) { .hv-sk-globe-space { display: none; } }
@media (width <= 700px) {
  .hv-sk-thead, .hv-sk-row { grid-template-columns: 20px minmax(0, 1fr) 38px 38px 58px; column-gap: 8px; }
  .hv-sk-idx { display: none; }
  .hv-sk-th-name { grid-column: 2; }
  .hv-sk-side .hv-sk-meta-s { display: none; }
}


/* Dev-only variant switcher */
.hv-switcher { position: fixed; right: 16px; bottom: 16px; z-index: 120; font-family: var(--sans); }
.hv-switcher-toggle { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--navy-2); color: var(--text); font: 500 12px/1 var(--sans); cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); }
.hv-switcher-menu { position: absolute; right: 0; bottom: 42px; display: grid; gap: 2px; width: 220px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--navy-1); box-shadow: 0 16px 40px rgba(0, 0, 0, .36); }
.hv-switcher-menu[hidden] { display: none; }
.hv-switcher-menu p { margin: 6px 6px 2px; color: var(--faint); font-size: 11px; }
.hv-switcher-menu button { min-height: 32px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: 500 12px var(--sans); text-align: left; cursor: pointer; }
.hv-switcher-menu button:hover { background: var(--navy-2); color: var(--text); }
.hv-switcher-menu button[aria-pressed="true"] { background: var(--navy-3); color: var(--text); }
.hv-switcher :focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }

@media (width <= 1180px) {
  .hv-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hv-grid-map { grid-template-columns: minmax(0, 1fr); }
}
@media (width <= 900px) {
  .hv-grid-2, .hv-split, .hv-tiles, .hv-list-cols { grid-template-columns: minmax(0, 1fr); }
  .hv-list-cols > li:nth-child(2) { border-top: 1px solid var(--line); }
}
@media (width <= 700px) {
  .hv-root { padding: 14px 12px 28px; }
  .hv-panel { padding: 16px 14px; }
  .hv-hero .hv-panel-head h2 { font-size: 18px; line-height: 24px; }
  .hv-panel-head { flex-wrap: wrap; }
  .hv-cell { width: 24px; }
  .hv-switcher { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .hv-map { height: 340px; }
}

/* ---------- Home 1 · Senaste rörelserna: finance tables ---------- */
[data-cardinal-theme="light"] .hv-root { --hv-up: #2765a6; --hv-down: #b84c42; }
.hv-text-up { color: var(--hv-up) !important; }
.hv-text-down { color: var(--hv-down) !important; }

/* Header: summary + facts beside the distribution of moves. Bars are buttons: hover reads a
   bin out, click opens the list of companies in it. */
.hv-text-muted { color: var(--muted) !important; }
.hv-movers-hero { gap: 16px; }
.hv-movers-head { align-items: center; }
.hv-movers-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; gap: 36px; }
.hv-movers-text { display: grid; gap: 18px; min-width: 0; }
.hv-summary { margin: 0; max-width: 34ch; color: var(--muted); font-size: 17px; line-height: 26px; letter-spacing: -.005em; text-wrap: pretty; }
.hv-summary b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hv-facts { display: grid; gap: 0; margin: 0; }
.hv-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--line); }
.hv-facts dt { margin: 0; color: var(--faint); font-size: 12px; font-weight: 400; line-height: 16px; letter-spacing: 0; text-transform: none; }
.hv-facts dd { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--text); font-size: 13px; font-weight: 600; line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hv-facts dd small { color: var(--faint); font-size: 12px; font-weight: 400; }

.hv-hist { display: grid; gap: 8px; min-width: 0; margin: 0; }
.hv-hist-calls { display: flex; justify-content: space-between; gap: 12px; min-height: 20px; }
.hv-hist-call { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 48%; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; line-height: 16px; cursor: pointer; }
.hv-hist-call span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-hist-call b { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.hv-hist-call:hover span { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.hv-hist-bars { display: flex; align-items: stretch; gap: 2px; height: 96px; padding-bottom: 0; border-bottom: 1px solid var(--line-strong); }
.hv-hist-bar { display: flex; flex: 1 1 0; flex-direction: column; justify-content: flex-end; align-items: stretch; min-width: 0; padding: 0; border: 0; border-radius: 2px 2px 0 0; background: transparent; cursor: pointer; }
.hv-hist-bar:disabled { cursor: default; }
.hv-hist-bar > i { display: block; width: 100%; border-radius: 1px 1px 0 0; background: color-mix(in srgb, var(--faint) 45%, transparent); transition: opacity .12s ease; }
.hv-hist-bar.hv-tone-up > i { background: var(--hv-up); }
.hv-hist-bar.hv-tone-down > i { background: var(--hv-down); }
.hv-hist-bar.hv-hist-zero > i { background: var(--faint); }
.hv-hist-bar:not(:disabled):hover > i, .hv-hist-bar:focus-visible > i { filter: brightness(1.35); opacity: 1 !important; }
.hv-hist-bar:focus-visible { outline: 2px solid var(--aqua); outline-offset: 1px; }
.hv-hist-bars.has-pick .hv-hist-bar:not([aria-pressed="true"]) > i { opacity: .38; }
.hv-hist-bar[aria-pressed="true"] { box-shadow: 0 3px 0 0 var(--text); }
.hv-hist-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; line-height: 14px; font-variant-numeric: tabular-nums; }
.hv-hist-readout { min-height: 18px; margin: 0; color: var(--faint); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }
.hv-hist-readout b { color: var(--text); font-weight: 600; }

.hv-pick { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.hv-pick-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.hv-pick-head h3 { margin: 0; color: var(--text); font-size: 14px; font-weight: 600; line-height: 20px; }
.hv-pick-head h3 span { color: var(--faint); font-weight: 400; }
.hv-pick-head .hv-actions { gap: 6px; }
.hv-pick-head .hv-button { min-height: 30px; padding: 0 12px; font-size: 12px; }
.hv-pick-more { justify-self: start; }
.hv-pick-cols { column-gap: 28px; }
@media (width <= 900px) { .hv-pick-cols > .hv-table + .hv-table .hv-thead { display: none; } .hv-pick-cols { gap: 0; } .hv-pick-cols > .hv-table + .hv-table .hv-list > li:first-child { border-top: 1px solid var(--line); } }

.hv-table { display: grid; min-width: 0; }
.hv-thead, .hv-mrow { display: grid; grid-template-columns: 14px minmax(0, 1fr) 56px 48px 48px 66px; align-items: center; column-gap: 12px; }
.hv-thead { padding: 0 6px 8px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 11px; line-height: 14px; }
.hv-thead span:nth-child(n + 4) { text-align: right; }
.hv-table .hv-list > li:first-child { border-top: 0; }
.hv-mrow { justify-content: stretch; }
.hv-idx { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.hv-mag { display: block; height: 4px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--line) 70%, transparent); }
.hv-mag:empty { background: transparent; }
.hv-mag i { display: block; height: 100%; border-radius: 2px; background: var(--muted); }
.hv-mag.hv-tone-up i { background: var(--hv-up); }
.hv-mag.hv-tone-down i { background: var(--hv-down); }
.hv-num { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hv-num-then { color: var(--faint); font-size: 12px; }
.hv-num-now { font-weight: 600; }
.hv-chg { justify-self: end; min-width: 52px; padding: 2px 6px; border-radius: 4px; background: var(--navy-2); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 18px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hv-chg.hv-tone-up { background: color-mix(in srgb, var(--hv-up) 15%, transparent); color: var(--hv-up); }
.hv-chg.hv-tone-down { background: color-mix(in srgb, var(--hv-down) 15%, transparent); color: var(--hv-down); }
.hv-mrow:hover .hv-name b { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

.hv-sectors { display: grid; margin: 0; padding: 0; list-style: none; }
.hv-sectors li { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr) 52px; align-items: center; column-gap: 12px; min-height: 34px; padding: 0 6px; border-top: 1px solid var(--line); }
.hv-sectors li:first-child { border-top: 0; }
.hv-sector-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.hv-sector-name b { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.hv-sector-name small { flex: none; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.hv-diverge { position: relative; display: block; height: 14px; }
.hv-diverge-axis { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line-strong); }
.hv-diverge-bar { position: absolute; top: 4px; height: 6px; border-radius: 2px; background: var(--muted); }
.hv-diverge-bar.hv-tone-up { background: var(--hv-up); }
.hv-diverge-bar.hv-tone-down { background: var(--hv-down); }

/* Top panel views: Marknader (globe) and Storbolag (block map), switched by a quiet text toggle. */
.hv-head-side { display: flex; flex: none; align-items: baseline; gap: 18px; min-width: 0; }
.hv-top-switch { display: flex; gap: 14px; }
.hv-top-switch button, .hv-markets button { padding: 0; border: 0; background: none; color: var(--faint); font: inherit; font-size: 12px; line-height: 16px; cursor: pointer; }
.hv-top-switch button:hover, .hv-markets button:hover { color: var(--muted); }
.hv-top-switch button[aria-pressed="true"], .hv-markets button[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.hv-top-switch button:focus-visible, .hv-markets button:focus-visible, .hv-tm-cell:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }

.hv-globe-body { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: center; gap: 36px; }
.hv-globe { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }
.hv-globe-sea { fill: color-mix(in srgb, var(--navy-2) 70%, var(--navy-1)); stroke: var(--line); }
.hv-globe-grid { fill: none; stroke: var(--line); stroke-width: 1.5; }
.hv-globe-land { fill: color-mix(in srgb, var(--line) 62%, var(--navy-1)); stroke: var(--navy-1); stroke-width: 1.8; }
.hv-globe-c { fill: color-mix(in srgb, var(--faint) 55%, var(--line)); stroke: var(--navy-1); stroke-width: 1.8; cursor: pointer; transition: fill .18s ease; }
.hv-globe-c.is-off { fill: color-mix(in srgb, var(--faint) 26%, var(--line)); }
.hv-globe-c.is-on { fill: var(--aqua); }
.hv-globe-c:hover { fill: color-mix(in srgb, var(--faint) 80%, var(--line)); }
.hv-globe-c.is-on:hover { fill: #7dabd8; }
.hv-globe text { pointer-events: none; text-anchor: middle; font-family: var(--sans); font-size: 11px; font-variant-numeric: tabular-nums; }
.hv-globe-name { fill: var(--text); font-size: 12px !important; font-weight: 600; }
.hv-globe-count .up { fill: var(--hv-up); }
.hv-globe-count .down { fill: var(--hv-down); }
.hv-globe-text { display: grid; gap: 16px; min-width: 0; }
.hv-globe-line { margin: 0; color: var(--muted); font-size: 19px; line-height: 28px; letter-spacing: -.005em; text-wrap: pretty; }
.hv-globe-line b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.hv-globe-cols { column-gap: 28px; }
.hv-globe-col { display: grid; align-content: start; gap: 8px; min-width: 0; }
.hv-globe-col h3 { margin: 0; color: var(--text); font-size: 13px; font-weight: 600; line-height: 18px; }
.hv-markets { display: flex; flex-wrap: wrap; gap: 6px 18px; }

.hv-tm { position: relative; min-width: 0; }
.hv-tm-group { position: absolute; display: flex; align-items: center; gap: 7px; height: 20px; padding-bottom: 4px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 16px; white-space: nowrap; }
.hv-tm-group .hv-flag { width: 16px; height: 11px; flex: none; }
.hv-tm-cell { position: absolute; display: block; overflow: hidden; padding: 4px 6px; border: 1px solid var(--navy-1); border-radius: 3px; background: color-mix(in srgb, var(--faint) 11%, var(--navy-1)); color: var(--text); font: inherit; font-size: 11px; line-height: 14px; font-variant-numeric: tabular-nums; text-align: left; cursor: pointer; }
.hv-tm-cell b { display: block; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hv-tm-up { background: color-mix(in srgb, var(--hv-up) var(--p), var(--navy-1)); }
.hv-tm-down { background: color-mix(in srgb, var(--hv-down) var(--p), var(--navy-1)); }
.hv-tm-cell:hover { filter: brightness(1.25); }
.hv-tm-note { margin-top: -2px; }

@media (width <= 900px) {
  .hv-globe-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
@media (width <= 700px) {
  .hv-head-side { width: 100%; justify-content: space-between; }
  .hv-globe-line { font-size: 17px; line-height: 25px; }
  .hv-globe-cols { row-gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { .hv-globe-c { transition: none; } }

@media (width <= 1280px) {
  .hv-thead, .hv-mrow { grid-template-columns: 14px minmax(0, 1fr) 44px 44px 62px; }
  .hv-thead span:nth-child(3), .hv-mrow .hv-mag { display: none; }
}
@media (width <= 900px) {
  .hv-movers-body { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (width <= 700px) {
  .hv-summary { font-size: 16px; line-height: 24px; }
  .hv-hist-bars { height: 84px; gap: 1px; }
  .hv-thead, .hv-mrow { grid-template-columns: minmax(0, 1fr) 38px 38px 58px; column-gap: 8px; }
  .hv-thead span:first-child, .hv-mrow .hv-idx { display: none; }
  .hv-sectors li { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 48px; column-gap: 8px; }
}

/* ---------- Habit nav ---------- */
body.cardinal-habit-nav .sidebar { visibility: hidden !important; pointer-events: none !important; }
#cardinal-habit-nav { font-family: var(--sans); color: var(--text); }
#cardinal-habit-nav ul, .hn-sheet ul { margin: 0; padding: 0; list-style: none; }
.hn-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.hn-item:hover { background: var(--navy-2); color: var(--text); }
.hn-item[aria-current="page"] { background: color-mix(in srgb, var(--aqua) 14%, transparent); color: var(--text); }
.hn-item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--aqua); }
:is(#cardinal-habit-nav, .hn-sheet) .hn-item:focus-visible, #cardinal-habit-nav .hn-brand:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--aqua); }
.hn-icon { display: grid; place-items: center; width: 20px; height: 20px; color: inherit; }
.hn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.hn-icon svg [fill="currentColor"] { fill: currentColor; stroke: none; }
.hn-text { display: grid; min-width: 0; }
.hn-text b { overflow: hidden; font-size: 13px; font-weight: 500; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.hn-text small { overflow: hidden; color: var(--faint); font-size: 11px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hn-count { color: var(--faint); font-size: 11px; font-style: normal; font-variant-numeric: tabular-nums; }
.hn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--aqua); }
.hn-change { font-variant-numeric: tabular-nums; }
.hn-change-up { color: var(--positive, #5d9fd3); }
.hn-change-down { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .hn-item { transition: none; } }

/* Desktop: a 224px labelled sidebar */
@media (width >= 1181px) {
  /* .app-frame is zoomed by --minimal-density; the nav is not, so scale the column back to 224 visual px. */
  body.cardinal-habit-nav .app-frame { grid-template-columns: calc(224px * var(--minimal-density-inverse, 1)) minmax(0, 1fr) !important; }
  body.cardinal-habit-nav .app-frame > .sidebar { width: calc(224px * var(--minimal-density-inverse, 1)) !important; }
  #cardinal-habit-nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    width: 224px;
    padding: 14px 12px 12px;
    border-right: 1px solid var(--line);
    background: var(--navy-0);
  }
  .hn-brand { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 10px; padding: 4px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: 600 14px/1 var(--sans); letter-spacing: .01em; cursor: pointer; overflow: hidden; }
  .hn-brand:focus-visible { outline: 2px solid var(--aqua); outline-offset: -2px; }
  .hn-brand svg { flex: none; width: 30px; height: 18px; fill: currentColor; }
  .hn-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .hn-group { display: grid; gap: 2px; }
  .hn-label { margin: 18px 10px 6px; color: var(--faint); font-size: 11px; font-weight: 500; line-height: 15px; }
  .hn-scroll > .hn-group:first-child { margin-bottom: 0; }
  .hn-foot { padding-top: 10px; border-top: 1px solid var(--line); }
}

/* Tablet: one labelled top bar */
@media (width >= 701px) and (width <= 1180px) {
  body.cardinal-habit-nav .app-frame > .sidebar { display: none !important; }
  body.cardinal-habit-nav .app-frame { padding-top: 60px; }
  #cardinal-habit-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 60px;
    padding: 0 10px;
    border-bottom: 1px solid var(--line);
    background: var(--navy-0);
  }
  #cardinal-habit-nav .hn-brand { display: flex; flex: none; align-items: center; justify-content: center; height: 44px; min-width: 44px; padding: 0 7px; border: 0; background: none; color: var(--text); cursor: pointer; }
  #cardinal-habit-nav .hn-brand > span { display: none; }
  #cardinal-habit-nav .hn-brand svg { width: 30px; height: 18px; fill: currentColor; }
  #cardinal-habit-nav .hn-group > li { flex: none; }
  #cardinal-habit-nav .hn-scroll { display: flex; flex: 1; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  #cardinal-habit-nav .hn-scroll::-webkit-scrollbar { display: none; }
  #cardinal-habit-nav .hn-group { display: flex; gap: 2px; }
  #cardinal-habit-nav .hn-label { display: none; }
  #cardinal-habit-nav .hn-group + .hn-label + .hn-group, #cardinal-habit-nav .hn-group + .hn-group { padding-left: 6px; border-left: 1px solid var(--line); }
  #cardinal-habit-nav .hn-item { grid-template-columns: 18px auto auto; width: auto; min-height: 44px; padding: 0 10px; white-space: nowrap; }
  #cardinal-habit-nav .hn-item[aria-current="page"]::before { left: 10px; right: 10px; top: auto; bottom: 2px; width: auto; height: 2px; }
  #cardinal-habit-nav .hn-text small { display: none; }
  #cardinal-habit-nav .hn-return .hn-text b { max-width: 140px; }
  #cardinal-habit-nav .hn-foot { flex: none; }
  #cardinal-habit-nav .hn-foot .hn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #cardinal-habit-nav .hn-foot .hn-item { grid-template-columns: 18px; padding: 0 13px; }
  #cardinal-habit-nav .hn-count, #cardinal-habit-nav .hn-digest .hn-dot { display: none; }
  #cardinal-habit-nav .hn-digest::after { content: ""; position: absolute; top: 8px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); opacity: 0; }
  #cardinal-habit-nav .hn-digest:has(.hn-dot)::after { opacity: 1; }
}
/* Narrow tablet: icons only, the current route keeps its label. */
@media (width >= 701px) and (width <= 900px) {
  /* Visually hidden, still the button's accessible name. */
  #cardinal-habit-nav .hn-item:not([aria-current="page"]) .hn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #cardinal-habit-nav .hn-item:not([aria-current="page"]) { grid-template-columns: 18px; padding: 0 13px; }
}

/* Phone: five-item bottom bar + "Mer" sheet */
@media (width <= 700px) {
  body.cardinal-habit-nav .app-frame > .sidebar { display: none !important; }
  #cardinal-habit-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 100;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-strong);
    background: var(--navy-0);
  }
  .hn-bar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; height: 52px; }
  .hn-bar .hn-item { grid-template-columns: 1fr; grid-template-rows: 22px 15px; justify-items: center; align-content: center; row-gap: 3px; height: 52px; padding: 4px 2px; }
  .hn-bar .hn-icon { grid-row: 1; }
  .hn-bar .hn-text { grid-row: 2; justify-items: center; max-width: 100%; }
  .hn-bar .hn-text b { font-size: 11px; line-height: 15px; }
  .hn-bar .hn-dot { position: absolute; top: 7px; left: calc(50% + 8px); }
  .hn-bar .hn-item[aria-current="page"]::before { left: 30%; right: 30%; top: 0; bottom: auto; width: auto; height: 2px; }
  .hn-sheet { position: fixed; inset: 0 0 calc(64px + env(safe-area-inset-bottom)); z-index: 99; display: flex; align-items: flex-end; background: rgba(2, 8, 14, .5); }
  .hn-sheet[hidden] { display: none; }
  .hn-sheet-panel { display: grid; gap: 8px; width: 100%; max-height: 70vh; overflow-y: auto; padding: 12px; border-top: 1px solid var(--line-strong); border-radius: 10px 10px 0 0; background: var(--navy-1); }
  .hn-sheet .hn-group { display: grid; gap: 2px; }
  .hn-sheet .hn-group + .hn-group { padding-top: 8px; border-top: 1px solid var(--line); }
  .hn-sheet .hn-item { min-height: 44px; }
}
@media (width > 700px) { .hn-sheet { display: none; } }

body:has(.hn-sheet:not([hidden])) .hv-switcher { display: none; }
.hv-bars + .hv-note { margin-top: 12px; }
