/* hem's own parts of Home, in the Marmorvägen design. Needs marmorvagen.css,
   komponenter.css and fasad.css. Only the package's roles, steps and sizes; hem's
   own classes start with hem-, and the hooks the checks read (brow, press, ww-, undo)
   keep their names. Motion is colour only, over --mv-tid. */

/* Hidden means hidden, also on the package's flex and grid parts. */
body.mv [hidden] { display: none; }

/* A screen reader's words, not drawn. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The state line is the link to Huset: a tap target of the package's size even when
   its under-line is empty (Blank, Uppdaterar husets läge.). */
.hem-sida .mv-lage { min-height: var(--mv-tryckyta); }

/* The icon sprite, inlined once; drawn by <use>, so not display:none (WebKit). */
.hem-ikoner { position: absolute; width: 0; height: 0; overflow: hidden; }

/* The signet in the header, as komponenter/index.html draws it. */
.hem-signet-m { fill: var(--marke-m); stroke: none; }
.hem-signet-m + .hem-signet-m { fill: none; stroke: var(--marke-m); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.hem-signet-tak { fill: none; stroke: var(--marke); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.hem-signet-tak + .hem-signet-tak { stroke-linecap: butt; }

/* ---------------------------------------------------------------- the page */
.hem-kol { display: flex; flex-direction: column; gap: var(--mv-rum-4); min-width: 0; }
.hem-fasad .mv-fasad { display: block; width: 100%; height: auto; }
.hem-varden { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hem-serie-batteri { --serie: var(--diagram-batteri); }
.hem-varden .is-gammal .mv-varde__tal { color: var(--text-2); }
.hem-varden .is-gammal .mv-etikett__farg { background: var(--text-2); }
/* Under the values, which are old and from when. */
.hem-not { margin: 0; font-size: var(--mv-storlek-liten); line-height: var(--mv-rad-liten); color: var(--text-2); }
.hem-energi > .mv-lank, .hem-energi > .mv-tyst { border-top: 0; }
/* Hem's and Huset's state boxes (changes 45 and 47): one box per thing, on Hem at most
   two and the line Och 1 till, på Huset. under them, on Huset all (at most three), at the
   package's step inside a section. */
.hem-rutor { display: flex; flex-direction: column; gap: var(--mv-rum-2); }
.hem-rutor .mv-lank { border-top: 0; }
.mv .hem-energi .is-gammal { color: var(--text-2); }
.hem-mening { margin: 0; font-size: var(--mv-storlek-granssnitt); line-height: var(--mv-rad-granssnitt); text-wrap: pretty; }
/* A page's visible heading (Önskemål, Enheter, Logga in, Välkommen). */
.hem-rubrik1 { margin: 0; font-size: var(--mv-storlek-rubrik-1); line-height: var(--mv-rad-rubrik-1); font-weight: var(--mv-vikt-rubrik-1); }
.hem-jonas { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mv-rum-1) var(--mv-rum-2); }
.hem-media { display: flex; flex-direction: column; }

/* The rows: the package's .mv-rad; a held button is the filled one, and its line
   says what is about to happen. .is-bad is a hook only: no red outside an alarm. */
.brow .mv-rad__text { flex: 1 1 auto; }
.brow-why .mv-tagg { flex-shrink: 0; }

/* The phone: one column, the tabs fixed at the foot, the ask's undo bar above them. */
@media (max-width: 899px) {
  body.mv { padding-bottom: calc(var(--mv-flikar-hojd) + max(12px, env(safe-area-inset-bottom))); }
  body.mv:has(.undo-bar) { padding-bottom: calc(var(--mv-flikar-hojd) + max(12px, env(safe-area-inset-bottom)) + 60px); }
  html:has(body.mv) { scroll-padding-bottom: calc(var(--mv-flikar-hojd) + max(12px, env(safe-area-inset-bottom)) + var(--mv-rum-4)); }
  html:has(body.mv .undo-bar) { scroll-padding-bottom: calc(var(--mv-flikar-hojd) + max(12px, env(safe-area-inset-bottom)) + 60px + var(--mv-rum-4)); }
  .mv-flikar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; }
  .undo { position: fixed; left: 0; right: 0; bottom: calc(var(--mv-flikar-hojd) + max(12px, env(safe-area-inset-bottom)) + var(--mv-linje-1)); z-index: 20;
    background: var(--kort); border-top: var(--mv-linje-1) solid var(--linje); }
  /* Pages without the tab bar (Arvid's two, Logga in, Välkommen): the safe area alone
     at the foot, and the undo bar at the very bottom. */
  body.mv:not(:has(.mv-flikar)) { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  body.mv:not(:has(.mv-flikar)):has(.undo-bar) { padding-bottom: calc(max(12px, env(safe-area-inset-bottom)) + 60px); }
  html:has(body.mv:not(:has(.mv-flikar))) { scroll-padding-bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--mv-rum-4)); }
  html:has(body.mv:not(:has(.mv-flikar)) .undo-bar) { scroll-padding-bottom: calc(max(12px, env(safe-area-inset-bottom)) + 60px + var(--mv-rum-4)); }
  body.mv:not(:has(.mv-flikar)) .undo { bottom: 0; }
}
/* The computer, from 900 px: twelve columns, the state, the facade, the values and the
   energy line in seven, the rows, today and the media in five. */
