:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --line: #e4e4e7;
  --line-soft: #f4f4f5;
  --ink: #09090b;
  --ink-strong: #18181b;
  --ink-hover: #27272a;
  --dim: #52525b;
  --faint: #71717a;
  --ghost: #a1a1aa;
  --chip: #d4d4d8;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  touch-action: manipulation;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

.app {
  position: relative;
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Snu telefonen (liggende låses ute på mobil) ---- */
.rotate-screen { display: none; }

@media (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .rotate-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .rotate-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px;
    text-align: center;
  }
  .rotate-icon {
    width: 40px;
    height: 40px;
    color: var(--bg);
    margin-bottom: 6px;
  }
  .rotate-text {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--bg);
  }
  .rotate-sub {
    font-size: 13px;
    color: var(--faint);
  }
}

/* ---- Installasjonsinstruksjon (PWA) ---- */
.install-screen {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--ink-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.install-screen[hidden] { display: none; }
.install-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 48px 32px;
  max-width: 400px;
  text-align: center;
}
.install-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.install-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.9);
}
.install-app-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--bg);
  letter-spacing: 0.01em;
}
.install-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--bg);
}
.install-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ghost);
  text-wrap: pretty;
}
.install-warn {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ink-hover);
  border-radius: 12px;
  background: var(--ink-strong);
  font-size: 13px;
  line-height: 1.55;
  color: var(--chip);
  text-wrap: pretty;
}
.install-steps {
  margin: 12px 0 0;
  padding: 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  counter-reset: step;
  background: var(--ink);
  border: 1px solid var(--ink-hover);
  border-radius: 14px;
  align-self: stretch;
}
.install-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 24px;
  color: var(--chip);
}
.install-steps li span { flex: 1; }
.install-steps li strong { color: var(--bg); font-weight: 600; }
.install-steps li::before {
  content: counter(step);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-continue {
  margin-top: 18px;
  background: none;
  border: 1px solid var(--ink-hover);
  border-radius: 10px;
  padding: 11px 22px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ghost);
  cursor: pointer;
}
.install-continue:active { background: var(--ink-hover); }

/* ---- PIN-skjerm ---- */
/* Alt skaleres mot skjermhøyden så tittel, kode og Roger alltid får plass */
.pin-screen {
  --roger-w: min(64vw, 280px, 34vh);
  --roger-visible: calc(var(--roger-w) * 0.8);
  --pin-key: clamp(48px, min(15vw, 7.6vh), 64px);
  --pin-gap: clamp(8px, 1.4vh, 12px);

  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 24px calc(var(--roger-visible) + 12px);
  overflow: hidden;
  transition: opacity 360ms ease;
}
.pin-screen.unlocking { opacity: 0; pointer-events: none; }
.pin-screen[hidden] { display: none; }

.pin-roger {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 20%);
  width: var(--roger-w);
  display: block;
  pointer-events: none;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pin-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3.4vh, 32px);
}
.pin-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
.pin-title {
  margin: 0;
  font-size: clamp(20px, 3.2vh, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--bg);
}
.pin-sub {
  margin: 0;
  font-size: 13px;
  color: var(--faint);
}

.pin-dots { display: flex; gap: 16px; }
.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1.5px solid var(--dim);
  transition: background 120ms ease, border-color 120ms ease;
}
.pin-dot.filled {
  background: var(--bg);
  border-color: var(--bg);
}
.pin-dots.error { animation: pin-shake 320ms ease; }
@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, var(--pin-key));
  gap: var(--pin-gap);
  justify-items: center;
}
.pin-pad button {
  width: var(--pin-key);
  height: var(--pin-key);
  border-radius: 999px;
  border: 1px solid var(--ink-hover);
  background: var(--ink-strong);
  font-family: "Geist", system-ui, sans-serif;
  font-size: clamp(18px, 2.6vh, 22px);
  font-weight: 500;
  color: var(--bg);
  cursor: pointer;
  transition: background 100ms ease, transform 100ms ease;
}
.pin-pad button:active {
  background: var(--ink-hover);
  transform: scale(0.94);
}
.pin-pad .pin-del {
  border: none;
  background: none;
  font-size: 19px;
  color: var(--faint);
}

/* Svært lave skjermer (liggende telefon): tettere, mindre Roger */
@media (max-height: 500px) {
  .pin-screen {
    --roger-w: min(46vw, 190px, 30vh);
    --pin-key: clamp(42px, 6.6vh, 56px);
    padding-top: 12px;
  }
  .pin-sub { display: none; }
  .pin-inner { gap: clamp(12px, 2.4vh, 20px); }
}

@keyframes app-enter {
  from { opacity: 0; transform: scale(0.965) translateY(10px); }
  to { opacity: 1; transform: none; }
}
.app.entering { animation: app-enter 480ms cubic-bezier(0.22, 1, 0.36, 1); }

