:root {
  color-scheme: light;
  --ink: #10233f;
  --muted: #5d6b7c;
  --paper: #f4f6f8;
  --line: rgba(16, 35, 63, .1);
  --white: #fff;
  --acid: #0c6fe0;
  --nav: 248px;
  --shadow: 0 1px 2px rgba(16, 35, 63, .04), 0 0 0 1px rgba(16, 35, 63, .06);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--acid); outline-offset: 2px; }
[hidden] { display: none !important; }

.admin-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
}
.admin-gate p { margin: 0; color: var(--muted); font-size: .95rem; }
.brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
/* S-17 R1d: løpende tekstlenker får 44 px trykkflate. */
.tap-link { display: inline-flex; align-items: center; min-height: 44px; }
.brand-lockup { height: 28px; width: auto; display: block; }

.admin-app { min-height: 100vh; display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); }
.admin-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 16px;
  background: var(--paper);
}
.admin-nav .brand { padding: 0 8px 2px; }
.nav-kicker {
  margin: -6px 12px 0;
  color: #4d5d70;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: 0;
}
.admin-menu { display: grid; gap: 2px; }
/* DS-033: fast hjelpelenke i sidemenyen – samme form som seksjonsknappene. */
.admin-menu .nav-help {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  color: #3d4c60;
  background: transparent;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.admin-menu .nav-help:hover { color: var(--ink); background: rgba(16, 35, 63, .045); }
.admin-menu .nav-help .nav-icon { color: inherit; }
/* DS-033: førstegangs-sjekkliste. Kortet forsvinner når alle steg er fullført. */
.onboard-card { margin: 0 22px 18px; }
.onboard-card[hidden] { display: none; }
.onboard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.onboard-head .eyebrow { margin: 0 0 2px; color: #4d5d70; font-size: .75rem; font-weight: 600; }
.onboard-head h2 { margin: 0; }
.onboard-head .card-lead { margin: 4px 0 0; color: #3d4c60; }
.onboard-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.onboard-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #f4f7fb; }
.onboard-steps li.is-done { background: #eef6ef; }
.onboard-mark { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #3d4c60; background: #fff; box-shadow: var(--shadow); font-size: .8125rem; font-weight: 700; }
.onboard-steps li.is-done .onboard-mark { color: #fff; background: #1d6b32; }
.onboard-copy { flex: 1; min-width: 0; }
.onboard-copy strong { display: block; font-size: .9rem; }
.onboard-copy span { display: block; color: #3d4c60; font-size: .82rem; }
.admin-menu button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  color: #3d4c60;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: .92rem;
  font-weight: 500;
}
.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-icon .tone { fill: currentColor; stroke: none; opacity: .22; }
.nav-icon .mark { fill: currentColor; stroke: none; }
.admin-menu button:hover { color: var(--ink); background: rgba(16, 35, 63, .045); }
.admin-menu button[aria-current="page"] {
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
}
.admin-menu button[aria-current="page"] .nav-icon { color: var(--acid); }
.nav-user {
  margin-top: auto;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 1px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow);
}
.nav-avatar {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: #e7eef8;
  font-size: .72rem;
  font-weight: 600;
}
.nav-user strong { font-size: .84rem; font-weight: 600; letter-spacing: -.01em; }
.nav-user span, .sign-out { color: var(--muted); font-size: .75rem; }
.nav-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sign-out {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}
.sign-out:hover { color: var(--ink); }

.admin-main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.admin-top {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 32px 6px;
  background: transparent;
}
.admin-heading { display: grid; gap: 4px; min-width: 0; }
.admin-top h1 { margin: 0; font-size: 1.65rem; font-weight: 600; letter-spacing: -.038em; }
.section-lead { max-width: 68ch; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.panel-lead { display: none; }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.admin-panel { flex: 1; min-height: 0; }
.admin-panel-frame iframe { width: 100%; height: 100%; min-height: calc(100vh - 132px); border: 0; background: var(--paper); }
body.is-editing-view:has(#panel-widgets:not([hidden])) .admin-top,
body.is-editing-view:has(#panel-workspaces:not([hidden])) .admin-top { display: none; }
body.is-editing-view:has(#panel-widgets:not([hidden])) #panel-widgets iframe,
body.is-editing-view:has(#panel-workspaces:not([hidden])) #panel-workspaces iframe { min-height: 100vh; }
.admin-panel-page { overflow: auto; padding: 12px 32px 64px; }
.panel-lead { max-width: 62ch; margin: 0 0 22px; color: var(--muted); font-size: .98rem; line-height: 1.55; }
.notice, .form-error {
  max-width: 720px;
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  /* S-17: det beige banneret er fjernet – nøytralt varsel i felles komponentsystem. */
  background: #eef2f6;
  color: #3e5164;
  font-size: .88rem;
  line-height: 1.45;
}
.notice p { margin: 0; }
.form-error { background: #fff1ef; color: #8d2b22; }
.stack { display: grid; gap: 14px; max-width: 760px; }
.card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 0;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.card h2, .stack > h2 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge {
  padding: 4px 8px;
  border-radius: 99px;
  background: #eef2f6;
  color: #3e5164;
  font-size: .72rem;
  font-weight: 600;
}
.badge.is-active { color: #1d6b32; background: #e5f6ea; }
/* S-09: fast prøvemerke i sidemenyen, gult de siste 3 dagene. */
.trial-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 12px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #e8f0fe;
  color: #174a94;
  font-size: .8125rem;
  font-weight: 600;
}
.trial-badge.is-ending { background: #fef3c7; color: #92400e; }
.trial-badge-order {
  border: 0;
  border-radius: 8px;
  background: #125fe1;
  color: #fff;
  font: inherit;
  font-size: .8125rem;
  padding: 6px 10px;
  cursor: pointer;
}
.trial-notice {
  border-left: 4px solid #125fe1;
  background: #f2f7ff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
}
.trial-notice p { margin: 0 0 10px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: #f4f6f8;
  box-shadow: inset 0 0 0 1px rgba(16, 35, 63, .08);
  font-size: .86rem;
  font-weight: 500;
}
.choice-row label:has(input:checked) { background: #fff; box-shadow: 0 0 0 1px var(--acid), 0 1px 2px rgba(16, 35, 63, .04); }
.choice-row label > span { display: grid; gap: 2px; }
.field { display: grid; gap: 6px; }
fieldset.field { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.card legend { padding: 0; }
.field span, .card legend { font-size: .8125rem; font-weight: 600; }
.field small, .choice-row small { color: var(--muted); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="color"], select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: #f7f8fa;
  box-shadow: inset 0 0 0 1px rgba(16, 35, 63, .1);
}
select[multiple] { height: auto; min-height: 96px; padding: 8px; }
input[type="color"] { padding: 4px; }
input[type="range"] { width: min(420px, 100%); accent-color: var(--acid); }
.button {
  justify-self: start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: -.01em;
  text-decoration: none;
}
.button-acid { color: #fff; background: var(--acid); }
.button-acid:hover { background: #095fc2; }
.button:disabled { color: #5c6b7c; background: #e7edf3; cursor: not-allowed; }
.button-quiet { color: var(--ink); background: #fff; box-shadow: var(--shadow); }
.button-danger { color: #8d2b22; background: #fff; box-shadow: 0 0 0 1px #f0c2bc; }
.terms-row { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.terms-row input[type="checkbox"], .check-row input[type="checkbox"], .check-row input[type="radio"], .choice-row input[type="radio"] { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--acid); }
.price-line { margin: 0; font-size: 1.45rem; font-weight: 600; letter-spacing: -.03em; }
.price-line small { color: var(--muted); font-size: .8125rem; font-weight: 600; }
.meter { height: 8px; border-radius: 99px; background: rgba(16, 35, 63, .1); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--acid); transition: width .25s ease; }
.license-facts { display: grid; gap: 4px; }
.license-facts .empty { margin: 0; }
.license-slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.license-slider-head span { font-size: .8125rem; font-weight: 650; }
.license-slider-head strong { font-size: 1.1rem; font-weight: 650; letter-spacing: -.02em; }
.license-stepper { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.license-stepper input[type="range"] { width: 100%; min-width: 0; }
.license-stepper .button { flex: none; }
.device-list, .media-list { display: grid; gap: 10px; }
.device-card, .media-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.device-card header, .media-card { grid-template-columns: auto 1fr auto; align-items: center; }
.media-card { display: grid; grid-template-columns: 72px 1fr auto; }
.media-card img, .media-fallback {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  background: #e7eef5;
}
.media-fallback { display: grid; place-items: center; color: var(--muted); font-size: .68rem; font-weight: 800; }
.device-card h3, .media-card strong { margin: 0; font-size: .95rem; }
.device-card p, .media-card small { margin: 2px 0 0; color: var(--muted); font-size: .8125rem; }
.device-actions, .inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.device-actions button, .inline-actions button {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #314255;
  background: #f3f5f8;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
}
.device-actions button:hover, .inline-actions button:hover { background: #e7edf4; }
.user-card { display: flex; align-items: center; gap: 14px; max-width: 560px; }
.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: #e7eef8;
  font-size: .9rem;
  font-weight: 600;
}
.user-card h2 { margin: 0; font-size: 1.35rem; font-weight: 600; letter-spacing: -.03em; }
.user-card p { margin: 4px 0 0; color: var(--muted); }
.empty { margin: 0; color: var(--muted); }
.locale-toggle { min-width: 38px; height: 32px; padding: 0 9px; border: 1px solid #d5e0ea; border-radius: 999px; color: #10233f; background: #fff; font: 800 11px/1 ui-sans-serif, sans-serif; letter-spacing: .08em; cursor: pointer; }
body > .locale-toggle { position: fixed; right: 14px; bottom: 14px; z-index: 30; }
.billing-stack { display: grid; gap: 18px; max-width: 760px; margin: 18px 0; }
.billing-stack p { margin: 0; line-height: 1.55; }
.billing-trial { background: #eaf4ff; box-shadow: inset 0 0 0 1px #bfdaef; }
.billing-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.billing-change { display: grid; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.billing-change input, #licenseCount { max-width: 180px; }
#licenseForm, #panel-licenses > .card { max-width: 760px; }

@media (max-width: 860px) {
  .admin-app { display: block; }
  .nav-toggle { display: inline-flex; }
  .admin-nav {
    position: fixed;
    z-index: 20;
    inset: 8px auto 8px 8px;
    height: auto;
    width: min(84vw, 300px);
    border-radius: 22px;
    transform: translateX(calc(-100% - 16px));
    transition: transform .2s ease;
    box-shadow: 0 18px 50px rgba(16, 35, 63, .16), 0 0 0 1px rgba(16, 35, 63, .05);
  }
  .admin-nav.is-open { transform: none; }
  .nav-scrim {
    position: fixed;
    z-index: 15;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(16, 35, 63, .38);
    cursor: pointer;
  }
  .admin-panel-page { padding: 20px 16px 40px; }
  .media-card { grid-template-columns: 56px 1fr; }
  .media-card .inline-actions { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-nav { transition: none; }
}

.card,
.notice,
.form-error,
.button,
.badge,
.choice-row label,
.nav-user,
.nav-toggle,
.admin-menu button,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="color"],
select {
  border-radius: 2px;
}
.nav-avatar,
.avatar { border-radius: 2px; }
.admin-menu button[aria-current="page"] { box-shadow: none; outline: 1px solid rgba(16, 35, 63, .12); }
.nav-user { border: 1px solid rgba(16, 35, 63, .1); background: #fff; box-shadow: none; }
.card { border: 1px solid rgba(16, 35, 63, .12); box-shadow: none; }
.device-list,
.media-list {
  gap: 0;
  border: 1px solid rgba(16, 35, 63, .12);
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
}
.device-card,
.media-card {
  gap: 4px 16px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(16, 35, 63, .08);
  border-radius: 0;
  box-shadow: none;
}
.device-list .device-card:last-child,
.media-list .media-card:last-child { border-bottom: 0; }
.device-card { grid-template-columns: minmax(0, 1fr); }
.device-card h3 { font-size: .92rem; font-weight: 650; }
.device-actions { justify-content: flex-start; }
.device-actions select { width: auto; min-width: 160px; height: 44px; }
.media-card { grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; min-height: 52px; }
.media-card > div { display: grid; gap: 1px; min-width: 0; }
.media-card img,
.media-fallback { width: 44px; height: 32px; border-radius: 2px; }
.device-actions button,
.inline-actions button { border-radius: 2px; background: transparent; }
.device-actions button:hover,
.inline-actions button:hover { background: #eef2f6; }
.user-card { max-width: 640px; border-radius: 2px; }
@media (max-width: 860px) {
  .admin-nav { border-radius: 2px; }
  .device-card { grid-template-columns: minmax(0, 1fr); }
  .device-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .media-card { grid-template-columns: 44px minmax(0, 1fr); }
  .media-card .button { grid-column: 2; justify-self: start; }
}

.fleet-library .library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.fleet-library .library-toolbar strong { font-size: .8125rem; font-weight: 650; }
.fleet-library .library-toolbar .button { min-height: 44px; padding: 0 14px; }
.fleet-library .list-frame {
  border: 1px solid rgba(16, 35, 63, .12);
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
  container-type: inline-size;
}
.fleet-list-head,
.fleet-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(8rem, .9fr) minmax(7.5rem, .75fr);
  column-gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
}
.fleet-list-head.screen-list-head,
.fleet-row.screen-row {
  grid-template-columns: minmax(0, 1.3fr) minmax(6.5rem, .7fr) minmax(8rem, .9fr) minmax(7.5rem, .75fr);
}
.group-screens {
  display: grid;
  gap: 8px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 500;
}
.fleet-library .list-frame + .library-toolbar { margin-top: 22px; }
.fleet-list-head {
  min-height: 34px;
  color: #4d5d70;
  background: #f7f9fb;
  border-bottom: 1px solid rgba(16, 35, 63, .1);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fleet-rows { display: flex; flex-direction: column; }
.fleet-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(16, 35, 63, .08);
  border-radius: 0;
  color: inherit;
  background: #fff;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}
.fleet-rows .fleet-row:last-child { border-bottom: 0; }
.fleet-row:hover { background: #f6f8fb; }
.fleet-row.is-active { background: #eef4fb; box-shadow: inset 2px 0 0 var(--acid); }
.fleet-row strong {
  overflow: hidden;
  font-size: .92rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-row span {
  overflow: hidden;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-library .empty-library { margin: 0; padding: 18px 16px; color: var(--muted); font-size: .92rem; }
.fleet-library .list-frame.is-empty .fleet-list-head { display: none; }
.fleet-drawer {
  display: flex;
  flex-direction: column;
  background: #fff;
}
.fleet-drawer .drawer-bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(16, 35, 63, .1);
  background: #fff;
}
.fleet-drawer .drawer-bar h2 {
  margin: 0;
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-drawer-body { flex: 1 1 auto; overflow: auto; padding: 8px 22px 40px; }
.fleet-form .editor-group {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px 0 2px;
  border-top: 1px solid rgba(16, 35, 63, .1);
}
.fleet-form .editor-group:first-child { border-top: 0; }
.fleet-form .editor-group-title {
  margin: 0;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.fleet-meta { margin: 0; color: var(--muted); font-size: .88rem; }
.fleet-form .pairing-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink); font-size: .88rem; line-height: 1.5; }
/* S-08 R1C: QR + kopier avspilleradressen i Ny skjerm. */
.pair-qr { display: flex; gap: 14px; align-items: center; margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pair-qr[hidden] { display: none; }
.pair-qr canvas { width: 132px; height: 132px; flex: none; border-radius: 6px; }
.pair-qr figcaption { display: grid; gap: 8px; font-size: .84rem; color: var(--muted); }
.pair-qr code { font-size: .8125rem; color: var(--ink); overflow-wrap: anywhere; }
.pair-qr .button { justify-self: start; min-height: 44px; }
.fleet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.command-row { display: flex; flex-wrap: wrap; gap: 8px; }
.command-row button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(16, 35, 63, .14);
  border-radius: 2px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
}
.command-row button:hover { background: #f6f8fb; }
.command-row button:disabled { color: #5c6b7c; cursor: not-allowed; }
body.is-fleet-drawer #fleetDrawer {
  position: fixed;
  z-index: 12;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50vw;
  height: 100dvh;
  overflow: hidden;
  border-left: 1px solid rgba(16, 35, 63, .14);
  box-shadow: -18px 0 48px rgba(16, 35, 63, .16);
}
@media (min-width: 861px) {
  body.is-fleet-drawer .admin-top,
  body.is-fleet-drawer #panel-fleet {
    width: calc(50vw - var(--nav));
    max-width: none;
    box-sizing: border-box;
  }
}
@media (max-width: 860px) {
  body.is-fleet-drawer #fleetDrawer { width: 100%; }
}
@container (max-width: 560px) {
  .fleet-list-head,
  .fleet-row { grid-template-columns: minmax(0, 1fr) minmax(6.5rem, .75fr); }
  .group-list-head span:nth-child(2),
  .fleet-row:not(.screen-row) span:nth-of-type(1),
  .screen-list-head span:nth-child(2),
  .screen-list-head span:nth-child(3),
  .screen-row span:nth-of-type(1),
  .screen-row span:nth-of-type(2) { display: none; }
}

/* Users page: account, contributors, brand, news. */
.users-page .users-grid {
  display: grid;
  gap: 16px;
  max-width: 780px;
}
.users-page .users-collab {
  display: grid;
  gap: 16px;
}
.users-page .users-card {
  gap: 18px;
  padding: 22px;
  border-radius: 16px;
}
.users-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.users-card-head h2 {
  margin: 2px 0 0;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -.02em;
}
.users-card-head .eyebrow {
  margin: 0;
  color: var(--acid);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.users-card-head .card-lead {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}
.users-page .badge {
  flex: 0 0 auto;
  border-radius: 99px;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #f7f9fb;
  box-shadow: inset 0 0 0 1px rgba(16, 35, 63, .08);
}
.user-row .avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1rem;
}
.user-id {
  min-width: 0;
  flex: 1;
}
.user-id h3 {
  margin: 0;
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-id p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: .86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.users-form {
  display: grid;
  gap: 16px;
}
.users-page .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.users-page .hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.45;
}
.users-page .field > span:first-child,
.users-page .views-field > legend {
  font-size: .8125rem;
  font-weight: 650;
}
.users-page .views-field {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.users-page input[type="text"]:not(.hex-input),
.users-page input[type="email"],
.users-page input[type="password"],
.users-page select {
  background: #fff;
}
.password-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.password-row input {
  flex: 1;
  min-width: 0;
}
.password-row .button {
  flex: 0 0 auto;
}
.check-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: #f7f9fb;
  box-shadow: inset 0 0 0 1px rgba(16, 35, 63, .08);
}
.check-list:empty {
  display: none;
}
.check-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
}
.check-row:hover {
  background: #fff;
}
.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--acid);
}
#memberList .check-row {
  cursor: default;
  justify-content: space-between;
  padding: 8px 10px;
}
#memberList .check-row:hover {
  background: transparent;
}
#memberList .user-id {
  display: grid;
  gap: 2px;
  min-width: 0;
}
#memberList .user-id strong {
  font-size: .9rem;
}
#memberList .user-id span {
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.users-page .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.users-page input[type="color"] {
  width: 52px;
  height: 44px;
  flex: 0 0 auto;
  padding: 4px;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.users-page .hex-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86rem;
  text-transform: uppercase;
}
.brand-preview {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(16, 35, 63, .1);
}
.brand-preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: .82rem;
  font-weight: 650;
}
.brand-preview-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentcolor;
  filter: invert(1);
  opacity: .85;
}
.brand-preview-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
}
.brand-preview-aa {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}
.brand-preview-text {
  flex: 1;
  min-width: 0;
  font-size: .9rem;
  font-weight: 550;
}
.brand-preview-button {
  padding: 8px 14px;
  border-radius: 8px;
  color: #fff;
  font-size: .8125rem;
  font-weight: 700;
}
.brand-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-bottom .brand-font {
  flex: 1;
  min-width: 200px;
}
.news-rows {
  display: grid;
  gap: 14px;
}
.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.copy-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f7f9fb;
  box-shadow: inset 0 0 0 1px rgba(16, 35, 63, .08);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-value.empty-value:empty::before {
  content: "—";
  color: var(--muted);
}
.token-once {
  overflow-wrap: anywhere;
  user-select: all;
}
@media (max-width: 640px) {
  .users-page .form-grid,
  .brand-grid {
    grid-template-columns: 1fr;
  }
  .user-row {
    flex-wrap: wrap;
  }
  .user-row .button {
    width: 100%;
  }
  /* S-04: merket over tittelen og stablede radiokort på mobil. */
  .users-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .users-card-head .badge {
    order: -1;
    align-self: flex-start;
  }
  #licenseForm .choice-row {
    flex-direction: column;
    align-items: stretch;
  }
  #licenseForm .choice-row label {
    min-height: 44px;
  }
  /* S-04b: fast prisbar nederst på mobil – bestilling med pris alltid synlig
     (sticky virker ikke nederst i seksjonen, derfor fixed). */
  .license-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(16, 35, 63, .12);
  }
  /* S-04b: innholdet overbaren må ikke dekkes til. */
  #panel-licenses { padding-bottom: 76px; }
  .license-sticky[hidden] {
    display: none;
  }
  .license-sticky .license-sticky-price {
    font-weight: 700;
    white-space: nowrap;
  }
  .license-sticky .button {
    min-height: 44px;
    flex-shrink: 0;
  }
}
@media (min-width: 641px) {
  /* S-04: prisbaren finnes bare på mobil. */
  .license-sticky {
    display: none;
  }
}

/* Unified library lists: Widgets, Views, Fleet, Media share the Users card language. */
#panel-fleet .users-card,
#panel-media .users-card {
  gap: 14px;
}
#panel-fleet .library-toolbar,
#panel-media .library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}
#panel-fleet .library-toolbar strong,
#panel-media .library-toolbar strong {
  font-size: .8125rem;
  font-weight: 650;
}
#panel-fleet .library-toolbar .button,
#panel-media .library-toolbar .button {
  min-height: 44px;
  padding: 0 14px;
}
#panel-fleet .list-frame,
#panel-media .list-frame {
  border: 1px solid rgba(16, 35, 63, .12);
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
  container-type: inline-size;
}
.fleet-list-head,
.fleet-row,
.media-list-head,
.media-row {
  display: grid;
  column-gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
}
.fleet-list-head.group-list-head,
.fleet-row:not(.screen-row) {
  grid-template-columns: minmax(0, 1.4fr) minmax(8rem, 1fr) minmax(6rem, .6fr) minmax(8rem, 1fr);
}
.fleet-list-head.screen-list-head,
.fleet-row.screen-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(6rem, .7fr) minmax(8rem, .9fr) minmax(7rem, .7fr) minmax(8rem, .9fr);
}
.media-list-head,
.media-row {
  grid-template-columns: 44px minmax(0, 1.5fr) minmax(8rem, .8fr) minmax(9rem, 1fr);
}
.media-list-head {
  min-height: 34px;
  color: #4d5d70;
  background: #f7f9fb;
  border-bottom: 1px solid rgba(16, 35, 63, .1);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.media-rows { display: flex; flex-direction: column; }
.media-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(16, 35, 63, .08);
  border-radius: 0;
  color: inherit;
  background: #fff;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
}
.media-rows .media-row:last-child { border-bottom: 0; }
.media-row:hover { background: #f6f8fb; }
.media-row.is-active { background: #eef4fb; box-shadow: inset 2px 0 0 var(--acid); }
.media-row strong {
  overflow: hidden;
  font-size: .92rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-row span,
.media-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-thumb {
  width: 44px;
  height: 32px;
  object-fit: cover;
  border-radius: 2px;
  background: #e7eef5;
}
.media-fallback {
  width: 44px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  color: var(--muted);
  background: #e7eef5;
  font-size: .68rem;
  font-weight: 800;
}
.usage-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 99px;
  background: #eef2f6;
  color: #3e5164;
  font-size: .72rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usage-badge.is-unused {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(16, 35, 63, .14);
  color: var(--muted);
  font-weight: 600;
}
/* S-17: usage-badge er slått sammen med merkekomponenten .badge (4 tokens) – beholdes som alias. */
.badge.is-neutral { color: #3e5164; background: #eef2f6; }
.badge.is-warning { color: #92400e; background: #fef3c7; }
.badge.is-critical { color: #8d2b22; background: #fdeceb; }
.drawer-usage { display: grid; gap: 8px; }
.drawer-usage .usage-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f7f9fb;
  box-shadow: inset 0 0 0 1px rgba(16, 35, 63, .08);
  font-size: .86rem;
}
.drawer-usage .usage-line small { color: var(--muted); font-weight: 500; }
.media-drawer-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
  background: #0f233f;
}
.media-drawer-preview .media-fallback {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  font-size: 1rem;
}
.media-id {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .76rem;
}
body.is-media-drawer #mediaDrawer {
  position: fixed;
  z-index: 12;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50vw;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(16, 35, 63, .14);
  background: #fff;
  box-shadow: -18px 0 48px rgba(16, 35, 63, .16);
}
@media (min-width: 861px) {
  body.is-media-drawer .admin-top,
  body.is-media-drawer #panel-media {
    width: calc(50vw - var(--nav));
    max-width: none;
    box-sizing: border-box;
  }
}
@media (max-width: 860px) {
  body.is-media-drawer #mediaDrawer { width: 100%; }
}
@container (max-width: 640px) {
  .fleet-list-head.group-list-head,
  .fleet-row:not(.screen-row),
  .fleet-list-head.screen-list-head,
  .fleet-row.screen-row { grid-template-columns: minmax(0, 1fr) minmax(7rem, .8fr); }
  .group-list-head span:nth-child(2),
  .group-list-head span:nth-child(3),
  .fleet-row:not(.screen-row) span:nth-of-type(1),
  .fleet-row:not(.screen-row) span:nth-of-type(2),
  .screen-list-head span:nth-child(2),
  .screen-list-head span:nth-child(3),
  .screen-list-head span:nth-child(4),
  .screen-row span:nth-of-type(1),
  .screen-row span:nth-of-type(2),
  .screen-row span:nth-of-type(3),
  .media-list-head span:nth-child(2),
  .media-row .media-detail { display: none; }
  .media-list-head { grid-template-columns: 44px minmax(0, 1fr) minmax(7rem, .8fr); }
  .media-row { grid-template-columns: 44px minmax(0, 1fr) minmax(7rem, .8fr); }
}

/* S-16: fast topplinje (56 px) med meny på mobil, også i editoren. Skyggestripen er fjernet. */
@media (max-width: 860px) {
  .admin-top { position: sticky; top: 0; z-index: 10; min-height: 56px; padding: 8px 16px; background: var(--paper); }
  .admin-top h1 { font-size: 1.2rem; }
  .nav-toggle { width: 44px; min-width: 44px; height: 44px; flex: none; }
  body.is-editing-view:has(#panel-widgets:not([hidden])) .admin-top,
  body.is-editing-view:has(#panel-workspaces:not([hidden])) .admin-top { display: flex; }
  .admin-nav { box-shadow: none; border-right: 1px solid var(--line); }
}

/* S-17: felles layout- og komponentsystem – ett grid, tom tilstand med handling, overflow-meny. */
.cards-grid, .users-page .users-grid { display: grid; gap: 16px; max-width: 780px; }
.empty-state { display: grid; gap: 10px; justify-items: start; padding: 16px; border: 1px dashed rgba(16,35,63,.25); border-radius: 12px; }
.empty-state p { margin: 0; color: var(--muted); font-size: .92rem; }
.overflow { position: relative; display: none; }
.overflow-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.overflow-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 160px; display: grid; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.overflow-menu button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; font: inherit; font-size: .9rem; cursor: pointer; }
.overflow-menu button:hover { background: #f2f5f9; }
.overflow-menu button.danger-action { color: #8d2b22; }
@media (max-width: 860px) {
  /* S-17 mobil: kortlister og Slett i en ⋯-meny. */
  #memberList .check-row { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px; }
  #memberList .member-remove-inline { display: none; }
  #memberList .overflow { display: block; }
  .fleet-rows .fleet-row, .media-rows .media-row { border-radius: 12px; }
}

/* S-17: alle knapper minst 44 px trykkflate på mobil. */
@media (max-width: 860px) {
  button { min-height: 44px; }
}

/* S-16 rest: menyknappen er alltid 44×44 – målt ned til 22 px bred på enkelte faner. */
#navToggle.nav-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  flex: none;
  padding: 0;
  box-sizing: border-box;
}

/* S-22: redigeringsrammene holdes skjult til språket er lastet (unngår engelsk blink på nb). */
.admin-panel-frame iframe { visibility: hidden; }
.admin-panel-frame iframe.is-ready { visibility: visible; }

/* S-24: hopp-lenke på app-siden. */
.skip-link { position: fixed; top: -100px; left: 20px; padding: 12px 20px; background: #fff; color: var(--ink); z-index: 100; }
.skip-link:focus { top: 12px; }

/* S-27: kollapset sjekkliste (≤ 240 px desktop, ≤ 160 px mobil). Knappen står under teksten på mobil. */
.onboard-head-actions { display: flex; gap: 8px; flex: none; }
#onboardingCard.is-collapsed #onboardSteps { display: none; }
.onboard-collapsed-wrap { display: grid; gap: 10px; margin-top: 10px; }
.onboard-collapsed-wrap[hidden] { display: none; }
.onboard-collapsed { margin: 0; font-size: .8125rem; font-weight: 650; }
.onboard-next { justify-self: start; min-height: 44px; }
@media (max-width: 640px) {
  .onboard-head { flex-wrap: wrap; }
  .onboard-head-actions { width: 100%; }
  .onboard-head-actions .button { flex: 1 1 auto; }
  .onboard-next { justify-self: stretch; width: 100%; }
}

/* S-33: faner på Brukere-siden – én kategori synlig av gangen. */
.users-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.users-tabs[hidden] { display: none; }
.users-tabs [data-users-tab] { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; font-size: .84rem; font-weight: 700; }
.users-tabs [data-users-tab][aria-selected="true"] { color: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
/* S-33: språkvalget bor i brukermenyen – aldri flytende over innhold. */
.nav-user .locale-toggle { grid-column: 1 / -1; justify-self: start; margin-top: 6px; min-width: 44px; min-height: 44px; }

/* S-35: skeleton mens Visninger/Widgeter laster – aldri tom flate uten indikator. */
.frame-loading { padding: 12px 32px 64px; }
.frame-loading[hidden] { display: none; }
.frame-loading-text { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.skeleton-rows { display: grid; gap: 10px; max-width: 780px; }
.skeleton-rows span { height: 56px; border-radius: 12px; background: linear-gradient(100deg, #e8eef5 40%, #f4f7fb 50%, #e8eef5 60%); background-size: 200% 100%; animation: skeleton-shimmer 1.4s ease-in-out infinite; }
@keyframes skeleton-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-rows span { animation: none; } }

/* S-52: ✕ oppe til høyre + backdrop på høyrepanelene. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.drawer-bar h2 { flex: 1 1 auto; }
.drawer-close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; margin-left: auto; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.drawer-close:hover { background: var(--paper); }
.drawer-scrim { position: fixed; z-index: 11; inset: 0; border: 0; padding: 0; background: rgba(16, 35, 63, .38); cursor: pointer; }
.drawer-scrim[hidden] { display: none; }
