/* Epen's home. Mørk marineblå flate, og gult lys betyr alltid «på». Alt annet er dempet. */
:root {
  --bg: #0c131c;
  --plate: #151e2b;
  --plate2: #1d2838;
  --ink: #eef1f5;
  --muted: #8d9aab;
  --line: #263245;
  --on: #f2b45a;
  --on-ink: #2a1b05;
  --accent: #e9b36a;
  --accent-ink: #1b1205;
  --danger: #ff8a7a;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg) radial-gradient(120% 60% at 50% -10%, #1c2840 0%, rgba(12, 19, 28, 0) 70%) no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1 { font-size: 1.5rem; line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2, h3 { margin: 0; }
main { max-width: 640px; margin: 0 auto; padding: 4px 16px 56px; }

/* ---------- topp */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 12px;
}
.hello { min-width: 0; }
.summary { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; min-height: 1.4em; }
.summary:empty { min-height: 0; }

.menu-wrap { position: relative; flex: none; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: 190px;
  padding: 6px;
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}
.menu-item {
  font: inherit;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--plate2); }

/* ---------- knapper */

.btn {
  font: inherit;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--plate);
  color: var(--ink);
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.9rem; }

/* ---------- forside */

.sec { margin: 22px 2px 8px; font-size: 0.95rem; font-weight: 650; color: var(--muted); }
.sec:first-child { margin-top: 8px; }

input[type="search"] { margin: 4px 0 6px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 96px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--plate2), var(--plate));
  box-shadow: var(--shadow);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.tile:active { transform: scale(0.98); }
.tile .ico { font-size: 1.4rem; line-height: 1; margin-bottom: 8px; filter: grayscale(1); opacity: 0.55; }
.tile .name { font-weight: 600; overflow-wrap: anywhere; }
.tile .sub { margin-top: auto; padding-top: 6px; font-size: 0.85rem; color: var(--muted); }
.tile.on { background: linear-gradient(160deg, rgba(242, 180, 90, 0.20), rgba(242, 180, 90, 0.06)); border-color: rgba(242, 180, 90, 0.55); }
.tile.on .ico { filter: none; opacity: 1; }
.tile.on .sub { color: var(--on); }
.tile .foot { margin-top: auto; padding-top: 6px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .foot .sub { margin: 0; padding: 0; }
.tile .switch { width: 44px; height: 26px; }
.tile .switch .thumb { width: 20px; height: 20px; }
.tile.on .switch { background: var(--on); }
.tile.on .switch .thumb { transform: translateX(18px); }
.tile.busy { opacity: 0.65; cursor: progress; }
.tile:disabled:not(.busy) { opacity: 0.45; cursor: default; }

.room { margin: 0 0 10px; }
.room > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 4px 6px;
}
.room > summary::-webkit-details-marker { display: none; }
.room > summary::after {
  content: "";
  flex: none;
  align-self: center;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.room[open] > summary::after { transform: rotate(45deg); }
.room-name { flex: 1; font-size: 1.1rem; font-weight: 650; overflow-wrap: anywhere; }
.room-meta { font-size: 0.85rem; color: var(--muted); }
.room-meta.lit { color: var(--ink); font-weight: 600; }
.room-meta.lit::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--on); }

.plate {
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dev { display: flex; align-items: stretch; position: relative; }
.dev + .dev { border-top: 1px solid var(--line); }
.dev.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--on); }
.dev.busy { opacity: 0.7; }

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 6px 8px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.row-main:disabled { cursor: default; }
.row-main:disabled:not(.busy) .name { color: var(--muted); }
.row-main .ico { font-size: 1.25rem; width: 1.6rem; text-align: center; flex: none; filter: grayscale(1); opacity: 0.55; }
.dev.on .ico { filter: none; opacity: 1; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.txt .name { font-weight: 550; overflow-wrap: anywhere; }
.txt .sub { font-size: 0.85rem; color: var(--muted); }
.pill { flex: none; padding: 6px 14px; border-radius: 99px; background: var(--plate2); border: 1px solid var(--line); font-size: 0.9rem; font-weight: 600; }

/* Bryteren: gult spor og hvit knapp når på */
.switch {
  flex: none;
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 99px;
  background: var(--line);
  transition: background 0.15s;
}
.thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s;
}
.dev.on .switch { background: var(--on); }
.dev.on .thumb { transform: translateX(22px); }
.row-main:disabled .switch { opacity: 0.5; }

.star {
  flex: none;
  width: 52px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  cursor: pointer;
}
.star.on { color: var(--on); }

/* ---------- innlogging og meldinger */

