/* ════════════════════════════════════════════════════════════════
 * formstube · Controlling · fs-fab-menu.css
 * ════════════════════════════════════════════════════════════════
 * Action-Sheet das aus dem FAB nach oben slidet.
 * Brand-konforme Hex-Icons pro Action · staggered Slide-In.
 * ════════════════════════════════════════════════════════════════ */

.fs-fab-menu {
  position: fixed;
  inset: 0;
  z-index: 9500;            /* unter Modals (9999) aber über Tab-Bar (90) */
  pointer-events: none;
  visibility: hidden;
}

.fs-fab-menu.is-open,
.fs-fab-menu.is-closing {
  visibility: visible;
}
.fs-fab-menu.is-open {
  pointer-events: auto;
}
/* is-closing: visible damit Out-Animation läuft, aber keine Klicks mehr */
.fs-fab-menu.is-closing {
  pointer-events: none;
}

/* ─── Backdrop · dunkles Glas ──────────────────────────────────── */
.fs-fab-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.32s, backdrop-filter 0.32s;
}
.fs-fab-menu.is-open .fs-fab-backdrop {
  background: rgba(10, 10, 12, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ─── Container für die Action-Optionen ──────────────────────── */
.fs-fab-options {
  position: absolute;
  /* sitzt über dem FAB (FAB ist 60px hoch + 36px nach oben gezogen
     + Tab-Bar padding · daher ~ env(safe-area-inset-bottom) + ~80px) */
  bottom: calc(96px + env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  /* NACHT-23d Fix · explizite Breite verhindert iOS-Width-Bug bei langen Labels */
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  /* Bei vielen Items vertikal scrollbar machen statt horizontal sprengen */
  max-height: calc(100vh - 180px - env(safe-area-inset-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ─── Action-Row · Hex-Icon links + Label rechts ─────────────── */
.fs-fab-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px 14px 14px;
  background: var(--charcoal, #151517);
  border: 1px solid var(--graphite, #2A2C30);
  text-decoration: none;
  color: var(--paper, #F0F0F0);
  font-family: 'Mona Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  /* NACHT-23d Fix · min-width 0 erlaubt flex-children zu schrumpfen + overflow zu greifen */
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  /* Animation: start hidden + below */
  opacity: 0;
  transform: translateY(20px) scale(0.94);
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fs-fab-option:active {
  transform: scale(0.97);
}

.fs-fab-option:hover,
.fs-fab-option:focus-visible {
  border-color: var(--fab-bg, var(--module-accent, var(--accent, #D8FF3C)));
  outline: none;
}

/* Active-Reveal: gestaffelt durchnummerieren */
.fs-fab-menu.is-open .fs-fab-option {
  opacity: 1;
  transform: none;
}
/* Stagger-Delays für alle 8 Quick-Actions (Marc-Bug-Fix 2026-05-26:
   früher nur 5 Items mit Delay · untersten 3 hatten keinen → animierten sofort/nicht) */
.fs-fab-menu.is-open .fs-fab-option:nth-child(1) { transition-delay: 0.04s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(2) { transition-delay: 0.08s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(3) { transition-delay: 0.12s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(4) { transition-delay: 0.16s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(5) { transition-delay: 0.20s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(6) { transition-delay: 0.24s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(7) { transition-delay: 0.28s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(8) { transition-delay: 0.32s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(9) { transition-delay: 0.36s; }
.fs-fab-menu.is-open .fs-fab-option:nth-child(10){ transition-delay: 0.40s; }

/* ─── Animate-Out (Marc 2026-05-25) ──────────────────────────────
 * Beim Schließen läuft Reverse-Stagger: BOTTOM-Option (= näher am
 * FAB) verschwindet zuerst, TOP-Option zuletzt — fühlt sich an wie
 * „in den FAB zurück gesaugt". Backdrop fadet parallel aus.
 * is-closing hält Menu sichtbar bis Animation durch ist, danach
 * räumt JS via setTimeout(400) die Klasse wieder weg. */
.fs-fab-menu.is-closing .fs-fab-backdrop {
  background: rgba(10, 10, 12, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}
.fs-fab-menu.is-closing .fs-fab-option {
  opacity: 0;
  transform: translateY(20px) scale(0.94);
  /* Default-Transition wird genutzt (0.3s) · nur Delays werden überschrieben */
}
/* Reverse-Stagger · last-child = bottom = nah am FAB → 0s · top → längste Delay */
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(1) { transition-delay: 0.00s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(2) { transition-delay: 0.04s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(3) { transition-delay: 0.08s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(4) { transition-delay: 0.12s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(5) { transition-delay: 0.16s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(6) { transition-delay: 0.20s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(7) { transition-delay: 0.24s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(8) { transition-delay: 0.28s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(9) { transition-delay: 0.32s; }
.fs-fab-menu.is-closing .fs-fab-option:nth-last-child(10){ transition-delay: 0.36s; }

/* Hex-Icon-Container · 44×44 Lime-Outline */
.fs-fab-option-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  background: var(--ink, #0A0A0C);
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.fs-fab-option-icon::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--fab-bg, var(--module-accent, var(--accent, #D8FF3C)));
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  opacity: 0.15;
}
.fs-fab-option-icon svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
  stroke: var(--fab-bg, var(--module-accent, var(--accent, #D8FF3C)));
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Label + Sublabel-Hierarchie */
.fs-fab-option-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 0;
  /* NACHT-23d · min-width:0 ist Pflicht damit Flex-Item schrumpfen kann */
  min-width: 0;
  overflow: hidden;
}
.fs-fab-option-title {
  font-family: 'Mona Sans', sans-serif;
  font-weight: 800;
  font-size: 0.96rem;
  line-height: 1.15;
  color: var(--paper, #F0F0F0);
  /* Ellipsis bei zu langem Title (z.B. mit "NEU"-Inline-Span) */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-fab-option-sub {
  font-family: 'Geist Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone, #888);
  /* Sub-Label auch Ellipsis (z.B. "UTM · Short-URL · QR-Code" lang) */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pfeil-Hint rechts */
.fs-fab-option-arrow {
  flex: 0 0 auto;
  color: var(--stone, #888);
  font-size: 1.2rem;
  transition: color 0.2s, transform 0.2s;
}
.fs-fab-option:hover .fs-fab-option-arrow,
.fs-fab-option:active .fs-fab-option-arrow {
  color: var(--fab-bg, var(--module-accent, var(--accent, #D8FF3C)));
  transform: translateX(3px);
}

/* ═══════════════════════════════════════════════════════════════
   Welle 48.C Item 6 (NACHT-76) · Long-Press-State + Mode-Picker
   ═══════════════════════════════════════════════════════════════ */

/* iOS-Long-Press-Fix (Marc 2026-05-31 iPhone-Bug):
   Long-Press triggerte iOS-Selection-Menu (Kopieren/Nachschlagen/Übersetzen)
   parallel zum Mode-Picker. Unterdrücken via:
   - user-select: none (kein Text-Markieren)
   - -webkit-touch-callout: none (kein iOS-Context-Menu)
   - touch-action: manipulation (verhindert Double-Tap-Zoom + Native-Geste)
   Gilt für beide FABs + den ganzen Mode-Picker. */
.fs-tab-bar-fab,
.fs-desktop-fab,
body > #fs-desktop-fab,
body > #fs-tab-bar-fab,
.fs-mode-picker,
.fs-mode-picker-panel,
.fs-mode-picker-head,
.fs-mode-picker-title,
.fs-mode-picker-eyebrow,
.fs-mode-picker-hint,
.fs-mode-card,
.fs-mode-card *,
.fs-fab-mode-pill,
.fs-fab-mode-pill *,
.fs-fab-coachmark {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Visual feedback während Long-Press läuft (subtle Scale + Pulse) */
.fs-tab-bar-fab.is-longpressing,
.fs-desktop-fab.is-longpressing {
  transform: scale(0.92);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 0 0 0 rgba(216, 255, 60, 0.4),
    0 0 0 6px rgba(216, 255, 60, 0.2),
    0 0 0 14px rgba(216, 255, 60, 0.08);
  animation: fs-fab-longpress-pulse 0.5s ease-out forwards;
}

@keyframes fs-fab-longpress-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(216, 255, 60, 0.4); }
  100% { box-shadow: 0 0 0 18px rgba(216, 255, 60, 0); }
}

/* ── Mode-Picker Overlay ── */
.fs-mode-picker {
  position: fixed;
  inset: 0;
  z-index: 10001; /* über fs-fab-menu (10000) */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.fs-mode-picker.is-open {
  display: flex;
  animation: fs-mode-picker-fade-in 0.2s ease-out;
}
@keyframes fs-mode-picker-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fs-mode-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.78);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}

.fs-mode-picker-panel {
  position: relative;
  max-width: 720px;
  width: 100%;
  background: var(--ink, #0A0A0C);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 36px 32px 28px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(216, 255, 60, 0.06);
  animation: fs-mode-picker-rise 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fs-mode-picker-rise {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.fs-mode-picker-head {
  text-align: center;
  margin-bottom: 28px;
}
.fs-mode-picker-eyebrow {
  display: inline-block;
  font-family: 'Geist Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--accent, #D8FF3C);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.fs-mode-picker-title {
  font-family: 'Mona Sans', sans-serif;
  font-weight: 800;
  font-variation-settings: 'wdth' 125;
  font-size: 1.6rem;
  color: var(--paper, #F5F6F7);
  margin: 0;
  line-height: 1.2;
}

.fs-mode-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 600px) {
  .fs-mode-picker-grid { grid-template-columns: 1fr; gap: 12px; }
  .fs-mode-picker-panel { padding: 28px 22px 22px; }
  .fs-mode-picker-title { font-size: 1.3rem; }
}

.fs-mode-card {
  appearance: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  padding: 22px 18px 18px;
  text-align: left;
  cursor: pointer;
  color: var(--paper, #F5F6F7);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  min-height: 130px;
}
.fs-mode-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.20);
  transform: translateY(-3px);
}
.fs-mode-card.is-active {
  border-color: rgba(216, 255, 60, 0.45);
  background: rgba(216, 255, 60, 0.04);
  box-shadow: inset 0 0 0 1px rgba(216, 255, 60, 0.2);
}
.fs-mode-card-hex {
  display: inline-block;
  width: 32px;
  aspect-ratio: 1 / 1;
  clip-path: polygon(50% 0%, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
  flex-shrink: 0;
  box-shadow: 0 4px 16px currentColor;
}
.fs-mode-card-label {
  font-family: 'Mona Sans', sans-serif;
  font-weight: 800;
  font-variation-settings: 'wdth' 115;
  font-size: 1.15rem;
  color: var(--paper, #F5F6F7);
  line-height: 1;
}
.fs-mode-card-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--stone, #888);
  line-height: 1.4;
}

.fs-mode-picker-hint {
  margin: 22px 0 0;
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--stone, #888);
  text-transform: uppercase;
}

/* Body-Klasse wenn Picker offen (für andere Layout-Reactions) */
body.fs-mode-picker-open { overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════
   Welle 48.C Item 7 (NACHT-76) · Mode-Pill Label + Coachmark
   ═══════════════════════════════════════════════════════════════
   Position: direkt links neben dem Desktop-FAB (bottom: 26px, right:
   26px+60px+12px = ~98px). Mobile (<= 720px): hidden — kommt später
   integriert in die Tab-Bar als Mini-Label unter dem zentralen Hex.

   Coachmark erscheint einmalig (settings.fab_coach_seen). Pulsiert
   in Paper-Weiß über Mode-Pill (visual cue für die Long-Press-Geste).
   Verschwindet nach erstem Long-Press ODER nach 12s. */

#fs-fab-status,
body > #fs-fab-status {
  display: none;
}
@media (min-width: 721px) {
  body > #fs-fab-status {
    display: flex;
    position: fixed;
    bottom: 32px;         /* leicht über FAB-Mitte (FAB bottom 26px, height 60px) */
    right: 96px;          /* FAB right 26px + 60px + 10px = 96px */
    z-index: 9509;        /* knapp unter Desktop-FAB (9510) */
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    pointer-events: none;
    animation: fs-fab-status-rise 0.5s ease-out backwards;
    animation-delay: 0.8s;
  }
}

@keyframes fs-fab-status-rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fs-fab-mode-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  background: rgba(10, 10, 12, 0.78);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper, #F5F6F7);
  white-space: nowrap;
  user-select: none;
  cursor: default;
}
.fs-fab-mode-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--fab-bg, var(--module-accent, var(--accent, #D8FF3C)));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 6px 0 currentColor;
}

/* Coachmark · einmalig + pulsiert (Paper-Weiß) */
.fs-fab-coachmark {
  pointer-events: none;
  display: inline-block;
  padding: 4px 10px;
  background: var(--paper, #F5F6F7);
  color: var(--ink, #0A0A0C);
  border-radius: 999px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: fs-coach-pulse 1.6s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(245, 246, 247, 0.18));
}
@keyframes fs-coach-pulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1;     transform: scale(1.06); }
}
.fs-fab-coachmark.is-hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   Welle 48.C+1 (NACHT-76+1) · Modus-Header im FAB-Menu
   Klein-formatiges Mini-Label oben im Action-Sheet: zeigt aktuellen
   Modus mit Hex-Dot + „[Modus]-Modus" Label. Schafft Kontext was
   der User gleich sieht (warum andere Aktionen als gestern).
   ═══════════════════════════════════════════════════════════════ */
.fs-fab-mode-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 6px;
  -webkit-user-select: none;
  user-select: none;
}
.fs-fab-mode-head-dot {
  display: inline-block;
  width: 14px;
  aspect-ratio: 1 / 1;
  clip-path: polygon(50% 0%, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
  flex-shrink: 0;
  box-shadow: 0 0 8px 0 currentColor;
}
.fs-fab-mode-head-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fs-fab-mode-head-eyebrow {
  font-family: 'Geist Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--stone, #888);
  text-transform: uppercase;
}
.fs-fab-mode-head-label {
  font-family: 'Mona Sans', sans-serif;
  font-weight: 800;
  font-variation-settings: 'wdth' 115;
  font-size: 0.95rem;
  color: var(--paper, #F5F6F7);
  line-height: 1.1;
}

/* Universal-Footer-Items (immer sichtbar in jedem Modus) bekommen
   subtilen Top-Separator damit klar ist „dies ist modus-unabhängig". */
.fs-fab-option--universal {
  border-top: 1px dashed rgba(255,255,255,.08);
  margin-top: 6px;
  opacity: 0.85;
}
.fs-fab-option--universal:hover { opacity: 1; }
