@font-face { font-family: Inter; src: url("fonts/Inter-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #F6F4EF; --card: #fff; --text: #1F2A2E; --muted: #6B7579; --line: rgba(31,42,46,.08);
  --ok: #3FA66B; --warn: #E8A33D; --error: #D9534F; --offline: #B8BEC1;
  --accent: #3B7DD8; --accent-2: #A9C8F0; --accent-soft: rgba(59,125,216,.12);
  --shadow: 0 4px 20px rgba(0,0,0,.06); --shadow-lg: 0 10px 40px rgba(31,42,46,.12);
}
body.loc-Hytta { --accent: #2F5D50; --accent-2: #C98B4E; --accent-soft: rgba(47,93,80,.12); --bg: #F3EEE5; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; transition: background .25s; }
button, a { font: inherit; color: inherit; background: none; border: 0; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
svg { width: 100%; height: 100%; }
/* Ikon-arket i index.html: må ikke arve 100 % over, ellers dekker det hele skjermen og stjeler trykk. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.page { max-width: 1344px; margin: 0 auto; padding: 28px 48px 40px; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.greet h1 { font-size: 26px; font-weight: 650; letter-spacing: -.035em; }
.greet .sub { margin-top: 4px; font-size: 14px; color: var(--muted); }
.seg { display: flex; background: #E8E4DC; border-radius: 999px; padding: 4px; flex-shrink: 0; }
.seg a { padding: 9px 22px; font-size: 15px; font-weight: 600; color: var(--muted); border-radius: 999px; transition: background .2s, color .2s; }
.seg a.is-on { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(31,42,46,.12); }

.journey { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.journey::-webkit-scrollbar { display: none; }
.journey a { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.55); white-space: nowrap; transition: background .2s, color .2s; }
.journey a img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.journey a.is-on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.journey a.is-on img { box-shadow: 0 0 0 2px var(--accent); }
.journey .sep { color: var(--offline); }

.alert { display: flex; justify-content: space-between; gap: 12px; width: 100%; margin-bottom: 14px; padding: 12px 16px; border-radius: 16px; background: #FCF1DE; color: #7A4F10; font-size: 14px; text-align: left; }
.alert[hidden] { display: none; }

.scene { position: relative; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); background: #d9e2ea; }
.stage { position: relative; aspect-ratio: 16 / 9; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: .3; } }
.sky { position: absolute; inset: 0; pointer-events: none; transition: background .6s; }
.overlays { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px; pointer-events: none; z-index: 8; }
.scene-title { font-size: 26px; font-weight: 680; letter-spacing: -.04em; padding: 8px 14px; background: rgba(255,255,255,.75); backdrop-filter: blur(12px); border-radius: 14px; }
.overlay-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.pill { display: flex; align-items: center; gap: 7px; padding: 8px 12px; background: rgba(255,255,255,.82); backdrop-filter: blur(12px); border-radius: 999px; font-size: 13px; font-weight: 550; pointer-events: auto; }
.pill svg { width: 16px; height: 16px; color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.ok { color: #1E6B42; } .pill.ok .dot { background: var(--ok); }
.pill.warn { color: #8A5A12; } .pill.warn .dot { background: var(--warn); }

.step { position: absolute; top: 50%; transform: translateY(-50%); z-index: 8; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; line-height: 1; background: rgba(255,255,255,.8); backdrop-filter: blur(8px); box-shadow: var(--shadow); color: var(--text); }
.step.prev { left: 14px; } .step.next { right: 14px; }

/* Punkter i scenen */
.spot { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 2px)); display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 2px 8px rgba(31,42,46,.14)); }
.spot[data-dir="down"] { flex-direction: column-reverse; transform: translate(-50%, -8px); }
.spot:hover, .spot.is-sel { z-index: 7; }
.chip { display: flex; align-items: center; gap: 7px; background: #fff; border-radius: 16px; padding: 5px 10px 5px 5px; min-height: 38px; white-space: nowrap; transition: transform .15s; }
.spot:hover .chip, .spot.is-sel .chip { transform: translateY(-2px); }
.spot.is-sel .chip { box-shadow: 0 0 0 2px var(--accent); }
.dome { width: 28px; height: 28px; border-radius: 10px 10px 8px 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); padding: 6px; }
.chip .meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.chip .name { font-size: 10.5px; font-weight: 550; color: var(--muted); }
.chip .val { font-size: 13.5px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.lvl-warn .sdot { background: var(--warn); }
.lvl-error .sdot { background: var(--error); animation: pulse 1.4s infinite; }
.lvl-offline .sdot, .lvl-unknown .sdot { background: var(--offline); }
.lvl-ok .sdot { box-shadow: 0 0 0 3px rgba(63,166,107,.18); }
.lvl-offline .chip, .lvl-offline .dome { filter: grayscale(1); }
.lvl-offline .chip { opacity: .72; }
.lvl-offline .val { color: var(--muted); }
.chip .count { display: none; }
.pin { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--ok), 0 2px 6px rgba(31,42,46,.25); margin-top: 6px; }
.spot[data-dir="down"] .pin { margin: 0 0 6px; }
.spot.lvl-warn .pin { box-shadow: 0 0 0 3px var(--warn), 0 2px 6px rgba(31,42,46,.25); }
.spot.lvl-error .pin { box-shadow: 0 0 0 3px var(--error), 0 2px 6px rgba(31,42,46,.25); }
.spot.lvl-offline .pin, .spot.lvl-unknown .pin { box-shadow: 0 0 0 3px var(--offline), 0 2px 6px rgba(31,42,46,.2); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(217,83,79,.25); } }