/* ---- Pull-down easter egg ---- */
.scrim {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  background: var(--ink);
  z-index: 40;
  pointer-events: none;
}
.roger {
  position: absolute;
  top: 0; left: 50%;
  width: 84.6%;
  z-index: 41;
  display: block;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -255px);
  filter: drop-shadow(0 8px 12px rgba(9, 9, 11, 0.3));
}
.roger-cap {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: 22px;
  z-index: 42;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ghost);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

/* ---- Views ---- */
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.view[hidden] { display: none; }

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.view-header {
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.view-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---- Hjem ---- */
/* Toppen glir fra hvit (matcher statusfeltet) til appbakgrunnen */
#view-hjem {
  background: linear-gradient(
    to bottom,
    #ffffff 0,
    #ffffff calc(env(safe-area-inset-top, 0px) + 10px),
    var(--bg) calc(env(safe-area-inset-top, 0px) + 110px)
  );
}
.home-scroll {
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px 20px;
  gap: 16px;
  touch-action: pan-y;
}
.pull-panel { height: 0; flex: none; }
.home-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 4px 0;
}
.home-head .kicker { letter-spacing: 0.1em; }
.home-title {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}
.home-lede {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--dim);
  text-wrap: pretty;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.countdown-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.mono-dim { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* Split-flap-tavle (Solari) */
.flap-board {
  background: var(--ink);
  border-radius: 10px;
  padding: 14px 8px 12px;
  display: flex;
  justify-content: center;
  gap: 12px;
}
.flap-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.flap-digits { display: flex; gap: 3px; }
.flap-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.flap-digit {
  position: relative;
  width: 28px;
  height: 40px;
  perspective: 220px;
}
.flap-digit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1.5px;
  margin-top: -0.75px;
  background: rgba(0, 0, 0, 0.65);
  z-index: 3;
}
.flap-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  background: var(--ink-strong);
}
.flap-top { top: 0; border-radius: 4px 4px 0 0; }
.flap-bottom { bottom: 0; border-radius: 0 0 4px 4px; }
.flap-half span,
.flap-leaf span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--bg);
  font-variant-numeric: tabular-nums;
}
.flap-top span { top: 0; }
.flap-bottom span { top: -100%; }
.flap-leaf {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  z-index: 2;
  transform-origin: bottom;
  transform-style: preserve-3d;
  animation: flap-fold 300ms ease-in forwards;
}
.flap-leaf-front,
.flap-leaf-back {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  background: var(--ink-strong);
}
.flap-leaf-front { border-radius: 4px 4px 0 0; }
.flap-leaf-front span { top: 0; }
.flap-leaf-back {
  transform: rotateX(180deg);
  border-radius: 0 0 4px 4px;
}
.flap-leaf-back span { top: -100%; }
@keyframes flap-fold {
  from { transform: rotateX(0); }
  to { transform: rotateX(-180deg); }
}

.btn-primary {
  border: none;
  background: var(--ink-strong);
  color: var(--bg);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  padding: 11px;
  cursor: pointer;
}

.link-stack { display: flex; flex-direction: column; gap: 10px; }
.link-card {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  /* Snapgruppa er en <a>, resten er <button> — nulls ut lenkestilen */
  text-decoration: none;
}
.link-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }

.link-badge {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--line-soft);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.link-badge svg { width: 21px; height: 21px; }
/* Snapgruppa er den eneste eksterne lenken, og skal stikke seg ut i en
   ellers svart-hvit app — derfor Snapchat-gult i stedet for grått. */
.link-badge-snap { background: #fffc00; }
.link-card-snap .arrow { color: var(--dim); }
.link-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.link-sub { font-size: 12px; color: var(--faint); }
.arrow { font-family: var(--mono); font-size: 13px; color: var(--ghost); }

.next-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-note { font-size: 13px; color: var(--dim); line-height: 1.5; }

/* ---- Lists / cards shared ---- */
.list-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: none;
}
.list-card > :last-child { border-bottom: none; }

.footnote {
  margin: 4px 4px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ghost);
}

/* ---- Program ---- */
.day-list { display: flex; flex-direction: column; gap: 12px; }
.day-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  flex: none;
}
.day-head {
  width: 100%;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  text-align: left;
}
.day-head-text { display: flex; flex-direction: column; gap: 3px; }
.day-title { font-size: 15px; font-weight: 500; color: var(--ink); }
.day-chevron { font-family: var(--mono); font-size: 13px; color: var(--ghost); }
.day-items {
  border-top: 1px solid var(--line-soft);
  padding: 6px 16px 14px;
  display: flex;
  flex-direction: column;
}
.day-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.day-item:last-child { border-bottom: none; }
.item-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  padding-top: 1px;
}
.item-body { display: flex; flex-direction: column; gap: 3px; }
.item-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.item-note { font-size: 12px; line-height: 1.5; color: var(--faint); }