@media (min-width: 900px) {
  .hem-sida { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--mv-rum-6); align-items: start; padding-top: var(--mv-rum-6); }
  .hem-kol--v { grid-column: span 7; }
  .hem-kol--h { grid-column: span 5; }
  .hem-varden { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .undo { border: var(--mv-linje-1) solid var(--linje); border-radius: var(--mv-radie-2); background: var(--kort); }
}
.undo:empty { display: none; }
.undo-bar { display: flex; align-items: center; gap: var(--mv-rum-3); min-height: 60px; padding: var(--mv-rum-2) var(--mv-marginal); box-sizing: border-box; }
.undo-w { min-width: 0; font-size: var(--mv-storlek-granssnitt); line-height: var(--mv-rad-granssnitt); font-weight: 600; }
.undo-bar .undo-go.mv-knapp { margin-left: auto; }
.undo-said .undo-go { font-size: var(--mv-storlek-granssnitt); line-height: var(--mv-rad-granssnitt); color: var(--text); }

/* ---------------------------------------------------------------- I dag */
.today { display: flex; flex-direction: column; gap: var(--mv-rum-2); }
.evening:empty, .feedlines:empty, .reminds:empty { display: none; }
.reminds, .feedlines { display: flex; flex-direction: column; gap: var(--mv-rum-1); }
.hem-paminn, .feedline { margin: 0; display: flex; gap: var(--mv-rum-2); align-items: flex-start;
  font-size: var(--mv-storlek-granssnitt); line-height: var(--mv-rad-granssnitt); }
.hem-paminn .mv-ikon, .feedline .mv-ikon { margin-top: var(--mv-linje-1); color: var(--text-2); }
.feedline-b { display: flex; flex-direction: column; min-width: 0; }
.feedline-d { font-size: 13px; line-height: 18px; color: var(--text-2); }

/* Who's where, today's lanes in the package's roles: tracks in --linje, bars in --text,
   ended ones in --linje, the running one in --accent, Family bands in --lugnt, keys and
   all-day chips as tags. Positions and sizes come from today.js (phone form). */
