/* Klikbar Spireby-telefon (se demo.js) */
.spd {
  --spd-accent: #2f9e6e;
  --spd-accent-deep: #1e6b47;
  --spd-soft: #e7f7ee;
  --spd-ink: #1d2b24;
  --spd-muted: #61736a;
  --spd-line: #e4e8e3;
  display: grid;
  grid-template-columns: minmax(190px, 240px) auto minmax(250px, 330px);
  scroll-margin-top: 84px;
  gap: clamp(20px, 3vw, 44px);
  align-items: center;
  justify-content: center;
  text-align: left;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--spd-ink);
  --spd-status: 36px;
  --spd-header: 49px;
}
.spd[data-mode="foraelder"] {
  --spd-accent: #1d7c8a;
  --spd-accent-deep: #155e69;
  --spd-soft: #e2f2f4;
}
.spd [hidden] { display: none !important; }
.spd > * { min-width: 0; } /* ellers gør den lange række af sider gitteret bredere end skærmen */
.spd svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- Venstre: skift side + liste ---------------------------------------- */
.spd-left { display: flex; flex-direction: column; gap: 16px; align-self: center; }
.spd-toggle {
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px;
  background: #fff; border: 1px solid var(--spd-line); border-radius: 999px;
  box-shadow: 0 6px 18px -12px rgba(20, 50, 35, .35);
}
.spd-tab {
  appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit;
  font-size: 13.5px; font-weight: 700; color: var(--spd-muted);
  padding: 10px 12px; border-radius: 999px; transition: background .2s, color .2s;
}
.spd-tab:hover { color: var(--spd-ink); }
.spd-tab.on { background: var(--spd-accent); color: #fff; box-shadow: 0 6px 14px -8px var(--spd-accent); }
.spd-tab:focus-visible, .spd-item:focus-visible, .spd-other:focus-visible, .spd-spot:focus-visible, .spd-burger:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--spd-accent) 45%, transparent); outline-offset: 2px;
}
.spd-list { display: flex; flex-direction: column; gap: 2px; }