/* ---- Fly ---- */
.flight-list { display: flex; flex-direction: column; gap: 12px; }
.flight-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: none;
}
.flight-code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}
.badges { display: flex; align-items: center; gap: 6px; }
.badge {
  font-size: 11px;
  color: var(--dim);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 3px 9px;
}
.badge-mine {
  color: var(--bg);
  background: var(--ink-strong);
}
.flight-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.route-end { display: flex; flex-direction: column; gap: 2px; }
.route-end.right { align-items: flex-end; }
.route-code { font-family: var(--mono); font-size: 20px; color: var(--ink); line-height: 1; }
.route-time { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.route-line { flex: 1; height: 1px; background: var(--line); margin: 0 4px; }
.flight-foot {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flight-who { font-size: 12px; color: var(--dim); line-height: 1.5; }
.flight-note { font-size: 12px; color: var(--ghost); line-height: 1.5; }

.flight-empty { gap: 4px; }

/* ---- Billettreferanse (kun på ditt eget fly) ---- */
.flight-ref {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ref-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.ref-entry { display: flex; flex-direction: column; gap: 5px; }
.ref-row { display: flex; align-items: center; gap: 8px; }
.ref-who { font-size: 11px; color: var(--ghost); line-height: 1.5; padding-left: 2px; }
.ref-hint {
  font-size: 11px;
  line-height: 1.55;
  color: var(--faint);
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--line-soft);
  text-wrap: pretty;
}
.ref-code {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ref-code-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--ghost);
  transition: color 0.15s;
}
.ref-icon-check { display: none; }
.ref-code:active { background: var(--line-soft); }
.ref-code.is-copied {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.ref-code.is-copied .ref-icon { color: var(--bg); }
.ref-code.is-copied .ref-icon-copy { display: none; }
.ref-code.is-copied .ref-icon-check { display: block; }
.ref-link {
  flex: none;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.ref-link:active { background: var(--ink-hover); }

/* ---- Kontakt ---- */
.kontakt-scroll { gap: 20px; }
.section-block { display: flex; flex-direction: column; gap: 10px; flex: none; }
.section-label { padding-left: 2px; }
.apt-list { display: flex; flex-direction: column; gap: 10px; }
.apt-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
}
.apt-address { font-size: 13px; color: var(--dim); line-height: 1.5; }
.apt-roster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.apt-person {
  font-size: 12px;
  color: var(--dim);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.apt-person.is-me {
  color: var(--bg);
  background: var(--ink-strong);
}

/* ---- Beer-mile ---- */
.bm-header { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
.back-btn {
  align-self: flex-start;
  margin-bottom: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  cursor: pointer;
}
.back-btn:active { color: var(--ink); }

.item-link {
  align-self: flex-start;
  margin-top: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}
.item-link:active { background: var(--line-soft); }
.item-link .arrow { font-size: 11px; }

.bm-lock {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 32px 24px;
  margin-top: 8px;
}
.bm-seal {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--line-soft);
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* Arrangørens nødluke: holdes seglet inne, krymper det til lagene slippes */
  transition: transform 1500ms linear, background 240ms ease;
}
.bm-seal svg { width: 26px; height: 26px; }
.bm-seal.holding { transform: scale(0.86); background: var(--chip); }
.bm-lock-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.bm-lock-sub {
  font-size: 13px;
  line-height: 1.5;
  color: var(--faint);
  max-width: 24ch;
}
.bm-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--line-soft);
  border-radius: 999px;
  padding: 6px 14px;
}
.bm-lock .btn-primary { width: 100%; margin-top: 4px; }
.bm-lock[hidden] { display: none; }

.bm-teams { display: flex; flex-direction: column; gap: 12px; }
.bm-teams[hidden] { display: none; }
.bm-team {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: bm-in 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.bm-team.is-mine { border-color: var(--chip); }
.bm-team-note { font-size: 12px; color: var(--faint); }
.bm-roster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}
.bm-member {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--dim);
}
.bm-member.is-me { color: var(--ink); font-weight: 500; }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.bm-member.is-me .avatar-sm { background: var(--ink-strong); color: var(--bg); }

@keyframes bm-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-team { animation: none; }
  .bm-seal { transition: background 240ms ease; }
}

