:root {
  --navy: #00173D;
  --navy-2: #0A2550;
  --navy-3: #13305F;
  --line: #2A4775;
  --text: #FFFFFF;
  --muted: #B9C6DB;
  --teal: #0084A3;
  --ice: #84CEDA;
  --blue: #367BF6;
  --bezel: #0B1B36;
  --font: Aptos, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Verktøylinje ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--navy);
  position: relative;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { height: 20px; width: auto; display: block; }
.divider { width: 1px; height: 22px; background: var(--line); }
.product { font-weight: 700; font-size: 17px; letter-spacing: 0.2px; white-space: nowrap; }

.urlbar {
  flex: 1 1 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 4px 0 14px;
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.urlbar:focus-within { border-color: var(--ice); }
.urlicon { color: var(--muted); }
.urlbar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.urlbar input::placeholder { color: #8FA2C1; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.devices { display: flex; gap: 8px; }
.devsel { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.chip {
  display: flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 12px 0 14px;
  background: transparent; color: var(--muted);
  border: 0; font: inherit; font-size: 14px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--teal); color: #fff; }
.chip:focus-visible, .btn:focus-visible, .model:focus-visible, .switch input:focus-visible + .track { outline: 2px solid var(--ice); outline-offset: 2px; }
.model {
  appearance: none; -webkit-appearance: none;
  background: var(--navy-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B9C6DB' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  color: var(--text); border: 0; border-left: 1px solid var(--line);
  font: inherit; font-size: 13px; padding: 0 28px 0 10px; cursor: pointer; max-width: 150px;
}
.model option { background: var(--navy); }

.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { width: 42px; height: 24px; border-radius: 12px; background: var(--navy-3); border: 1px solid var(--line); position: relative; transition: background .15s; }
.thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .track { background: var(--teal); border-color: var(--teal); }
.switch input:checked + .track .thumb { transform: translateX(18px); background: #fff; }

.actions { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 20px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  white-space: nowrap;
}
.btn:hover { background: var(--navy-3); }
.btn.primary { background: var(--blue); border-color: var(--blue); height: 36px; padding: 0 20px; }
.btn.primary:hover { background: #2863D8; }
.btn.icon { width: 40px; padding: 0; }

/* ---------- Scene ---------- */
.stage { flex: 1; position: relative; overflow: hidden; }
.empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 6px;
}
.empty-art { width: 120px; height: 90px; color: var(--ice); stroke-width: 1.4; margin-bottom: 18px; }
.empty h1 { margin: 0; font-size: 28px; font-weight: 700; }
.empty p { margin: 6px 0 0; color: var(--muted); max-width: 520px; line-height: 1.5; font-size: 16px; }

.devicerow {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 28px 32px 22px;
}
.slot { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.slot-box { position: relative; }
.device { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.caption { margin-top: 12px; font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.caption b { color: var(--text); font-weight: 600; }

.device iframe { display: block; border: 0; background: #fff; }
.screen { position: relative; overflow: hidden; background: #fff; }

.device.desktop { border-radius: 12px; overflow: hidden; background: var(--bezel); border: 1px solid var(--line); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.browserbar { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 16px; background: #102447; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #2F4B78; }
.addr { margin-left: 14px; flex: 1; height: 26px; border-radius: 13px; background: var(--navy); color: var(--muted); font-size: 13px; display: flex; align-items: center; padding: 0 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.device.tablet { padding: 20px; border-radius: 40px; background: var(--bezel); border: 1px solid var(--line); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.device.tablet .screen { border-radius: 20px; }
.device.mobile { padding: 14px; border-radius: 54px; background: var(--bezel); border: 1px solid var(--line); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.device.mobile .screen { border-radius: 42px; }

.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,23,61,.55); pointer-events: none; opacity: 0; transition: opacity .2s; }
.loading.on { opacity: 1; }
.spinner { width: 56px; height: 56px; border-radius: 50%; border: 5px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Presentasjonsmodus ---------- */
body.present .toolbar { display: none; }
body.present .devicerow { padding: 40px 48px 28px; }
.exit-present {
  position: fixed; top: 14px; right: 14px; z-index: 20;
  display: none; opacity: 0; transition: opacity .2s;
  height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--navy-3); color: #fff; border: 1px solid var(--line); font: inherit; font-size: 13px; cursor: pointer;
}
body.present .exit-present { display: block; }
body.present .exit-present:hover, body.present .exit-present:focus-visible { opacity: 1; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #fff; color: var(--navy); padding: 10px 18px; border-radius: 20px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Innlogging ---------- */
.login { position: fixed; inset: 0; z-index: 40; background: var(--navy); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login[hidden] { display: none; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; background: var(--navy-2); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px; }
.login-card .logo { height: 22px; align-self: flex-start; margin-bottom: 8px; }
.login-card h2 { margin: 0; font-size: 22px; }
.login-card p { margin: 0; color: var(--muted); }
.login-card input { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--navy); color: #fff; font: inherit; padding: 0 14px; }
.login-card .btn.primary { height: 44px; }
.login-error { color: #FFB4A8 !important; min-height: 1.2em; font-size: 14px; }

@media (max-width: 900px) {
  .product { display: none; }
  .btn.ghost span { display: none; }
  .btn.ghost { width: 40px; padding: 0; }
  .model { display: none; }
}

[hidden] { display: none !important; }
