/* === LEGENDARIO HUB — SOFT 3D CLAY / WHITE BENTO (/legendario) === */
:root {
  --h-bg: #F3F4F6;
  --h-card: #FFFFFF;
  --h-ink: #111318;
  --h-muted: #64748B;
  --h-border: rgba(15, 23, 42, 0.065);
  --h-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.07), 0 2px 8px -2px rgba(15, 23, 42, 0.03);
  --h-shadow-hover: 0 16px 36px -10px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --h-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Quando está no Hub Inicial, muda fundo e topbar para claro suave */
body.is-hub-light {
  background: var(--h-bg) !important;
  color: var(--h-ink) !important;
}
body.is-hub-light .plat-topbar {
  background: rgba(243, 244, 246, 0.96) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07) !important;
}
body.is-hub-light .plat-brand__name { color: #111318 !important; }
body.is-hub-light .plat-nav {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
body.is-hub-light .plat-nav__btn { color: #64748B !important; }
body.is-hub-light .plat-nav__btn.is-active {
  background: #111318 !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 12px rgba(17, 19, 24, 0.18) !important;
}

/* Container de visualização: altura exata do viewport, scrollbar estável, SEM jump */
#view-hub {
  height: calc(100vh - 54px);
  max-height: calc(100vh - 54px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  background: var(--h-bg) !important;
  box-sizing: border-box;
}

/* Container principal do Hub: cabe 100% no viewport em 1080p, Mac e notebooks */
.soft-hub {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(10px, 1.8vh, 20px) 24px clamp(12px, 2vh, 22px);
  box-sizing: border-box;
}

.soft-hub__head {
  text-align: center;
  margin-bottom: clamp(10px, 1.8vh, 18px);
}
.soft-hub__eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #FF5E1A;
  margin-bottom: 3px;
}
.soft-hub__title {
  margin: 0 0 3px;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--h-ink);
  text-wrap: balance;
  line-height: 1.15;
}
.soft-hub__sub {
  margin: 0;
  font-size: clamp(12px, 1vw, 13px);
  color: var(--h-muted);
  text-wrap: pretty;
}

/* Bento Grid 12 colunas */
.soft-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(10px, 1.4vh, 16px);
  align-items: stretch;
}

