/* ── Form sheet primitive ────────────────────────────────────────────── */
.vb-fs[hidden] { display: none !important; }
.vb-fs {
  --vb-fs-safe-top: max(8px, env(safe-area-inset-top, 0px));
  position: fixed;
  inset: auto 0 auto;
  top: var(--vv-offset-top, 0px);
  height: var(--app-visual-viewport-h, 100dvh);
  box-sizing: border-box;
  padding-top: var(--vb-fs-safe-top);
  z-index: 3300;
  display: flex; align-items: flex-end; justify-content: center;
  animation: vb-fs-fadein 0.16s ease-out;
}
.vb-fs__backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.48);
}
.vb-fs__panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 520px;
  max-height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--t-card, var(--card-bg, #fff));
  color: var(--t-text, var(--text));
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22);
  display: flex; flex-direction: column;
  animation: vb-fs-slideup 0.20s ease-out;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes vb-fs-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes vb-fs-slideup { from { transform: translateY(24px); } to { transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .vb-fs,
  .vb-fs__panel {
    animation: none;
  }
}

.vb-fs__grip {
  width: 40px; height: 4px;
  background: var(--t-row-border, var(--border));
  border-radius: 2px;
  margin: 8px auto 6px;
  flex-shrink: 0;
}

.vb-fs__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 18px 10px;
  border-bottom: 1px solid var(--t-row-border, var(--border));
  flex-shrink: 0;
}
.vb-fs__title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--t-text, var(--text));
}
.vb-fs__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  background: color-mix(in srgb, var(--t-surface, var(--surface, #f6f4fb)) 74%, transparent);
  border: 1px solid color-mix(in srgb, var(--t-border, var(--border, #d7d2e4)) 86%, transparent);
  cursor: pointer;
  padding: 0;
  color: var(--t-text-muted, var(--text-muted));
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 999px;
  outline: none;
}
.vb-fs__close:hover {
  color: var(--t-text, var(--text));
  background: color-mix(in srgb, var(--t-surface, var(--surface, #f6f4fb)) 92%, var(--t-text, var(--text)) 8%);
}
.vb-fs__close:focus-visible {
  outline: 2px solid var(--t-cta-bg, var(--t-admin-accent-strong, var(--t-focus)));
  outline-offset: 2px;
}

.vb-fs__body {
  padding: 16px 18px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}
.vb-fs__foot {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--t-row-border, var(--border));
  flex-shrink: 0;
}
.vb-fs__foot:empty { display: none; }

@supports (height: 100svh) {
  body.app-shell:not(.app-shell--standalone) .vb-fs__foot {
    padding-bottom: calc(14px + (100vh - 100svh));
  }
}