/* Pilen ved den anden part */
.spd-toggle-wrap { position: relative; width: min(360px, 100%); }
.spd-toggle-wrap .spd-toggle { width: 100%; }
.spd-hint {
  --hint: #1d7c8a;
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  appearance: none; border: 0; background: none; cursor: pointer; padding: 6px 4px;
  font: inherit; font-size: 14.5px; font-weight: 800; color: var(--hint);
}
.spd-toggle-wrap[data-anden="pasning"] .spd-hint { --hint: #2f9e6e; }
.spd-hint svg { width: 40px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.spd-toggle-wrap[data-pos="hoejre"] .spd-hint { left: calc(100% + 10px); animation: spd-mod-v 1.8s ease-in-out infinite; }
.spd-toggle-wrap[data-pos="venstre"] .spd-hint { right: calc(100% + 10px); animation: spd-mod-h 1.8s ease-in-out infinite; }
.spd-hint:hover span { text-decoration: underline; text-underline-offset: 3px; }
@keyframes spd-mod-v { 0%, 100% { translate: 0 0; } 50% { translate: -6px 0; } }
@keyframes spd-mod-h { 0%, 100% { translate: 0 0; } 50% { translate: 6px 0; } }
.spd-item {
  appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit; text-align: left;
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; color: var(--spd-muted); transition: background .15s, color .15s;
}
.spd-item svg { width: 19px; height: 19px; flex: none; }
.spd-item:hover { background: #fff; color: var(--spd-ink); }
.spd-item.on { background: var(--spd-soft); color: var(--spd-accent-deep); }

/* --- Midten: telefonen ---------------------------------------------------- */
.spd-mid { position: relative; display: flex; flex-direction: column; align-items: center; }
/* En rigtig iPhone: titaniumramme, sort kant og Dynamic Island. Alle mål følger
   telefonens bredde (--w), så den ser ens ud i alle størrelser. */
.spd-phone {
  --w: clamp(280px, min(30vw, calc((100vh - 120px) * .46)), 400px);
  --w: clamp(280px, min(30vw, calc((100svh - 120px) * .46)), 400px);
  --kant: calc(var(--w) * .032);
  position: relative;
  width: var(--w);
  padding: 3px;
  border-radius: calc(var(--w) * .178);
  background: linear-gradient(135deg, #dcdee1 0%, #a2a7ad 16%, #f2f3f5 36%, #8c9197 60%, #d3d6da 80%, #9ba0a6 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .22),
    inset 0 0 0 1px rgba(255, 255, 255, .5),
    0 70px 110px -50px rgba(12, 40, 24, .55),
    0 34px 54px -34px rgba(12, 40, 24, .4);
}
.spd-phone::before, .spd-phone::after { /* knapperne i siden */
  content: ""; position: absolute; width: 3px; border-radius: 2px;
  background: linear-gradient(90deg, #8c9197, #d3d6da);
}
.spd-phone::before { left: -3px; top: 19%; height: 5%; box-shadow: 0 calc(var(--w) * .13) 0 #a9adb2, 0 calc(var(--w) * .26) 0 #a9adb2; }
.spd-phone::after { right: -3px; top: 29%; height: 14%; background: linear-gradient(270deg, #8c9197, #d3d6da); }
.spd-screen {
  position: relative;
  aspect-ratio: 390 / 844;
  border: var(--kant) solid #050505;
  border-radius: calc(var(--w) * .165);
  overflow: hidden;
  background: #faf9f5;
  isolation: isolate;
}
.spd-status {
  position: absolute; inset: 0 0 auto 0; height: var(--spd-status); z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8.5% 0 11%; background: #fff; color: #111;
  font-size: calc(var(--spd-status) * .36); font-weight: 700; letter-spacing: -.01em;
}
.spd-island {
  position: absolute; left: 50%; top: 17%; transform: translateX(-50%);
  width: 31%; height: 64%; border-radius: 999px; background: #000;
}
.spd-sys { display: flex; align-items: center; gap: 5px; }
.spd-sys svg { height: calc(var(--spd-status) * .27); width: auto; fill: currentColor; stroke: none; }
.spd-sys svg + svg { height: calc(var(--spd-status) * .3); }
.spd-view {
  position: absolute; top: var(--spd-status); left: 0; right: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  transition: opacity .16s ease, transform .16s ease;
}
.spd-view::-webkit-scrollbar { display: none; }
.spd-view.spd-fade { opacity: 0; transform: translateY(6px); }
.spd-view:focus-visible { outline: none; }
.spd-canvas { position: relative; }
.spd-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.spd-hot { position: absolute; inset: 0; }
.spd-spot {
  position: absolute; appearance: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  background: transparent; border-radius: 10px; transition: background .15s;
}
.spd-spot:hover { background: rgba(47, 158, 110, .10); }
.spd[data-mode="foraelder"] .spd-spot:hover { background: rgba(29, 124, 138, .12); }
.spd-spot-dim:hover { background: transparent; }
.spd-head {
  position: absolute; left: 0; right: 0; top: var(--spd-status); height: var(--spd-header); z-index: 3;
  background-repeat: no-repeat; background-position: 0 0; background-size: 100% auto;
}
.spd-burger {
  position: absolute; left: 0; top: 0; width: 21%; height: 100%;
  appearance: none; border: 0; background: transparent; cursor: pointer; border-radius: 12px;
}
.spd-burger::after { /* pulserende ring, indtil man har prøvet */
  content: ""; position: absolute; left: 50%; top: 50%; width: 58%; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  box-shadow: 0 0 0 3px var(--spd-accent); opacity: .9;
  animation: spd-puls 1.8s ease-out infinite;
}
.spd-rort .spd-burger::after { display: none; }
.spd-burger:hover { background: rgba(0, 0, 0, .04); }
@keyframes spd-puls {
  0% { transform: translate(-50%, -50%) scale(.8); opacity: .95; }
  80%, 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}
.spd-homebar {
  position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); z-index: 5;
  width: 36%; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .78); pointer-events: none;
}

/* Forklaring inde i telefonen (fx galleriet) */
.spd-toast {
  position: absolute; left: 4.5%; right: 4.5%; bottom: 22px; z-index: 6;
  background: #fff; border-radius: 18px; padding: 15px 38px 15px 16px;
  box-shadow: 0 18px 40px -12px rgba(10, 30, 20, .45), 0 0 0 1px rgba(0, 0, 0, .04);
  font-size: 12.5px; line-height: 1.45; color: var(--spd-muted);
  transform: translateY(16px); opacity: 0; transition: transform .22s ease, opacity .22s ease;
}
.spd-toast.on { transform: none; opacity: 1; }
.spd-toast b { display: block; color: var(--spd-ink); font-size: 13.5px; margin-bottom: 3px; }
.spd-toast-link { display: inline-block; margin-top: 7px; font-weight: 700; color: var(--spd-accent-deep); text-decoration: none; }
.spd-toast-x {
  position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%;
  appearance: none; border: 0; background: #f1f3f1; color: var(--spd-muted); font-size: 16px; line-height: 1; cursor: pointer;
}

/* "Prøv selv"-boblen sidder inde i telefonen, lige under ☰ */
.spd-tip {
  position: absolute; z-index: 7;
  left: calc(3px + var(--kant) + 10px); top: calc(3px + var(--kant) + var(--spd-status) + var(--spd-header) + 8px);
  display: block; width: max-content; max-width: 200px;
  background: var(--spd-ink); color: #fff; padding: 10px 14px; border-radius: 14px;
  font-size: 13px; line-height: 1.4; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45);
  animation: spd-svaev 2.4s ease-in-out infinite; transition: opacity .3s, transform .3s;
}
.spd-tip b { display: block; color: #9fe6c1; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1px; }
.spd[data-mode="foraelder"] .spd-tip b { color: #9ddbe3; }
.spd-tip::after {
  content: ""; position: absolute; left: 18px; top: -6px; width: 12px; height: 12px;
  background: var(--spd-ink); transform: rotate(45deg); border-radius: 2px;
}
.spd-kbd { display: inline-block; font-weight: 800; padding: 0 2px; }
.spd-tip-væk { opacity: 0; pointer-events: none; transform: translateY(-6px); animation: none; }
@keyframes spd-svaev { 0%, 100% { translate: 0 0; } 50% { translate: 0 4px; } }

/* --- Højre: forklaring ---------------------------------------------------- */
.spd-card {
  background: #fff; border: 1px solid var(--spd-line); border-radius: 22px; padding: 24px 24px 22px;
  box-shadow: 0 24px 50px -34px rgba(20, 50, 35, .45);
}
.spd-role {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; color: var(--spd-accent-deep);
}
.spd-role::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--spd-accent); }
.spd-title {
  display: flex; align-items: center; gap: 11px; margin: 14px 0 0;
  font-family: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif;
  font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
}
.spd-title svg {
  width: 38px; height: 38px; flex: none; padding: 8px; border-radius: 12px;
  background: var(--spd-soft); color: var(--spd-accent-deep);
}
.spd-text { margin: 12px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--spd-muted); }
.spd-scrolltip {
  display: flex; align-items: center; gap: 7px; margin: 14px 0 0;
  font-size: 13px; font-weight: 600; color: var(--spd-muted);
}
.spd-scrolltip svg { width: 16px; height: 16px; animation: spd-ned 1.6s ease-in-out infinite; }
@keyframes spd-ned { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.spd-other {
  appearance: none; cursor: pointer; font: inherit; width: 100%; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; padding: 13px 16px; border-radius: 14px;
  border: 1.5px solid color-mix(in srgb, var(--spd-accent) 30%, #fff);
  background: color-mix(in srgb, var(--spd-soft) 60%, #fff);
  color: var(--spd-accent-deep); font-size: 14px; font-weight: 700;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.spd-other svg { width: 18px; height: 18px; flex: none; transition: transform .15s; }
.spd-other:hover { background: var(--spd-soft); box-shadow: 0 10px 22px -16px var(--spd-accent); }
.spd-other:hover svg { transform: translateX(3px); }
.spd[data-mode="pasning"] .spd-other { /* knappen fører over på forældresiden: teal */
  --spd-accent: #1d7c8a; --spd-accent-deep: #155e69; --spd-soft: #e2f2f4;
}
.spd[data-mode="foraelder"] .spd-other {
  --spd-accent: #2f9e6e; --spd-accent-deep: #1e6b47; --spd-soft: #e7f7ee;
}

/* --- Computerudgaven: appen i en bærbar ------------------------------------ */
.spd-laptop { display: none; }
.spd.spd-pc { grid-template-columns: 1fr; justify-items: center; gap: 22px; }
.spd.spd-pc .spd-phone { display: none; }
.spd.spd-pc .spd-left { flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.spd.spd-pc .spd-toggle-wrap { width: min(360px, 100%); }
/* Siderne i én samlet bjælke på én linje, i samme stil som knappen over den */
.spd.spd-pc .spd-list {
  display: flex; flex-direction: row; flex-wrap: nowrap; gap: 2px; max-width: 100%;
  padding: 4px; background: #fff; border: 1px solid var(--spd-line); border-radius: 999px;
  box-shadow: 0 6px 18px -12px rgba(20, 50, 35, .35);
  overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth;
}
.spd.spd-pc .spd-list::-webkit-scrollbar { display: none; }
/* Er der flere sider end der er plads til, toner kanterne ud, så man kan se at bjælken kan skubbes */
.spd.spd-pc .spd-list.ruller {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 30px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 30px), transparent 100%);
}
.spd.spd-pc .spd-item {
  flex: none; padding: 8px 12px; border: 0; border-radius: 999px; background: transparent;
  font-size: 13px; font-weight: 700; color: var(--spd-muted); white-space: nowrap;
}
.spd.spd-pc .spd-item svg { display: none; }
.spd.spd-pc .spd-item:hover { background: var(--spd-soft); color: var(--spd-accent-deep); }
.spd.spd-pc .spd-item.on { background: var(--spd-accent); color: #fff; box-shadow: 0 6px 14px -8px var(--spd-accent); }
.spd.spd-pc .spd-mid { width: 100%; }
.spd.spd-pc .spd-laptop { display: block; }
.spd-laptop {
  --lw: min(1000px, calc((100vh - 290px) * 1.5), 100%);
  --lw: min(1000px, calc((100svh - 290px) * 1.5), 100%);
  width: var(--lw); margin: 0 auto; position: relative;
}
.spd-lid {
  position: relative; padding: calc(var(--lw) * .026);
  background: #121315; border-radius: calc(var(--lw) * .045);
  box-shadow: 0 0 0 1.5px #9ea3a9, 0 0 0 4px #d9dcdf, 0 0 0 5px #b3b7bc, 0 60px 100px -50px rgba(12, 40, 24, .5);
}
.spd-lid::before { /* kamera */
  content: ""; position: absolute; top: calc(var(--lw) * .01); left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: #2a2d31; box-shadow: inset 0 0 0 1.5px #1a1c1f;
}
.spd-lscreen { position: relative; overflow: hidden; border-radius: calc(var(--lw) * .02); background: #fff; isolation: isolate; }
.spd-lbar {
  position: relative; z-index: 4; height: 36px; display: flex; align-items: center; gap: 14px; padding: 0 14px;
  background: #f1f2f4; border-bottom: 1px solid #e1e3e6;
}
.spd-dots { display: flex; gap: 7px; }
.spd-dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.spd-dots i:nth-child(2) { background: #febc2e; }
.spd-dots i:nth-child(3) { background: #28c840; }
.spd-url {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 42%;
  padding: 5px 16px; border-radius: 8px; background: #fff; border: 1px solid #e3e5e8;
  font-size: 12.5px; font-weight: 600; color: #4a4f55;
}
.spd-url svg { width: 12px; height: 12px; color: #7a8087; }
.spd-dview {
  position: relative; aspect-ratio: 1280 / 800; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  scrollbar-width: thin; transition: opacity .16s ease;
}
.spd-dview.spd-fade { opacity: 0; }
.spd-dview:focus-visible { outline: none; }
.spd-dfast { position: absolute; top: 36px; left: 0; z-index: 3; background-repeat: no-repeat; background-position: 0 0; background-size: 100% auto; }
.spd-dfast .spd-hot { position: absolute; inset: 0; }
.spd-ipad .spd-base { display: none; }
.spd-base {
  position: relative; height: calc(var(--lw) * .026); width: 114%; margin-left: -7%;
  background: linear-gradient(180deg, #e6e8eb 0%, #c9ccd1 55%, #a7abb1 100%);
  border-radius: 2px 2px calc(var(--lw) * .018) calc(var(--lw) * .018) / 2px 2px calc(var(--lw) * .012) calc(var(--lw) * .012);
  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .45);
}
.spd-base::before { /* fordybningen til at åbne låget */
  content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 15%; height: 42%; border-radius: 0 0 10px 10px; background: linear-gradient(180deg, #c3c6cb, #d8dadd);
}
.spd-ltoast { left: 50%; right: auto; width: min(420px, 80%); transform: translate(-50%, 16px); bottom: 24px; }
.spd-ltoast.on { transform: translate(-50%, 0); }
.spd-ltip { left: calc(var(--spd-pcside, 200px) + 14px); top: calc(36px + var(--spd-pctop, 0px) + 60px); }
.spd-ltip::after { left: -6px; top: 16px; }
.spd.spd-pc .spd-right { width: var(--lw, 100%); max-width: 1060px; }
.spd.spd-pc .spd-card {
  display: grid; grid-template-columns: auto 1fr auto; column-gap: 22px; align-items: center; padding: 20px 24px;
}
.spd.spd-pc .spd-role { grid-column: 1 / -1; }
.spd.spd-pc .spd-title { margin-top: 10px; font-size: 22px; }
.spd.spd-pc .spd-text { margin-top: 10px; font-size: 15px; grid-column: 2; grid-row: 2 / span 2; }
.spd.spd-pc .spd-scrolltip { grid-column: 1; grid-row: 3; margin-top: 6px; }
.spd.spd-pc .spd-other { grid-column: 3; grid-row: 2 / span 2; width: auto; margin-top: 0; }

@media (max-width: 760px) {
  .spd-hint { position: static; transform: none; margin-top: 6px; font-size: 13.5px; }
  .spd-toggle-wrap { display: flex; flex-direction: column; }
  .spd-toggle-wrap[data-pos="hoejre"] .spd-hint { align-self: flex-end; animation-name: spd-op; }
  .spd-toggle-wrap[data-pos="venstre"] .spd-hint { align-self: flex-start; animation-name: spd-op; }
  .spd-hint svg { display: none; }
  .spd-hint::before { content: "↑"; font-size: 18px; line-height: 1; }
}
@keyframes spd-op { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .spd-hint { animation: none !important; } }
@media (max-width: 720px) {
  .spd.spd-pc .spd-list { display: flex !important; width: 100%; }
  .spd.spd-pc .spd-item { padding: 8px 12px; font-size: 13px; }
  .spd.spd-pc .spd-card { display: block; padding: 18px; }
  .spd.spd-pc .spd-other { width: 100%; margin-top: 14px; }
  .spd-lbar { height: 26px; gap: 8px; padding: 0 9px; }
  .spd-dots i { width: 7px; height: 7px; }
  .spd-dots { gap: 5px; }
  .spd-url { font-size: 10px; padding: 3px 10px; gap: 4px; }
  .spd-url svg { width: 9px; height: 9px; }
  .spd-dfast { top: 26px; }
  .spd-ltip { display: none; }
}

/* --- Mindre skærme -------------------------------------------------------- */
@media (max-width: 1080px) {
  .spd { grid-template-columns: auto minmax(260px, 360px); }
  .spd-left { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
  .spd-toggle { width: min(340px, 100%); }
  .spd-list { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; }
  .spd-item { padding: 7px 12px; font-size: 13.5px; background: #fff; border: 1px solid var(--spd-line); border-radius: 999px; }
  .spd-item svg { width: 16px; height: 16px; }
  .spd-item.on { border-color: transparent; }
}
@media (max-width: 720px) {
  .spd { grid-template-columns: 1fr; gap: 18px; }
  .spd-left { order: 1; }
  .spd-toggle { width: 100%; max-width: 360px; }
  .spd-list { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; width: 100%; padding: 2px 2px 8px; scrollbar-width: none; }
  .spd-list::-webkit-scrollbar { display: none; }
  .spd-item { flex: none; }
  .spd-mid { order: 2; }
  .spd-right { order: 3; }
  /* På mobil skal hele telefonen kunne ses på én gang. Rækken med sider skjules,
     for menuen inde i telefonen gør det samme og fylder ikke ekstra. */
  .spd { scroll-margin-top: 68px; }
  .spd-list { display: none; }
  .spd-phone { --w: min(88vw, calc((100vh - 150px) * .46), 380px); --w: min(88vw, calc((100svh - 150px) * .46), 380px); }
  .spd-title { font-size: 22px; }
  .spd-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .spd-burger::after, .spd-tip, .spd-scrolltip svg { animation: none; }
  .spd-view, .spd-toast { transition: none; }
}