.login {
  max-width: 360px;
  margin: 12vh auto 0;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.logo-img { width: 112px; height: 112px; margin: 0 auto; display: block; border-radius: 26px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.tagline { margin: 0; color: var(--muted); font-size: 0.95rem; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-img { flex: none; width: 46px; height: 46px; border-radius: 12px; display: block; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field > span { color: var(--muted); font-size: 0.9rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
  font: inherit;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--plate);
  color: var(--ink);
}
input:focus-visible, select:focus-visible, .btn:focus-visible, .tile:focus-visible, .row-main:focus-visible,
.star:focus-visible, .menu-item:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.error { color: var(--danger); min-height: 1.2em; margin: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0; }
.center { text-align: center; }
.notice { max-width: 420px; margin: 14vh auto 0; padding: 0 20px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ---------- admin */

.section-title { margin: 26px 2px 8px; font-size: 0.95rem; font-weight: 650; color: var(--muted); }
.panel { background: var(--plate); border: 1px solid var(--line); border-radius: 16px; margin: 0 0 10px; overflow: hidden; box-shadow: var(--shadow); }
.panel > summary {
  list-style: none;
  cursor: pointer;
  min-height: 60px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.panel[open] > summary::after { transform: rotate(45deg); }
.panel .inner { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.panel .who { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.panel .who small { color: var(--muted); display: block; font-weight: 400; font-size: 0.85rem; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--plate2); border: 1px solid var(--line); font-weight: 700; }

.chips { display: flex; gap: 6px; flex: none; }
.chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 99px; background: var(--plate2); color: var(--muted); border: 1px solid var(--line); }
.chip.warn { color: var(--danger); }

.sub-title { font-size: 0.95rem; font-weight: 650; }
.acct { border-top: 1px solid var(--line); padding-top: 4px; }
.acct > summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }

.checklist { max-height: 380px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--plate2); position: sticky; top: 0; }
.group-head h3 { font-size: 0.95rem; font-weight: 650; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 12px; border-top: 1px solid var(--line); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.check span { min-width: 0; overflow-wrap: anywhere; }
.check small { display: block; color: var(--muted); }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row .field { flex: 1 1 100%; }
.logline { font-size: 0.85rem; border-bottom: 1px solid var(--line); padding: 6px 0; overflow-wrap: anywhere; }
ol.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: 90vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  transition: opacity 0.2s, transform 0.2s;
}
body.has-tabs .toast { bottom: calc(var(--tabbar-h, 74px) + 14px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.acct > summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; }
.acct[open] > summary::after { transform: rotate(45deg); }
.acct > summary { list-style: none; }
.acct > summary::-webkit-details-marker { display: none; }

.renames { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.rename { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.rename + .rename { border-top: 1px solid var(--line); }
.rename-info { display: flex; flex-direction: column; }
.rename-room { font-size: 0.85rem; color: var(--muted); }
.rename-info small { font-size: 0.75rem; color: var(--muted); }
.rename-edit { display: flex; gap: 8px; align-items: center; }
.rename-edit input { flex: 1; min-width: 0; }

/* Kamera-visning */
.cam-modal { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 16, 0.78); display: flex; align-items: center; justify-content: center; padding: 12px; }
.cam-box { width: min(100%, 760px); max-height: 100%; overflow: auto; background: var(--plate); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cam-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cam-head h2 { margin: 0; font-size: 1.1rem; }
.cam-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cam-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam-img[hidden] { display: none; }
.cam-note { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 12px; text-align: center; font-size: 0.9rem; color: #fff; background: rgba(0, 0, 0, 0.55); }
.cam-note[hidden] { display: none; }
.cam-frame .cam-img[hidden] ~ .cam-note { position: static; background: none; }

.dev.on::before { background: var(--on); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tile .foot .sub { font-size: 0.85rem; color: var(--muted); }
.tile.on .foot .sub { color: var(--on); }

/* Lysstyring */
.tilewrap { position: relative; }
.tilewrap .tile { width: 100%; height: 100%; }
.adj { font: inherit; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.25rem; }
.adj:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.adj.in-row { flex: none; width: 48px; }
.dev.on .adj.in-row { color: var(--on); }
.adj.on-tile { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border-radius: 50%; }
.tile.on + .adj.on-tile { color: var(--on); }
.sl-group, .cam-box > .sl-row { display: flex; flex-direction: column; gap: 10px; }
.sl-row { display: flex; flex-direction: column; gap: 6px; }
.sl-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; }
.sl { width: 100%; height: 34px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.sl::-webkit-slider-runnable-track { height: 12px; border-radius: 99px; background: var(--plate2); border: 1px solid var(--line); }
.sl::-moz-range-track { height: 12px; border-radius: 99px; background: var(--plate2); border: 1px solid var(--line); }
.sl.bri::-webkit-slider-runnable-track { background: linear-gradient(90deg, #2a2f38, #ffe9b8); }
.sl.bri::-moz-range-track { background: linear-gradient(90deg, #2a2f38, #ffe9b8); }
.sl.temp::-webkit-slider-runnable-track { background: linear-gradient(90deg, #ffbe78, #fff4e5, #d6e8ff); }
.sl.temp::-moz-range-track { background: linear-gradient(90deg, #ffbe78, #fff4e5, #d6e8ff); }
.sl.hue::-webkit-slider-runnable-track { background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.sl.hue::-moz-range-track { background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.sl.sat::-webkit-slider-runnable-track { background: linear-gradient(90deg, #ffffff, #e9b36a); }
.sl.sat::-moz-range-track { background: linear-gradient(90deg, #ffffff, #e9b36a); }
.sl::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid var(--on); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.sl::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--on); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer; padding: 0; }
.swatch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.static { margin: 0; min-height: 48px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }
.cam-box { gap: 14px; }

/* Fullskjerm, snu bildet og kamerastyring */
.cam-frame.flip .cam-img { transform: rotate(180deg); }
.cam-frame:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
.cam-frame:-webkit-full-screen { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; }
.cam-frame.full { position: fixed; inset: 0; z-index: 60; width: 100vw; height: 100dvh; aspect-ratio: auto; border-radius: 0; }
.cam-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 8px; z-index: 2; }
.cam-tool { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 1.3rem; cursor: pointer; padding: 0; }
.cam-tool:focus-visible, .pad-btn:focus-visible, .preset:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pad { position: absolute; right: 8px; bottom: 8px; z-index: 2; display: grid; grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(3, 40px); gap: 2px; }
.cam-frame:fullscreen .pad, .cam-frame:-webkit-full-screen .pad, .cam-frame.full .pad { grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: 6px; right: 16px; bottom: 16px; }
.pad-btn { border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 1.2rem; cursor: pointer; padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pad-btn:active { background: rgba(242, 180, 90, 0.75); color: #1b1205; }
.pad-up { grid-column: 2; grid-row: 1; }
.pad-left { grid-column: 1; grid-row: 2; }
.pad-right { grid-column: 3; grid-row: 2; }
.pad-down { grid-column: 2; grid-row: 3; }
.presets { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 150px); }
.preset { border-radius: 99px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.55); color: #fff; padding: 6px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.cam-note { z-index: 1; }

/* ---------- dashbord (en skjerm uten knapper) */

body.is-dash { background: #070b11; overflow: hidden; padding: 0; cursor: none; user-select: none; -webkit-user-select: none; }
body.is-dash .dash-root { position: fixed; inset: 0; }
body.is-dash .dash-root .notice { cursor: default; }

.dash {
  --gap: 1.3vmin;
  height: 100%;
  display: grid;
  gap: var(--gap);
  padding: var(--gap);
  font-size: 1.9vmin;
  color: var(--ink);
}
.dash.sz-s { font-size: 1.6vmin; }
.dash.sz-l { font-size: 2.3vmin; }
.dash.t-cams-left { grid-template-columns: auto minmax(0, 1fr); }
.dash.t-cams-right { grid-template-columns: minmax(0, 1fr) auto; }
.dash.t-cams-top { grid-template-rows: auto minmax(0, 1fr); }
.dash.t-cams-bottom { grid-template-rows: minmax(0, 1fr) auto; }

/* Kameraboksene får bredde/høyde etter 16:9, så det ikke blir svarte felt. Resten av skjermen går til vær og kalender. */
.dcams.n1 { --n: 1; } .dcams.n2 { --n: 2; } .dcams.n3 { --n: 3; }
.t-cams-left .dcams, .t-cams-right .dcams { width: min(62vw, calc((100vh - (var(--n) + 1) * var(--gap)) / var(--n) * 16 / 9)); }
.t-cams-top .dcams, .t-cams-bottom .dcams { height: min(62vh, calc((100vw - (var(--n) + 1) * var(--gap)) / var(--n) * 9 / 16)); }
.dash.nocams, .dash.noinfo { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }

.dcams { display: grid; gap: var(--gap); min-height: 0; min-width: 0; }
.t-cams-left .dcams, .t-cams-right .dcams { grid-auto-rows: minmax(0, 1fr); }
.t-cams-top .dcams, .t-cams-bottom .dcams { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.nocams .dcams, .noinfo .dcams { grid-auto-flow: row; width: auto; height: auto; }
.dash.noinfo.t-cams-top .dcams, .dash.noinfo.t-cams-bottom .dcams { grid-auto-flow: column; }
.dash.noinfo.t-cams-left .dcams, .dash.noinfo.t-cams-right .dcams { width: auto; }
.dash.noinfo.t-cams-top .dcams, .dash.noinfo.t-cams-bottom .dcams { height: auto; }

.dcam { position: relative; margin: 0; overflow: hidden; border-radius: 1.2em; background: #000; border: 1px solid var(--line); min-height: 0; min-width: 0; }
.dcam-img { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.dcam.flip .dcam-img { transform: rotate(180deg); }
.dcam-note { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; color: var(--muted); font-size: 1.1em; text-align: center; padding: 1em; }
.dcam-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6em 1em .6em; font-size: 1em; font-weight: 600; background: linear-gradient(transparent, rgba(0, 0, 0, 0.65)); text-shadow: 0 1px 3px #000; }

.dinfo { display: flex; gap: var(--gap); min-height: 0; min-width: 0; font-size: calc(1em * var(--k, 1)); }
.t-cams-left .dinfo, .t-cams-right .dinfo, .nocams .dinfo { flex-direction: column; }
.t-cams-top .dinfo, .t-cams-bottom .dinfo { flex-direction: row; }
.dw { flex: 0 1 auto; background: var(--plate); border: 1px solid var(--line); border-radius: 1.2em; padding: 1em 1.3em; min-width: 0; min-height: 0; overflow: hidden; }
.dinfo:not(:has(.dcal)) .dw { flex: 1 1 auto; }
.dw.dcal { flex: 1 1 0; position: relative; }
.t-cams-top .dw, .t-cams-bottom .dw { flex: 1 1 0; }
.t-cams-top .dw.dforecast, .t-cams-bottom .dw.dforecast, .t-cams-top .dw.dcal, .t-cams-bottom .dw.dcal { flex: 2 1 0; }
.t-cams-top .dw.dclock, .t-cams-bottom .dw.dclock { flex: 1.3 1 0; }
.t-cams-top .d-time, .t-cams-bottom .d-time { font-size: 4.4em; }
.t-cams-top .d-date, .t-cams-bottom .d-date { font-size: 1.2em; }
.t-cams-top .d-temp, .t-cams-bottom .d-temp { font-size: 3em; }
.t-cams-top .d-wicon, .t-cams-bottom .d-wicon { font-size: 2.6em; }
.dw.dcal::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(rgba(21, 30, 43, 0), var(--plate)); pointer-events: none; }

.d-title { font-size: 0.8em; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5em; }
.dclock { display: flex; flex-direction: column; justify-content: center; }
.d-time { font-size: 6.2em; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.d-date { font-size: 1.5em; color: var(--accent); margin-top: 0.15em; }
.d-date::first-letter { text-transform: uppercase; }

.d-now { display: flex; align-items: center; gap: 0.5em; flex-wrap: wrap; }
.d-wicon { font-size: 3.4em; line-height: 1; }
.d-temp { font-size: 3.8em; font-weight: 700; line-height: 1; }
.d-wtext { font-size: 1.5em; color: var(--accent); }
.d-bits { list-style: none; margin: 0.6em 0 0; padding: 0; color: var(--muted); font-size: 1.05em; display: flex; flex-wrap: wrap; gap: 0.2em 1.2em; }
.d-empty { margin: 0; color: var(--muted); font-size: 1.1em; }

.d-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6em; text-align: center; }
.d-dname { font-weight: 600; font-size: 1em; white-space: nowrap; }
.d-dname::first-letter { text-transform: uppercase; }
.d-dicon { font-size: 2.4em; line-height: 1.2; }
.d-dtemp b { font-size: 1.4em; }
.d-dtemp span { color: var(--muted); }
.d-drain { color: #7db4ff; font-size: 0.9em; min-height: 1.3em; }

.d-evlist { display: flex; flex-direction: column; gap: 0.8em; }
.d-dayhead { color: var(--accent); font-weight: 700; font-size: 1.1em; margin-bottom: 0.15em; }
.d-dayhead::first-letter { text-transform: uppercase; }
.d-ev { display: flex; gap: 0.8em; font-size: 1.15em; padding: 0.12em 0; }
.d-evtime { flex: none; width: 6.6em; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.d-evtitle { min-width: 0; overflow-wrap: anywhere; }
.d-evtitle small { color: var(--muted); font-size: 0.8em; }

.dash-close { position: fixed; top: 10px; right: 10px; z-index: 6; cursor: pointer; font: inherit; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(21, 30, 43, 0.92); color: var(--ink); }
body.is-dash .dash-close { cursor: pointer; }

/* stående skjerm eller mobil: alt under hverandre */
@media (max-aspect-ratio: 1/1) {
  body.is-dash { overflow-y: auto; }
  .dash { height: auto; min-height: 100%; font-size: 3.4vmin; display: flex; flex-direction: column; }
  .dash.sz-s { font-size: 3vmin; }
  .dash.sz-l { font-size: 4vmin; }
  .dcams, .t-cams-left .dcams, .t-cams-right .dcams, .t-cams-top .dcams, .t-cams-bottom .dcams { grid-auto-flow: row; grid-auto-columns: auto; grid-auto-rows: auto; }
  .dcam { aspect-ratio: 16 / 9; }
  .dinfo, .t-cams-top .dinfo, .t-cams-bottom .dinfo { flex-direction: column; }
  .dcams, .t-cams-left .dcams, .t-cams-right .dcams, .t-cams-top .dcams, .t-cams-bottom .dcams { width: auto; height: auto; }
  .dcams, .dinfo { flex: none; min-height: auto; }
  .dw, .t-cams-top .dw, .t-cams-bottom .dw, .dw.dcal, .t-cams-top .dw.dclock, .t-cams-bottom .dw.dclock { flex: none; min-height: auto; overflow: visible; }
  .t-cams-top .d-time, .t-cams-bottom .d-time { font-size: 6.2em; }
  .dw.dcal::after { display: none; }
  body.is-dash .dash-root { overflow-y: auto; }
}

/* admin: layout */
.dash-list { border-top: 1px solid var(--line); }
.dash-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.inline { display: flex; align-items: center; gap: 8px; }
.inline input[type="checkbox"] { width: 22px; height: 22px; flex: none; }
.inline.grow { flex: 1; min-width: 0; }

/* ---- bevegelse og varsler */
.ev-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.ev-row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px; text-align: left; color: var(--ink); background: var(--plate); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font: inherit; }
.ev-thumb { width: 112px; height: 63px; flex: none; object-fit: cover; border-radius: 8px; background: #000; }
.ev-none { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.ev-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.7); display: flex; align-items: flex-end; justify-content: center; }
.modal-card { background: var(--bg); width: 100%; max-width: 640px; max-height: 94vh; overflow-y: auto; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; display: flex; flex-direction: column; gap: 12px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.modal-head p { margin: 2px 0 0; }
.ev-imgs { display: flex; flex-direction: column; gap: 12px; }
.ev-img { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ev-img img, .ev-video video { width: 100%; border-radius: 10px; background: #000; }
.ev-video { display: flex; flex-direction: column; gap: 8px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.check { display: flex; align-items: center; gap: 12px; padding: 12px 4px; min-height: 44px; }
.check input { width: 22px; height: 22px; }

/* ---- stjerner */
.star-banner { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 56px; margin: 0 0 14px; padding: 0 18px; font: inherit; font-weight: 600; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 14px; cursor: pointer; }
.star-hero { text-align: center; padding: 18px 8px 6px; }
.star-big { font-size: 3rem; font-weight: 700; line-height: 1.1; }
.st-list { display: flex; flex-direction: column; gap: 8px; }
.st-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--plate); border: 1px solid var(--line); border-radius: 14px; }
.st-row.st-dim { opacity: 0.7; }
.st-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 8em; }
.st-main strong { overflow-wrap: anywhere; }
.st-wait, .st-actions { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.st-ok { color: var(--on); font-weight: 600; white-space: nowrap; }
.st-edit { background: var(--plate); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; margin: 0 0 8px; }
.st-edit > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; }
.st-edit[open] { padding-bottom: 12px; }
.st-add > summary { color: var(--accent); font-weight: 600; }

/* ---- stjernetavle på dashbordet */
.dw.dstars { flex: 0 0 auto; }
.d-kid { display: grid; grid-template-columns: minmax(5em, 1fr) 2fr auto; grid-template-areas: "name track n" "name track tot"; align-items: center; column-gap: 0.8em; row-gap: 0; padding: 0.35em 0; }
.d-kidname { grid-area: name; font-weight: 600; overflow-wrap: anywhere; }
.d-track { grid-area: track; height: 0.9em; border-radius: 1em; background: var(--plate2); overflow: hidden; }
.d-bar { display: block; height: 100%; width: var(--w, 0%); min-width: 0.9em; border-radius: 1em; background: var(--on); transition: width 0.6s; }
.d-kidn { grid-area: n; font-weight: 700; text-align: right; white-space: nowrap; }
.d-kidtot { grid-area: tot; color: var(--muted); text-align: right; font-size: 0.7em; }

.st-desc { font-size: 0.92rem; color: var(--ink); opacity: 0.85; overflow-wrap: anywhere; white-space: pre-line; }
textarea { width: 100%; font: inherit; color: var(--ink); background: var(--plate2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; }

.lv-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; margin: 8px 0 0; background: var(--plate); border: 1px solid var(--line); border-radius: 14px; }
.lv-name { font-weight: 700; font-size: 1.1rem; }
.lv-box .d-track { height: 0.7em; }

/* ---------- bunnmeny */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: rgba(21, 30, 43, 0.97); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tab {
  flex: 1 1 0; max-width: 160px; min-height: 56px; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: inherit; font-size: 0.78rem; color: var(--muted);
  background: transparent; border: 0; border-radius: 12px; cursor: pointer;
}
.tab .tab-ico { font-size: 1.35rem; line-height: 1; filter: grayscale(1); opacity: 0.7; }
.tab.on { color: var(--on); background: rgba(242, 180, 90, 0.10); }
.tab.on .tab-ico { filter: none; opacity: 1; }
.tab:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
main.has-tabs { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- scener */
.scene-tile .ico { filter: none; opacity: 1; font-size: 1.7rem; }
.scene-tile.hidden-scene { opacity: 0.6; }
.tilewrap .adj.on-tile { color: var(--muted); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.icon-pick button { width: 46px; height: 46px; font-size: 1.5rem; border-radius: 12px; border: 1px solid var(--line); background: var(--plate); cursor: pointer; }
.icon-pick button.on { border-color: var(--on); background: rgba(242, 180, 90, 0.15); }
.sc-step { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin-bottom: 10px; background: var(--plate); border: 1px solid var(--line); border-radius: 14px; }
.sc-head { display: flex; align-items: center; gap: 6px; }
.sc-head select { flex: 1; min-width: 0; }
.sc-head .btn { flex: none; min-width: 40px; padding: 0 8px; }
.sc-swatch { display: block; height: 28px; border-radius: 8px; border: 1px solid var(--line); }
input[type="number"] { font: inherit; width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--plate); color: var(--ink); }

/* ---------- fast bunnmeny på alle sider, admin-liste */
body.has-tabs main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.is-dash .tabbar { display: none; }
.hub { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.hub-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 14px; font: inherit; color: var(--ink); text-align: left; background: var(--plate); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.hub-item:active { transform: scale(0.99); }
.hub-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hub-ico { font-size: 1.5rem; flex: none; width: 32px; text-align: center; }
.hub-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hub-txt small { color: var(--muted); }
.hub-go { color: var(--muted); font-size: 1.4rem; }

/* ---------- dashbord-malen «Tavle»: ukekalender og pall ---------- */
.dcal-grid { display: none; }
.dstars .dpodium-wrap { display: none; }
.dleft, .dright { font-size: calc(1em * var(--k, 1)); }

/* pall (som på Kahoot) */
.dpodium { display: flex; align-items: flex-end; justify-content: center; gap: 0.6em; }
.pd-col { flex: 1 1 0; min-width: 0; max-width: 11em; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; }
.pd-crown { font-size: 1.5em; line-height: 1.1; min-height: 1.1em; }
.pd-name { font-weight: 700; font-size: 1.2em; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-n { font-size: 1.1em; color: var(--accent); font-variant-numeric: tabular-nums; margin-bottom: 0.25em; }
.pd-block { width: 100%; display: grid; place-items: center; border-radius: 0.6em 0.6em 0 0; font-weight: 800; font-size: 2.2em; color: rgba(10, 15, 25, 0.6); }
.pd-col.r1 .pd-block { height: 58%; background: linear-gradient(#ffd75e, #d9a023); }
.pd-col.r2 .pd-block { height: 42%; background: linear-gradient(#e4e8ee, #9aa3b0); }
.pd-col.r3 .pd-block { height: 30%; background: linear-gradient(#e0a06a, #a8693a); }
.pd-rest { margin-top: 0.5em; border-top: 1px solid var(--line); padding-top: 0.4em; }
.pd-row { display: flex; gap: 0.6em; font-size: 1.05em; padding: 0.1em 0; }
.pd-rk { width: 1.6em; color: var(--muted); }
.pd-rname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-rn { color: var(--accent); }

/* ukekalender */
.wk-head { text-align: center; font-weight: 700; font-size: 0.95em; padding: 0.15em 0 0.3em; }
.wk-head small { margin-left: 0.3em; color: var(--muted); font-weight: 600; font-size: 0.9em; }
.wk-head.today, .wk-head.today small { color: var(--accent); }
.wk-head::first-letter { text-transform: uppercase; }
.wk-allday { display: flex; flex-direction: column; gap: 0.15em; padding-bottom: 0.3em; min-width: 0; }
.wk-chip { font-size: 0.8em; padding: 0.1em 0.4em; border-radius: 0.4em; border-left: 3px solid; overflow-wrap: anywhere; line-height: 1.15; }
.wk-axis { position: relative; overflow: visible; height: calc(var(--hrs, 1) * 2.8em); }
.wk-col { height: calc(var(--hrs, 1) * 2.8em); }
.wk-break { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(255, 255, 255, 0.28); z-index: 1; }
.wk-hour { position: absolute; right: 0.3em; transform: translateY(0.1em); font-size: 0.75em; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-col { position: relative; min-width: 0; overflow: hidden; border-left: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% calc(100% / var(--hrs, 8)); }
.wk-col.today, .wk-allday.today { background-color: rgba(255, 255, 255, 0.05); }
.wk-ev { position: absolute; box-sizing: border-box; padding: 0.1em 0.3em; border-radius: 0.4em; border-left: 3px solid; font-size: 0.8em; line-height: 1.15; overflow: hidden; min-height: 1.3em; overflow-wrap: anywhere; }
.wk-ev .wk-t { font-weight: 700; opacity: 0.85; }
.wk-ev.past { opacity: 0.45; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: #ff5a5f; z-index: 2; }
.c0 { background: rgba(125, 180, 255, 0.24); border-color: #7db4ff; }
.c1 { background: rgba(240, 166, 74, 0.24); border-color: #f0a64a; }
.c2 { background: rgba(111, 207, 151, 0.24); border-color: #6fcf97; }
.c3 { background: rgba(183, 148, 244, 0.26); border-color: #b794f4; }
.c4 { background: rgba(244, 143, 177, 0.26); border-color: #f48fb1; }

@media (min-aspect-ratio: 1/1) {
  .dash.t-tavle { --lw: min(36vw, calc((100vh - 2 * var(--gap)) * 0.6 / var(--n, 1) * 16 / 9)); grid-template-columns: var(--lw) minmax(0, 1fr); }
  .dash.t-tavle.single { grid-template-columns: minmax(0, 1fr); }
  .t-tavle .dleft, .t-tavle .dright { display: flex; flex-direction: column; gap: var(--gap); min-height: 0; min-width: 0; }
  .t-tavle .dcams { display: grid; grid-auto-flow: row; grid-auto-rows: auto; width: auto; height: auto; flex: none; }
  .t-tavle .dcam { aspect-ratio: 16 / 9; }
  .t-tavle .dw { padding: 0.6em 0.9em; }
  .t-tavle .dw.dstars { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; }
  .t-tavle .dstars.has-podium .dstars-list { display: none; }
  .t-tavle .dstars.has-podium .dpodium-wrap { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
  .t-tavle .dpodium { flex: 1 1 0; min-height: 0; }
  .t-tavle .dtop { display: flex; gap: var(--gap); flex: none; min-width: 0; }
  .t-tavle .dtop .dw { flex: 1 1 0; min-width: 0; }
  .t-tavle .dtop .dw.dweather { flex: 1.25 1 0; }
  .t-tavle .dw.dforecast { flex: none; }
  .t-tavle .d-time { font-size: 3.4em; }
  .t-tavle .d-date { font-size: 1.05em; }
  .t-tavle .d-wicon { font-size: 2.2em; }
  .t-tavle .d-temp { font-size: 2.6em; }
  .t-tavle .d-wtext { font-size: 1.1em; }
  .t-tavle .d-bits { font-size: 0.85em; margin-top: 0.3em; }
  .t-tavle .d-dicon { font-size: 1.7em; }
  .t-tavle .d-dtemp b { font-size: 1.15em; }
  .t-tavle .dw.dcal { flex: 0 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .t-tavle .dw.dcal::after { display: none; }
  .t-tavle .dcal-list { display: none; }
  .t-tavle .dcal-grid { display: grid; flex: 0 1 auto; min-height: 0; grid-template-columns: 2.4em repeat(7, minmax(0, 1fr)); column-gap: 0.3em; }
  .t-tavle .dcal-grid.empty { display: block; }
}
@media (max-aspect-ratio: 1/1) {
  .dleft, .dright, .dtop { display: contents; }
}

/* kamera med to linser over hverandre: vis bare den ene halvdelen */
.dcam.crop-top .dcam-img, .dcam.crop-bottom .dcam-img { position: absolute; left: 0; width: 100%; height: 200%; object-fit: fill; }
.dcam.crop-top .dcam-img { top: 0; }
.dcam.crop-bottom .dcam-img { top: -100%; }

/* admin: dashbord-rader. Kameraer får en egen linje med valg, så ingenting blir trangt på mobil */
.dash-row { flex-wrap: wrap; }
.dash-row .inline.grow span { overflow-wrap: anywhere; }
.dash-opts { flex: 0 0 100%; display: flex; align-items: center; gap: 12px; padding: 0 0 4px 34px; }
.dash-opts .inline { white-space: nowrap; }
.dash-opts select { flex: 1 1 auto; min-width: 0; width: auto; }

/* Gi stjerner raskt */
.quick-give { margin: 8px 0 14px; }
.quick-give .chips { flex-wrap: wrap; gap: 8px; }
.quick-give .chip { font-size: 1rem; padding: 10px 16px; min-height: 44px; color: var(--text, inherit); }
.quick-give .chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* Siste bevegelse */
.dmo { display: flex; flex-direction: column; }
.dmo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9em, 1fr)); gap: 0.5em; align-content: start; flex: 1 1 auto; min-height: 0; }
.dmo-item { margin: 0; min-width: 0; }
.dmo-pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 0.5em; background: #000; }
.dmo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dmo-img.crop-top { height: 200%; top: 0; bottom: auto; }
.dmo-img.crop-bottom { height: 200%; top: -100%; bottom: auto; }
.dmo-none { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.dmo-item figcaption { display: flex; justify-content: space-between; gap: 0.4em; font-size: 0.75em; color: var(--muted); margin-top: 0.2em; white-space: nowrap; }
.dmo-item figcaption b { color: inherit; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.t-tavle .dw.dmo { flex: 1 1 0; min-height: 0; }

.dmo[hidden] { display: none; }
/* Kamerarad: halve kamerabilder ved siden av hverandre */
.dw.dstrip { flex: 0 0 auto; padding: 0.4em; }
.dstrip-row { display: grid; grid-template-columns: repeat(var(--sn, 4), minmax(0, 1fr)); gap: 0.4em; }
.dstrip .dcam { aspect-ratio: 16 / 9 !important; width: 100%; min-width: 0; }
.dstrip .dcam-name { font-size: 0.7em; }

/* Kamerarader i admin: Snu og to valg får plass uten å gå utenfor skjermen */
.dash-opts { flex-wrap: wrap; row-gap: 8px; box-sizing: border-box; max-width: 100%; }
.dash-opts select { flex: 1 1 100%; width: 100%; }

.dst { margin: 0; min-width: 0; }
.dst .dmo-pic { aspect-ratio: 16 / 9; }
.dst figcaption { display: flex; justify-content: space-between; gap: 0.4em; font-size: 0.7em; color: var(--muted); margin-top: 0.2em; white-space: nowrap; }
.dst figcaption b { color: inherit; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.dmo-img.flip { transform: rotate(180deg); }

/* Buss */
.dbus .bus-list { display: flex; flex-direction: column; gap: 0.25em; }
.bus-row { display: flex; align-items: baseline; gap: 0.5em; font-size: 1.05em; white-space: nowrap; }
.bus-row.off { opacity: 0.55; text-decoration: line-through; }
.bus-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.bus-live { font-size: 0.6em; color: var(--muted); }
.bus-live.on { color: #5fd38d; }
.bus-when { color: var(--muted); }
.bus-late { color: #f0a35e; font-size: 0.85em; }
.dfc-row { display: flex; gap: var(--gap, 12px); min-width: 0; }
.dfc-row .dw { min-width: 0; }
.dfc-row .dw.dforecast { flex: 1 1 0; }
.dfc-row .dw.dbus { flex: 0 0 auto; min-width: 11em; }
@media (min-aspect-ratio: 1/1) { .t-tavle .dfc-row { flex: none; } }
@media (max-aspect-ratio: 1/1) { .dfc-row { display: contents; } }

/* Temperatur */
.temps { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 10px; margin-bottom: 8px; }
.temp-chip { background: var(--plate); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: var(--shadow); }
.temp-chip.gone { opacity: 0.55; }
.temp-val { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.temp-name { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.pill.temp { font-weight: 700; font-variant-numeric: tabular-nums; background: transparent; }

/* Handleliste */
.shop-add { display: flex; gap: 8px; margin: 4px 0 14px; }
.shop-add input { flex: 1 1 auto; min-width: 0; }
.shop-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.shop-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 44px; font-size: 1.1rem; cursor: pointer; }
.shop-main span { overflow-wrap: anywhere; }
.shop-main input { width: 24px; height: 24px; flex: none; }
.shop-row.done .shop-main span { text-decoration: line-through; color: var(--muted); }
.shop-done { margin-top: 12px; }
.shop-done .btn { margin-top: 10px; }
.shop-link { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 8px 0 12px; }
.shop-count { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 10px; font-weight: 700; min-width: 1.6em; text-align: center; }
.shop-add .btn { white-space: nowrap; }