.sb-card {
  position: relative;
  border-radius: 18px;
  background: var(--h-card);
  border: 1px solid var(--h-border);
  box-shadow: var(--h-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  cursor: pointer;
  padding: 0;
  transition: box-shadow 220ms var(--h-ease), border-color 200ms ease;
  /* Sem transform: translateY para NUNCA oscilar ou saltar scroll */
}
.sb-card:hover {
  box-shadow: var(--h-shadow-hover);
  border-color: rgba(15, 23, 42, 0.13);
}

.sb-card--editor { grid-column: span 6; }
.sb-card--crm    { grid-column: span 6; }
.sb-card--svg    { grid-column: span 4; }
.sb-card--vault  { grid-column: span 4; }
.sb-card--mcp    { grid-column: span 4; cursor: default; }

@media (max-width: 980px) {
  .sb-card--editor, .sb-card--crm, .sb-card--svg, .sb-card--vault, .sb-card--mcp {
    grid-column: span 12;
  }
}

/* Palco visual 3D suave no topo de cada card */
.sb-stage {
  position: relative;
  height: clamp(90px, 12.5vh, 126px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sb-body {
  padding: clamp(10px, 1.4vh, 15px) clamp(14px, 1.6vw, 20px) clamp(12px, 1.6vh, 18px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sb-title {
  margin: 0;
  font-size: clamp(15px, 1.2vw, 17px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--h-ink);
  text-wrap: balance;
  line-height: 1.2;
}
.sb-desc {
  margin: 0;
  font-size: clamp(11.5px, 0.95vw, 12.5px);
  line-height: 1.42;
  color: var(--h-muted);
  text-wrap: pretty;
}
.sb-cta-pill {
  margin-top: auto;
  align-self: flex-start;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: #111318;
  color: #FFFFFF;
  border: 0;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgba(17, 19, 24, 0.35);
  transition: filter 160ms ease, box-shadow 160ms ease;
}
.sb-cta-pill:hover { filter: brightness(1.15); }
.sb-cta-pill--ghost {
  background: #F1F5F9;
  color: #111318;
  box-shadow: none;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

/* === 1. ILUSTRAÇÃO 3D: EDITOR DE PÁGINAS === */
.sb-stage--editor {
  background: radial-gradient(circle at 18% 12%, #3B82F6 0%, #93C5FD 34%, #EFF6FF 72%, #FFFFFF 100%);
}
.mock-browser {
  width: 82%;
  height: 82%;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 12px 12px 0 0;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 12px 28px -10px rgba(37, 99, 235, 0.22);
  padding: 8px 12px;
  position: relative;
  box-sizing: border-box;
}
.mock-dots { display: flex; gap: 4px; margin-bottom: 6px; }
.mock-dots span { width: 6px; height: 6px; border-radius: 50%; }
.mock-dots span:nth-child(1) { background: #FB7185; }
.mock-dots span:nth-child(2) { background: #FBBF24; }
.mock-dots span:nth-child(3) { background: #34D399; }
.mock-headline {
  font-size: clamp(13.5px, 1.3vw, 16.5px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111318;
  line-height: 1.15;
}
.mock-select-box {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 6px;
  border: 1.5px solid #3B82F6;
  background: rgba(59, 130, 246, 0.06);
  position: relative;
}
.clay-tag {
  position: absolute;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  box-shadow: 0 6px 14px -4px rgba(15, 23, 42, 0.16), inset 0 1px 1px rgba(255, 255, 255, 0.7);
  pointer-events: none;
}
.clay-tag--green  { top: 12px; right: 14px; background: #BBF7D0; color: #166534; }
.clay-tag--violet { bottom: 10px; left: 10px; background: #DDD6FE; color: #5B21B6; }
.clay-tag--peach  { bottom: 8px; right: 12px; background: #FED7AA; color: #9A3412; }

/* === 2. ILUSTRAÇÃO 3D: CRM FUNIL === */
.sb-stage--crm {
  background: radial-gradient(circle at 50% 0%, #FFF7ED 0%, #FFFFFF 75%);
  flex-direction: column;
}
.crm-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #FF9A3C, #FF5E1A 60%, #C2410C);
  box-shadow: 0 12px 24px -6px rgba(255, 94, 26, 0.44), inset 0 2px 4px rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  z-index: 2;
}
.crm-pill-float {
  margin-top: 6px;
  padding: 5px 12px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 8px 18px -6px rgba(15, 23, 42, 0.12);
  font-size: 11px;
  font-weight: 600;
  color: #111318;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.crm-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: #10B981; }

/* === 3. ILUSTRAÇÃO 3D: GPU VETOR & RECORTE === */
.sb-stage--svg {
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  flex-direction: column;
  gap: 5px;
}
.svg-chip {
  width: 80%;
  padding: 5px 10px;
  border-radius: 9px;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 4px 10px -4px rgba(15, 23, 42, 0.06);
  font-size: 10.5px;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.svg-ribbon {
  width: 104%;
  padding: 8px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  background: linear-gradient(90deg, #38BDF8 0%, #6366F1 52%, #8B5CF6 100%);
  box-shadow: 0 10px 22px -6px rgba(99, 102, 241, 0.38);
}

/* === 4. ILUSTRAÇÃO 3D: PROMPTS & ARQUIVOS === */
.sb-stage--vault {
  background: radial-gradient(circle at 80% 15%, #38BDF8 0%, #A78BFA 42%, #F5F3FF 80%, #FFFFFF 100%);
}
.vault-badge-3d {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 24px -8px rgba(99, 102, 241, 0.28), inset 0 2px 3px #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #4F46E5;
}

/* === 5. CARD MCP (Skill na Nuvem) === */
.sb-stage--mcp {
  height: 48px;
  background: radial-gradient(circle at 88% 10%, #FF9A3C 0%, #FDBA74 32%, #FFF7ED 72%, #FFFFFF 100%);
  justify-content: flex-start;
  padding: 0 18px;
  flex-shrink: 0;
}
.mcp-pill-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 10.5px;
  font-weight: 600;
  color: #111318;
  box-shadow: 0 4px 12px -4px rgba(15, 23, 42, 0.1);
}
.mcp-cmd-box {
  margin-top: 5px;
  padding: 5px 9px;
  border-radius: 9px;
  background: #F8FAFC;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 10.5px;
  line-height: 1.38;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  max-height: 40px;
  overflow: hidden;
}
.mcp-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.mcp-actions-row .sb-cta-pill {
  height: 29px;
  font-size: 11px;
  padding: 0 11px;
}
.mcp-foot-links {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
}
.mcp-foot-links button {
  background: transparent;
  border: 0;
  padding: 0;
  color: #64748B;
  font-weight: 500;
  cursor: pointer;
}
.mcp-foot-links button:hover { color: #111318; }

/* === BADGE DE ATUALIZAÇÃO DISPONÍVEL (TOPBAR + LOGIN) === */
.leg-upd-badge {
  height: 30px;
  padding: 0 6px 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 94, 26, 0.35);
  background: rgba(255, 94, 26, 0.12);
  color: #F8FAFC;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease;
}
.leg-upd-badge:hover {
  background: rgba(255, 94, 26, 0.2);
}
.leg-upd-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FF5E1A;
  flex-shrink: 0;
}
.leg-upd-cta {
  padding: 3px 9px;
  border-radius: 999px;
  background: #FF5E1A;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
}
.leg-upd-badge--login {
  align-self: center;
  margin-bottom: 4px;
}

/* Adaptação automática no Hub Claro e CRM Sage */
body.is-hub-light .leg-upd-badge,
body.is-crm-sage .leg-upd-badge {
  background: #FFFFFF;
  color: #111318;
  border-color: rgba(17, 19, 24, 0.14);
  box-shadow: 0 6px 16px -8px rgba(17, 19, 24, 0.18);
}
body.is-hub-light .leg-upd-cta,
body.is-crm-sage .leg-upd-cta {
  background: #111318;
  color: #FFFFFF;
}

/* === BADGE DE CONTA NA TOPBAR (CONTRASTE HUB CLARO E CRM SAGE) === */
body.is-hub-light #headerUserBadge,
body.is-crm-sage #headerUserBadge {
  background: rgba(17, 19, 24, 0.06) !important;
  border-color: rgba(17, 19, 24, 0.12) !important;
  color: #111318 !important;
  box-shadow: 0 2px 8px rgba(17, 19, 24, 0.04) !important;
}
body.is-hub-light #headerUserBadge:hover,
body.is-crm-sage #headerUserBadge:hover {
  background: rgba(17, 19, 24, 0.10) !important;
}
body.is-hub-light #headerUserBadge .user-badge-nick,
body.is-crm-sage #headerUserBadge .user-badge-nick,
body.is-hub-light #headerUserBadge span:nth-child(2),
body.is-crm-sage #headerUserBadge span:nth-child(2) {
  color: #111318 !important;
}
body.is-hub-light #headerUserBadge .user-badge-plan,
body.is-crm-sage #headerUserBadge .user-badge-plan,
body.is-hub-light #headerUserBadge span:nth-child(3),
body.is-crm-sage #headerUserBadge span:nth-child(3) {
  color: #C2410C !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   TELAS ULTRA-COMPACTAS (< 660px de altura, ex: janelas pequenas ou split)
   ========================================================================== */
@media (max-height: 660px) {
  .soft-hub {
    padding: 8px 16px 16px;
  }
  .soft-hub__head {
    margin-bottom: 8px;
  }
  .soft-hub__title {
    font-size: 19px;
  }
  .soft-hub__sub {
    font-size: 11.5px;
  }
  .soft-bento {
    gap: 8px;
  }
  .sb-stage {
    height: 72px;
  }
  .sb-stage--mcp {
    height: 38px;
  }
  .sb-body {
    padding: 8px 12px 12px;
  }
  .mock-browser {
    height: 56px;
    margin-top: 6px;
    padding: 4px 8px;
  }
}
