/* 3D-modell på analyssidan (app.js model3dHtml, js/m3d.js). Laddas bara på sidor med sektionen. Iframen laddas först när man klickar. */
.m3d { margin-top: 48px; }
.m3d__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 16px; }
.m3d__head h2 { font-size: 26px; letter-spacing: -0.025em; }
.m3d__head p { font-size: 15px; color: var(--muted); }
.m3d__stage { position: relative; aspect-ratio: 16 / 8; min-height: 320px; border-radius: var(--r); overflow: hidden; background: #DFE7EE; }
.m3d__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 45%; }
.m3d__poster-btn { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.m3d__poster-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17,20,23,.42) 0%, rgba(17,20,23,.12) 45%, rgba(17,20,23,0) 70%); transition: background .2s; }
.m3d__cta { position: absolute; left: 28px; bottom: 28px; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; text-align: left; }
.m3d__cta .btn { background: #fff; color: var(--ink); box-shadow: 0 2px 14px rgba(17,20,23,.18); }
.m3d__poster-btn:hover .m3d__cta .btn { background: var(--ink); color: #fff; }
.m3d__cta .btn svg { transform: none !important; }
.m3d__cta small { color: #fff; font-size: 14px; font-weight: 500; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.m3d__chips { position: absolute; left: 28px; top: 24px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.m3d__chips span { padding: 5px 10px; border-radius: 999px; background: rgba(17,20,23,.72); color: #fff; font-size: 12.5px; font-weight: 500; backdrop-filter: blur(6px); }
.m3d__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.m3d__loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; color: var(--muted); pointer-events: none; }
.m3d__tools { position: absolute; left: 12px; top: 12px; z-index: 3; display: none; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(255,255,255,.92); box-shadow: 0 2px 12px rgba(0,0,0,.12); backdrop-filter: blur(8px); }
.m3d.is-live .m3d__tools { display: flex; }
.m3d__tools button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink); background: none; border: 0; border-radius: 7px; padding: 7px 10px; cursor: pointer; }
.m3d__tools button:hover { background: rgba(0,0,0,.06); }
.m3d__tools svg { width: 16px; height: 16px; }
.m3d .m3d__exit { display: none; }
.m3d.is-full .m3d__exit { display: inline-flex; }
.m3d.is-full .m3d__enter { display: none; }
.m3d__note { margin-top: 10px; font-size: 13px; color: var(--faint); max-width: 820px; }
/* Helskärm: riktig fullscreen där det finns, annars (iPhone) ett lager över sidan. */
.m3d__stage:fullscreen { aspect-ratio: auto; border-radius: 0; }
.m3d.is-overlay .m3d__stage { position: fixed; inset: 0; z-index: 1000; aspect-ratio: auto; min-height: 0; margin: 0; border-radius: 0; }
body.m3d-lock { overflow: hidden; }
.m3d-link { white-space: nowrap; }

@media (max-width: 680px) {
  .m3d { margin-top: 36px; }
  .m3d__head h2 { font-size: 22px; }
  .m3d__stage { aspect-ratio: 4 / 3.4; min-height: 0; margin-inline: -18px; border-radius: 0; }
  .m3d__poster { object-position: 66% 50%; }
  .m3d__cta { left: 18px; right: 18px; bottom: 18px; }
  .m3d__cta .btn { width: 100%; }
  .m3d__chips { left: 18px; top: 16px; }
  .m3d__poster-btn::after { background: linear-gradient(0deg, rgba(17,20,23,.45) 0%, rgba(17,20,23,0) 50%); }
}

/* Helskärmslagret får en egen rad överst, så att våra knappar inte ligger på visningens. */
.m3d__bar-title { display: none; }
.m3d.is-overlay .m3d__tools { left: 0; right: 0; top: 0; height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); align-items: center; justify-content: space-between; border-radius: 0; background: #fff; box-shadow: none; border-bottom: 1px solid var(--line); }
.m3d.is-overlay .m3d__bar-title { display: block; font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m3d.is-overlay .m3d__bar-title span { font-weight: 400; color: var(--muted); }
.m3d.is-overlay .m3d__frame { top: calc(52px + env(safe-area-inset-top)); height: calc(100% - 52px - env(safe-area-inset-top)); }
