:root {
  --bg: #0f1115; --card: #181b22; --line: #262a33; --text: #eef0f4; --muted: #8a909c;
  --blue: #2f6fec; --green: #1fa463; --amber: #e0a526; --red: #e0483e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 24px); max-width: 520px; margin: 0 auto; }
a { color: var(--text); }
h1 { font-size: 24px; margin: 8px 0 4px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 14px 0; }
.narrow { margin-top: 12vh; text-align: center; }
.narrow form { text-align: left; }
.logo svg { width: 64px; height: 64px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0; }
input[type=text], input:not([type]), input[type=password] {
  display: block; width: 100%; margin-top: 6px; padding: 13px 14px; font-size: 17px; color: var(--text);
  background: #0f1115; border: 1px solid var(--line); border-radius: 12px; }
input:focus { outline: 2px solid var(--blue); border-color: transparent; }
label.check { display: flex; gap: 10px; align-items: center; color: var(--text); }
.btn { appearance: none; border: 0; border-radius: 14px; padding: 14px 18px; font-size: 17px; font-weight: 600;
  color: #fff; background: #2a2f3a; cursor: pointer; width: 100%; }
.btn.primary { background: var(--blue); margin-top: 8px; }
.btn.small { width: auto; padding: 7px 12px; font-size: 14px; }
.btn.danger { background: #3a1f1f; color: #ff9b94; }
.btn:disabled { opacity: .5; }
.btn:active:not(:disabled) { transform: scale(.98); }
.err, .ok { padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.err { background: #3a1f1f; color: #ffb3ad; } .ok { background: #173a29; color: #9fe3bd; }

header.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 2px 4px; }
header.top strong { display: block; font-size: 18px; }
header.top span { font-size: 13px; }
header.top nav { display: flex; gap: 16px; font-size: 15px; }
header.top a { text-decoration: none; color: var(--muted); }

/* Status med lille port-illustration */
.status { display: flex; gap: 18px; align-items: center; }
.door { width: 86px; height: 76px; flex: none; border: 4px solid #3a404c; border-bottom: 0; border-radius: 6px 6px 0 0;
  position: relative; overflow: hidden; background: #0b0d10; }
.panels { position: absolute; left: 0; right: 0; top: 0; height: 100%; display: flex; flex-direction: column; gap: 2px; padding: 2px;
  transition: transform .8s ease; }
.panels i { flex: 1; background: #4a5160; border-radius: 2px; }
.status-text .label { font-size: 26px; font-weight: 700; }
[data-state=lukket] .panels i { background: var(--green); }
[data-state=aaben] .panels { transform: translateY(-88%); } [data-state=aaben] .panels i { background: var(--amber); }
[data-state=mellem] .panels { transform: translateY(-45%); } [data-state=mellem] .panels i { background: var(--amber); }
[data-state=offline] .panels i, [data-state=fejl] .panels i { background: var(--red); }
[data-state=lukket] .label { color: #6fdca2; } [data-state=aaben] .label, [data-state=mellem] .label { color: #f2c75c; }
[data-state=offline] .label, [data-state=fejl] .label { color: #ff8a80; }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.btn.big { padding: 26px 10px; font-size: 21px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.btn.big svg { width: 34px; height: 34px; fill: currentColor; }
.btn.open { background: var(--blue); } .btn.close { background: #2a2f3a; border: 1px solid #3a404c; }
.msg { min-height: 22px; text-align: center; margin: 12px 0 0; color: var(--muted); }
.msg.good { color: #6fdca2; } .msg.bad { color: #ff8a80; }

.log, .users { list-style: none; margin: 0; padding: 0; }
.log li, .users li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.log li:first-child, .users li:first-child { border-top: 0; }
.log .t { color: var(--muted); font-variant-numeric: tabular-nums; display: inline-block; min-width: 46px; }
.log li.failed span:last-child { color: #ff8a80; }
.users li { display: flex; justify-content: space-between; align-items: center; }
.tag { font-style: normal; font-size: 12px; background: #23304d; color: #9dbbff; padding: 2px 7px; border-radius: 6px; margin-left: 6px; }
.row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.row > * { min-width: 0; }
.row label { margin: 8px 0; }
.share input { margin: 0 0 10px; font-size: 14px; }
.share .row .btn { margin: 0; }
input[type=datetime-local] { display: block; width: 100%; min-width: 0; max-width: 100%; margin-top: 6px; padding: 12px 10px; font-size: 15px; color: var(--text);
  background: #0f1115; border: 1px solid var(--line); border-radius: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.chip { background: #23283a; color: #c6d3ff; border: 1px solid #2e3650; border-radius: 99px; padding: 7px 12px; font-size: 14px; }
.guests { list-style: none; margin: 0; padding: 0; }
.guests li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.guests li:first-child { border-top: 0; }
.guests .acts { display: flex; gap: 8px; flex: none; }
.g-udløbet, .g-tilbagekaldt { opacity: .5; }
.g-aktiv .st { background: #173a29; color: #9fe3bd; }
.g-kommende .st { background: #3a321a; color: #f2c75c; }
.guestinfo p { margin: 0 0 6px; }
.cam { padding: 12px; }
.cam-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 10px; }
.cam-frame { position: relative; aspect-ratio: 16 / 9; background: #0b0d10; border-radius: 12px; overflow: hidden; }
.cam-frame img { width: 100%; height: 100%; object-fit: cover; display: none; }
.cam.has-img .cam-frame img { display: block; }
.cam.has-img .cam-empty { display: none; }
.cam-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; }
.cam.stale img { filter: grayscale(1) brightness(.6); }
.cam .cam-age { font-variant-numeric: tabular-nums; }
.controls:has(> .btn:only-child) { grid-template-columns: 1fr; }
