/* ESTATIQS – gemeinsame Bausteine für Desktop (index.html) und Handy (mobil.html)
   Glas (Apple-artig, klar statt milchig), Anzeigen-Vorschauen (Facebook-Feed, Instagram-Reel, Google),
   Budgetrechner und Kampagnen-Cockpit. Nutzt die Farb-Tokens der jeweiligen Seite (--ink, --muted, --line …). */

/* ---------- Glas ---------- */
:where(.lg) { position: relative; } /* ohne Gewicht: absolut positionierte Glasflächen behalten ihre Lage */
.lg {
  /* Klares Glas: kaum Tönung, leichte Unschärfe, kräftige Lichtkanten oben links, weicher Glanz oben */
  --lg-tint: rgba(255, 255, 255, 0.04);
  isolation: isolate;
  background: radial-gradient(130% 150% at 8% 0%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 52%), var(--lg-tint);
  -webkit-backdrop-filter: blur(4px) saturate(210%) brightness(1.08) contrast(1.04);
  backdrop-filter: blur(4px) saturate(210%) brightness(1.08) contrast(1.04);
  box-shadow:
    inset 1.5px 1.5px 0.5px -0.5px rgba(255, 255, 255, 0.95),
    inset -1px -1px 0.5px -0.5px rgba(255, 255, 255, 0.6),
    inset 0 0 0 0.75px rgba(255, 255, 255, 0.34),
    inset 0 0 24px rgba(255, 255, 255, 0.12),
    inset 0 -12px 20px -16px rgba(255, 255, 255, 0.5),
    0 1px 2px rgba(10, 12, 18, 0.06),
    0 16px 36px -18px rgba(10, 12, 18, 0.3);
}
.lg::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1.25px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.35) 18%, rgba(255, 255, 255, 0) 42%,
              rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.4) 86%, rgba(255, 255, 255, 0.75) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.lg::after {
  content: ""; position: absolute; inset: 1px; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.04) 34%, rgba(255, 255, 255, 0) 60%);
}
.lg--dark {
  --lg-tint: rgba(12, 14, 20, 0.16);
  color: #fff;
  background: radial-gradient(130% 150% at 8% 0%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 50%), var(--lg-tint);
  -webkit-backdrop-filter: blur(5px) saturate(180%) brightness(0.86);
  backdrop-filter: blur(5px) saturate(180%) brightness(0.86);
  box-shadow:
    inset 1.5px 1.5px 0.5px -0.5px rgba(255, 255, 255, 0.75),
    inset -1px -1px 0.5px -0.5px rgba(255, 255, 255, 0.32),
    inset 0 0 0 0.75px rgba(255, 255, 255, 0.2),
    inset 0 0 22px rgba(255, 255, 255, 0.06),
    0 18px 40px -18px rgba(0, 0, 0, 0.5);
}
.lg--dark::before { opacity: 0.7; }
.lg--dark::after { opacity: 0.55; }

