/* Extra chrome for the hosted portal (preview iframe, stubs, connect row). */
.cs-embed-preview-body {
  margin: 0;
  min-height: 100%;
  background: #0e0e0e;
  color: #ececec;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
.cs-embed-preview {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 20% 0%, rgba(225, 29, 46, 0.16), transparent 60%),
    #121316;
}
.cs-embed-preview__note {
  margin: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.72rem;
  color: #a6a39e;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cs-embed-preview__stage {
  flex: 1;
  position: relative;
  min-height: 22rem;
}
.cs-embed-chat {
  position: absolute;
  right: 1.1rem;
  bottom: 4.5rem;
  width: min(22rem, calc(100% - 2rem));
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  background: #161616;
}
.cs-embed-chat__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
}
.cs-embed-chat__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #e11d2e;
  flex: 0 0 auto;
  overflow: hidden;
}
.cs-embed-chat__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-embed-chat__name { font-weight: 700; font-size: 0.9rem; line-height: 1.2; }
.cs-embed-chat__sub { font-size: 0.72rem; opacity: 0.8; }
.cs-embed-chat__body { padding: 0.85rem; min-height: 10rem; background: #0f0f10; }
.cs-embed-chat__bubble {
  max-width: 85%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0 0 0.55rem;
}
.cs-embed-chat__bubble--bot { background: #1c1e24; color: #ececec; }
.cs-embed-chat__bubble--user { margin-left: auto; }
.cs-embed-chat__foot {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.cs-embed-chat__input {
  flex: 1;
  min-height: 2.2rem;
  border-radius: 8px;
  background: #121316;
  border: 1px solid #3a3d45;
}
.cs-embed-chat__send {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  border: 0;
}
.cs-embed-fab {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  border: 0;
  background: #e11d2e;
  color: #fff;
  box-shadow: 0 10px 24px rgba(225, 29, 46, 0.35);
}
.cs-portal-stub {
  max-width: 36rem;
}
.cs-portal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem;
}
.cs-portal-stat {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--cs-portal-line-soft, rgba(255,255,255,0.05));
  background: rgba(255,255,255,0.03);
}
.cs-portal-stat__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: var(--cs-portal-muted, #a6a39e);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
}
.cs-portal-stat__value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.cs-portal-stat__meta {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--cs-portal-muted-dim, #7e7972);
}
.cs-portal-look-savebar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1.25rem;
}
.cs-portal-look-savebar .cs-portal__btn { width: auto; }
.cs-admin-home .cs-portal-table-wrap { overflow: auto; }
.cs-admin-home table { width: 100%; border-collapse: collapse; }
.cs-admin-home th, .cs-admin-home td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--cs-portal-line, rgba(255,255,255,0.07));
  font-size: 0.88rem;
}
.cs-portal-disabled-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(225, 29, 46, 0.35);
  border-radius: 8px;
  background: rgba(225, 29, 46, 0.08);
}
.cs-portal-home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: 1.25rem 0 0;
}
.cs-portal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
  margin-top: 1rem;
  padding: 0.35rem 0 0;
}
.cs-portal-bars__col {
  flex: 1 1 0;
  min-width: 2px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.cs-portal-bars__col i {
  display: block;
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: rgba(225, 29, 46, 0.55);
}
.cs-portal-invite-pre {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Staff admin-portal */
.cs-admin-muted { color: var(--cs-portal-muted-dim, #7e7972); font-size: 0.82rem; }
.cs-admin-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.cs-admin-status.is-ok { color: var(--cs-portal-ok, #3ecf8e); }
.cs-admin-status.is-warn { color: #e8b86d; }
.cs-admin-status.is-bad { color: #e11d2e; }
.cs-admin-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  color: var(--cs-portal-muted, #a6a39e);
}
.cs-admin-badge.is-bad { background: rgba(225, 29, 46, 0.16); color: #ff6b78; }
.cs-admin-plan-form__section { margin: 0 0 1.65rem; }
.cs-admin-plan-form__heading {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.cs-admin-user-card {
  padding: 1rem 1.1rem;
  margin: 0 0 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--cs-portal-line, rgba(255,255,255,0.07));
  background: rgba(255,255,255,0.03);
}
.cs-admin-account-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}
.cs-admin-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cs-admin-trash-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cs-admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem;
  margin: 0 0 1.25rem;
}
.cs-admin-summary__card {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--cs-portal-line-soft, rgba(255,255,255,0.05));
  background: rgba(255,255,255,0.03);
}
.cs-admin-summary__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cs-portal-muted, #a6a39e);
  font-weight: 650;
}
.cs-admin-summary__value { margin: 0.35rem 0 0; font-size: 1.45rem; font-weight: 700; letter-spacing: -0.03em; }
.cs-admin-summary__sub { margin: 0.3rem 0 0; font-size: 0.78rem; color: var(--cs-portal-muted-dim, #7e7972); }
.cs-admin-security-tabs,
.cs-admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.15rem;
}
.cs-admin-security-tabs__link,
.cs-admin-subtab {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--cs-portal-line, rgba(255,255,255,0.07));
  color: var(--cs-portal-ink-soft, #cfcac4);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}
.cs-admin-security-tabs__link.is-active,
.cs-admin-subtab.is-active {
  background: rgba(225, 29, 46, 0.16);
  border-color: rgba(225, 29, 46, 0.45);
  color: #fff;
}
.cs-admin-confirm[hidden] { display: none; }
.cs-admin-confirm {
  position: fixed;
  inset: 0;
  z-index: 11000;
}
.cs-admin-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
}
.cs-admin-confirm__panel {
  position: relative;
  z-index: 1;
  width: min(28rem, calc(100% - 2rem));
  margin: 12vh auto 0;
  padding: 1.25rem 1.3rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--cs-portal-line, rgba(255,255,255,0.07));
  background: #161616;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
}
.cs-admin-confirm__title { margin: 0 0 0.45rem; font-size: 1.05rem; }
.cs-admin-confirm__lead { margin: 0 0 1rem; color: var(--cs-portal-muted, #a6a39e); font-size: 0.88rem; }
.cs-admin-support-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem 1.1rem;
  margin: 0 0 1rem;
}
.cs-admin-support-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cs-portal-muted, #a6a39e); }
.cs-admin-support-meta dd { margin: 0.2rem 0 0; }
.cs-admin-support-message__body {
  white-space: pre-wrap;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--cs-portal-line, rgba(255,255,255,0.07));
}
.cs-admin-platform-logo-preview { margin: 0.65rem 0 0; }
.cs-admin-platform-logo-preview img { max-height: 3rem; max-width: 12rem; display: block; }
.cs-admin-account-plan-display { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; }
.cs-admin-portal .cs-portal__actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.1rem; }
