/* app.css — AR Appen i nettleseren og telefonrammen. Tallene er docs/APP-DESIGN-LYS.md.
   Skjermen er 390 px bred; under 560 px fyller appen nettleseren. style-src 'self': all stil
   ligger her. */

/* ================================================================ rundt rammen */

.demo-scene { margin: 0 0 var(--block); }

/* Det demoen ikke er. Står først, over rollevelgeren og over telefonen, fordi en besøkende
   som tror dette er AR, har misforstått produktet før han har trykket på noe. */
.demo-banner {
  margin: 0 0 20px; padding: 16px 18px;
  background: var(--warn); border-radius: var(--r);
  border-left: 6px solid var(--timber);
  color: var(--ink);
}
.demo-banner p { margin: 0; font-size: 16px; line-height: 1.5; max-width: 68ch; }
.demo-banner strong { font-weight: 700; }
.demo-banner ul { margin: 10px 0; padding: 0 0 0 20px; max-width: 68ch; }
.demo-banner li { margin: 0 0 6px; font-size: 16px; line-height: 1.5; }
.demo-banner li:last-child { margin-bottom: 0; }
.demo-banner a { color: inherit; }

.demo-roller {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 20px; padding: 0;
}
.demo-rolle {
  display: flex; flex-direction: column; gap: 2px;
  min-height: 48px; padding: 8px 14px;
  font: inherit; text-align: left; cursor: pointer;
  color: var(--ink); background: #fff;
  border: 2px solid var(--line-2); border-radius: 10px;
}
.demo-rolle:hover { background: var(--surface); }
.demo-rolle.er-valgt { color: #fff; background: var(--ink); border-color: var(--ink); }
.demo-rolle-tittel { font-size: 15px; font-weight: 600; }
.demo-rolle-navn { font-size: 14px; opacity: .8; }

.demo-hjelp { max-width: 62ch; margin: 0 0 20px; color: var(--body); font-size: 16px; line-height: 1.6; }
.demo-hjelp a { color: inherit; }

/* Telefonen. Samme bezel og samme skygge som .phone på nettstedet, men skjermen er 390 bred. */
.demo-ramme {
  width: min(100%, 414px); margin: 0 auto; padding: 12px;
  background: linear-gradient(#20262f, #12161c);
  border-radius: 48px;
  box-shadow: var(--shadow-phone), inset 0 0 0 1px rgba(255, 255, 255, .09);
}
.demo-skjerm {
  position: relative; overflow: hidden;
  height: max(560px, min(844px, 100svh - 220px));
  border-radius: 38px; background: #fff;
}
/* Øya og hjemlinjen: bare tegning. */
.demo-skjerm::before {
  content: ""; position: absolute; z-index: 20; top: 10px; left: 50%;
  width: 116px; height: 34px; margin-left: -58px; border-radius: 99px; background: #000;
  pointer-events: none;
}
.demo-skjerm::after {
  content: ""; position: absolute; z-index: 20; bottom: 8px; left: 50%;
  width: 132px; height: 5px; margin-left: -66px; border-radius: 99px;
  background: rgba(22, 33, 43, .32); pointer-events: none;
}

@media (max-width: 559px) {
  .demo-ramme { width: 100%; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .demo-skjerm { height: max(520px, 100svh - 160px); border-radius: var(--r); border: 2px solid var(--line-2); }
  .demo-skjerm::before, .demo-skjerm::after { display: none; }
}

/* ================================================================ appen */

.demo-app {
  --a-bg: #fff;
  --a-surface: #f4f6f7;
  --a-surface2: #eaeef0;
  --a-ink: #16212b;
  --a-body: #2a3641;
  --a-muted: #55616d;
  --a-line: #8a939b;          /* LineStrong: hver grense mellom to trykkbare ting */
  --a-timber: #ffb020;
  --a-ok: #2ecc71;
  --a-bad: #ff5c5c;
  --a-warn: #ebcb6b;
  --a-warn-text: #8a6a00;
  --a-bad-text: #c23b30;
  --a-app: #11151c;
  --a-app-panel: #1b212b;
  --a-app-ink: #f2f5f9;
  --a-app-dim: #a3aebf;
  --a-app-line: #5f6b7a;
  --a-side: 20px;

  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  font-family: var(--sans); font-synthesis: none;
  color: var(--a-ink); background: var(--a-bg);
}

.demo-app *:focus-visible { outline: 2px solid var(--a-ink); outline-offset: 3px; }
.demo-app button { font: inherit; }
/* FARGEN ARVES MED NULL SPESIFISITET, så en knappeklasse alltid slår den: som .demo-app button (0,1,1)
   slo den .a-knapp-hoved (0,1,0), og hovedknappene sto med Ink-tekst på Ink-flate. */
:where(.demo-app) button { color: inherit; }
.demo-app p { margin: 0; }

/* ---- topplinjen: 56 dp under systemlinjen */
.a-topp {
  flex: none; display: flex; align-items: center; gap: 4px;
  height: 56px; padding: 0 8px; margin-top: 52px;
  border-bottom: 2px solid var(--a-line); background: var(--a-bg);
}
.a-tilbake, .a-mer {
  flex: none; width: 48px; height: 48px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 10px; cursor: pointer;
  font-size: 19px; line-height: 1;
}
.a-tilbake:hover, .a-mer:hover { background: var(--a-surface2); }
.a-topp-navn { flex: 1 1 auto; min-width: 0; padding: 0 4px; }
.a-topp-tittel {
  display: block; font-size: 19px; font-weight: 600; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.a-topp-under {
  display: block; font-size: 14px; font-weight: 600; color: var(--a-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- fanene: bare de synlige fordeles, valgt fane får 3 px Ink under */
.a-faner {
  flex: none; display: flex; overflow-x: auto;
  border-bottom: 2px solid var(--a-line); background: var(--a-bg);
}
.a-fane {
  flex: 1 0 auto; min-height: 48px; padding: 12px 10px;
  font-size: 14px; font-weight: 400; color: var(--a-muted);
  background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer;
  white-space: nowrap;
}
.a-fane-valgt { color: var(--a-ink); font-weight: 600; border-bottom-color: var(--a-ink); }

/* ---- siden */
.a-innhold { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.a-innhold-mork { background: var(--a-app); }
.a-side { display: flex; flex-direction: column; gap: 12px; padding: 16px var(--a-side) 88px; }
.a-bolk { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.a-laster { padding: 40px var(--a-side); color: var(--a-muted); font-size: 16px; }

/* ---- skrift (1.4) */
.a-tittel { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.a-hilsen { margin: 0; font-size: 22px; font-weight: 700; text-align: center; }
.a-ledetekst { font-size: 16px; line-height: 1.5; color: var(--a-body); text-align: center; }
.a-overskrift { margin: 0; font-size: 14px; font-weight: 600; color: var(--a-muted); }
.a-fase { margin: 0; font-size: 19px; font-weight: 600; }
.a-avsnitt { font-size: 16px; line-height: 1.5; color: var(--a-body); }
.a-dempet { font-size: 14px; font-weight: 400; line-height: 1.5; color: var(--a-muted); }
.a-maltall { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.a-pris { font-size: 16px; font-weight: 600; }
.a-strek { height: 2px; margin: 8px 0; border: 0; background: var(--a-line); }

/* Gjestens nedtelling: Warn-flate med WarnText, aldri ravgul tekst (2.1). */
.a-okt {
  min-height: 48px; display: grid; place-items: center; padding: 12px;
  font-size: 16px; font-weight: 600; color: var(--a-warn-text);
  background: var(--a-warn); border-radius: var(--r);
}

/* ---- knapper (1.6) */
.a-knapp {
  display: block; width: 100%; min-height: 52px; padding: 12px 16px;
  font-size: 17px; font-weight: 600; text-align: center; text-decoration: none;
  border-radius: 10px; border: 2px solid transparent; cursor: pointer;
}
.a-knapp-hoved { min-height: 56px; color: #fff; background: var(--a-ink); }
.a-knapp-hoved:hover { background: #27353f; }
.a-knapp-vanlig { color: var(--a-ink); background: var(--a-bg); border-color: var(--a-line); }
.a-knapp-vanlig:hover { background: var(--a-surface2); }
.a-knapp-ar { min-height: 56px; color: var(--a-ink); background: var(--a-timber); }
.a-knapp-slett { color: var(--a-bad-text); background: var(--a-bg); border-color: var(--a-bad); }
.a-knapp-mork { color: var(--a-app-ink); background: var(--a-app-panel); border-color: var(--a-app-line); }
.a-knapperad { display: flex; gap: 12px; }
.a-knapperad > * { flex: 1 1 0; }

/* ---- varselet (Ui.Caution) */
.a-varsel {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  background: var(--a-warn); border-left: 6px solid var(--a-timber); border-radius: var(--r);
}
.a-varsel-i {
  flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; border: 2px solid var(--a-ink); border-radius: 50%;
}
.a-varsel-tekst { font-size: 16px; line-height: 1.45; color: var(--a-ink); }
.a-praksis { font-size: 14px; color: var(--a-muted); }
.a-beskjed { font-size: 14px; font-weight: 600; color: var(--a-bad-text); }

/* ---- tilstand: fargen i prikken, ordet i Ink (1.2) */
.a-status { display: inline-flex; align-items: center; gap: 8px; }
.a-prikk { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--a-muted); }
.a-status-ok .a-prikk { background: var(--a-ok); }
.a-status-avvik .a-prikk { background: var(--a-bad); }
.a-status-warn .a-prikk { background: var(--a-warn); }
.a-status-na .a-prikk { background: transparent; box-shadow: inset 0 0 0 2px var(--a-muted); }
.a-status-ingen .a-prikk { background: transparent; box-shadow: inset 0 0 0 2px var(--a-muted); }
.a-status-ord { font-size: 14px; font-weight: 600; color: var(--a-ink); }

/* ---- kort og rader */
.a-kort {
  display: block; width: 100%; text-align: left;
  padding: 16px; background: var(--a-bg);
  border: 2px solid var(--a-line); border-radius: var(--r); cursor: default;
}
.a-kort-trykk { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.a-kort-trykk:hover { background: var(--a-surface2); }
.a-kort-inni { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.a-kort > .a-kort-tittel, .a-kort > .a-kort-under, .a-kort > .a-dempet, .a-kort > p { margin: 0 0 4px; }
.a-kort-tittel { display: block; font-size: 19px; font-weight: 600; line-height: 1.25; }
.a-kort-tittel-stor { font-size: 22px; font-weight: 700; }
.a-kort-under { display: block; font-size: 14px; font-weight: 400; color: var(--a-muted); line-height: 1.4; }
.a-kort-meta { display: block; font-size: 14px; font-weight: 600; color: var(--a-muted); }
.a-kort-grå .a-kort-tittel, .a-kort-grå .a-kort-under { color: var(--a-muted); }
.a-kort .a-knapp { margin-top: 12px; }

.a-merke {
  align-self: flex-start; padding: 2px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--a-ink);
  border: 2px solid var(--a-line);
}
.a-merke-bas { background: var(--a-timber); border-color: var(--a-timber); }

.a-chevron {
  flex: none; width: 12px; height: 12px;
  border-top: 2px solid var(--a-ink); border-right: 2px solid var(--a-ink);
  transform: rotate(45deg);
}
.a-chevron-venstre { transform: rotate(-135deg); }

.a-rad {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 56px; padding: 12px 16px; background: var(--a-bg);
  border: 2px solid var(--a-line); border-radius: var(--r);
}
.a-rad-trykk { cursor: pointer; }
.a-rad-trykk:hover { background: var(--a-surface2); }
.a-rad-inni { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.a-rad-etikett { font-size: 14px; font-weight: 600; color: var(--a-muted); }
.a-rad-tittel { font-size: 16px; font-weight: 600; line-height: 1.35; }
.a-rad-under { font-size: 14px; color: var(--a-muted); line-height: 1.4; }
.a-rad-verdi { flex: none; font-size: 16px; font-weight: 600; }

.a-tall {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 10px 0; border-bottom: 2px solid var(--a-line);
}
.a-tall-etikett { font-size: 16px; color: var(--a-muted); }
.a-tall-verdi { font-size: 19px; font-weight: 600; }

/* ---- fliser: to per rad */
.a-fliser { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.a-flis { padding: 14px; }
.a-flis .a-kort-tittel { font-size: 17px; }

/* ---- felt */
.a-feltrad { display: flex; flex-direction: column; gap: 6px; }
.a-felt-etikett { font-size: 14px; font-weight: 600; color: var(--a-muted); }
.a-felt {
  width: 100%; min-height: 56px; padding: 12px 14px;
  font: inherit; font-size: 17px; color: var(--a-ink);
  background: var(--a-surface); border: 2px solid var(--a-line); border-radius: 10px;
}
.a-dodtfelt {
  display: flex; align-items: center; width: 100%; min-height: 56px; padding: 12px 14px;
  text-align: left; background: var(--a-surface);
  border: 2px solid var(--a-line); border-radius: 10px; cursor: pointer;
}
.a-dodtfelt-tekst { font-size: 17px; color: var(--a-muted); }

/* ---- sjekklistepunkt og svarknapper (2.5) */
.a-punkt {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0; border-bottom: 2px solid var(--a-line);
}
.a-punkt-tekst { font-size: 16px; font-weight: 600; line-height: 1.45; }
.a-punkt-meta { font-size: 14px; color: var(--a-muted); line-height: 1.4; }
.a-svar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.a-svar-celle {
  min-height: 56px; padding: 8px 6px;
  font-size: 17px; font-weight: 600; line-height: 1.2; color: var(--a-body);
  background: var(--a-bg); border: 2px solid var(--a-line); border-radius: 10px; cursor: pointer;
}
.a-svar-valgt { color: var(--a-ink); }
.a-svar-ok { border-color: var(--a-ok); background: #eafaf1; }
.a-svar-avvik { border-color: var(--a-bad); background: #ffeeee; }
.a-svar-na { border-color: var(--a-muted); background: var(--a-surface); }
/* Målefeltet: etiketten til venstre og feltet til høyre på samme linje, 124 dp bredt (FeatureUi). */
.a-maal { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a-maal .a-felt { flex: none; width: 124px; }

/* ---- avvik */
.a-avvik {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border: 2px solid var(--a-line); border-radius: var(--r);
}
.a-avvik-tittel { font-size: 16px; font-weight: 600; }
.a-avvik-under { font-size: 14px; color: var(--a-muted); }
.a-avvik-mm { font-size: 22px; font-weight: 700; }
.a-avvik-merknad, .a-punkt-merknad { font-size: 14px; line-height: 1.4; color: var(--a-ink); }

/* ---- tilvalg */
.a-tilvalg {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 64px; padding: 12px 16px; background: var(--a-bg);
  border: 2px solid var(--a-line); border-radius: var(--r); cursor: pointer;
}
.a-tilvalg:hover { background: var(--a-surface2); }
.a-tilvalg-valgt { background: var(--a-surface); }
.a-tilvalg-inni { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.a-tilvalg-tittel { font-size: 16px; line-height: 1.35; color: var(--a-body); }
.a-tilvalg-valgt .a-tilvalg-tittel { color: var(--a-ink); font-weight: 600; }
.a-tilvalg-detalj { font-size: 14px; color: var(--a-muted); }
.a-tilvalg-hoyre { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.a-tilvalg-ord { font-size: 14px; font-weight: 600; color: var(--a-muted); }
.a-tilvalg-valgt .a-tilvalg-ord { color: var(--a-ink); }

/* Haken tegnes, fordi det ikke finnes noe haketegn i skriften. Aldri grønn (2.9). */
.a-hake {
  flex: none; width: 18px; height: 10px; border-left: 3px solid var(--a-ink);
  border-bottom: 3px solid var(--a-ink); transform: rotate(-45deg); margin-bottom: 4px;
}

/* ---- satser */
.a-satsrad {
  display: flex; gap: 12px; align-items: flex-end; padding: 12px 0;
  border-bottom: 2px solid var(--a-line);
}
.a-satsrad-inni { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.a-satsrad .a-feltrad { flex: none; width: 132px; }
.a-satsrad .a-felt-etikett { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.a-prisnotat { display: flex; flex-direction: column; gap: 12px; }

/* ---- personer */
.a-person {
  display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap;
  padding: 14px 16px; border: 2px solid var(--a-line); border-radius: var(--r);
}
.a-initial {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  font-size: 19px; font-weight: 600; background: var(--a-surface); border-radius: 8px;
}
.a-person-inni { flex: 1 1 140px; min-width: 0; }
.a-person-navn { display: flex; gap: 8px; align-items: center; font-size: 19px; font-weight: 600; }
.a-person-rolle { font-size: 14px; color: var(--a-muted); }
.a-person .a-knapp { flex: 0 0 auto; width: auto; min-height: 48px; }

/* ---- valgrad (rom, budsjett, firma, innlogging) */
.a-valgrad {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 56px; padding: 12px 16px; background: var(--a-bg);
  border: 2px solid var(--a-line); border-radius: var(--r); cursor: pointer;
}
.a-valgrad:hover { background: var(--a-surface2); }
.a-valgrad-valgt { background: var(--a-surface); }
.a-valgrad-inni { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.a-valgrad-valgt .a-rad-tittel { font-weight: 700; }

/* ---- skissemerket: likt på hver skjerm som viser et skannet tall (9.11) */
.a-skisse {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--a-surface); border: 2px solid var(--a-line); border-radius: var(--r);
}
.a-skisse-tittel { font-size: 19px; font-weight: 600; }
.a-skisse-kort, .a-skisse-lang { font-size: 16px; line-height: 1.45; color: var(--a-body); }

.a-linje { display: flex; flex-direction: column; gap: 2px; }
.a-linje-etikett { font-size: 14px; font-weight: 600; color: var(--a-muted); }
.a-linje-verdi { font-size: 16px; line-height: 1.45; }

/* ---- logoen: alltid på mørkt panel, aldri rett på hvitt (1.8) */
.a-lockup {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 20px 20px; background: var(--a-app); border-radius: var(--r-lg);
}
.a-merke-svg { width: 55px; height: 44px; }
.a-wm { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.a-wm-a, .a-wm-r {
  font-family: var(--wordmark); font-weight: 800; font-size: 22px; letter-spacing: .06em;
}
.a-wm-a { color: var(--a-app-ink); }
.a-wm-r { color: var(--a-timber); }
.a-ar-linjal { font-family: var(--mono); font-size: 14px; color: var(--blueprint); }
.a-nick { font-family: var(--hand); font-size: 18px; color: var(--a-app-dim); }

/* ---- AR-fanen: den ene mørke skjermen (1.7) */
.a-mork { color: var(--a-app-ink); background: var(--a-app); }
.a-mork-tittel { font-size: 19px; font-weight: 600; }
.a-mork-under { font-size: 14px; font-weight: 600; color: var(--a-app-dim); }
.a-mork-brod { font-size: 16px; line-height: 1.5; color: var(--a-app-ink); }
.a-mork-dempet { font-size: 14px; line-height: 1.5; color: var(--a-app-dim); }
.a-mork .a-knapp-vanlig { color: var(--a-app-ink); background: var(--a-app-panel); border-color: var(--a-app-line); }
.a-mork *:focus-visible { outline-color: var(--a-timber); }

/* ---- 3D-visningen (site/demo/3d/) fyller fanen, som ikke ruller: å dra snur huset. */
.a-innhold:has(.a-3d) { overflow: hidden; }
.a-3d { position: relative; height: 100%; min-height: 320px; background: var(--a-app); }
.a-3d .ar3d-hus { display: none; }
.a-3d-laster {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 0 20px; text-align: center;
  font-size: 16px; line-height: 1.5; color: var(--a-app-dim); background: var(--a-app);
}

/* ================================================================ uten JavaScript */
#uten-js .screen-row { display: flex; flex-wrap: wrap; gap: 20px; }