.person {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  flex: none;
}
.person-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.person-name { font-size: 14px; font-weight: 500; color: var(--ink); }
.person-role { font-size: 12px; color: var(--faint); }
.person-phone { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.me-badge {
  font-size: 11px;
  color: var(--bg);
  background: var(--ink-strong);
  border-radius: 999px;
  padding: 3px 8px;
  flex: none;
}
.change-me {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 4px 2px;
  font: inherit;
  font-size: 12px;
  color: var(--faint);
  text-decoration: underline;
  cursor: pointer;
}

/* ---- Pakking ---- */
.packed-label { font-size: 12px; color: var(--faint); margin-top: 4px; }
.pack-item {
  width: 100%;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border-left: none; border-right: none; border-top: none;
  font: inherit;
  text-align: left;
}
.checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--chip);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
}
.pack-item.checked .checkbox {
  background: var(--ink-strong);
  border-color: var(--ink-strong);
  color: var(--bg);
}
.pack-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pack-label { font-size: 14px; color: var(--ink); }
.pack-note { font-size: 12px; color: var(--ghost); }

/* ---- Onboarding ---- */
.onboarding { z-index: 50; background: var(--bg); position: absolute; inset: 0; }
.ob-header {
  padding: calc(env(safe-area-inset-top, 0px) + 26px) 24px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ob-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ob-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--dim);
  text-wrap: pretty;
}
.choice {
  width: 100%;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border-left: none; border-right: none; border-top: none;
  font: inherit;
  text-align: left;
}
.choice-radio {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--chip);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
}
.choice.selected .choice-radio {
  background: var(--ink-strong);
  border-color: var(--ink-strong);
  color: var(--bg);
}
.ob-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 20px calc(env(safe-area-inset-bottom, 0px) + 26px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ob-footer .btn-primary { padding: 12px; }
.btn-primary:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ---- Tab bar ---- */
.tabbar {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  flex: none;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.tab-icon {
  width: 20px;
  height: 20px;
  color: var(--ghost);
}
.tab-label { font-size: 10px; color: var(--ghost); }
.tab.active .tab-icon { color: var(--ink-strong); }
.tab.active .tab-label { color: var(--ink-strong); }

/* Hover-effekter kun der det finnes en ekte peker (ikke touch) */
@media (hover: hover) {
  .btn-primary:hover { background: var(--ink-hover); }
  .link-card:hover { border-color: var(--chip); }
  .day-head:hover { background: var(--bg); }
  .person:hover { background: var(--bg); }
  .change-me:hover { color: var(--dim); }
  .pack-item:hover { background: var(--bg); }
  .choice:hover { background: var(--bg); }
}

/* Desktop: sentrert innholdskolonne med flytende navigasjon nederst */
@media (min-width: 768px) {
  .app {
    max-width: none;
    display: flex;
    flex-direction: column;
  }

  /* Innhold sentreres i en kolonne, tekst venstrejustert i kolonnen */
  .view-header {
    padding: 44px 32px 18px;
    background: transparent;
    border-bottom: 1px solid var(--line);
    align-items: center;
  }
  .view-header > * {
    width: 100%;
    max-width: 760px;
  }
  .view-title { font-size: 26px; }

  .scroll {
    padding: 28px 32px 128px;
    align-items: center;
    gap: 14px;
  }
  .scroll > * {
    width: 100%;
    max-width: 760px;
  }

  /* Hjem */
  .home-scroll { padding: 56px 32px 128px; }
  #view-hjem { background: none; }
  .home-head { padding: 0; }
  .home-title { font-size: 40px; }
  .home-lede { font-size: 15px; max-width: 560px; }
  .flap-board { justify-content: center; gap: 18px; }
  .link-stack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  /* Kort i grid der det er flere av dem */
  .flight-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .apt-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }
  .day-list { gap: 14px; }

  /* Onboarding sentrert */
  .ob-header, .ob-footer {
    align-items: center;
    padding-left: 32px;
    padding-right: 32px;
  }
  .ob-header > *, .ob-footer > * {
    width: 100%;
    max-width: 520px;
  }
  .ob-scroll { align-items: center; }
  .ob-scroll > * { width: 100%; max-width: 520px; }

  /* Flytende navigasjon nederst */
  .tabbar {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    width: auto;
    gap: 4px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    box-shadow: 0 14px 40px -14px rgba(9, 9, 11, 0.32);
  }
  .tab {
    flex-direction: row;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    transition: background 140ms ease, color 140ms ease;
  }
  .tab-icon { width: 17px; height: 17px; }
  .tab-label { font-size: 13px; font-weight: 500; }
  .tab.active { background: var(--ink-strong); }
  .tab.active .tab-icon,
  .tab.active .tab-label { color: var(--bg); }

  /* Pull-down-easter-egget er en mobilgreie */
  .scrim, .roger, .roger-cap { display: none; }
}

/* Brede skjermer: litt mer luft i kolonnen */
@media (min-width: 1180px) {
  .view-header > *,
  .scroll > * { max-width: 840px; }
}