.go { position: absolute; z-index: 6; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(31,42,46,.25); white-space: nowrap; transition: transform .15s; }
.go[data-side="left"] { transform: translate(-24px, -50%); }
.go[data-side="right"] { transform: translate(calc(-100% + 24px), -50%); }
.go .short { display: none; }
.go b { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; }

/* Liste under scenen */
.section-title { margin: 28px 0 12px; font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); text-align: left; min-height: 64px; }
.row .dome { width: 40px; height: 40px; border-radius: 14px 14px 10px 10px; padding: 9px; }
.row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .val { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; max-width: 42%; }
.row .has-ctrl { color: var(--accent); font-size: 14px; }
.row.lvl-offline { opacity: .6; }
.row.lvl-offline .dome { filter: grayscale(1); }
.drawer-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 20px; padding: 14px 18px; border-radius: 16px; border: 1px dashed rgba(31,42,46,.18); color: var(--muted); font-size: 14px; font-weight: 550; }
.drawer-btn b { background: #E8E4DC; color: var(--text); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.tap-hint, .go-row { display: none; }
footer { margin-top: 28px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* Ark (kort på desktop, bunnark på mobil) */
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(20,25,27,.0); transition: background .2s; }
.sheet-open .backdrop { background: rgba(20,25,27,.18); }
.sheet { position: fixed; z-index: 21; right: 28px; bottom: 28px; width: 400px; max-height: calc(100vh - 56px); overflow: auto; background: #fff; border-radius: 22px; box-shadow: 0 20px 60px rgba(31,42,46,.22); padding: 20px 18px 18px; opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; overscroll-behavior: contain; }
.sheet-open .sheet { opacity: 1; transform: none; }
.grab { display: none; }
.close { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; font-size: 22px; color: var(--muted); background: #F1EEE8; }
.sheet-title { font-size: 20px; font-weight: 680; letter-spacing: -.03em; margin: 2px 44px 14px 2px; }
.group { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 2px 8px; }
.dcard { padding: 14px; border-radius: 18px; background: #FAF9F6; margin-bottom: 10px; }
.dcard header { display: flex; gap: 12px; align-items: center; }
.dcard .dome { width: 42px; height: 42px; border-radius: 15px 15px 11px 11px; padding: 10px; }
.dcard h4 { font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.dcard .st { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin-top: 2px; }
.dcard .st .sdot { width: 7px; height: 7px; }
.dcard.lvl-offline { opacity: .6; } .dcard.lvl-offline .dome { filter: grayscale(1); }
.dcard .note { margin-top: 10px; font-size: 13px; line-height: 1.4; color: #7A4F10; background: #FCF1DE; padding: 8px 10px; border-radius: 10px; }
.dcard dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 12px; }
.dcard dt { font-size: 12px; color: var(--muted); }
.dcard dd { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ctrl-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 550; }
.switch { width: 60px; height: 34px; border-radius: 999px; background: #D5D9DB; position: relative; transition: background .2s; flex-shrink: 0; touch-action: manipulation; }
.switch i { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch.is-on { background: var(--accent); }
.switch.is-on i { transform: translateX(26px); }
.switch:disabled, .btn:disabled { opacity: .45; }
.ctrl-buttons { display: flex; gap: 10px; margin-top: 14px; }
.btn { flex: 1; padding: 12px 14px; border-radius: 14px; font-size: 15px; font-weight: 650; touch-action: manipulation; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: #ECE9E3; }
.hint { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.sent { margin-top: 10px; font-size: 13px; font-weight: 600; color: #8A5A12; background: #FCF1DE; padding: 8px 10px; border-radius: 10px; }

.confirm { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(20,25,27,.4); padding: 20px; }
.confirm[hidden] { display: none; }
.confirm-box { width: min(380px, 100%); background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.confirm-box h3 { font-size: 19px; font-weight: 680; letter-spacing: -.02em; }
.confirm-box p { margin-top: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1F2A2E; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
[hidden] { display: none !important; }

@media (max-width: 600px) {
  .page { padding: 16px 16px 28px; }
  .page-header { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 12px; }
  .greet h1 { font-size: 22px; }
  .greet .sub { font-size: 13px; }
  .seg a { flex: 1; text-align: center; padding: 9px 0; }
  .who { padding: 4px; font-size: 0; gap: 0; }
  .journey { margin: 0 -16px 12px; padding: 0 16px; }
  .scene { border-radius: 20px; display: flex; flex-direction: column; }
  .scene-scroll { overflow-x: auto; scrollbar-width: none; }
  .scene-scroll::-webkit-scrollbar { display: none; }
  .overlays { position: static; order: -1; padding: 10px 12px; background: rgba(255,255,255,.7); align-items: center; }
  .scene-title { font-size: 17px; padding: 0; background: none; backdrop-filter: none; }
  .pill { padding: 6px 10px; font-size: 12px; }
  #weather { display: none; }
  .step { width: 36px; height: 36px; font-size: 24px; top: calc(50% + 24px); }
  .step.prev { left: 8px; } .step.next { right: 8px; }
  .spot { transform: translate(-50%, -50%); }
  .spot[data-dir="down"] { transform: translate(-50%, -50%); }
  .chip { padding: 4px; min-height: 0; border-radius: 12px; gap: 0; position: relative; }
  .chip .meta, .pin { display: none; }
  .chip .dome { width: 26px; height: 26px; padding: 6px; }
  .chip .count { display: block; font-size: 13px; font-weight: 700; padding: 0 5px 0 4px; font-variant-numeric: tabular-nums; }
  .chip .sdot { position: absolute; right: -2px; top: -2px; width: 10px; height: 10px; border: 2px solid #fff; }
  .go { padding: 7px 8px 7px 12px; font-size: 12.5px; }
  .go b { width: 20px; height: 20px; }
  .go .long { display: none; } .go .short { display: inline; }
  .rows { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .step { display: none; }
  .scene { margin: 0 -16px; border-radius: 0; }
  #rows-title, #rows { display: none; }
  .go { display: none; }
  .go-row { display: flex; gap: 8px; margin-top: 12px; }
  .go-row a { flex: 1 1 auto; justify-content: center; display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); }
  .go-row img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
  .go-row b { font-weight: 600; }
  .tap-hint { display: block; margin: 14px 2px 0; font-size: 13.5px; color: var(--muted); text-align: center; }
  .sheet { left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh; border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); opacity: 1; transition: transform .25s ease; }
  .sheet-open .backdrop { background: rgba(20,25,27,.35); }
  .grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: #DAD6CE; margin: 0 auto 10px; }
  .close { top: 14px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Innlogging */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, rgba(246,244,239,.55), rgba(246,244,239,.92)), url("img/huset.jpg") center / cover; }
.login-card { width: min(400px, 100%); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); border-radius: 28px; box-shadow: var(--shadow-lg); padding: 32px 26px 26px; text-align: center; }
.login-house { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 22px 22px 16px 16px; background: var(--accent-soft); color: var(--accent); padding: 15px; }
.login h1 { font-size: 26px; font-weight: 680; letter-spacing: -.035em; }
.login p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.login input { width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid rgba(31,42,46,.14); background: #fff; font: inherit; font-size: 16px; }
.login input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.login .btn { padding: 15px; font-size: 16px; }
.login-error { min-height: 20px; margin-top: 14px !important; color: var(--error) !important; font-size: 14px !important; font-weight: 550; }
.login-error:empty { min-height: 0; margin-top: 0 !important; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 22px; }
.name-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); font-size: 16px; font-weight: 600; transition: transform .15s; }
.name-btn:hover { transform: translateY(-2px); }
.name-btn span, .who span { display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.name-btn span { width: 48px; height: 48px; font-size: 20px; }
.link { margin-top: 16px; color: var(--muted); font-size: 14px; font-weight: 550; }
.header-right { display: flex; align-items: center; gap: 10px; }
.who { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255,255,255,.7); font-size: 13.5px; font-weight: 600; color: var(--muted); }
.who span { width: 30px; height: 30px; font-size: 14px; }
@media (max-width: 600px) {
  .header-right { justify-content: space-between; }
  .header-right .seg { flex: 1; }
}

/* Personvern */
body.privacy { background: var(--bg); }
.privacy-page { max-width: 680px; margin: 0 auto; padding: 48px 22px 64px; line-height: 1.55; font-size: 16px; }
.privacy-page h1 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 12px; }
.privacy-page h2 { font-size: 18px; margin: 28px 0 6px; }
.privacy-page .lead { font-size: 17.5px; color: var(--text); }
.privacy-page p, .privacy-page li { color: #3B474B; }
.privacy-page ul { padding-left: 20px; margin: 6px 0; }
.privacy-page li { margin: 4px 0; }
.privacy-page a { color: var(--accent); }
.privacy-page .back { margin-top: 36px; }
.login-privacy { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--muted); }

footer a { color: inherit; }

/* ===== Kameraer (Daras kamera-spec: dashboard-mockup/kamera-spec.md) ===== */
:root { --live: #E0564C; --wood: #C4A06A; --home: #3B7DD8; --cabin: #2F5D50; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cam-object { position: absolute; z-index: 8; width: 44px; height: 44px; transform: translate(-50%, -50%); padding: 0; }
.cam-object .cam-hit { position: absolute; inset: 0; border-radius: 50%; }
.cam-object .cam-ring { position: absolute; inset: -3px; border-radius: 50%; pointer-events: none; opacity: .95;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.9), 0 0 10px 2px rgba(255,255,255,.4); transition: box-shadow .2s; }
.cam-object .cam-glyph { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(31,42,46,.35)); transition: transform .18s ease-out; }
.cam-object:hover .cam-glyph, .cam-object:focus-visible .cam-glyph { transform: scale(1.06); }
.cam-object:hover .cam-ring, .cam-object:focus-visible .cam-ring { box-shadow: 0 0 0 2.4px #fff, 0 0 14px 4px rgba(255,255,255,.6); }
.cam-object:focus-visible { outline: none; }
.cam-object .live-dot, .cam-object .live-label { display: none; position: absolute; z-index: 2; pointer-events: none; }
.cam-object .live-dot { top: 2px; right: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 4px rgba(224,86,76,.28), 0 0 8px rgba(224,86,76,.7); animation: livepulse 1.6s ease-in-out infinite; }
.cam-object .live-label { top: -16px; left: 50%; transform: translateX(-50%); font-size: 8px; font-weight: 700; letter-spacing: .08em;
  color: #fff; background: var(--live); padding: 1px 5px; border-radius: 4px; line-height: 1.4; box-shadow: 0 1px 4px rgba(224,86,76,.35); }
.cam-object.is-live .live-dot, .cam-object.is-live .live-label { display: block; }
.cam-object.is-live .cam-ring { box-shadow: 0 0 0 2px rgba(224,86,76,.55), 0 0 16px 4px rgba(224,86,76,.28); }
.cam-object.is-off { filter: grayscale(.75); opacity: .72; }
.cam-object.is-off .cam-ring { box-shadow: 0 0 0 2px rgba(184,190,193,.75), 0 0 8px 2px rgba(184,190,193,.25); }
.cam-object.is-off .led { fill: var(--offline); }
.cam-object.is-live .led { fill: var(--live); }
@keyframes livepulse { 50% { box-shadow: 0 0 0 7px rgba(224,86,76,.12), 0 0 10px rgba(224,86,76,.5); } }

.cam-object.is-tree { width: 52px; height: 40px; }
.cam-object.is-tree .cam-glyph { inset: -4px -6px; width: auto; height: auto; }
.cam-object.is-doorbell { width: 18px; height: 32px; }
.cam-object.is-doorbell .cam-hit { inset: -13px; }
.cam-object.is-doorbell .cam-ring { inset: -5px -4px; border-radius: 16px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.92), 0 0 10px 2px rgba(255,255,255,.4); }
.cam-object.is-doorbell.is-ringing .cam-ring { animation: ringpulse 1.4s ease-in-out infinite; }
@keyframes ringpulse {
  0%, 100% { inset: -6px -5px; border-radius: 18px; box-shadow: 0 0 0 3px rgba(59,125,216,.55), 0 0 0 6px rgba(59,125,216,.18), 0 0 14px 4px rgba(59,125,216,.2); }
  50% { inset: -12px -10px; border-radius: 22px; box-shadow: 0 0 0 3px rgba(59,125,216,.55), 0 0 0 10px rgba(59,125,216,.22), 0 0 22px 6px rgba(59,125,216,.28); }
}
.cam-object.is-wall { width: 44px; height: 44px; }

.cam-label { position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column;
  background: #fff; border-radius: 14px; padding: 5px 10px 5px 8px; white-space: nowrap; line-height: 1.15; text-align: left; pointer-events: none;
  box-shadow: 0 2px 10px rgba(31,42,46,.12); }
.cam-label .nm { font-size: 10px; font-weight: 550; color: var(--muted); }
.cam-label .mt { font-size: 12.5px; font-weight: 650; letter-spacing: -0.02em; color: var(--text); }
.cam-label .pointer { position: absolute; left: -4px; top: 50%; width: 10px; height: 10px; background: #fff; transform: translateY(-50%) rotate(45deg); border-radius: 2px; }
.stage.cam-open .cam-label { display: none; }
.stage.cam-open .spot, .stage.cam-open .go { opacity: .32; transition: opacity .2s; }

.cam-connector { display: none; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 11; pointer-events: none; overflow: visible; }
.cam-connector path { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.stage.cam-open .cam-connector { display: block; }

.cam-window { position: absolute; z-index: 12; width: 45%; filter: drop-shadow(0 18px 40px rgba(31,42,46,.24)) drop-shadow(0 2px 8px rgba(31,42,46,.08));
  transition: transform .25s ease-out, opacity .25s ease-out; }
.cam-window.is-closed { transform: scale(.72); opacity: 0; }
.cam-window.is-closing { transition-timing-function: ease-in; }
.cam-frame { border-radius: 16px; overflow: hidden; background: #1C1A17; display: flex; flex-direction: column; color: #fff; }
.cam-window.is-cabin .cam-frame { border-radius: 14px; box-shadow: inset 0 0 0 5px var(--wood), inset 0 0 0 6px rgba(90,60,30,.35); }
.cam-window.is-home .cam-frame { background: #1F2A2E; border-radius: 16px; box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 5px rgba(31,42,46,.12); }
.sheet-handle { display: none; width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.28); margin: 10px auto 0; }
.cam-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; position: relative; z-index: 2;
  background: linear-gradient(180deg, rgba(20,18,16,.72), rgba(20,18,16,.28)); }
.cam-window.is-home .cam-head { background: linear-gradient(180deg, rgba(31,42,46,.7), rgba(31,42,46,.25)); margin: 4px 4px 0; border-radius: 12px 12px 0 0; }
.cam-window.is-cabin .cam-head { margin: 5px 5px 0; border-radius: 9px 9px 0 0; }
.cam-title { font-size: 14.5px; font-weight: 650; letter-spacing: -0.03em; margin-right: 2px; line-height: 1.2; }
.live-pill { display: none; align-items: center; gap: 5px; background: var(--live); color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  padding: 3px 7px 3px 6px; border-radius: 999px; line-height: 1; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.28); }
.cam-timer { display: none; margin-left: 2px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: rgba(255,255,255,.92); }
.cam-window.st-live .live-pill { display: inline-flex; }
.cam-window.st-live .cam-timer { display: inline; }
.cam-window.st-slutt .cam-timer { display: inline; color: rgba(255,255,255,.7); }
.cam-head .spacer { flex: 1; }
.cam-x { position: relative; width: 32px; height: 32px; min-width: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: rgba(255,255,255,.12); }
.cam-x::after { content: ""; position: absolute; inset: -6px; }
.cam-x svg { width: 16px; height: 16px; }
.cam-x:hover { background: rgba(255,255,255,.2); }

.cam-stage { position: relative; aspect-ratio: 16 / 9; background: #141210; overflow: hidden; }
.cam-window.is-cabin .cam-stage { margin: 0 5px; }
.cam-window.is-home .cam-stage { margin: 0 4px; }
.cam-stage video, .cam-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #141210; }
.cam-stage:fullscreen video { object-fit: contain; }
.cam-window:not(.st-live) .cam-stage video { visibility: hidden; }
.cam-stage canvas { display: none; filter: brightness(.42) saturate(.8); }
.cam-window.st-slutt .cam-stage canvas { display: block; }
.cam-stage::before { content: ""; position: absolute; inset: -12px; background: var(--cam-bg) center / cover; filter: blur(6px) saturate(.9); opacity: 0; }
.cam-window.st-kobler .cam-stage::before, .cam-window.st-feil .cam-stage::before { opacity: 1; }
.cam-window.st-feil .cam-stage::before { filter: blur(6px) grayscale(.45); }
.cam-state { display: none; position: absolute; inset: 0; z-index: 1; }
.cam-window.st-kobler .state-kobler, .cam-window.st-laster .state-laster, .cam-window.st-live .state-live,
.cam-window.st-slutt .state-slutt, .cam-window.st-feil .state-feil { display: flex; }
.state-kobler, .state-feil { align-items: center; justify-content: center; flex-direction: column; gap: 16px; background: linear-gradient(180deg, rgba(20,18,16,.55), rgba(20,18,16,.72)); }
.state-feil { gap: 14px; background: linear-gradient(180deg, rgba(20,18,16,.72), rgba(20,18,16,.82)); }
.spin-wrap { width: 86px; height: 86px; position: relative; display: grid; place-items: center; }
.spin-wrap .cam-mini { width: 32px; height: 32px; color: #fff; opacity: .95; }
.dot-ring { position: absolute; inset: 0; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kobler-msg, .laster-msg, .feil-msg { color: #fff; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; text-shadow: 0 1px 8px rgba(0,0,0,.4); text-align: center; padding: 0 16px; }
.state-laster { align-items: center; justify-content: center; flex-direction: column; background: #1E1C19; }
.skel { position: absolute; inset: 0; background: #25221E; }
.skel::before, .skel::after { content: ""; position: absolute; inset: 18% 12%; border-radius: 12px; }
.skel::before { background: #34302A; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.skel::after { background: linear-gradient(105deg, transparent 28%, rgba(255,255,255,.16) 48%, transparent 68%); background-size: 250% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.laster-msg { position: relative; z-index: 1; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
.state-live, .state-slutt { pointer-events: none; }
.state-slutt .pause-card { pointer-events: auto; }
.timebar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.18); z-index: 2; }
.timebar b { display: block; height: 100%; width: 100%; background: var(--live); border-radius: 0 2px 2px 0; transition: width 1s linear; }
.state-slutt .timebar b { width: 0; }
.pause-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; z-index: 3; text-align: center; padding: 16px; }
.play-btn { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--cabin); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.28); margin-bottom: 10px; }
.cam-window.is-home .play-btn { color: var(--home); }
.play-btn svg { width: 26px; height: 26px; margin-left: 3px; }
.pause-card h4 { color: #fff; font-size: 18px; font-weight: 650; letter-spacing: -0.03em; }
.pause-card .cta { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; opacity: .95; }
.pause-card .fine { margin-top: 6px; color: rgba(255,255,255,.72); font-size: 11.5px; font-weight: 500; max-width: 260px; line-height: 1.35; }
.feil-msg { position: relative; z-index: 1; }
.btn-retry { position: relative; z-index: 1; background: #fff; color: var(--text); font-size: 14.5px; font-weight: 650; letter-spacing: -0.02em;
  padding: 10px 18px; min-height: 44px; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }

.cam-foot { display: flex; align-items: center; justify-content: space-around; gap: 4px; padding: 6px 8px 8px; background: rgba(20,18,16,.92); }
.cam-window.is-cabin .cam-foot { margin: 0 5px 5px; border-radius: 0 0 9px 9px; }
.cam-window.is-home .cam-foot { margin: 0 4px 4px; border-radius: 0 0 12px 12px; }
.cam-foot button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; color: rgba(255,255,255,.88);
  font-size: 12px; font-weight: 600; letter-spacing: -0.01em; border-radius: 10px; padding: 6px 4px; }
.cam-foot button svg { width: 16px; height: 16px; flex-shrink: 0; }
.cam-foot button:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.cam-foot button:disabled { opacity: .4; }

.clip-list { background: #fff; color: var(--text); padding: 10px 12px 12px; margin: 0 4px; }
.clip-list h4 { font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.clip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: 10px; min-height: 44px; }
.clip + .clip { margin-top: 2px; }
.clip.is-on { background: rgba(59,125,216,.08); }
.clip .tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(59,125,216,.10); color: var(--home); flex-shrink: 0; }
.clip .tile svg { width: 18px; height: 18px; }
.clip .when { display: block; font-size: 13.5px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.clip .day { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.clip .tag { margin-left: auto; font-size: 10px; font-weight: 650; color: var(--home); }

.cam-toast { position: absolute; z-index: 14; right: 20px; top: 78px; width: 320px; display: flex; align-items: flex-start; gap: 10px; background: #fff; color: var(--text);
  border-radius: 18px; padding: 10px 12px 12px; box-shadow: 0 14px 40px rgba(31,42,46,.18), 0 2px 8px rgba(31,42,46,.06); animation: fade .25s ease-out; }
.toast-tile { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: rgba(59,125,216,.10); color: var(--home); flex-shrink: 0; }
.toast-tile svg { width: 26px; height: 26px; }
.toast-body { flex: 1; min-width: 0; padding-top: 2px; }
.toast-title { font-size: 14.5px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.25; margin-bottom: 8px; }
.toast-actions { display: flex; gap: 6px; }
.toast-actions button { flex: 1; min-height: 34px; border-radius: 10px; font-size: 12.5px; font-weight: 650; letter-spacing: -0.02em; padding: 6px 8px; }
.btn-solid { background: var(--home); color: #fff; box-shadow: 0 3px 10px rgba(59,125,216,.28); }
.btn-ghost { background: rgba(59,125,216,.10); color: var(--home); }
.cam-backdrop { display: none; }

@media (max-width: 600px) {
  .cam-label { display: none; }
  .cam-window { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; top: auto !important; left: 0 !important; width: auto; max-height: 92vh; overflow-y: auto; filter: none; }
  .cam-window.is-closed { transform: translateY(40%); opacity: 0; }
  .cam-frame, .cam-window.is-cabin .cam-frame, .cam-window.is-home .cam-frame { background: #1C1A17; border-radius: 22px 22px 0 0; box-shadow: 0 -8px 28px rgba(31,42,46,.18); padding-bottom: env(safe-area-inset-bottom); }
  .sheet-handle { display: block; }
  .cam-head, .cam-window.is-cabin .cam-head, .cam-window.is-home .cam-head { margin: 0; padding: 8px 14px; background: transparent; }
  .cam-title { font-size: 15px; }
  .cam-x { width: 44px; height: 44px; min-width: 44px; border-radius: 12px; }
  .cam-x::after { inset: 0; }
  .cam-stage, .cam-window.is-cabin .cam-stage, .cam-window.is-home .cam-stage { margin: 0; aspect-ratio: 16 / 10; }
  .cam-foot, .cam-window.is-cabin .cam-foot, .cam-window.is-home .cam-foot { margin: 0; background: transparent; padding: 8px 8px 16px; }
  .clip-list { margin: 0; }
  .cam-connector { display: none !important; }
  .cam-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15,20,22,.28); }
  .cam-backdrop[hidden] { display: none; }
  .cam-toast { position: fixed; z-index: 58; left: 12px; right: 12px; top: 12px; width: auto; }
  .stage.cam-open .spot, .stage.cam-open .go { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cam-window, .cam-object .cam-glyph { transition: none; }
  .dot-ring, .skel::after, .cam-object .live-dot, .cam-object.is-doorbell.is-ringing .cam-ring { animation: none; }
}
