/* Live site preview popup — FiTech / ViewKeeper (ViewKeeper-style open live) */
.fm-brand-link {
  display: inline;
  margin: 0;
  padding: 0 0 1px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, text-shadow 0.15s ease, border-color 0.15s ease;
}
/* ViewKeeper SA — keep purple / magenta */
.fm-brand-link--vk,
.fm-brand-link[data-site-key="viewkeeper"] {
  color: #e9b3ff;
  border-bottom-color: rgba(233, 179, 255, 0.55);
  background: linear-gradient(90deg, #e9b3ff 0%, #c084fc 50%, #f0abfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.fm-brand-link--vk:hover,
.fm-brand-link--vk:focus-visible,
.fm-brand-link[data-site-key="viewkeeper"]:hover,
.fm-brand-link[data-site-key="viewkeeper"]:focus-visible {
  filter: brightness(1.12);
  text-shadow: none;
  outline: none;
  border-bottom-color: rgba(233, 179, 255, 0.9);
}
/* FiTech — blue / cyan (not purple) */
.fm-brand-link--ft,
.fm-brand-link[data-site-key="fitech"] {
  background: linear-gradient(90deg, #38bdf8 0%, #3b82f6 45%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  border-bottom-color: rgba(56, 189, 248, 0.55);
}
.fm-brand-link--ft:hover,
.fm-brand-link--ft:focus-visible,
.fm-brand-link[data-site-key="fitech"]:hover,
.fm-brand-link[data-site-key="fitech"]:focus-visible {
  filter: brightness(1.12);
  outline: none;
  border-bottom-color: rgba(56, 189, 248, 0.95);
}

.fm-site-root[hidden] { display: none !important; }
.fm-site-root {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.fm-site-root.is-open { pointer-events: auto; }
.fm-site-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.fm-site-root.is-open .fm-site-backdrop { opacity: 1; }

.fm-site-panel {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  height: min(86dvh, 820px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0a0a0c;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(182, 0, 168, 0.18);
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.25s ease;
}
.fm-site-root.is-open .fm-site-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.fm-site-chrome {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(40, 20, 48, 0.95), rgba(12, 8, 16, 0.98));
}
.fm-site-dots {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.fm-site-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.fm-site-dots span:nth-child(1) { background: #ff5f57; }
.fm-site-dots span:nth-child(2) { background: #febc2e; }
.fm-site-dots span:nth-child(3) { background: #28c840; }

.fm-site-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d7e2ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fm-site-url {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(215, 226, 234, 0.75);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 640px) {
  .fm-site-url { display: block; }
  .fm-site-title { flex: 0 1 auto; max-width: 28%; }
}

.fm-site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}
.fm-site-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(215, 226, 234, 0.35);
  color: #d7e2ea;
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fm-site-open:hover {
  background: rgba(215, 226, 234, 0.1);
  border-color: #d7e2ea;
}
.fm-site-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #d7e2ea;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.fm-site-close:hover { background: rgba(255, 255, 255, 0.1); }

.fm-site-frame-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #111;
}
.fm-site-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}
.fm-site-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #0a0a0c;
  color: rgba(215, 226, 234, 0.7);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.fm-site-loading.is-done { opacity: 0; }
.fm-site-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(233, 179, 255, 0.2);
  border-top-color: #e9b3ff;
  animation: fmSiteSpin 0.7s linear infinite;
}
@keyframes fmSiteSpin { to { transform: rotate(360deg); } }

/* Screenshot preview when site blocks iframe (NEOM / SenseTime) — looks like live page */
.fm-site-shot-wrap {
  position: absolute;
  inset: 0;
  display: block;
  overflow: auto;
  background: #0a0a0c;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.fm-site-shot-wrap[hidden] { display: none !important; }
.fm-site-shot {
  display: block;
  width: 100%;
  min-height: 100%;
  height: auto;
  object-fit: cover;
  object-position: top center;
  background: #111;
  pointer-events: none;
}
.fm-site-shot-hint {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -2.75rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e8eef4;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82) 35%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.fm-site-shot-wrap:hover .fm-site-shot-hint,
.fm-site-shot-wrap:focus-visible .fm-site-shot-hint {
  opacity: 1;
}
.fm-site-shot-wrap:focus-visible {
  outline: 2px solid #7dd3fc;
  outline-offset: -2px;
}

body.fm-site-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .fm-site-backdrop,
  .fm-site-panel,
  .fm-site-loading { transition: none; }
  .fm-site-spinner { animation: none; }
}