.ww-grid { position: relative; }
.ww-track { position: absolute; border: var(--mv-linje-1) solid var(--linje); border-radius: var(--mv-radie-1); }
.ww-line { position: absolute; width: 1px; background: var(--linje); }
.ww-line:not(.is-major) { display: none; }
.ww-tick { position: absolute; top: 0; width: 24px; font-size: 12px; line-height: 16px; color: var(--text-2); }
.ww-tick.is-off { visibility: hidden; }
.ww-band { position: absolute; background: var(--lugnt); }
.ww-band.is-ended { background: none; border-left: var(--mv-linje-1) solid var(--linje); border-right: var(--mv-linje-1) solid var(--linje); }
.ww-row { position: absolute; left: 0; right: 0; }
.ww-who { position: absolute; left: 0; top: 0; width: 68px; display: flex; flex-direction: column; justify-content: center; }
.ww-name { font-size: var(--mv-storlek-liten); line-height: var(--mv-rad-liten); font-weight: 600; color: var(--text); white-space: nowrap; }
.ww-status { font-size: 13px; line-height: 18px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ww-status.is-live { font-weight: 600; color: var(--text); }
.ww-status.is-cant { font-weight: 600; }
.ww-bar { position: absolute; overflow: hidden; border-radius: var(--mv-radie-1); background: var(--text); color: var(--yta); }
.ww-bar.is-unusual { background: var(--kort); border: var(--mv-linje-1) solid var(--text); color: var(--text); }
.ww-bar.is-ended { background: var(--linje); color: var(--text-2); }
.ww-bar.is-running { background: var(--accent); color: var(--pa-accent); }
.ww-bar.is-unusual.is-ended { border-color: var(--linje); color: var(--text-2); }
.ww-bar.is-busy { background: none; border: var(--mv-linje-1) dashed var(--text-2); color: var(--text-2); }
.ww-bar.is-school { background: var(--kort); border: var(--mv-linje-1) solid var(--text-2); color: var(--text); }
.ww-bar.is-school.is-running { border-color: var(--accent); }
.ww-bar.is-school.is-ended { background: none; border-color: var(--linje); color: var(--text-2); }
.ww-bar.is-samling, .ww-bar.is-right { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ww-lesson { position: absolute; top: var(--mv-rum-1); bottom: var(--mv-rum-1); border-radius: var(--mv-radie-1); background: var(--linje); }
.ww-lead { position: absolute; border: var(--mv-linje-ikon) dashed var(--text-2); border-right: 0;
  border-radius: var(--mv-radie-1) 0 0 var(--mv-radie-1); }
.ww-lead.is-ended { border-color: var(--linje); }
.ww-label { position: relative; display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ww-tag { position: absolute; font-size: 12px; line-height: 20px; font-weight: 600; white-space: nowrap; color: var(--text-2); }
.ww-tag.is-running { color: var(--text); }
.ww-tag.is-next { font-weight: 500; }
.ww-now { position: absolute; background: var(--text); z-index: 3; }
.ww-pill { position: absolute; top: -1px; text-align: center; font-size: 12px; font-weight: 600; white-space: nowrap;
  border-radius: var(--mv-radie-2); background: var(--yta); color: var(--text); z-index: 4; }
.ww-keys { display: flex; flex-wrap: wrap; gap: var(--mv-rum-1) var(--mv-rum-2); }
.ww-key, .ww-chip { display: inline-flex; align-items: center; gap: var(--mv-rum-2); min-height: 20px; padding: 0 6px; width: fit-content;
  background: var(--linje); color: var(--text); font-size: 12px; line-height: 16px; }
.ww-chip { display: flex; margin-top: var(--mv-rum-1); }
.ww-chip-t { font-weight: 600; }
.ww-chip.is-busy { background: none; border: var(--mv-linje-1) dashed var(--text-2); }
/* The server's mark on an unusual event: framed on the card colour, no amber (DESIGN
   keeps Senap for Varning). */
.ww-chip.is-unusual { background: var(--kort); border: var(--mv-linje-1) solid var(--text); }
.ww-chip.is-unusual.is-past { border-color: var(--text-2); }
.ww-key.is-ended, .ww-chip.is-past { color: var(--text-2); }
.ww-sw { flex: none; width: 8px; height: 8px; background: var(--lugnt); border: var(--mv-linje-1) solid var(--text-2); }
.ww-key.is-ended .ww-sw { background: none; }
.tomorrow.mv-lank { border-top: 0; }

/* ---------------------------------------------------------------- banners
   Moved from hus.css unchanged (step 5): Huset's services and Önskemål's Jonas line
   draw them. A banner is one 20 px line between var(--mv-rum-3) above and below, 44 px
   in all; its link takes that whole height as its tap target (--mv-tryckyta), its
   margins pulling it out by half the difference to the line. */
body.mv .banner, body.mv .ssec-banner {
  margin: 0; padding: var(--mv-rum-3) 0; display: flex; gap: var(--mv-rum-2); align-items: flex-start;
  font-size: var(--mv-storlek-liten); line-height: var(--mv-rad-liten); color: var(--text-2);
  border-top: var(--mv-linje-1) solid var(--linje);
}
body.mv .banner .mv-ikon, body.mv .ssec-banner .mv-ikon { width: 20px; height: 20px; flex-shrink: 0; }
body.mv .banner a { margin: calc((var(--mv-rad-liten) - var(--mv-tryckyta)) / 2) 0 calc((var(--mv-rad-liten) - var(--mv-tryckyta)) / 2) auto; min-height: var(--mv-tryckyta); display: flex; align-items: center; font-weight: 600; white-space: nowrap; }