/* ---------- Anzeigen-Vorschau ---------- */
.adsx { container-type: inline-size; }
.adsx__grid { display: grid; gap: 28px; }
@container (min-width: 820px) { .adsx__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: 56px; } }
.adsx__side .h3, .adsx__side .mh3 { margin: 0 0 18px; }
.adsx__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.adsx__desc { margin: 16px 0 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.adsx__facts { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 0; }
.adsx__facts li { display: grid; grid-template-columns: 84px 1fr; align-items: baseline; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.adsx__facts b { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.adsx__facts span { font-size: 15px; color: var(--muted); }
.adsx__note { margin: 14px 0 0; font-size: 13.5px; color: var(--muted, #6e6e73); }
.adsx__stage { position: relative; display: grid; justify-items: center; }
.adsx__view { grid-area: 1 / 1; width: 100%; display: grid; justify-items: center; opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.45s; }
.adsx__view.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.adsx__desc { min-height: 4.5em; }

/* Facebook-Feed (Nachbau der App-Ansicht) */
.fb-feed { width: min(380px, 100%); padding: 8px 0; border-radius: 22px; background: #f0f2f5; box-shadow: 0 30px 60px -36px rgba(10, 12, 18, 0.45); }
.fb {
  --fb-ink: #050505; --fb-sub: #65676b; --fb-line: #ced0d4; --fb-blue: #0866ff;
  background: #fff; color: var(--fb-ink); text-align: left;
  font: 15px/1.3333 -apple-system, BlinkMacSystemFont, "Segoe UI Historic", "Segoe UI", Helvetica, Arial, sans-serif;
}
.fb svg { display: block; }
.fb__head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0 16px; }
.fb__avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #1d1d1f; color: #fff; font: 600 13px/1 var(--display, sans-serif); letter-spacing: 0.02em; }
.fb__who { flex: 1; min-width: 0; }
.fb__who b { display: block; font-size: 15px; font-weight: 600; }
.fb__who span { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--fb-sub); }
.fb__who span svg { width: 12px; height: 12px; }
.fb__icons { display: flex; gap: 6px; color: var(--fb-sub); }
.fb__icons svg { width: 20px; height: 20px; padding: 6px; box-sizing: content-box; }
.fb__text { margin: 0; padding: 6px 16px 12px; font-size: 15px; }
.fb__more { color: var(--fb-sub); font-weight: 600; }
.fb__media { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.fb__link { display: flex; align-items: center; gap: 12px; padding: 10px 12px 12px 16px; background: #f0f2f5; }
.fb__link div { flex: 1; min-width: 0; }
.fb__link small { display: block; font-size: 13px; color: var(--fb-sub); text-transform: uppercase; letter-spacing: 0.01em; }
.fb__link b { display: block; font-size: 16px; font-weight: 600; line-height: 1.25; }
.fb__link span:not(.fb__cta) { display: block; font-size: 14px; color: var(--fb-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb__cta { flex: none; padding: 8px 12px; border-radius: 6px; background: #e2e5e9; font-size: 15px; font-weight: 600; }
.fb__stats { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 16px; padding: 10px 0; border-bottom: 1px solid var(--fb-line); font-size: 14px; color: var(--fb-sub); }
.fb__reacts { display: inline-flex; align-items: center; gap: 6px; }
.fb__reacts i { display: inline-flex; margin-right: -9px; border-radius: 50%; border: 2px solid #fff; }
.fb__reacts i:last-of-type { margin-right: 0; }
.fb__reacts svg { width: 18px; height: 18px; }
.fb__actions { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px 8px; }
.fb__actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; border-radius: 6px; font: inherit; font-size: 15px; font-weight: 600; color: var(--fb-sub); }
.fb__actions button:hover { background: #f2f2f2; }
.fb__actions button svg { width: 20px; height: 20px; }
.fb__actions button.is-liked { color: var(--fb-blue); }
.fb__next { height: 54px; margin-top: 8px; background: #fff; border-radius: 0 0 0 0; position: relative; }
.fb__next::before { content: ""; position: absolute; left: 16px; top: 12px; width: 40px; height: 40px; border-radius: 50%; background: #e4e6eb; }
.fb__next::after { content: ""; position: absolute; left: 64px; top: 18px; width: 120px; height: 10px; border-radius: 5px; background: #e4e6eb; box-shadow: 0 16px 0 -2px #eef0f2; }

/* Instagram-Reel */
.ig {
  position: relative; width: min(320px, 100%); aspect-ratio: 9 / 19.5; border-radius: 40px; overflow: hidden; background: #000; color: #fff;
  border: 8px solid #111; box-shadow: 0 0 0 1px #2a2a2e, 0 40px 80px -40px rgba(0, 0, 0, 0.7);
  font: 14px/1.3 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif; text-align: left;
}
.ig svg { display: block; }
.ig__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ig__shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 16%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.62) 100%); }
.ig__island { position: absolute; top: 8px; left: 50%; width: 30%; height: 22px; margin-left: -15%; border-radius: 14px; background: #000; z-index: 3; }
.ig__top { position: absolute; top: 40px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.ig__top b { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.ig__top svg { width: 24px; height: 24px; }
.ig__side { position: absolute; right: 10px; bottom: 92px; display: grid; justify-items: center; gap: 16px; z-index: 2; }
.ig__side button, .ig__side span { display: grid; justify-items: center; gap: 4px; color: #fff; font: inherit; }
.ig__side svg { width: 27px; height: 27px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.ig__side small { font-size: 12.5px; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.ig__side button.is-liked svg { color: #ff3040; fill: #ff3040; }
.ig__audio { width: 28px; height: 28px; border-radius: 7px; overflow: hidden; border: 2px solid #fff; }
.ig__audio img { width: 100%; height: 100%; object-fit: cover; }
.ig__bottom { position: absolute; left: 14px; right: 58px; bottom: 16px; z-index: 2; }
.ig__user { display: flex; align-items: center; gap: 8px; }
.ig__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #1d1d1f; border: 1.5px solid #fff; font-size: 11px; font-weight: 700; }
.ig__user b { font-size: 14px; font-weight: 600; }
.ig__follow { padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.85); border-radius: 8px; font-size: 13px; font-weight: 600; }
.ig__caption { margin: 8px 0 4px; font-size: 14px; line-height: 1.35; }
.ig__caption span { color: rgba(255, 255, 255, 0.7); }
.ig__meta { display: flex; align-items: center; gap: 5px; margin: 0 0 10px; font-size: 12.5px; color: rgba(255, 255, 255, 0.85); }
.ig__meta svg { width: 12px; height: 12px; }
.ig__cta { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 14px; font-weight: 600; }
.ig__cta svg { width: 16px; height: 16px; }
.ig__burst { position: absolute; left: 50%; top: 45%; width: 96px; height: 96px; margin: -48px 0 0 -48px; z-index: 3; color: #fff; opacity: 0; pointer-events: none; }
.ig__burst.is-on { animation: igBurst 0.9s ease-out; }
@keyframes igBurst { 0% { opacity: 0; transform: scale(0.4); } 25% { opacity: 1; transform: scale(1.1); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.05) translateY(-14px); } }

/* Google-Suche */
.gs { width: min(420px, 100%); padding: 18px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 60px -40px rgba(10, 12, 18, 0.45);
  font: 14px/1.45 Arial, Helvetica, sans-serif; color: #202124; text-align: left; }
.gs__bar { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 24px; border: 1px solid #dfe1e5; box-shadow: 0 1px 6px rgba(32, 33, 36, 0.18); font-size: 15px; }
.gs__bar svg { width: 18px; height: 18px; color: #70757a; flex: none; }
.gs__tabs { display: flex; gap: 18px; margin: 12px 4px 14px; font-size: 13px; color: #70757a; border-bottom: 1px solid #ebebeb; }
.gs__tabs span { padding-bottom: 8px; }
.gs__tabs span:first-child { color: #1a73e8; border-bottom: 3px solid #1a73e8; }
.gs__ad b { font-weight: 700; font-size: 12px; }
.gs__site { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.gs__fav { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #f1f3f4; font-size: 11px; font-weight: 700; color: #1d1d1f; }
.gs__site div { font-size: 14px; line-height: 1.25; }
.gs__site small { display: block; font-size: 12px; color: #4d5156; }
.gs__title { margin: 2px 0 4px; font-size: 19px; line-height: 1.3; color: #1a0dab; font-weight: 400; }
.gs__text { margin: 0; color: #4d5156; font-size: 14px; }
.gs__links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 10px; }
.gs__links span { padding: 8px 0; border-top: 1px solid #ebebeb; color: #1a0dab; font-size: 14px; }
.gs__organic { margin-top: 18px; opacity: 0.45; }

/* ---------- Budgetrechner ---------- */
.calc { container-type: inline-size; }
.calc input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; cursor: pointer;
  --fill: 50%; }
.calc input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--ink) var(--fill), #dedee3 var(--fill)); }
.calc input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #dedee3; }
.calc input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--ink); }
.calc input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 0;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(10, 12, 18, 0.22); }
.calc input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(10, 12, 18, 0.22); }

/* ---------- Kampagnen-Cockpit ---------- */
.dash { container-type: inline-size; padding: clamp(20px, 3vw, 32px); border-radius: 24px; background: #0d0f14; color: #f5f5f7; }
.dash__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.dash__live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(245, 245, 247, 0.78); }
.dash__live i { width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.18); animation: dashPulse 1.6s 5; }
@keyframes dashPulse { 50% { box-shadow: 0 0 0 7px rgba(52, 199, 89, 0.05); } }
.dash__head h3 { margin: 0; font-family: var(--display); font-size: clamp(20px, 2vw, 26px); font-weight: 600; letter-spacing: -0.02em; }
.dash__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@container (min-width: 700px) { .dash__tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dash__tile { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); }
.dash__tile span { display: block; font-size: 13px; color: rgba(245, 245, 247, 0.74); }
.dash__tile b { display: block; margin-top: 2px; font-family: var(--display); font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dash__tile em { font-style: normal; font-size: 12px; font-weight: 600; }
.dash__tile em.up { color: #34c759; }
.dash__tile em.down { color: #34c759; }
.dash__chart { margin-top: 16px; }
.dash__chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.dash__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: 13px; color: rgba(245, 245, 247, 0.74); }
.dash__legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.dash__scrub { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: rgba(245, 245, 247, 0.7); }
.dash__scrub output { font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; min-width: 5.5em; text-align: right; }
.dash input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; --fill: 100%; }
.dash input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #f5f5f7 var(--fill), rgba(255, 255, 255, 0.16) var(--fill)); }
.dash input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); }
.dash input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: #f5f5f7; }
.dash input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.dash input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 0; }
.dash__note { margin: 12px 0 0; font-size: 14px; color: rgba(245, 245, 247, 0.74); }

/* ---------- Video-Zustand (Fehler, Datensparmodus) ---------- */
.vstate { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 6; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(14, 16, 22, 0.78); color: #fff;
  font: 500 14px/1.35 var(--body, system-ui, sans-serif); text-align: center; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.vstate:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------- Pause/Play für Autoplay-Videos ---------- */
.vtoggle { position: absolute; right: 10px; bottom: 10px; z-index: 4; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(14, 16, 22, 0.55); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.vtoggle svg { width: 16px; height: 16px; }
.vtoggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ig .vtoggle { top: 76px; right: 14px; bottom: auto; }

/* Ruhige Ansicht / reduzierte Bewegung: keine Dauer-Animationen */
@media (prefers-reduced-motion: reduce) {
  .dash__live i, .ig__burst.is-on { animation: none; }
  .adsx__view { transition: none; }
}
.is-calm .dash__live i { animation: none; }

/* Videoqualität (Fußzeile): Automatisch · Hoch · Sparsam */
.vq { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.vq span { margin-right: 6px; }
.vq button { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong, rgba(29,29,31,0.18)); font: inherit; font-size: 13px; color: inherit; background: none; cursor: pointer; }
.vq button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
