:root {
  --pc-bg: #071008;
  --pc-bg-secondary: #0a160c;
  --pc-bg-card: #101b13;
  --pc-bg-card-soft: #142319;
  --pc-border: #203323;
  --pc-border-strong: #35523a;
  --pc-text: #f4f8f3;
  --pc-text-muted: #a4b5a5;
  --pc-text-dim: #748776;
  --pc-accent: #D92F24;
  --pc-accent-2: #d92f24;
  --pc-accent-purple: #8bbf55;
  --pc-success: #3FB950; /* distinct from danger red (F36 — WCAG 1.4.1) */
  --pc-danger: #FF6A5E;
  --pc-gradient-primary: linear-gradient(135deg, #111111 0%, #d92f24 58%, #d92f24 100%);
  --pc-gradient-primary-soft: linear-gradient(135deg, rgba(217, 47, 36, 0.18), rgba(217, 47, 36, 0.08));
  --pc-gradient-glow: radial-gradient(60% 60% at 50% 0%, rgba(217, 47, 36, 0.2), rgba(217, 47, 36, 0) 72%);
  --app-sidebar-width: 252px;
  --app-card-shadow: 0 18px 52px rgba(0, 0, 0, 0.18);
  --app-card-shadow-hover: 0 22px 58px rgba(0, 0, 0, 0.24);
}

html {
  color-scheme: dark;
}

body {
  background:
    radial-gradient(circle at 80% -10%, rgba(217, 47, 36, 0.14), transparent 34%),
    radial-gradient(circle at -10% 70%, rgba(217, 47, 36, 0.09), transparent 32%),
    var(--pc-bg);
}

::selection {
  background: rgba(217, 47, 36, 0.28);
  color: #fff;
}

* {
  scrollbar-color: rgba(217, 47, 36, 0.35) rgba(255, 255, 255, 0.035);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.025);
}

*::-webkit-scrollbar-thumb {
  background: rgba(217, 47, 36, 0.28);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(217, 47, 36, 0.28);
  outline-offset: 2px;
}

.app {
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  background: transparent;
}

.app-main {
  background: linear-gradient(180deg, rgba(8, 18, 10, 0.6), rgba(7, 16, 8, 0.94));
}

.app-content {
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent 220px),
    transparent;
}

.sb {
  position: sticky;
  top: 0;
  z-index: 35;
  height: 100vh;
  padding: 18px 14px;
  gap: 3px;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(16, 31, 18, 0.97), rgba(7, 15, 9, 0.98)),
    var(--pc-bg);
  border-right: 1px solid rgba(217, 47, 36, 0.14);
  box-shadow: 14px 0 44px rgba(0, 0, 0, 0.18);
}

.sb-logo {
  min-height: 52px;
  gap: 11px;
  padding: 6px 8px 12px;
  margin-bottom: 9px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.12);
}

.sb-logo img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(217, 47, 36, 0.3);
}

.sb-logo span {
  font-size: 15px;
  font-weight: 800;
  color: var(--pc-text);
}

.sb-section {
  padding: 17px 10px 8px;
  color: #7d9a80;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.sb-item {
  position: relative;
  min-height: 42px;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #a9baa9;
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sb-item svg {
  flex: 0 0 auto;
  color: #84a487;
  transition: color 0.18s ease, transform 0.18s ease;
}

.sb-item:hover {
  color: #eff8ed;
  background: rgba(217, 47, 36, 0.07);
  border-color: rgba(217, 47, 36, 0.11);
  transform: translateX(2px);
}

.sb-item:hover svg {
  color: #8fd36e;
}

.sb-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(217, 47, 36, 0.24), rgba(217, 47, 36, 0.08));
  border-color: rgba(217, 47, 36, 0.22);
  box-shadow: inset 3px 0 0 #d92f24, 0 8px 20px rgba(0, 0, 0, 0.12);
}

.sb-item.active svg {
  color: #D92F24;
  transform: scale(1.04);
}

.sb-item .badge {
  min-width: 23px;
  padding: 2px 7px;
  background: rgba(217, 47, 36, 0.17);
  border: 1px solid rgba(217, 47, 36, 0.24);
  color: #D92F24;
  text-align: center;
}

.sb-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 15px 11px 4px;
  border-top: 1px solid rgba(217, 47, 36, 0.12);
  color: var(--pc-text-muted);
  font-size: 12.5px;
}

.sb-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d92f24;
  box-shadow: 0 0 0 4px rgba(217, 47, 36, 0.1), 0 0 16px rgba(217, 47, 36, 0.55);
}

.tb {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.12);
  background: rgba(7, 16, 8, 0.82);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-workspace-button {
  min-width: 190px;
  min-height: 40px;
  border: 1px solid rgba(217, 47, 36, 0.13);
  background: rgba(255, 255, 255, 0.025);
}

.app-workspace-button:hover {
  background: rgba(217, 47, 36, 0.07);
  border-color: rgba(217, 47, 36, 0.24);
}

.tb-search {
  max-width: 520px;
  min-height: 40px;
  padding: 9px 13px;
  border-color: rgba(217, 47, 36, 0.12);
  background: rgba(14, 27, 16, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tb-search:focus-within {
  border-color: rgba(217, 47, 36, 0.42);
  background: rgba(17, 34, 20, 0.92);
  box-shadow: 0 0 0 4px rgba(217, 47, 36, 0.08);
}

.tb-search svg {
  color: #7ca17d;
}

.tb-search input::placeholder {
  color: #6e846f;
}

.tb-icon,
.tb-avatar,
.app-profile-button {
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.tb-icon {
  border-color: rgba(217, 47, 36, 0.13);
  background: rgba(14, 27, 16, 0.82);
}

.tb-icon:hover {
  color: #a9e892;
  border-color: rgba(217, 47, 36, 0.3);
  background: rgba(217, 47, 36, 0.09);
  transform: translateY(-1px);
}

.tb-avatar {
  background: var(--pc-gradient-primary);
  box-shadow: 0 8px 18px rgba(217, 47, 36, 0.26);
}

.app-workspace-dropdown,
.app-profile-dropdown,
.app-notification-dropdown {
  border-color: rgba(217, 47, 36, 0.18);
  background: rgba(10, 22, 12, 0.98);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(18px);
}

.app-workspace-option:hover,
.app-workspace-actions button:hover:not(:disabled),
.app-profile-link:hover,
.app-profile-signout:hover,
.app-notification-item:hover {
  background: rgba(217, 47, 36, 0.07);
}

.app-workspace-option.is-active {
  color: #D92F24;
  background: rgba(217, 47, 36, 0.16);
}

.app-notification-enable {
  color: #94d87b;
}
/* "Mark all read": make it a clear, tappable red pill instead of faint text. */
.app-notification-head button {
  color: #D92F24;
  font-weight: 700;
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(217, 47, 36, 0.10);
  transition: background .18s ease, color .18s ease;
}
.app-notification-head button:hover,
.app-notification-head button:focus-visible {
  background: rgba(217, 47, 36, 0.18);
  color: #B42318;
}

/* Top-bar search: results dropdown for page/route navigation. */
.tb-search { position: relative; }
.tb-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.12);
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.tb-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  color: #111111;
  cursor: pointer;
  text-align: left;
}
.tb-search-result:hover { background: rgba(217, 47, 36, 0.08); color: #B42318; }
.tb-search-empty { padding: 12px; font-size: 13px; color: rgba(17, 17, 17, 0.55); text-align: center; }

.app-notification-enable,
.app-notification-item.is-unread {
  background: rgba(217, 47, 36, 0.1);
}

.app-notification-item.is-unread {
  box-shadow: inset 3px 0 0 #d92f24;
}

.view {
  width: 100%;
  max-width: 1510px;
  margin: 0 auto;
  padding: 32px 36px 44px;
}

.view-head {
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.view-head h1 {
  color: #f5faf4;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.view-head .sub {
  max-width: 760px;
  margin-top: 6px;
  color: #92a895;
  line-height: 1.55;
}

.view-actions {
  flex-wrap: wrap;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(217, 47, 36, 0.13);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0)),
    var(--pc-bg-card);
  box-shadow: var(--app-card-shadow);
}

.card::before {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 47, 36, 0.22), transparent);
  border-radius: inherit;
}

body .card:hover {
  transform: none;
  border-color: rgba(217, 47, 36, 0.22);
  box-shadow: var(--app-card-shadow-hover);
}

.btn {
  min-height: 40px;
  justify-content: center;
  padding: 9px 15px;
  border-radius: 11px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.btn-primary {
  background: var(--pc-gradient-primary);
  box-shadow: 0 9px 24px rgba(217, 47, 36, 0.28);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 13px 30px rgba(217, 47, 36, 0.38);
  filter: brightness(1.05);
}

.btn-secondary {
  border-color: rgba(217, 47, 36, 0.16);
  background: rgba(255, 255, 255, 0.018);
}

.btn-secondary:hover:not(:disabled) {
  border-color: rgba(217, 47, 36, 0.34);
  background: rgba(217, 47, 36, 0.07);
  color: #111111;
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
}

.icon-chip,
.app-empty-icon,
.app-template-create span {
  color: #D92F24;
  border-color: rgba(217, 47, 36, 0.25);
  background: rgba(217, 47, 36, 0.13);
}

.pill.ok,
.pill.success {
  color: #D92F24;
  border-color: rgba(217, 47, 36, 0.28);
  background: rgba(217, 47, 36, 0.14);
}

.pill.dim {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(164, 181, 165, 0.14);
}

.embedded-input,
.field input,
.field select,
.field textarea,
.users-form-card input,
.users-form-card select,
.users-modal input,
.users-modal select,
.live-inbox-filters input,
.live-inbox-filters select,
.live-detail-section select {
  min-height: 43px;
  border-color: rgba(217, 47, 36, 0.14);
  border-radius: 11px;
  background: rgba(7, 17, 9, 0.78);
  color: var(--pc-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea.embedded-input,
.field textarea {
  min-height: 104px;
  resize: vertical;
}

.embedded-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.users-form-card input:focus,
.users-form-card select:focus,
.users-modal input:focus,
.users-modal select:focus,
.live-inbox-filters input:focus,
.live-inbox-filters select:focus,
.live-detail-section select:focus {
  border-color: rgba(217, 47, 36, 0.48);
  background: rgba(10, 23, 12, 0.95);
  box-shadow: 0 0 0 4px rgba(217, 47, 36, 0.08);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: #d92f24;
}

input[type="range"] {
  accent-color: #d92f24;
}

.embedded-toggle {
  border-color: rgba(217, 47, 36, 0.18);
  background: #27322a;
}

.embedded-toggle.is-on {
  background: var(--pc-gradient-primary);
  box-shadow: 0 7px 18px rgba(217, 47, 36, 0.25);
}

.embedded-toggle-row {
  padding: 15px 0;
  border-color: rgba(217, 47, 36, 0.1);
}

.embedded-settings-card {
  padding: 21px;
}

.embedded-settings-head {
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.11);
}

.embedded-settings-head h3 {
  font-size: 15px;
  font-weight: 800;
}

.embedded-form-row {
  gap: 7px;
  padding: 13px 0;
  border-color: rgba(217, 47, 36, 0.09);
}

.embedded-form-row > span,
.embedded-toggle-row strong {
  color: #e9f3e6;
  font-weight: 700;
}

.embedded-form-row small,
.embedded-toggle-row span,
.embedded-code-actions span {
  color: #879d89;
  line-height: 1.55;
}

.embedded-radio-grid label,
.live-settings-options label,
.live-agent-row,
.user-workspace-check,
.workspace-option {
  border-color: rgba(217, 47, 36, 0.13);
  background: rgba(255, 255, 255, 0.016);
}

.embedded-radio-grid label:hover,
.live-settings-options label:hover,
.user-workspace-check:hover,
.workspace-option:hover {
  border-color: rgba(217, 47, 36, 0.3);
  background: rgba(217, 47, 36, 0.06);
}

.app-page-feedback,
.embedded-api-feedback,
.users-alert {
  border-radius: 13px;
}

.embedded-api-feedback.is-success,
.users-alert.success {
  border-color: rgba(217, 47, 36, 0.28);
  background: rgba(217, 47, 36, 0.1);
  color: #D92F24;
}

.app-empty-state {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 47, 36, 0.09), transparent 45%),
    var(--pc-bg-card);
}

.app-empty-state h2 {
  font-size: 18px;
  font-weight: 800;
}

.app-empty-state p {
  max-width: 570px;
  line-height: 1.65;
}

.kpi-grid {
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-grid .card {
  min-height: 146px;
  padding: 21px;
}

.kpi-grid .card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  background: linear-gradient(90deg, #111111, #d92f24, transparent);
  opacity: 0.75;
}

.kpi-label {
  color: #8fa292;
  font-weight: 600;
}

.kpi-value {
  margin: 9px 0 7px;
  color: #f7fbf5;
  font-size: 30px;
}

.dashboard-grid {
  gap: 16px !important;
}

.dashboard-grid > .card {
  min-height: 340px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th,
.users-table th {
  color: #8fa792;
  background: rgba(217, 47, 36, 0.045);
  border-bottom-color: rgba(217, 47, 36, 0.12);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody td,
.users-table td {
  border-bottom-color: rgba(217, 47, 36, 0.08);
}

tbody tr,
.users-table tbody tr {
  transition: background 0.16s ease;
}

tbody tr:hover,
.users-table tbody tr:hover {
  background: rgba(217, 47, 36, 0.035);
}

.app-table-scroll {
  border-radius: 17px;
}

.app-builder-grid {
  gap: 18px;
}

.app-builder-two-col {
  gap: 18px;
}

.app-builder-stack {
  gap: 18px;
}

.app-builder-preview {
  position: sticky;
  top: 92px;
  border-color: rgba(217, 47, 36, 0.18);
  background:
    linear-gradient(rgba(217, 47, 36, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 47, 36, 0.035) 1px, transparent 1px),
    #09150b;
  background-size: 26px 26px;
}

.app-builder-preview::after {
  content: 'Live preview';
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 5px 9px;
  border: 1px solid rgba(217, 47, 36, 0.2);
  border-radius: 999px;
  background: rgba(6, 15, 8, 0.82);
  color: #D92F24;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-builder-widget-card {
  border-color: rgba(217, 47, 36, 0.2);
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.42);
}

.app-builder-widget-head,
.embedded-install-preview-head,
.embedded-showcase-widget-head {
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.app-save-notice {
  border-color: rgba(217, 47, 36, 0.25);
  background: rgba(217, 47, 36, 0.1);
}

.app-save-notice a {
  color: #9de283;
}

.domain-list,
.workspace-option-list {
  border-color: rgba(217, 47, 36, 0.12);
  background: rgba(7, 17, 9, 0.44);
}

.domain-item,
.workspace-option {
  border-bottom-color: rgba(217, 47, 36, 0.08);
}

.domain-item button {
  color: #D92F24;
}

.app-template-grid {
  gap: 18px;
}

.app-template-card,
.app-template-create {
  min-height: 240px;
  border-color: rgba(217, 47, 36, 0.13);
  background:
    linear-gradient(180deg, rgba(217, 47, 36, 0.025), transparent),
    var(--pc-bg-card);
}

.app-template-create {
  border-style: dashed;
}

.app-template-create:hover,
.app-template-card:hover {
  border-color: rgba(217, 47, 36, 0.32);
  background-color: var(--pc-bg-card-soft);
}

.app-template-code pre,
.embedded-code-box {
  border-color: rgba(217, 47, 36, 0.12);
  background: #071008;
}

.app-template-overview,
.embedded-summary-grid {
  gap: 10px;
}

.app-template-overview > div,
.embedded-summary-item {
  border-color: rgba(217, 47, 36, 0.11);
  background: rgba(255, 255, 255, 0.018);
}

.users-layout {
  gap: 18px;
}

.users-form-card,
.users-table-card {
  border-radius: 17px;
}

.users-card-head {
  margin-bottom: 19px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.1);
}

.workspace-chip {
  border-color: rgba(217, 47, 36, 0.14);
  background: rgba(217, 47, 36, 0.08);
  color: #d7edd2;
}

.users-modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.users-modal {
  border-color: rgba(217, 47, 36, 0.19);
  background: #0c190f;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.6);
}

.live-inbox-shell {
  border-top-color: rgba(217, 47, 36, 0.12);
  background: #071008;
}

.live-inbox-list,
.live-inbox-thread,
.live-inbox-details {
  background: rgba(8, 18, 10, 0.83);
}

.live-inbox-list,
.live-inbox-thread {
  border-color: rgba(217, 47, 36, 0.11);
}

.live-inbox-title,
.live-thread-header {
  border-bottom-color: rgba(217, 47, 36, 0.11);
  background: rgba(255, 255, 255, 0.012);
}

.live-inbox-counts button {
  border-color: rgba(217, 47, 36, 0.13);
  color: #94a896;
}

.live-inbox-counts button:hover {
  border-color: rgba(217, 47, 36, 0.28);
  color: #dcefd8;
}

.live-inbox-counts button.is-active {
  border-color: rgba(217, 47, 36, 0.42);
  background: rgba(217, 47, 36, 0.16);
  color: #dff7d8;
}

.live-inbox-item {
  border-bottom-color: rgba(217, 47, 36, 0.07);
}

.live-inbox-item:hover,
.live-inbox-item.is-active {
  background: rgba(217, 47, 36, 0.09);
}

.live-inbox-item.is-active {
  box-shadow: inset 3px 0 0 #d92f24;
}

.live-inbox-avatar {
  background: var(--pc-gradient-primary);
}

.live-thread-message.is-agent,
.live-thread-message.is-assistant {
  border-color: rgba(217, 47, 36, 0.13);
  background: #122217;
}

.live-thread-message.is-user,
.live-thread-message.is-visitor {
  background: linear-gradient(135deg, #276f19, #45a822);
}

.live-thread-reply {
  border-top-color: rgba(217, 47, 36, 0.11);
  background: rgba(7, 16, 8, 0.94);
}

.live-thread-reply textarea {
  border-color: rgba(217, 47, 36, 0.14);
  background: #0c1a0f;
}

.live-thread-reply textarea:focus {
  border-color: rgba(217, 47, 36, 0.42);
  box-shadow: 0 0 0 4px rgba(217, 47, 36, 0.08);
}

.live-status.is-needs_human,
.live-status.is-assigned,
.live-status.is-active {
  border-color: rgba(217, 47, 36, 0.24);
  background: rgba(217, 47, 36, 0.13);
  color: #a5e58d;
}

.embedded-app-view .pc-section {
  background: transparent;
}

.embedded-app-view .pc-section--alt {
  background: rgba(10, 22, 12, 0.46);
}

.embedded-hero {
  min-height: auto;
  padding-top: 58px;
  padding-bottom: 48px;
}

.embedded-hero::before {
  background: radial-gradient(circle, rgba(217, 47, 36, 0.16), transparent 68%);
}

.embedded-hero-copy h1,
.pc-section-head h2 {
  color: #f5fbf3;
}

.eyebrow {
  color: #D92F24;
  border-color: rgba(217, 47, 36, 0.2);
  background: rgba(217, 47, 36, 0.09);
}

.embedded-preview-install-card,
.embedded-hero-showcase {
  border-color: rgba(217, 47, 36, 0.16);
}

.embedded-showcase-stat,
.embedded-showcase-widget,
.embedded-install-preview-widget,
.embedded-install-note,
.embedded-note,
.embedded-backend-note {
  border-color: rgba(217, 47, 36, 0.13);
}

.integration-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.integration-template-card {
  position: sticky;
  top: 92px;
}

.integration-panel-stack {
  display: grid;
  gap: 14px;
}

.integration-panel {
  overflow: hidden;
  border: 1px solid rgba(217, 47, 36, 0.13);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent),
    var(--pc-bg-card);
  box-shadow: var(--app-card-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.integration-panel:hover,
.integration-panel.is-open {
  border-color: rgba(217, 47, 36, 0.25);
  box-shadow: var(--app-card-shadow-hover);
}

.integration-panel.is-open {
  background:
    linear-gradient(180deg, rgba(217, 47, 36, 0.055), transparent 170px),
    var(--pc-bg-card);
}

.integration-panel-summary {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  padding: 17px 18px;
  border: 0;
  background: transparent;
  color: var(--pc-text);
  text-align: left;
}

.integration-panel-summary:hover {
  background: rgba(217, 47, 36, 0.035);
}

.integration-panel-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 47, 36, 0.22);
  border-radius: 13px;
  background: rgba(217, 47, 36, 0.12);
  color: #D92F24;
}

.integration-panel-copy {
  min-width: 0;
}

.integration-panel-copy strong,
.integration-panel-copy span {
  display: block;
}

.integration-panel-copy strong {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 800;
}

.integration-panel-copy span {
  overflow: hidden;
  color: #879c89;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-panel-chevron {
  color: #81aa82;
  transition: transform 0.2s ease;
}

.integration-panel.is-open .integration-panel-chevron {
  color: #9fe286;
}

.integration-panel-body {
  padding: 0 18px 18px;
  animation: integration-panel-open 0.2s ease-out;
}

.integration-panel-body[hidden] {
  display: none;
}

.integration-panel-body > .card {
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid rgba(217, 47, 36, 0.1);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.integration-panel-body > .card::before,
.integration-panel-body > .card > .embedded-settings-head {
  display: none;
}

.integration-panel-body > .card:hover {
  border-color: rgba(217, 47, 36, 0.1);
  box-shadow: none;
}

@keyframes integration-panel-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-auth-state {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 47, 36, 0.17), transparent 42%),
    var(--pc-bg);
}

.app-auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  border-radius: 20px;
  border: 1px solid rgba(217, 47, 36, 0.18);
  background: var(--pc-bg-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.app-auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: contain;
  margin-bottom: 2px;
}

.app-auth-card-loading {
  min-height: 140px;
  justify-content: center;
}

.app-auth-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(217, 47, 36, 0.18);
  border-top-color: #D92F24;
  border-radius: 50%;
  animation: appAuthSpin 700ms linear infinite;
}

@keyframes appAuthSpin {
  to { transform: rotate(360deg); }
}

.app-auth-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--pc-text);
}

.app-auth-subtitle {
  margin: 0;
  max-width: 320px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--pc-text-dim);
}

.app-auth-card .app-auth-cta {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
  font-size: 15px;
}

.app-auth-back {
  font-size: 13px;
  color: var(--pc-text-muted);
  text-decoration: none;
}

.app-auth-back:hover {
  color: var(--pc-text);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .app-auth-card { padding: 32px 22px; }
}

@media (max-width: 1180px) {
  :root {
    --app-sidebar-width: 224px;
  }

  .view {
    padding-right: 28px;
    padding-left: 28px;
  }

  .integration-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .integration-layout {
    grid-template-columns: 1fr;
  }

  .integration-template-card,
  .app-builder-preview {
    position: relative;
    top: auto;
  }

  .integration-panel-copy span {
    white-space: normal;
  }
}

@media (max-width: 760px) {
  .app {
    display: block;
  }

  .sb {
    position: sticky;
    top: 0;
    height: 62px;
    min-height: 62px;
    padding: 8px 10px;
    background: rgba(7, 16, 8, 0.97);
    border-bottom-color: rgba(217, 47, 36, 0.14);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  }

  .sb-logo {
    min-height: 0;
    padding: 3px 7px 3px 3px;
    border-bottom: 0;
  }

  .sb-logo img {
    width: 34px;
    height: 34px;
  }

  .sb-item {
    min-height: 42px;
    transform: none;
  }

  .sb-status {
    display: none !important;
  }

  .tb {
    position: relative;
    top: auto;
    min-height: 0;
    height: auto;
    padding: 14px;
    background: rgba(8, 18, 10, 0.92);
  }

  .tb-actions {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .tb-actions .tb-icon,
  .tb-actions .tb-avatar {
    display: flex;
  }

  .tb-actions .btn {
    width: auto;
  }

  .view {
    padding: 23px 15px 36px;
  }

  .view-head {
    align-items: stretch;
  }

  .view-head > div:last-child,
  .view-actions {
    display: flex !important;
    flex-wrap: wrap;
  }

  .view-head > .btn,
  .view-actions .btn,
  .view-head > div:last-child .btn {
    width: auto;
    flex: 1 1 150px;
  }

  .card,
  .embedded-settings-card {
    padding: 17px;
  }

  .integration-panel-summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 15px;
  }

  .integration-panel-summary .pill {
    grid-column: 2;
    justify-self: start;
  }

  .integration-panel-chevron {
    grid-column: 3;
    grid-row: 1;
  }

  .integration-panel-body {
    padding: 0 15px 15px;
  }
}

@media (max-width: 520px) {
  .tb-actions {
    grid-template-columns: 1fr auto auto;
  }

  .tb-actions .btn {
    min-width: 0;
    padding-right: 11px;
    padding-left: 11px;
  }

  .view-head h1 {
    font-size: 23px;
  }

  .integration-panel-icon {
    width: 38px;
    height: 38px;
  }

  .integration-panel-copy strong {
    font-size: 13px;
  }

  .integration-panel-copy span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.pc-glow {
  background: radial-gradient(closest-side, rgba(217, 47, 36, 0.48), rgba(217, 47, 36, 0));
}

.text-gradient {
  background: var(--pc-gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pill-accent,
.pill-cyan {
  border-color: rgba(217, 47, 36, 0.3);
  background: rgba(217, 47, 36, 0.13);
  color: #D92F24;
}

.embedded-range-row input,
.embedded-radio-grid input {
  accent-color: #d92f24;
}

.app-builder-widget-starters button,
.embedded-showcase-starters button,
.embedded-install-preview-starters button {
  border-color: rgba(217, 47, 36, 0.24);
  background: rgba(217, 47, 36, 0.1);
  color: #D92F24;
}

.live-inbox-item-meta b {
  background: #d92f24;
}

.live-thread-message.is-visitor > div {
  border: 0;
  background: linear-gradient(135deg, #111111, #d92f24);
  color: #fff;
}

.live-thread-message.is-agent > div {
  border-color: rgba(217, 47, 36, 0.18);
  background: #15281a;
}

.live-thread-reply button {
  background: var(--pc-gradient-primary);
  box-shadow: 0 8px 20px rgba(217, 47, 36, 0.24);
}

.live-status {
  border: 1px solid rgba(217, 47, 36, 0.2);
  background: rgba(217, 47, 36, 0.12);
  color: #D92F24;
}

/* App experience refinement */
:root {
  --pc-text: #fbfff9;
  --pc-text-muted: #becdbe;
  --pc-text-dim: #91a493;
  --pc-bg-card: #102016;
  --pc-bg-card-soft: #15291b;
  --pc-border: #29432e;
  --pc-border-strong: #416b49;
  --app-card-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
  --app-card-shadow-hover: 0 18px 42px rgba(0, 0, 0, 0.28);
}

html,
body,
#root {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body {
  color: var(--pc-text);
}

.app {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-main {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.tb {
  flex: 0 0 68px;
}

.app-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}

.app-content.is-conversations-view {
  overflow: hidden !important;
}

.sb {
  position: relative;
  height: 100dvh;
  min-height: 0;
  overscroll-behavior: contain;
}

.view {
  max-width: 1440px;
  min-height: 100%;
  padding: 30px 34px 46px;
}

.view-head {
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.12);
}

.view-head h1 {
  color: #ffffff;
  font-size: 28px;
  line-height: 1.15;
}

.view-head .sub,
.pc-section-head p,
.embedded-hero-copy p,
.app-empty-state p,
.app-template-create small,
.live-inbox-empty,
.live-inbox-placeholder {
  color: var(--pc-text-muted);
}

.card {
  border-color: rgba(217, 47, 36, 0.17);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    var(--pc-bg-card);
  box-shadow: var(--app-card-shadow);
}

.card::before {
  opacity: 0.5;
}

body .card:hover {
  transform: none;
  border-color: rgba(217, 47, 36, 0.25);
  box-shadow: var(--app-card-shadow-hover);
}

.btn {
  min-height: 40px;
  justify-content: center;
  border-radius: 11px;
}

.btn-secondary {
  border-color: rgba(190, 218, 190, 0.2);
  background: rgba(255, 255, 255, 0.025);
  color: #eff8ec;
}

.btn-secondary:hover {
  border-color: rgba(217, 47, 36, 0.38);
  background: rgba(217, 47, 36, 0.08);
}

.pill.dim {
  color: #b8c8b9;
}

.embedded-input,
.field input,
.field select,
.field textarea,
.users-form-card input,
.users-form-card select,
.users-modal input,
.users-modal select,
.live-inbox-filters input,
.live-inbox-filters select,
.live-detail-section select {
  color: #f7fcf5;
  background: rgba(5, 15, 8, 0.78);
}

.embedded-input::placeholder,
.field input::placeholder,
.field textarea::placeholder,
.live-inbox-filters input::placeholder {
  color: #78907b;
}

.embedded-form-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  align-items: start;
  column-gap: 22px;
  row-gap: 7px;
  padding: 15px 0;
}

.embedded-form-row > span {
  align-self: center;
  color: #f2f8ef;
  line-height: 1.45;
}

.embedded-form-row > .embedded-input,
.embedded-form-row > .embedded-color-row,
.embedded-form-row > .embedded-radio-grid,
.embedded-form-row > .embedded-range-row,
.embedded-form-row > .domain-list,
.embedded-form-row > .domain-add-row,
.embedded-form-row > .domain-error,
.embedded-form-row > .live-settings-options,
.embedded-form-row > div:not(:first-child),
.embedded-form-row > small {
  grid-column: 2;
}

.embedded-form-row > small {
  color: #a8b9aa;
}

.embedded-toggle-row {
  min-height: 72px;
  gap: 24px;
}

.embedded-toggle-row strong {
  color: #f4faf1;
}

.embedded-toggle-row span {
  color: #aebdaf;
}

.embedded-card-grid.app-builder-two-col,
.app-builder-two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

.app-builder-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: start;
  gap: 22px;
}

.app-builder-stack {
  gap: 16px;
}

.app-settings-panel {
  overflow: hidden;
  border: 1px solid rgba(217, 47, 36, 0.17);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent),
    var(--pc-bg-card);
  box-shadow: var(--app-card-shadow);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-settings-panel:hover,
.app-settings-panel.is-open {
  border-color: rgba(217, 47, 36, 0.28);
}

.app-settings-panel-summary {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  border: 0;
  background: transparent;
  color: var(--pc-text);
  text-align: left;
}

.app-settings-panel-summary:hover {
  background: rgba(217, 47, 36, 0.045);
}

.app-settings-panel-title {
  color: #f8fdf6;
  font-size: 15px;
  font-weight: 800;
}

.app-settings-panel-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 47, 36, 0.15);
  border-radius: 10px;
  color: #9fc99e;
  background: rgba(255, 255, 255, 0.018);
}

.app-settings-panel-body {
  padding: 2px 20px 20px;
  border-top: 1px solid rgba(217, 47, 36, 0.1);
  animation: app-panel-in 0.18s ease-out;
}

.app-settings-panel-body[hidden] {
  display: none;
}

.app-settings-panel-body .embedded-form-row:first-child,
.app-settings-panel-body .embedded-toggle-row:first-child {
  padding-top: 18px;
}

.ai-builder-view .view-head {
  align-items: start;
}

.ai-builder-section-stack {
  display: grid;
  gap: 18px;
}

.ai-builder-main-section {
  border-color: rgba(217, 47, 36, 0.22);
  background:
    linear-gradient(180deg, rgba(217, 47, 36, 0.035), transparent 150px),
    rgba(8, 19, 10, 0.88);
}

.ai-builder-main-summary {
  min-height: 78px;
  padding: 17px 20px;
}

.ai-builder-main-body {
  display: grid;
  gap: 20px;
  padding: 20px;
  background: rgba(4, 13, 6, 0.22);
}

.ai-builder-main-body > .widget-editor-grid,
.ai-builder-main-body > .customize-settings-grid,
.ai-builder-main-body > .embedded-preview-install-wrap {
  min-width: 0;
}

.ai-builder-main-body > .training-view {
  width: 100%;
  max-width: none;
  min-height: 0;
  padding: 0;
}

.ai-builder-customize-grid {
  align-items: start;
}

.ai-builder-customize-grid .app-settings-panel-body {
  height: auto;
}

.ai-builder-install-wrap {
  margin: 0;
}

.ai-builder-install-card {
  border: 1px solid rgba(217, 47, 36, 0.16);
  background:
    linear-gradient(180deg, rgba(217, 47, 36, 0.025), transparent),
    var(--pc-bg-card);
}

@keyframes app-panel-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-builder-preview {
  top: 22px;
  min-height: 620px;
  border-radius: 18px;
}

.domain-list {
  max-height: 220px;
  overflow-y: auto;
  border-radius: 12px;
}

.domain-item {
  min-height: 48px;
  padding: 10px 12px;
}

.domain-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

/* Template cards */
.app-template-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
}

.app-template-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.app-template-head {
  margin: 0;
  padding: 20px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.11);
}

.app-template-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-template-title-wrap > div {
  min-width: 0;
}

.app-template-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 47, 36, 0.22);
  border-radius: 13px;
  background: rgba(217, 47, 36, 0.12);
  color: #9be17f;
}

.app-template-head h2 {
  color: #fbfff9;
}

.app-template-head span:not(.pill) {
  max-width: 100%;
  color: #91a493;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-template-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 18px 20px;
}

.app-template-quick-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(217, 47, 36, 0.11);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.app-template-quick-grid span,
.app-template-quick-grid strong {
  display: block;
}

.app-template-quick-grid span {
  margin-bottom: 5px;
  color: #8fa293;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-template-quick-grid strong {
  overflow: hidden;
  color: #edf5e9;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-template-detail-toggle {
  width: calc(100% - 40px);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 20px 16px;
  padding: 9px 12px;
  border: 1px solid rgba(217, 47, 36, 0.13);
  border-radius: 10px;
  background: rgba(217, 47, 36, 0.045);
  color: #cfe0ce;
  font-size: 12px;
  font-weight: 700;
}

.app-template-detail-toggle:hover {
  border-color: rgba(217, 47, 36, 0.32);
  background: rgba(217, 47, 36, 0.08);
  color: #f4fbf1;
}

.app-template-details {
  padding: 0 20px 18px;
  animation: app-panel-in 0.18s ease-out;
}

.app-template-details[hidden] {
  display: none;
}

.app-template-details .app-template-overview {
  margin-bottom: 14px;
}

.app-template-details .app-template-code pre {
  max-height: 170px;
}

.app-template-actions {
  margin-top: auto;
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(217, 47, 36, 0.1);
}

.app-template-create {
  min-height: 300px;
}

/* Integration launch cards and floating configuration window */
.integration-layout {
  display: block;
}

.integration-template-card {
  position: relative;
  top: auto;
  margin-bottom: 20px;
}

.integration-template-warning {
  margin-bottom: 18px;
}

.integration-layout.is-disabled .integration-template-card,
.integration-layout.is-disabled .integration-launch-card {
  opacity: 0.58;
  filter: grayscale(0.45);
}

.integration-template-card .embedded-settings-head {
  margin-bottom: 8px;
}

.integration-template-card .embedded-form-row {
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
}

.integration-panel-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.integration-launch-card {
  min-height: 228px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(217, 47, 36, 0.17);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 47, 36, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent),
    var(--pc-bg-card);
  color: var(--pc-text);
  text-align: left;
  box-shadow: var(--app-card-shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.integration-launch-card:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 47, 36, 0.36);
  box-shadow: var(--app-card-shadow-hover);
}

.integration-launch-card.is-disabled,
.integration-launch-card:disabled {
  cursor: not-allowed;
}

.integration-launch-card.is-disabled:hover,
.integration-launch-card:disabled:hover {
  transform: none;
  border-color: rgba(217, 47, 36, 0.17);
  box-shadow: var(--app-card-shadow);
}

.integration-launch-card.is-disabled .integration-launch-action,
.integration-launch-card:disabled .integration-launch-action {
  color: var(--pc-text-muted);
}

.integration-layout.is-disabled .integration-template-card .embedded-input {
  cursor: not-allowed;
}

.integration-launch-icon,
.integration-modal-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 47, 36, 0.24);
  border-radius: 14px;
  background: rgba(217, 47, 36, 0.13);
  color: #D92F24;
}

.integration-launch-copy {
  flex: 1;
}

.integration-launch-copy > strong,
.integration-launch-copy > span {
  display: block;
}

.integration-launch-copy > strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: #fbfff9;
  font-size: 16px;
  font-weight: 800;
}

.integration-launch-copy > span {
  color: #b2c1b3;
  font-size: 13px;
  line-height: 1.6;
}

.integration-launch-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #D92F24;
  font-size: 12px;
  font-weight: 800;
}

.integration-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(2, 8, 4, 0.78);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: integration-backdrop-in 0.16s ease-out;
}

.integration-modal {
  width: min(880px, 100%);
  max-height: min(88dvh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(217, 47, 36, 0.28);
  border-radius: 20px;
  background: #0b180e;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.68);
  animation: integration-modal-in 0.2s ease-out;
}

.integration-modal-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.14);
  background: linear-gradient(180deg, rgba(217, 47, 36, 0.07), rgba(217, 47, 36, 0.015));
}

.integration-modal-head h2 {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.integration-modal-head p {
  margin: 0;
  color: #aebdaf;
  font-size: 12px;
  line-height: 1.5;
}

.integration-modal-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(190, 218, 190, 0.17);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: #d9e5d7;
}

.integration-modal-close:hover {
  border-color: rgba(217, 47, 36, 0.36);
  background: rgba(217, 47, 36, 0.08);
}

.integration-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.integration-modal-body > .card {
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.integration-modal-body > .card:hover {
  border: 0;
  box-shadow: none;
}

.integration-modal-body > .card > .embedded-settings-head {
  display: none;
}

.integration-modal-body .embedded-form-row {
  grid-template-columns: minmax(170px, 0.36fr) minmax(0, 1fr);
}

.integration-page-section {
  display: grid;
  gap: 16px;
}

.integration-card-soft {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(190, 218, 190, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.integration-form-grid {
  display: grid;
  gap: 14px;
}

.integration-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #d9e5d7;
  font-size: 13px;
  line-height: 1.45;
}

.integration-toggle-row input {
  margin-top: 3px;
}

.integration-status-lines {
  display: grid;
  gap: 8px;
  color: #b2c1b3;
  font-size: 12px;
  line-height: 1.55;
}

.integration-status-lines strong {
  color: #fbfff9;
}

.integration-inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #d9e5d7;
  font-size: 13px;
}

.integration-inline-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.has-app-modal .app-content {
  overflow: hidden !important;
}

@keyframes integration-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes integration-modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Compact install experience inside the app */
.embedded-app-view {
  min-height: 100%;
}

.embedded-app-view .pc-section {
  padding: 28px 34px 32px;
}

.embedded-app-view .pc-container {
  max-width: 1372px;
}

.embedded-hero {
  padding-top: 30px !important;
  padding-bottom: 18px !important;
}

.embedded-hero-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.75fr);
  gap: 26px;
  align-items: center;
}

.embedded-hero-copy h1 {
  max-width: 620px;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.06;
}

.embedded-hero-copy p {
  max-width: 650px;
  font-size: 15px;
}

.embedded-hero-actions {
  margin-top: 22px;
}

.embedded-note {
  margin-top: 18px;
}

.embedded-hero-showcase {
  min-height: 0;
  padding: 18px;
}

.embedded-app-view .pc-section--alt {
  padding-top: 24px;
  background: transparent;
}

.embedded-app-view .pc-section-head {
  max-width: none;
  margin: 0 0 20px;
  text-align: left;
}

.embedded-app-view .pc-section-head h2 {
  margin-bottom: 8px;
  font-size: 30px;
}

.embedded-app-view .pc-section-head p {
  max-width: 820px;
  font-size: 14px;
  line-height: 1.6;
}

.embedded-preview-install-wrap {
  max-width: none;
}

.embedded-preview-install-card {
  padding: 22px;
  border-radius: 18px;
}

.embedded-preview-install-head {
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.12);
}

.embedded-preview-install-grid {
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
}

.embedded-template-name-row {
  align-items: end;
  gap: 14px;
}

.embedded-template-name-row .embedded-form-row {
  grid-template-columns: 1fr;
}

.embedded-template-name-row .embedded-form-row > * {
  grid-column: 1;
}

.embedded-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* First-run dashboard tour */
.app-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 8, 4, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.has-app-tour .sb {
  z-index: 3001;
}

.sb-item.is-tour-target {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(72, 181, 25, 0.42), rgba(217, 47, 36, 0.16));
  border-color: rgba(158, 232, 130, 0.65);
  box-shadow: 0 0 0 4px rgba(217, 47, 36, 0.15), 0 12px 30px rgba(0, 0, 0, 0.35);
}

.app-tour-dialog {
  position: relative;
  z-index: 3002;
  width: min(470px, 100%);
  padding: 24px;
  border: 1px solid rgba(217, 47, 36, 0.3);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 47, 36, 0.13), transparent 38%),
    #0d1c11;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.68);
}

.app-tour-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: #94a997;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-tour-progress strong {
  color: #a9e991;
}

.app-tour-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(217, 47, 36, 0.26);
  border-radius: 15px;
  background: rgba(217, 47, 36, 0.14);
  color: #a1e684;
}

.app-tour-dialog h2 {
  margin: 0 0 9px;
  color: #ffffff;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.app-tour-dialog p {
  margin: 0;
  color: #becdbe;
  font-size: 14px;
  line-height: 1.65;
}

.app-tour-dots {
  display: flex;
  gap: 6px;
  margin: 20px 0;
}

.app-tour-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(190, 218, 190, 0.2);
}

.app-tour-dots span.is-active {
  width: 24px;
  background: #d92f24;
}

.app-tour-actions,
.app-tour-actions > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-tour-actions {
  justify-content: space-between;
}

@media (max-width: 1100px) {
  .embedded-card-grid.app-builder-two-col,
  .app-builder-two-col,
  .app-builder-grid {
    grid-template-columns: 1fr;
  }

  .app-builder-preview {
    position: relative;
    top: auto;
    min-height: 560px;
  }

  .integration-panel-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .embedded-hero-grid,
  .embedded-preview-install-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app {
    display: flex !important;
    flex-direction: column;
    height: 100dvh;
  }

  .sb {
    flex: 0 0 62px;
    height: 62px;
  }

  .app-main {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }

  .app-content {
    min-height: 0;
  }

  .view {
    padding: 22px 15px 34px;
  }

  .view-head {
    align-items: stretch;
  }

  .embedded-form-row,
  .integration-template-card .embedded-form-row,
  .integration-modal-body .embedded-form-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .embedded-form-row > .embedded-input,
  .embedded-form-row > .embedded-color-row,
  .embedded-form-row > .embedded-radio-grid,
  .embedded-form-row > .embedded-range-row,
  .embedded-form-row > .domain-list,
  .embedded-form-row > .domain-add-row,
  .embedded-form-row > .domain-error,
  .embedded-form-row > .live-settings-options,
  .embedded-form-row > div:not(:first-child),
  .embedded-form-row > small {
    grid-column: 1;
  }

  .integration-panel-stack,
  .app-template-grid {
    grid-template-columns: 1fr;
  }

  .integration-launch-card {
    min-height: 200px;
  }

  .integration-modal-backdrop {
    padding: 0;
  }

  .integration-modal {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .integration-modal-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 14px 15px;
  }

  .integration-modal-head > .pill {
    grid-column: 2;
    justify-self: start;
  }

  .integration-modal-close {
    grid-column: 3;
    grid-row: 1;
  }

  .integration-modal-scroll {
    padding: 15px;
  }

  .app-template-quick-grid {
    grid-template-columns: 1fr;
  }

  .domain-add-row {
    grid-template-columns: 1fr;
  }

  .embedded-app-view .pc-section {
    padding: 22px 15px 28px;
  }

  .embedded-preview-install-card {
    padding: 17px;
  }

  .ai-builder-main-summary {
    min-height: 68px;
    padding: 14px;
  }

  .ai-builder-main-body {
    padding: 14px;
  }

  .ai-builder-customize-grid {
    grid-template-columns: 1fr;
  }

  .ai-builder-customize-grid .embedded-form-row {
    grid-template-columns: 1fr;
  }

  .ai-builder-customize-grid .embedded-form-row > * {
    grid-column: 1;
  }

  .ai-builder-view .app-model-picker,
  .ai-builder-view .embedded-preview-install-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ai-builder-view .app-model-picker .btn,
  .ai-builder-view .embedded-preview-install-actions .btn {
    width: 100%;
  }

  .app-tour-backdrop {
    place-items: end center;
    padding: 12px;
  }

  .app-tour-dialog {
    width: 100%;
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .app-tour-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .app-tour-actions > div,
  .app-tour-actions .btn {
    width: 100%;
  }

  .app-tour-actions > div .btn {
    flex: 1;
  }
}

/* PluginChatBot widget preview */
.plug-widget-live-preview {
  position: sticky;
  top: 22px;
  overflow: hidden;
  align-self: start;
  border: 1px solid #dbe5d8;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22);
}

.plug-widget-live-preview.app-builder-preview {
  min-height: 0;
  padding: 0;
  background: #ffffff;
}

.plug-widget-live-preview.app-builder-preview::after {
  content: none;
}

.plug-widget-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #dbe5d8;
  color: #182118;
}

.plug-widget-preview-heading > div {
  display: grid;
  gap: 4px;
}

.plug-widget-preview-heading strong {
  color: #182118;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.plug-widget-preview-kicker {
  color: #2f8f2d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plug-widget-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e8f7ec;
  color: #16824c;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
}

.plug-widget-live-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16824c;
}

.plug-widget-preview-stage {
  display: flex;
  min-height: 610px;
  padding: 24px;
  background: #edf3eb;
}

.plug-widget-preview-stage.is-bottom-right {
  align-items: flex-end;
  justify-content: flex-end;
}

.plug-widget-preview-stage.is-bottom-left {
  align-items: flex-end;
  justify-content: flex-start;
}

.plug-widget-preview-stage.is-top-right {
  align-items: flex-start;
  justify-content: flex-end;
}

.plug-widget-preview-stage.is-top-left {
  align-items: flex-start;
  justify-content: flex-start;
}

.plug-widget-window {
  --pcw-accent: #d92f24;
  --pcw-accent-soft: rgba(29, 255, 133, 0.15);
  --pcw-accent-subtle: rgba(29, 255, 133, 0.08);
  --pcw-accent-glow: rgba(29, 255, 133, 0.38);
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  overflow: hidden;
  width: min(100%, 340px);
  height: 558px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 25px;
  background: #000000;
  box-shadow: 0 24px 54px rgba(12, 24, 10, 0.26);
  color: #ffffff;
  font-family: Outfit, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.plug-widget-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 156px;
  padding: 19px 58px 15px;
  background: #000000;
}

.plug-widget-orb {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
}

.plug-widget-avatar {
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--pcw-accent-soft, rgba(217,47,36,.15)), 0 0 24px var(--pcw-accent-soft, rgba(217,47,36,.15));
}

.plug-widget-orb::before,
.plug-widget-orb::after,
.plug-widget-orb span {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--pcw-accent);
  filter: blur(10px);
}

.plug-widget-orb::before {
  inset: 9px 15px 16px 10px;
  opacity: 0.5;
  transform: rotate(22deg);
}

.plug-widget-orb::after {
  inset: 20px 8px 8px 24px;
  opacity: 0.34;
  transform: rotate(-18deg);
}

.plug-widget-orb span {
  inset: 14px 18px 12px 17px;
  opacity: 0.56;
  transform: scale(0.9);
}

.plug-widget-identity {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  text-align: center;
}

.plug-widget-identity strong {
  max-width: 100%;
  overflow: hidden;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plug-widget-identity small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--pcw-accent);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plug-widget-identity small i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pcw-accent);
  box-shadow: 0 0 8px var(--pcw-accent);
}

.plug-widget-header-actions {
  position: absolute;
  top: 16px;
  right: 14px;
  display: flex;
  gap: 7px;
}

.plug-widget-header-actions span {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  background: #090909;
  color: rgba(255, 255, 255, 0.58);
}

.plug-widget-header-actions svg {
  width: 17px;
  height: 17px;
}

.plug-widget-messages {
  flex: 1;
  min-height: 0;
  padding: 12px 14px 18px;
  background: #000000;
}

.plug-widget-message {
  width: fit-content;
  max-width: 83%;
  border: 1px solid #1c241f;
  border-radius: 18px 18px 18px 5px;
  background: #080d0a;
  padding: 12px 14px;
  color: #f5f7f5;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.plug-widget-composer {
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #151515;
  background: #090909;
  padding: 14px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 11px;
}

.plug-widget-composer > span {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid #252525;
  border-radius: 999px;
  background: #111111;
  padding: 0 17px;
}

.plug-widget-composer button {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--pcw-accent);
  color: #000000;
  padding: 0;
  pointer-events: none;
  box-shadow: 0 0 20px var(--pcw-accent-soft);
}

.plug-widget-composer svg {
  width: 20px;
  height: 20px;
}

.plug-widget-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 55px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: #000000;
  padding: 10px 11px 13px;
}

.plug-widget-tools > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 27px;
  border: 1px solid #1d1d1d;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.46);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.plug-widget-tools > span.is-danger {
  border-color: rgba(255, 51, 102, 0.38);
  color: #ff4b76;
}

.plug-widget-preview-note {
  margin: 0;
  padding: 12px 18px;
  color: #6a7768;
  background: #ffffff;
  font-size: 12px;
  line-height: 1.5;
}

.plug-widget-live-preview.is-compact {
  position: relative;
  top: auto;
}

.plug-widget-live-preview.is-compact .plug-widget-preview-heading,
.plug-widget-live-preview.is-compact .plug-widget-preview-note {
  display: none;
}

.plug-widget-live-preview.is-compact .plug-widget-preview-stage {
  min-height: 570px;
  padding: 15px;
}

.plug-widget-live-preview.is-compact .plug-widget-window {
  width: min(100%, 320px);
  height: 538px;
}

.plug-widget-install-preview {
  width: 100%;
}

@media (max-width: 1100px) {
  .plug-widget-live-preview {
    position: relative;
    top: auto;
  }
}

@media (max-width: 760px) {
  .plug-widget-preview-stage,
  .plug-widget-live-preview.is-compact .plug-widget-preview-stage {
    min-height: 570px;
    padding: 15px;
  }

  .plug-widget-window,
  .plug-widget-live-preview.is-compact .plug-widget-window {
    width: min(100%, 320px);
    height: 538px;
  }
}

@media (max-width: 420px) {
  .plug-widget-preview-heading {
    align-items: flex-start;
  }

  .plug-widget-preview-stage,
  .plug-widget-live-preview.is-compact .plug-widget-preview-stage {
    min-height: 530px;
    padding: 10px;
  }

  .plug-widget-window,
  .plug-widget-live-preview.is-compact .plug-widget-window {
    width: 100%;
    height: 510px;
  }

  .plug-widget-header {
    min-height: 142px;
    padding-top: 15px;
  }

  .plug-widget-orb {
    width: 62px;
    height: 62px;
  }

  .plug-widget-tools > span {
    padding-inline: 6px;
    font-size: 8px;
  }
}

/* App experience parity and alignment */
.app-field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #f4faf1;
  font-weight: 700;
  line-height: 1.4;
}

.app-field-label-row > label,
.app-field-label-row > span {
  color: inherit;
  font: inherit;
}

.app-info-tip {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  vertical-align: middle;
}

.app-info-button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #86b784;
  cursor: help;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.app-info-button:hover,
.app-info-button:focus-visible {
  background: rgba(217, 47, 36, .1);
  color: #b8f79f;
  box-shadow: 0 0 0 3px rgba(217, 47, 36, .08);
  outline: 0;
}

.app-info-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 4500;
  width: min(300px, 78vw);
  padding: 10px 12px;
  border: 1px solid rgba(217, 47, 36, .22);
  border-radius: 10px;
  background: #132117;
  color: #dce9dc;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .42);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity .16s ease, transform .16s ease;
}

.app-info-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 9px;
  height: 9px;
  border-right: 1px solid rgba(217, 47, 36, .22);
  border-bottom: 1px solid rgba(217, 47, 36, .22);
  background: #132117;
  transform: translate(-50%, -5px) rotate(45deg);
}

.app-info-tip:hover .app-info-tooltip,
.app-info-tip:focus-within .app-info-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-settings-panel {
  overflow: visible;
}

.app-settings-panel-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.app-settings-panel-heading small {
  color: #9fb09f;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.app-settings-panel-body {
  border-radius: 0 0 17px 17px;
  background: rgba(4, 14, 7, .12);
}

.embedded-form-row > .app-field-label-row {
  align-self: start;
  grid-column: 1;
  padding-top: 12px;
}

.embedded-form-row > small.is-error {
  color: #ff9aa8;
}

.embedded-toggle-row strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.view-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Balanced Customize page grid */
.customize-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.customize-settings-grid > .app-settings-panel {
  height: 100%;
}

.customize-settings-grid .app-settings-panel-body {
  height: calc(100% - 73px);
}

.customize-settings-grid .embedded-form-row {
  grid-template-columns: minmax(155px, .72fr) minmax(0, 1.28fr);
  column-gap: 22px;
  padding: 18px 0;
}

.customize-settings-grid .embedded-toggle-row {
  padding: 18px 0;
}

.app-secret-field {
  position: relative;
  display: grid;
  gap: 8px;
}

.app-saved-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: #94d87e;
  font-size: 11px;
  font-weight: 700;
}

.app-model-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.app-model-picker .btn {
  min-width: 142px;
  white-space: nowrap;
}

.embedded-range-row.is-disabled {
  opacity: .58;
}

.domain-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  padding: 0;
  border: 0;
  background: transparent;
}

.domain-item {
  border: 1px solid rgba(217, 47, 36, .12);
  border-radius: 11px;
  background: rgba(7, 19, 10, .78);
}

/* Plug-style Knowledge Base page */
.training-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(320px, .72fr);
  gap: 20px;
  align-items: start;
}

.training-primary,
.training-secondary {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.training-secondary {
  position: sticky;
  top: 20px;
}

.training-card {
  padding: 20px;
  border-radius: 18px;
}

.training-card-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 13px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(217, 47, 36, .11);
}

.training-card-heading h2,
.training-files-head h2 {
  margin: 0;
  color: #f7fcf5;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.training-card-heading p,
.training-files-head p {
  margin: 4px 0 0;
  color: #a8b9aa;
  font-size: 12.5px;
  line-height: 1.55;
}

.training-template-card .embedded-form-row,
.training-library-card .embedded-form-row {
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  column-gap: 18px;
  padding: 15px 0;
}

.training-dropzone {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 225px;
  padding: 24px;
  border: 2px dashed rgba(144, 202, 127, .38);
  border-radius: 15px;
  background: rgba(7, 18, 10, .52);
  color: #f4faf1;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.training-dropzone:hover,
.training-dropzone.is-dragging {
  border-color: #78ff47;
  background: rgba(217, 47, 36, .07);
  transform: translateY(-1px);
}

.training-dropzone:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.training-dropzone-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 11px;
  border: 1px solid rgba(217, 47, 36, .22);
  border-radius: 15px;
  background: rgba(217, 47, 36, .09);
  color: #8ee66f;
}

.training-dropzone strong {
  margin-bottom: 5px;
  font-size: 15px;
}

.training-dropzone > span:last-child {
  color: #9eafa0;
  font-size: 12px;
}

.training-files-card {
  padding: 0;
  overflow: hidden;
}

.training-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 20px;
  border-bottom: 1px solid rgba(217, 47, 36, .11);
}

.training-files-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.training-files-tools > .embedded-input {
  width: 210px;
}

.training-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #aebcaf;
  font-size: 12px;
}

.training-file-list {
  display: grid;
}

.training-file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(217, 47, 36, .09);
}

.training-file-row:last-child {
  border-bottom: 0;
}

.training-file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(217, 47, 36, .14);
  border-radius: 10px;
  background: rgba(217, 47, 36, .07);
  color: #8bcf78;
}

.training-file-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.training-file-copy > strong {
  overflow: hidden;
  color: #f1f8ef;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.training-file-copy > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #9eafa0;
  font-size: 11.5px;
}

.training-file-actions,
.app-feedback-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.training-file-empty {
  padding: 26px 20px;
  color: #9eafa0;
  font-size: 13px;
  text-align: center;
}

.training-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 14px 0;
}

.training-toggle-row strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #f4faf1;
  font-size: 13.5px;
}

.training-toggle-row p {
  margin: 4px 0 0;
  color: #a8b9aa;
  font-size: 12.5px;
  line-height: 1.5;
}

.training-unsaved {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(217, 47, 36, .1);
  color: #e4c873;
  font-size: 11.5px;
  font-weight: 700;
}

.training-create-library {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.training-technical-details {
  margin-top: 12px;
  border-top: 1px solid rgba(217, 47, 36, .1);
  padding-top: 12px;
  color: #9eafa0;
  font-size: 11.5px;
}

.training-technical-details summary {
  cursor: pointer;
  color: #b8c7b9;
  font-weight: 700;
}

.training-technical-details code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 9px;
  color: #cce4c9;
}

.training-guidance {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid rgba(217, 47, 36, .15);
  border-radius: 15px;
  background: rgba(217, 47, 36, .055);
  padding: 15px;
  color: #8fd57a;
}

.training-guidance strong {
  color: #eef8eb;
  font-size: 13px;
}

.training-guidance p {
  margin: 4px 0 0;
  color: #a7b7a8;
  font-size: 12px;
  line-height: 1.55;
}

/* Dark app-aligned widget previews */
.plug-widget-live-preview,
.plug-widget-live-preview.app-builder-preview {
  border-color: rgba(217, 47, 36, .18);
  background: #0b180e;
  box-shadow: 0 24px 58px rgba(0, 0, 0, .38);
}

.plug-widget-preview-heading {
  border-bottom-color: rgba(217, 47, 36, .12);
  background: #0e1d12;
  color: #f3f8f1;
}

.plug-widget-preview-heading strong {
  color: #f3f8f1;
}

.plug-widget-live-dot {
  background: rgba(217, 47, 36, .1);
  color: #8be76c;
}

.plug-widget-live-dot i {
  background: #78ff47;
}

.plug-widget-preview-stage,
.plug-widget-live-preview.is-compact .plug-widget-preview-stage {
  background:
    linear-gradient(rgba(217, 47, 36, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(217, 47, 36, .035) 1px, transparent 1px),
    #071109;
  background-size: 22px 22px;
}

.plug-widget-preview-note {
  border-top: 1px solid rgba(217, 47, 36, .1);
  background: #0e1d12;
  color: #9faf9f;
}

.plug-widget-starters {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.plug-widget-starters > span {
  display: block;
  width: fit-content;
  max-width: 86%;
  border: 1px solid var(--pcw-accent);
  border-radius: 16px 16px 5px 16px;
  background: var(--pcw-accent-subtle);
  color: #f6fff2;
  padding: 8px 11px;
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

/* Precise Install page columns */
.embedded-template-name-row,
.embedded-preview-install-grid {
  display: grid;
  grid-template-columns: minmax(330px, .82fr) minmax(0, 1.18fr);
  gap: 22px;
}

.embedded-template-name-row {
  align-items: end;
  margin: 20px 0;
}

.embedded-template-name-row .embedded-form-row {
  display: grid;
  grid-template-columns: 1fr;
  align-content: end;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.embedded-template-name-row .embedded-form-row > * {
  grid-column: 1;
  width: 100%;
}

.embedded-template-name-row .embedded-form-row > .app-field-label-row {
  padding-top: 0;
}

/* Template name: make the typed name large and bold so it reads at a glance */
.embedded-template-name-row .embedded-input {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1px;
  min-height: 48px;
  text-overflow: ellipsis;
}

.embedded-install-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  margin: 0;
  border: 1px solid rgba(217, 47, 36, .14);
  border-radius: 13px;
  background: rgba(217, 47, 36, .055);
  padding: 14px 16px;
  color: #b2c2b3;
  font-size: 12.5px;
  line-height: 1.55;
}

.embedded-install-note > svg {
  flex: 0 0 auto;
  color: #86da6c;
}

.embedded-preview-install-grid > * {
  min-width: 0;
}

.embedded-install-column {
  align-content: start;
}

/* Page-specific guided tours */
.app-tour-trigger {
  color: #a8b9aa;
}

.app-page-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3998;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  background: rgba(1, 6, 2, .58);
}

.app-page-tour-dialog {
  position: relative;
  z-index: 4005;
  width: min(430px, 100%);
  padding: 22px;
  border: 1px solid rgba(217, 47, 36, .28);
  border-radius: 18px;
  background: radial-gradient(circle at 100% 0%, rgba(217, 47, 36, .12), transparent 38%), #0d1c11;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
}

.app-page-tour-progress {
  margin-bottom: 8px;
  color: #83d86a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-page-tour-dialog h2 {
  margin: 0 0 8px;
  color: #f7fcf5;
  font-size: 20px;
}

.app-page-tour-dialog p {
  margin: 0;
  color: #b1c0b2;
  font-size: 13.5px;
  line-height: 1.6;
}

.app-page-tour-dots {
  display: flex;
  gap: 6px;
  margin: 18px 0;
}

.app-page-tour-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
}

.app-page-tour-dots span.is-active {
  width: 22px;
  background: #78ff47;
}

.app-page-tour-actions,
.app-page-tour-actions > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-page-tour-actions > div {
  justify-content: flex-end;
}

.is-app-tour-focus {
  position: relative !important;
  z-index: 4002 !important;
  outline: 3px solid rgba(217, 47, 36, .85) !important;
  outline-offset: 5px !important;
  box-shadow: 0 0 0 8px rgba(217, 47, 36, .13), 0 20px 60px rgba(0, 0, 0, .46) !important;
}

.has-app-page-tour .sb,
.has-app-page-tour .tb {
  z-index: 4000;
}

@media (max-width: 1180px) {
  .training-layout {
    grid-template-columns: 1fr;
  }

  .training-secondary {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-guidance {
    grid-column: 1 / -1;
  }

  .embedded-template-name-row,
  .embedded-preview-install-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .customize-settings-grid {
    grid-template-columns: 1fr;
  }

  .customize-settings-grid .app-settings-panel-body {
    height: auto;
  }
}

@media (max-width: 760px) {
  .customize-settings-grid .embedded-form-row,
  .training-template-card .embedded-form-row,
  .training-library-card .embedded-form-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .embedded-form-row > .app-field-label-row,
  .customize-settings-grid .embedded-form-row > *,
  .training-template-card .embedded-form-row > *,
  .training-library-card .embedded-form-row > * {
    grid-column: 1;
  }

  .embedded-form-row > .app-field-label-row {
    padding-top: 0;
  }

  .training-secondary {
    grid-template-columns: 1fr;
  }

  .training-files-head,
  .training-file-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .training-files-head {
    display: grid;
  }

  .training-files-tools {
    justify-content: flex-start;
  }

  .training-files-tools > .embedded-input {
    width: 100%;
  }

  .training-file-icon {
    display: none;
  }

  .training-file-actions {
    width: 100%;
  }

  .app-model-picker,
  .training-create-library,
  .domain-add-row {
    grid-template-columns: 1fr;
  }

  .app-model-picker .btn,
  .domain-add-row .btn,
  .training-create-library .btn {
    width: 100%;
  }

  .app-page-tour-backdrop {
    align-items: flex-end;
    padding: 12px;
  }
}

@media (max-width: 520px) {
  .view-head-actions,
  .view-head-actions .btn {
    width: 100%;
  }

  .app-page-tour-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .app-page-tour-actions > div,
  .app-page-tour-actions .btn {
    width: 100%;
  }

  .app-page-tour-actions > div .btn {
    flex: 1;
  }
}

/* Final parity details */
.training-template-card,
.training-capabilities-card,
.training-library-card {
  overflow: visible;
}

.training-capabilities-card .training-toggle-row + .training-toggle-row {
  border-top: 1px solid rgba(217, 47, 36, .1);
}

.app-info-tip {
  z-index: 6;
}

.app-info-tip:focus-within {
  z-index: 60;
}

.app-info-button:focus-visible {
  outline: 2px solid #78ff47;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .app-info-tooltip {
    left: auto;
    right: -8px;
    width: min(280px, calc(100vw - 48px));
    transform: translate(0, 6px);
  }

  .app-info-tooltip::after {
    left: auto;
    right: 11px;
    transform: translate(0, -5px) rotate(45deg);
  }

  .app-info-tip:hover .app-info-tooltip,
  .app-info-tip:focus-within .app-info-tooltip {
    transform: translate(0, 0);
  }
}

/* Playground */
.playground-view .view-head {
  align-items: center;
}

.playground-shell {
  display: grid;
  grid-template-columns: minmax(260px, .82fr) minmax(420px, 1.45fr) minmax(280px, .85fr);
  gap: 16px;
  align-items: stretch;
  min-height: calc(100vh - 166px);
}

.playground-panel,
.playground-chat-card {
  min-width: 0;
  border-radius: 18px;
}

.playground-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.playground-panel-head,
.playground-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.playground-panel-head {
  justify-content: flex-start;
}

.playground-panel-head h2,
.playground-chat-head h2 {
  margin: 0;
  color: var(--pc-text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
}

.playground-panel-head span:not(.icon-chip),
.playground-chat-head .eyebrow {
  color: var(--pc-text-muted);
  font-size: 12px;
}

.playground-template-picker {
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 0;
  border: 0;
}

.playground-template-picker > * {
  grid-column: 1;
}

.playground-load-button {
  justify-content: center;
  width: 100%;
}

.playground-empty {
  display: grid;
  gap: 10px;
  place-items: center;
  padding: 24px 16px;
  border: 1px dashed rgba(217, 47, 36, .22);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
  color: var(--pc-text-muted);
  text-align: center;
}

.playground-empty strong {
  color: var(--pc-text);
  font-size: 14px;
}

.playground-empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(217, 47, 36, .1);
  color: #9be37d;
}

.playground-template-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.playground-template-summary > div,
.playground-param,
.playground-tool-state {
  min-width: 0;
  border: 1px solid rgba(217, 47, 36, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .026);
}

.playground-template-summary > div {
  display: grid;
  gap: 4px;
  padding: 11px;
}

.playground-template-summary span,
.playground-template-summary strong,
.playground-param span,
.playground-param strong {
  min-width: 0;
}

.playground-template-summary span,
.playground-param span {
  color: var(--pc-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.playground-template-summary strong,
.playground-param strong {
  overflow: hidden;
  color: var(--pc-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playground-param-list {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.playground-param {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
}

.playground-param span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.playground-chat-card {
  display: grid;
  grid-template-rows: auto minmax(340px, 1fr) auto;
  overflow: hidden;
  padding: 0;
}

.playground-chat-head {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(217, 47, 36, .12);
}

.playground-transcript {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 340px;
  overflow-y: auto;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(217, 47, 36, .025), transparent 140px),
    rgba(0, 0, 0, .08);
}

.playground-transcript-empty {
  display: grid;
  gap: 9px;
  place-items: center;
  height: 100%;
  min-height: 300px;
  color: var(--pc-text-muted);
  text-align: center;
}

.playground-transcript-empty strong {
  color: var(--pc-text);
  font-size: 14px;
}

.playground-message {
  display: grid;
  gap: 6px;
  max-width: min(82%, 620px);
}

.playground-message > span {
  color: var(--pc-text-dim);
  font-size: 11px;
  font-weight: 700;
}

.playground-message > div {
  overflow-wrap: anywhere;
  border: 1px solid rgba(217, 47, 36, .14);
  border-radius: 14px;
  padding: 12px 13px;
  background: rgba(16, 27, 19, .94);
  color: var(--pc-text);
  font-size: 13px;
  line-height: 1.55;
}

.playground-message.is-user {
  align-self: flex-end;
}

.playground-message.is-user > span {
  text-align: right;
}

.playground-message.is-user > div {
  border-color: rgba(217, 47, 36, .32);
  background: linear-gradient(135deg, rgba(217, 47, 36, .86), rgba(217, 47, 36, .62));
  color: #f8fff5;
}

.playground-message.is-error > div {
  border-color: rgba(248, 113, 113, .38);
  background: rgba(127, 29, 29, .24);
  color: #fecaca;
}

.playground-message.is-thinking > div {
  color: var(--pc-text-muted);
}

.playground-message audio {
  width: min(100%, 320px);
}

.playground-composer {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid rgba(217, 47, 36, .12);
  background: rgba(7, 16, 8, .78);
}

.playground-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playground-starters button {
  max-width: 100%;
  border: 1px solid rgba(217, 47, 36, .18);
  border-radius: 999px;
  background: rgba(217, 47, 36, .07);
  color: var(--pc-text);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}

.playground-starters button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.playground-composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.playground-composer-row textarea {
  min-height: 82px;
  resize: vertical;
}

.playground-composer-row .btn {
  min-height: 42px;
  align-self: stretch;
}

.playground-inspector-panel {
  overflow: hidden;
}

.playground-inspector-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.playground-inspector-block h3 {
  margin: 0;
  color: var(--pc-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.playground-inspector-block p {
  max-height: 154px;
  overflow: auto;
  border: 1px solid rgba(217, 47, 36, .12);
  border-radius: 12px;
  background: rgba(0, 0, 0, .16);
  color: var(--pc-text-muted);
  font-size: 12px;
  line-height: 1.55;
  padding: 11px;
  white-space: pre-wrap;
}

.playground-tool-list {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.playground-tool-state {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  color: var(--pc-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.playground-tool-state.is-active {
  border-color: rgba(217, 47, 36, .28);
  color: #b6ee9f;
}

@media (max-width: 1320px) {
  .playground-shell {
    grid-template-columns: minmax(250px, .78fr) minmax(420px, 1.35fr);
  }

  .playground-inspector-panel {
    grid-column: 1 / -1;
  }

  .playground-tool-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .playground-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .playground-panel,
  .playground-chat-card {
    min-height: auto;
  }

  .playground-chat-card {
    grid-template-rows: auto minmax(360px, 56vh) auto;
  }

  .playground-param-list,
  .playground-tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .playground-view .view-head {
    align-items: stretch;
  }

  .playground-template-summary,
  .playground-param-list,
  .playground-tool-list,
  .playground-composer-row {
    grid-template-columns: 1fr;
  }

  .playground-composer-row .btn {
    width: 100%;
  }

  .playground-message {
    max-width: 100%;
  }
}

/* Playground editor + in-page widget preview */
.playground-v2-view {
  min-height: 100%;
}

.playground-v2-head {
  align-items: center;
  margin-bottom: 16px;
}

.playground-v2-feedback {
  display: grid;
  gap: 5px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 47, 36, 0.28);
  border-radius: 14px;
  background: rgba(36, 86, 32, 0.18);
  color: #dff4d6;
}

.playground-v2-feedback strong {
  color: #ffffff;
  font-size: 13px;
}

.playground-v2-feedback span {
  color: #b9d1b6;
  font-size: 13px;
}

.playground-v2-feedback.is-error {
  border-color: rgba(255, 105, 105, 0.48);
  background: rgba(110, 20, 20, 0.34);
}

.playground-v2-feedback.is-warning {
  border-color: rgba(255, 207, 103, 0.4);
  background: rgba(119, 84, 19, 0.18);
}

.playground-v2-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(420px, 1.22fr) minmax(250px, 0.66fr);
  gap: 18px;
  align-items: stretch;
}

.playground-v2-editor,
.playground-v2-preview-card,
.playground-v2-checklist {
  min-width: 0;
  overflow: hidden;
  border-color: rgba(217, 47, 36, 0.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 47, 36, 0.08), transparent 34%),
    rgba(15, 35, 21, 0.92);
}

.playground-v2-editor {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 170px);
  min-height: 640px;
}

.playground-v2-panel-head,
.playground-v2-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}

.playground-v2-panel-head {
  justify-content: flex-start;
}

.playground-v2-panel-head h2,
.playground-v2-preview-head h2 {
  margin: 0;
  color: #ffffff;
  font-size: 19px;
}

.playground-v2-panel-head span:not(.icon-chip),
.playground-v2-preview-head .eyebrow {
  color: #9db99b;
  font-size: 12px;
  font-weight: 700;
}

.playground-v2-picker {
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px 0 12px;
}

.playground-v2-picker > * {
  grid-column: 1;
}

.playground-v2-editor-actions,
.playground-v2-preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.playground-v2-editor-actions .btn,
.playground-v2-preview-actions .btn {
  width: 100%;
  justify-content: center;
}

.playground-v2-editor-scroll {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 14px;
  padding: 0 4px 4px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.playground-v2-editor-section {
  margin-bottom: 14px;
  border: 1px solid rgba(217, 47, 36, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.025);
}

.playground-v2-editor-section-head {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(217, 47, 36, 0.12);
}

.playground-v2-editor-section-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.playground-v2-editor-section-body {
  display: grid;
  gap: 13px;
  padding: 14px;
}

.playground-v2-field,
.playground-v2-toggle {
  display: grid;
  gap: 8px;
}

.playground-v2-field > span,
.playground-v2-toggle > span {
  color: #f1fff0;
  font-size: 12px;
  font-weight: 800;
}

.playground-v2-field small {
  color: #92ab91;
  font-size: 11px;
  line-height: 1.5;
}

.playground-v2-field .embedded-input,
.playground-v2-field textarea.embedded-input,
.playground-v2-field select.embedded-input,
.playground-v2-picker .embedded-input {
  width: 100%;
  border-color: rgba(217, 47, 36, 0.2);
  background: rgba(0, 10, 4, 0.74);
  color: #ffffff;
}

.playground-v2-color-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 9px;
}

.playground-v2-color-row input[type="color"] {
  width: 46px;
  height: 42px;
  padding: 3px;
  border: 1px solid rgba(217, 47, 36, 0.22);
  border-radius: 12px;
  background: rgba(0, 10, 4, 0.74);
}

.playground-v2-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.playground-v2-range strong {
  color: #ffffff;
  font-size: 12px;
  text-align: right;
}

.playground-v2-range.is-disabled {
  opacity: 0.58;
}

.playground-v2-toggle {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(217, 47, 36, 0.16);
  border-radius: 12px;
  background: rgba(0, 10, 4, 0.34);
}

.playground-v2-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #d92f24;
}

.playground-v2-preview-card {
  display: flex;
  flex-direction: column;
  min-height: 640px;
  max-height: calc(100dvh - 170px);
  padding-bottom: 16px;
}

.playground-v2-preview-head {
  flex: 0 0 auto;
}

.playground-v2-preview-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0 -18px 14px;
  padding: 12px 18px;
  border-top: 1px solid rgba(217, 47, 36, 0.13);
  border-bottom: 1px solid rgba(217, 47, 36, 0.13);
  background: rgba(27, 83, 42, 0.25);
  color: #bbd0b8;
  font-size: 12px;
  line-height: 1.45;
}

.playground-v2-widget-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(217, 47, 36, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.22), transparent 45%),
    linear-gradient(180deg, #071424, #050711 62%, #050710);
  overscroll-behavior: contain;
}

.playground-v2-widget-stage.is-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 520px;
  padding: 28px;
  color: #99b099;
  text-align: center;
}

.playground-v2-widget-stage.is-empty strong {
  color: #ffffff;
  font-size: 16px;
}

.playground-test-widget {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 520px;
  max-height: 100%;
  color: #f7fff7;
}

.playground-test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 10, 18, 0.62);
}

.playground-test-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.playground-test-head strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: #ffffff;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playground-test-head small {
  display: block;
  margin-top: 2px;
  color: #a4b7ae;
  font-size: 11px;
}

.playground-test-orb {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--playground-widget-accent, #D92F24);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--playground-widget-accent, #D92F24) 16%, transparent);
}

.playground-test-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--playground-widget-accent, #D92F24) 16%, transparent);
}

.playground-test-head-actions {
  display: flex;
  gap: 7px;
}

.playground-test-head-actions button,
.playground-test-tools button,
.playground-test-support-bar button,
.playground-test-starters button {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #e8f5e6;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.playground-test-head-actions button {
  padding: 7px 9px;
}

.playground-test-error {
  flex: 0 0 auto;
  margin: 10px 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 105, 105, 0.44);
  border-radius: 12px;
  background: rgba(136, 24, 24, 0.52);
  color: #ffd5d5;
  font-size: 12px;
  font-weight: 700;
}

.playground-test-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 15px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.playground-test-message {
  display: grid;
  gap: 4px;
  max-width: 84%;
  margin: 0 0 12px;
}

.playground-test-message > span {
  color: #8ea391;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.playground-test-message > div {
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px 15px 15px 5px;
  background: rgba(255, 255, 255, 0.09);
  color: #f5fff3;
  font-size: 13px;
  line-height: 1.48;
  white-space: pre-wrap;
}

.playground-test-message.is-user {
  justify-items: end;
  margin-left: auto;
}

.playground-test-message.is-user > div {
  border-color: color-mix(in srgb, var(--playground-widget-accent, #D92F24) 42%, transparent);
  border-radius: 15px 15px 5px 15px;
  background: color-mix(in srgb, var(--playground-widget-accent, #D92F24) 74%, #0a200d);
  color: #031007;
  font-weight: 800;
}

.playground-test-message.is-error > div {
  border-color: rgba(255, 105, 105, 0.45);
  background: rgba(126, 24, 24, 0.55);
  color: #ffe0e0;
}

.playground-test-message.is-warning > div {
  border-color: rgba(255, 207, 103, 0.35);
  background: rgba(111, 75, 17, 0.48);
}

.playground-test-message audio {
  width: 100%;
  max-width: 280px;
}

.playground-test-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.playground-test-sources-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.playground-test-source-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid rgba(217, 47, 36, 0.35);
  border-radius: 999px;
  background: rgba(217, 47, 36, 0.1);
  color: #D92F24;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playground-test-starters {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 14px 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.playground-test-starters button {
  flex: 0 0 auto;
  padding: 8px 10px;
}

.playground-test-starters button:hover,
.playground-test-support-bar button:hover,
.playground-test-tools button:hover,
.playground-test-head-actions button:hover {
  border-color: color-mix(in srgb, var(--playground-widget-accent, #D92F24) 45%, transparent);
  background: rgba(255, 255, 255, 0.12);
}

.playground-test-support-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  flex: 0 0 auto;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.playground-test-support-bar button {
  padding: 8px 10px;
}

.playground-test-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 9px;
  flex: 0 0 auto;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(3, 10, 18, 0.78);
}

.playground-test-form input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  outline: none;
  padding: 0 14px;
}

.playground-test-form input:focus {
  border-color: color-mix(in srgb, var(--playground-widget-accent, #D92F24) 55%, transparent);
}

.playground-test-form button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--playground-widget-accent, #D92F24);
  color: #031007;
  cursor: pointer;
}

.playground-test-form button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.playground-test-tools {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 14px 12px;
  background: rgba(3, 10, 18, 0.78);
}

.playground-test-tools button {
  flex: 1 1 0;
  padding: 8px 10px;
}

.playground-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.playground-modal-card {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(360px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: #101923;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.playground-modal-card > strong {
  color: #ffffff;
  font-size: 17px;
}

.playground-modal-card p {
  margin: 0;
  color: #b9c8c0;
  font-size: 12px;
  line-height: 1.5;
}

.playground-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: pointer;
}

.playground-modal-input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  outline: none;
  padding: 0 12px;
}

.playground-modal-input:focus {
  border-color: color-mix(in srgb, var(--playground-widget-accent, #D92F24) 55%, transparent);
}

.playground-modal-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #d4ded2;
  font-size: 12px;
  line-height: 1.4;
}

.playground-modal-check input {
  margin-top: 2px;
  accent-color: var(--playground-widget-accent, #D92F24);
}

.playground-modal-error {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(126, 24, 24, 0.56);
  color: #ffd8d8;
  font-size: 12px;
  font-weight: 700;
}

.playground-modal-submit {
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--playground-widget-accent, #D92F24);
  color: #041107;
  cursor: pointer;
  font-weight: 900;
}

.playground-test-toast {
  position: absolute;
  right: 16px;
  bottom: 74px;
  z-index: 9;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.92);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.playground-v2-preview-actions {
  flex: 0 0 auto;
  padding-top: 12px;
}

.playground-v2-checklist {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: calc(100dvh - 170px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.playground-v2-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.playground-v2-summary-grid > div,
.playground-v2-tool-state,
.playground-v2-help-box {
  border: 1px solid rgba(217, 47, 36, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.playground-v2-summary-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
}

.playground-v2-summary-grid span,
.playground-v2-summary-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playground-v2-summary-grid span {
  color: #9db49d;
  font-size: 11px;
  font-weight: 800;
}

.playground-v2-summary-grid strong {
  color: #ffffff;
  font-size: 13px;
}

.playground-v2-tool-list {
  display: grid;
  gap: 8px;
}

.playground-v2-tool-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: #93a792;
  font-size: 12px;
  font-weight: 800;
}

.playground-v2-tool-state.is-active {
  border-color: rgba(217, 47, 36, 0.36);
  color: #D92F24;
}

.playground-v2-help-box {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.playground-v2-help-box strong {
  color: #ffffff;
  font-size: 12px;
}

.playground-v2-help-box span {
  color: #b5c8b1;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

@media (max-width: 1320px) {
  .playground-v2-shell {
    grid-template-columns: minmax(300px, 0.92fr) minmax(420px, 1.18fr);
  }

  .playground-v2-checklist {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, 0.65fr) minmax(260px, 0.9fr) minmax(260px, 1fr);
    max-height: none;
  }
}

@media (max-width: 980px) {
  .playground-v2-shell {
    grid-template-columns: 1fr;
  }

  .playground-v2-editor,
  .playground-v2-preview-card,
  .playground-v2-checklist {
    max-height: none;
    min-height: 0;
  }

  .playground-v2-widget-stage {
    height: 660px;
    flex: 0 0 auto;
  }

  .playground-v2-checklist {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .playground-v2-head,
  .playground-v2-head .view-head-actions,
  .playground-v2-editor-actions,
  .playground-v2-preview-actions,
  .playground-v2-summary-grid {
    grid-template-columns: 1fr;
  }

  .playground-v2-head .view-head-actions {
    display: grid;
  }

  .playground-v2-widget-stage {
    height: 620px;
  }

  .playground-test-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .playground-test-head-actions,
  .playground-test-head-actions button {
    width: 100%;
  }

  .playground-test-head-actions button {
    flex: 1;
  }

  .playground-test-message {
    max-width: 92%;
  }
}


/* ============================================================
   Final Apex theme contrast pass — no layout rebuild
   ============================================================ */
:root {
  --pc-bg: #F7F6F3;
  --pc-bg-secondary: #F4F3EF;
  --pc-bg-card: #FFFFFF;
  --pc-bg-card-soft: #FAF9F6;
  --pc-border: rgba(17, 17, 17, 0.13);
  --pc-border-strong: rgba(17, 17, 17, 0.28);
  --pc-text: #111111;
  --pc-text-muted: rgba(17, 17, 17, 0.58);
  --pc-text-dim: rgba(17, 17, 17, 0.42);
  --pc-accent: #D92F24;
  --pc-accent-2: #111111;
  --pc-success: #15803D; /* distinct from danger red (F36 — WCAG 1.4.1) */
  --pc-danger: #D92F24;
  --pc-gradient-primary: linear-gradient(135deg, #D92F24 0%, #D92F24 100%);
  --pc-gradient-primary-soft: linear-gradient(135deg, rgba(217,47,36,.12), rgba(217,47,36,.04));
  --pc-shadow-card: 0 18px 42px rgba(17,17,17,.08);
  --pc-shadow-elev: 0 26px 70px rgba(17,17,17,.14);
  --pc-shadow-button: 0 10px 24px rgba(217,47,36,.22);
  --pc-ring: 0 0 0 3px rgba(217,47,36,.18);
  --app-card-shadow: 0 18px 42px rgba(17,17,17,.08);
  --app-card-shadow-hover: 0 24px 60px rgba(17,17,17,.13);
}

html { color-scheme: light !important; }
body {
  background: #F7F6F3 !important;
  color: #111111 !important;
}
::selection { background: rgba(217,47,36,.16) !important; color: #111111 !important; }
/* Dark surfaces: keep highlighted text readable (light text on a solid red highlight) */
.embedded-code-box::selection,
.embedded-code-box *::selection,
.app-template-code pre::selection,
.app-template-code pre *::selection,
.plug-widget-window::selection,
.plug-widget-window *::selection,
.playground-test-widget::selection,
.playground-test-widget *::selection { background: rgba(217,47,36,.75) !important; color: #ffffff !important; }
* { scrollbar-color: rgba(217,47,36,.42) rgba(17,17,17,.07) !important; }
*::-webkit-scrollbar-thumb { background: rgba(217,47,36,.42) !important; border-radius: 999px !important; }
*::-webkit-scrollbar-track { background: rgba(17,17,17,.05) !important; }

.app-main,
.app-content {
  background: #F7F6F3 !important;
  color: #111111 !important;
}
.app-content {
  background-image:
    radial-gradient(circle at 80% -10%, rgba(217,47,36,.055), transparent 28%),
    radial-gradient(circle at 10% 110%, rgba(17,17,17,.045), transparent 34%) !important;
}

/* Sidebar keeps the black command-panel feel */
.sb {
  background: #050505 !important;
  border-right-color: rgba(255,255,255,.10) !important;
  box-shadow: 14px 0 42px rgba(17,17,17,.16) !important;
}
.sb-logo { border-bottom-color: rgba(255,255,255,.10) !important; }
.sb-logo span { color: #FFFFFF !important; }
.sb-section { color: rgba(255,255,255,.44) !important; }
.sb-item { color: rgba(255,255,255,.68) !important; }
.sb-item svg { color: rgba(255,255,255,.58) !important; }
.sb-item:hover {
  background: rgba(255,255,255,.075) !important;
  border-color: rgba(255,255,255,.10) !important;
  color: #FFFFFF !important;
}
.sb-item:hover svg { color: #FFFFFF !important; }
.sb-item.active {
  background: rgba(217,47,36,.18) !important;
  border-color: rgba(217,47,36,.45) !important;
  box-shadow: inset 3px 0 0 #D92F24 !important;
  color: #FFFFFF !important;
}
.sb-item.active svg { color: #FFFFFF !important; }
.sb-status { color: rgba(255,255,255,.62) !important; border-top-color: rgba(255,255,255,.10) !important; }
.sb-status-dot { background: #D92F24 !important; box-shadow: 0 0 0 4px rgba(217,47,36,.12), 0 0 16px rgba(217,47,36,.46) !important; }

/* Top bar */
.tb {
  background: rgba(255,255,255,.92) !important;
  border-bottom-color: rgba(17,17,17,.12) !important;
  box-shadow: 0 10px 30px rgba(17,17,17,.06) !important;
  color: #111111 !important;
}
.app-workspace-button,
.tb-search,
.tb-icon,
.app-profile-button,
.app-notification-button {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.16) !important;
  color: #111111 !important;
  box-shadow: none !important;
}
.tb-search input { color: #111111 !important; }
.tb-search input::placeholder { color: rgba(17,17,17,.52) !important; }
.tb-search svg,
.tb-icon svg { color: rgba(17,17,17,.62) !important; }
.tb-search:focus-within,
.app-workspace-button:hover,
.tb-icon:hover {
  border-color: rgba(217,47,36,.42) !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 4px rgba(217,47,36,.08) !important;
  color: #111111 !important;
}
.tb-avatar {
  background: #D92F24 !important;
  color: #FFFFFF !important;
  box-shadow: 0 10px 24px rgba(217,47,36,.22) !important;
}
.app-workspace-dropdown,
.app-profile-dropdown,
.app-notification-dropdown {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.14) !important;
  box-shadow: 0 24px 70px rgba(17,17,17,.16) !important;
  color: #111111 !important;
}
.app-workspace-option:hover,
.app-profile-link:hover,
.app-profile-signout:hover,
.app-notification-item:hover { background: rgba(217,47,36,.06) !important; }
.app-workspace-option.is-active,
.app-notification-item.is-unread,
.app-notification-enable { background: rgba(217,47,36,.08) !important; color: #111111 !important; }
.app-notification-item.is-unread { box-shadow: inset 3px 0 0 #D92F24 !important; }

/* Page headings and common text */
.view-head { border-bottom-color: rgba(217,47,36,.14) !important; }
.view-head h1,
.app-main h1,
.app-main h2,
.app-main h3,
.app-main h4,
.card h1,
.card h2,
.card h3,
.card strong,
.app-field-label-row,
.app-field-label-row > label,
.app-field-label-row > span,
.embedded-form-row > span,
.embedded-toggle-row strong,
.app-settings-panel-title,
.playground-v2-field > span,
.playground-v2-toggle > span,
.playground-v2-editor-section-head span,
.playground-v2-panel-head h2,
.playground-v2-preview-head h2,
.integration-launch-copy > strong,
.app-template-head h2,
.app-template-quick-grid strong,
.users-name,
.live-thread-header strong,
.live-detail-section h3 {
  color: #111111 !important;
}
.view-head .sub,
.card p,
.card small,
.app-main p,
.app-main small,
.kpi-label,
.app-settings-panel-heading small,
.embedded-form-row small,
.embedded-toggle-row span,
.app-template-head span:not(.pill),
.app-template-quick-grid span,
.integration-launch-copy > span,
.playground-v2-panel-head span,
.playground-v2-summary-grid span,
.playground-v2-help-box span,
.users-email,
.live-inbox-title span,
.live-thread-header span,
.live-detail-section p,
.live-inbox-item-copy small,
.live-inbox-item-meta,
.live-detail-label {
  color: rgba(17,17,17,.58) !important;
}

/* Cards and panels */
.card,
.embedded-settings-card,
.app-settings-panel,
.ai-builder-main-section,
.ai-builder-install-card,
.integration-template-card,
.integration-launch-card,
.integration-panel,
.app-template-card,
.app-template-create,
.users-form-card,
.users-table-card,
.live-inbox-list,
.live-inbox-thread,
.live-inbox-details,
.playground-v2-editor,
.playground-v2-preview-card,
.playground-v2-checklist,
.playground-v2-editor-section,
.playground-v2-help-box,
.playground-v2-summary-grid > div,
.playground-v2-tool-state {
  background: #FFFFFF !important;
  color: #111111 !important;
  border-color: rgba(17,17,17,.13) !important;
  box-shadow: 0 18px 42px rgba(17,17,17,.08) !important;
}
.card::before,
.app-template-card::before,
.app-settings-panel::before,
.integration-launch-card::before { background: linear-gradient(90deg, transparent, rgba(217,47,36,.28), transparent) !important; }
body .card:hover,
.app-settings-panel:hover,
.app-settings-panel.is-open,
.integration-launch-card:hover,
.app-template-card:hover,
.app-template-create:hover {
  border-color: rgba(217,47,36,.25) !important;
  box-shadow: 0 24px 60px rgba(17,17,17,.12) !important;
  background: #FFFFFF !important;
}
.embedded-settings-head,
.users-card-head,
.app-template-head,
.app-template-actions,
.app-settings-panel-body,
.ai-builder-main-body,
.integration-modal-head,
.integration-panel-body > .card,
.playground-v2-editor-section-head {
  border-color: rgba(17,17,17,.10) !important;
  background: transparent !important;
}
.ai-builder-main-body,
.app-settings-panel-body,
.training-card-grid,
.app-builder-stack,
.ai-builder-section-stack { background-color: transparent !important; }

/* Buttons */
.btn-primary,
.live-thread-reply button,
.playground-modal-submit,
.playground-test-form button,
.app-notification-button > span,
.app-template-create span,
.live-inbox-avatar,
.integration-modal-icon,
.integration-launch-icon {
  background: #D92F24 !important;
  color: #FFFFFF !important;
  border-color: #D92F24 !important;
  box-shadow: 0 12px 28px rgba(217,47,36,.22) !important;
}
.btn-primary:hover:not(:disabled),
.live-thread-reply button:hover:not(:disabled) { background: #C6281E !important; box-shadow: 0 16px 34px rgba(217,47,36,.28) !important; }
.btn-secondary,
.btn:not(.btn-primary),
.live-thread-actions button,
.live-detail-heading button,
.playground-v2-editor-actions .btn-secondary,
.playground-v2-preview-actions .btn-secondary,
.app-template-actions .btn,
.users-row-actions .btn,
.users-modal-actions .btn {
  background: #FFFFFF !important;
  color: #111111 !important;
  border: 1px solid rgba(17,17,17,.16) !important;
  box-shadow: none !important;
}
.btn-secondary:hover:not(:disabled),
.btn:not(.btn-primary):hover:not(:disabled),
.live-thread-actions button:hover:not(:disabled),
.live-detail-heading button:hover:not(:disabled) {
  background: rgba(217,47,36,.06) !important;
  border-color: rgba(217,47,36,.34) !important;
  color: #111111 !important;
}
button.is-danger,
.btn.danger,
.app-template-actions .btn.danger { color: #D92F24 !important; border-color: rgba(217,47,36,.28) !important; background: rgba(217,47,36,.05) !important; }

/* Form controls */
.embedded-input,
.field input,
.field select,
.field textarea,
.users-form-card input,
.users-form-card select,
.users-modal input,
.users-modal select,
.live-inbox-filters input,
.live-inbox-filters select,
.live-detail-section select,
.live-thread-reply input,
.live-thread-reply textarea,
.playground-v2-color-row input:not([type="color"]),
.playground-modal-input {
  background: #FFFFFF !important;
  color: #111111 !important;
  border-color: rgba(17,17,17,.18) !important;
  box-shadow: none !important;
}
.embedded-input::placeholder,
.field input::placeholder,
.field textarea::placeholder,
.live-inbox-filters input::placeholder,
.live-thread-reply input::placeholder,
.playground-modal-input::placeholder { color: rgba(17,17,17,.42) !important; }
.embedded-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.users-form-card input:focus,
.users-form-card select:focus,
.users-modal input:focus,
.users-modal select:focus,
.live-inbox-filters input:focus,
.live-inbox-filters select:focus,
.live-detail-section select:focus,
.live-thread-reply input:focus,
.live-thread-reply textarea:focus,
.playground-modal-input:focus {
  border-color: rgba(217,47,36,.52) !important;
  box-shadow: 0 0 0 4px rgba(217,47,36,.08) !important;
}
input[type="checkbox"],
input[type="radio"],
input[type="range"] { accent-color: #D92F24 !important; }
.embedded-toggle {
  background: #171717 !important;
  border-color: rgba(17,17,17,.25) !important;
  box-shadow: none !important;
}
.embedded-toggle span { background: #FFFFFF !important; }
.embedded-toggle.is-on { background: #D92F24 !important; border-color: #D92F24 !important; box-shadow: 0 10px 22px rgba(217,47,36,.20) !important; }
.embedded-toggle.is-on span { background: #FFFFFF !important; }

/* Dashboard KPI readability */
.kpi-grid .card { background: #FFFFFF !important; }
.kpi-grid .card::after { background: linear-gradient(90deg, #D92F24, transparent) !important; opacity: .85 !important; }
.kpi-label { color: rgba(17,17,17,.58) !important; }
.kpi-value { color: #111111 !important; }
.kpi-delta,
.kpi-delta.up {
  display: inline-flex !important;
  width: auto !important;
  background: transparent !important;
  color: #D92F24 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-weight: 800 !important;
}
.kpi-delta span { color: rgba(17,17,17,.42) !important; }
.dashboard-grid .card { color: #111111 !important; }
.dashboard-grid .card [style*="linear-gradient"] { background: linear-gradient(180deg, #D92F24, #111111) !important; }

/* Pills, badges, statuses */
.pill,
.pill.success,
.pill.ok,
.pill-accent,
.pill-cyan,
.live-status,
.live-status.is-needs_human,
.live-status.is-assigned,
.live-status.is-active,
.live-status.is-closed,
.workspace-chip,
.app-workspace-default {
  background: rgba(217,47,36,.07) !important;
  border-color: rgba(217,47,36,.26) !important;
  color: #D92F24 !important;
}
.pill.dim { background: rgba(17,17,17,.04) !important; border-color: rgba(17,17,17,.13) !important; color: rgba(17,17,17,.58) !important; }
.role-pill,
.role-pill.owner,
.role-pill.admin,
.role-pill.user {
  background: #111111 !important;
  border-color: #111111 !important;
  color: #FFFFFF !important;
}

/* Info icons and helper states */
.icon-chip,
.app-empty-icon,
.app-info-button,
.integration-panel-icon,
.app-template-icon,
.playground-empty-icon {
  background: rgba(217,47,36,.06) !important;
  border-color: rgba(217,47,36,.24) !important;
  color: #D92F24 !important;
  box-shadow: none !important;
}
.app-info-button:hover,
.app-info-button:focus-visible { background: rgba(217,47,36,.08) !important; color: #D92F24 !important; box-shadow: 0 0 0 3px rgba(217,47,36,.08) !important; }
.app-info-tooltip,
.app-info-tooltip::after { background: #111111 !important; border-color: rgba(217,47,36,.38) !important; color: #FFFFFF !important; }
.embedded-api-feedback.is-success,
.users-alert.success,
.app-save-notice,
.playground-v2-feedback.is-success {
  background: rgba(217,47,36,.06) !important;
  border-color: rgba(217,47,36,.24) !important;
  color: #111111 !important;
}
.embedded-api-feedback.is-success strong,
.users-alert.success strong,
.app-save-notice strong,
.playground-v2-feedback.is-success strong { color: #111111 !important; }
.embedded-api-feedback.is-success span,
.users-alert.success span,
.app-save-notice span,
.playground-v2-feedback.is-success span { color: rgba(17,17,17,.62) !important; }

/* Error alert on the light theme: readable dark-red text on a soft red tint
   (the base dark-theme .users-alert.error was near-invisible on the light UI). */
.embedded-api-feedback.is-error,
.users-alert.error,
.playground-v2-feedback.is-error {
  background: rgba(217,47,36,.08) !important;
  border-color: rgba(217,47,36,.30) !important;
  color: #B42318 !important;
}
.users-alert.error strong { color: #991B1B !important; }
.users-alert.error span { color: rgba(180,35,24,.85) !important; }

/* Human support inbox */
.live-inbox-shell { background: #F7F6F3 !important; border-top-color: rgba(17,17,17,.12) !important; }
.live-inbox-list,
.live-inbox-thread,
.live-inbox-details { background: #FFFFFF !important; color: #111111 !important; border-color: rgba(17,17,17,.12) !important; }
.live-inbox-title,
.live-thread-header,
.live-thread-reply { background: #FFFFFF !important; border-color: rgba(17,17,17,.12) !important; }
.live-inbox-counts button { background: #FFFFFF !important; border-color: rgba(17,17,17,.16) !important; color: rgba(17,17,17,.62) !important; }
.live-inbox-counts button.is-active,
.live-inbox-counts button:hover { background: rgba(217,47,36,.06) !important; border-color: rgba(217,47,36,.34) !important; color: #D92F24 !important; }
.live-inbox-item { border-bottom-color: rgba(17,17,17,.09) !important; color: #111111 !important; }
.live-inbox-item:hover,
.live-inbox-item.is-active { background: rgba(217,47,36,.05) !important; }
.live-inbox-item.is-active { box-shadow: inset 3px 0 0 #D92F24 !important; }
.live-inbox-item-copy strong { color: #111111 !important; }
.live-inbox-item-copy em { color: #D92F24 !important; }
.live-inbox-avatar { background: #D92F24 !important; color: #FFFFFF !important; }
.live-thread-messages { background: #FFFFFF !important; }
.live-thread-message > div { color: #FFFFFF !important; box-shadow: none !important; }
.live-thread-message.is-visitor > div {
  background: #111111 !important;
  border-color: #111111 !important;
  color: #FFFFFF !important;
}
.live-thread-message.is-agent > div,
.live-thread-message.is-assistant > div,
.live-thread-message.is-bot > div {
  background: #D92F24 !important;
  border-color: #D92F24 !important;
  color: #FFFFFF !important;
}
.live-thread-message.is-system > div,
.live-thread-typing {
  background: rgba(217,47,36,.06) !important;
  border-color: rgba(217,47,36,.24) !important;
  color: #D92F24 !important;
}
.live-thread-message span,
.live-thread-message time { color: inherit !important; }
.live-summary { background: #FAF9F6 !important; border-color: rgba(17,17,17,.12) !important; color: #111111 !important; }

/* Training */
.training-layout,
.training-main,
.training-side,
.knowledge-files-card,
.training-guidance { background: transparent !important; }
.training-toggle-row,
.training-file-drop,
.knowledge-file-row {
  background: #FAF9F6 !important;
  border-color: rgba(17,17,17,.13) !important;
  color: #111111 !important;
}
.training-toggle-row strong,
.training-file-drop strong,
.knowledge-files-card h3 { color: #111111 !important; }
.training-toggle-row p,
.training-file-drop p { color: rgba(17,17,17,.58) !important; }

/* Playground editor and checklist */
.playground-v2-editor-scroll,
.playground-v2-checklist,
.playground-v2-editor { background: #FFFFFF !important; }
.playground-v2-summary-grid > div strong { color: #111111 !important; }
.playground-v2-summary-grid > div span { color: rgba(17,17,17,.58) !important; }
.playground-v2-tool-state { background: #FFFFFF !important; color: rgba(17,17,17,.64) !important; border-color: rgba(17,17,17,.13) !important; }
.playground-v2-tool-state.is-active { background: rgba(217,47,36,.06) !important; border-color: rgba(217,47,36,.30) !important; color: #D92F24 !important; }
.playground-v2-tool-state.is-active span,
.playground-v2-tool-state.is-active svg { color: #D92F24 !important; }
.playground-v2-field > span,
.playground-v2-toggle > span { color: #111111 !important; }
.playground-v2-preview-note { background: rgba(17,17,17,.04) !important; border-color: rgba(17,17,17,.10) !important; color: rgba(17,17,17,.62) !important; }
.playground-v2-preview-head .eyebrow { color: #D92F24 !important; border-color: rgba(217,47,36,.24) !important; background: rgba(217,47,36,.06) !important; }

/* Integrations and templates */
.integration-launch-card { background: #FFFFFF !important; }
.integration-launch-action,
.integration-launch-action * { background: transparent !important; color: #D92F24 !important; border: 0 !important; box-shadow: none !important; }
.integration-modal { background: #FFFFFF !important; color: #111111 !important; border-color: rgba(17,17,17,.13) !important; }
.integration-modal-backdrop { background: rgba(17,17,17,.58) !important; }
.integration-modal-head h2,
.integration-modal strong { color: #111111 !important; }
.integration-modal span,
.integration-modal p { color: rgba(17,17,17,.62) !important; }
.app-template-quick-grid > div,
.app-template-overview > div,
.embedded-summary-item,
.domain-list,
.domain-item,
.workspace-option {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.13) !important;
}
.app-template-quick-grid strong,
.embedded-summary-item strong { color: #111111 !important; }
.app-template-quick-grid span,
.embedded-summary-item span { color: rgba(17,17,17,.58) !important; }
.app-template-code pre,
.embedded-code-box { background: #111111 !important; color: #FFFFFF !important; border-color: #111111 !important; }

/* AI Builder live preview: keep the user's selected brand color dynamic */
.app-builder-preview,
.plug-widget-live-preview,
.playground-v2-widget-stage {
  background:
    linear-gradient(rgba(17,17,17,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,.045) 1px, transparent 1px),
    #F4F3EF !important;
  border-color: rgba(17,17,17,.13) !important;
}
.plug-widget-window {
  background: #000000 !important;
  color: #FFFFFF !important;
}
.plug-widget-window *,
.playground-test-widget *,
.playground-modal-backdrop * {
  color: inherit;
}
.plug-widget-identity strong,
.playground-test-head strong,
.playground-modal-card h3 { color: #FFFFFF !important; }
.plug-widget-identity small,
.playground-test-head small { color: var(--pcw-accent, #D92F24) !important; }
.plug-widget-message,
.playground-test-message > div { color: #FFFFFF !important; }
.plug-widget-starters button,
.plug-widget-starters span,
.playground-test-starters button,
.playground-test-support-bar button,
.playground-test-tools button,
.playground-test-head-actions button {
  color: #FFFFFF !important;
}
.plug-widget-composer > span,
.playground-test-form input,
.playground-modal-input { color: #FFFFFF !important; background: rgba(255,255,255,.08) !important; border-color: rgba(255,255,255,.13) !important; }
.plug-widget-composer button,
.playground-test-form button,
.playground-modal-submit {
  background: var(--pcw-accent, var(--playground-widget-accent, #D92F24)) !important;
  color: #FFFFFF !important;
}
.playground-test-message.is-user > div {
  background: var(--playground-widget-accent, #D92F24) !important;
  border-color: var(--playground-widget-accent, #D92F24) !important;
  color: #FFFFFF !important;
}

/* Product tour */
.app-tour-backdrop { background: rgba(17,17,17,.58) !important; }
.app-tour-dialog {
  background: #111111 !important;
  border-color: rgba(217,47,36,.35) !important;
  color: #FFFFFF !important;
  box-shadow: 0 32px 90px rgba(17,17,17,.45) !important;
}
.app-tour-dialog h2,
.app-tour-dialog strong { color: #FFFFFF !important; }
.app-tour-dialog p,
.app-tour-progress span { color: rgba(255,255,255,.68) !important; }
.app-tour-icon,
.app-tour-dots span.is-active { background: #D92F24 !important; color: #FFFFFF !important; }
.is-tour-target { outline-color: #D92F24 !important; box-shadow: 0 0 0 4px rgba(217,47,36,.16) !important; }

/* Keep explicit dark surfaces readable */
.app-template-code pre *,
.embedded-code-box *,
.plug-widget-window *,
.playground-test-widget *,
.app-tour-dialog * { text-shadow: none !important; }

/* Targeted readability polish after Apex theme pass */
:root {
  --pc-apex-red: #D92F24;
  --pc-apex-black: #111111;
  --pc-apex-offwhite: #F7F6F3;
  --pc-apex-panel: #FFFFFF;
  --pc-apex-muted: rgba(17, 17, 17, .62);
  --pc-apex-border: rgba(17, 17, 17, .14);
}

/* Templates page details toggle and summary text */
.app-template-card .app-template-detail-toggle,
.app-template-card .app-template-detail-toggle span,
.app-template-card .app-template-detail-toggle svg {
  color: var(--pc-apex-black) !important;
}
.app-template-card .app-template-detail-toggle {
  background: rgba(217, 47, 36, .055) !important;
  border-color: rgba(217, 47, 36, .28) !important;
}
.app-template-card .app-template-detail-toggle:hover {
  background: rgba(217, 47, 36, .09) !important;
  border-color: rgba(217, 47, 36, .38) !important;
}
.app-template-overview > div span,
.app-template-quick-grid > div span {
  color: rgba(17, 17, 17, .58) !important;
}
.app-template-overview > div strong,
.app-template-quick-grid > div strong {
  color: var(--pc-apex-black) !important;
}

/* AI Builder install note readability */
.embedded-install-note,
.embedded-api-feedback,
.app-save-notice {
  background: rgba(217, 47, 36, .045) !important;
  border-color: rgba(217, 47, 36, .22) !important;
  color: var(--pc-apex-black) !important;
}
.embedded-install-note span,
.embedded-api-feedback span,
.app-save-notice span {
  color: rgba(17, 17, 17, .68) !important;
}
.embedded-install-note strong,
.embedded-api-feedback strong,
.app-save-notice strong {
  color: var(--pc-apex-black) !important;
}
.embedded-install-note svg,
.embedded-api-feedback svg,
.app-save-notice svg {
  color: var(--pc-apex-red) !important;
}

/* Playground unsaved/success/error feedback text */
.playground-v2-feedback,
.playground-v2-feedback.is-warning,
.playground-v2-feedback.is-success {
  background: rgba(217, 47, 36, .055) !important;
  border-color: rgba(217, 47, 36, .24) !important;
  color: var(--pc-apex-black) !important;
}
.playground-v2-feedback strong,
.playground-v2-feedback span,
.playground-v2-feedback.is-warning strong,
.playground-v2-feedback.is-warning span,
.playground-v2-feedback.is-success strong,
.playground-v2-feedback.is-success span {
  color: var(--pc-apex-black) !important;
}
.playground-v2-feedback.is-error {
  background: rgba(217, 47, 36, .09) !important;
  border-color: rgba(217, 47, 36, .38) !important;
}

/* Playground editor/checklist text and card fields */
.playground-v2-panel-head h2,
.playground-v2-preview-head h2,
.playground-v2-editor-section-head span,
.playground-v2-field > span,
.playground-v2-toggle > span,
.playground-v2-summary-grid strong,
.playground-v2-tool-state strong,
.playground-v2-help-box strong {
  color: var(--pc-apex-black) !important;
}
.playground-v2-panel-head span:not(.icon-chip),
.playground-v2-preview-head span,
.playground-v2-summary-grid span,
.playground-v2-help-box span,
.playground-v2-field small {
  color: rgba(17, 17, 17, .62) !important;
}
.playground-v2-editor,
.playground-v2-checklist,
.playground-v2-preview-card,
.playground-v2-editor-section,
.playground-v2-summary-grid > div,
.playground-v2-tool-state,
.playground-v2-help-box {
  background: var(--pc-apex-panel) !important;
  border-color: var(--pc-apex-border) !important;
}
.playground-v2-tool-state.is-active {
  background: rgba(217, 47, 36, .055) !important;
  border-color: rgba(217, 47, 36, .28) !important;
  color: var(--pc-apex-red) !important;
}
.playground-v2-tool-state.is-active span,
.playground-v2-tool-state.is-active svg {
  color: var(--pc-apex-red) !important;
}

/* Playground widget stage: readable dark widget, white visitor popup */
.playground-v2-widget-stage {
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #111111 !important;
  border-color: rgba(17,17,17,.18) !important;
}
.playground-test-widget {
  background: #111111 !important;
  color: #FFFFFF !important;
}
.playground-test-head,
.playground-test-form,
.playground-test-tools,
.playground-test-support-bar {
  background: #111111 !important;
  border-color: rgba(255,255,255,.12) !important;
}
.playground-test-head strong,
.playground-test-head small,
.playground-test-message > span,
.playground-test-widget label {
  color: #FFFFFF !important;
}
.playground-test-head small,
.playground-test-message > span {
  opacity: .72;
}
.playground-test-body {
  background: #FAF9F6 !important;
}
.playground-test-message > div {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.12) !important;
  color: var(--pc-apex-black) !important;
  box-shadow: 0 8px 24px rgba(17,17,17,.07) !important;
}
.playground-test-message.is-user > div {
  background: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  border-color: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  color: #FFFFFF !important;
}
.playground-test-message.is-system > div,
.playground-test-message.is-warning > div {
  background: rgba(217,47,36,.06) !important;
  border-color: rgba(217,47,36,.22) !important;
  color: var(--pc-apex-black) !important;
}
.playground-test-starters button,
.playground-test-support-bar button,
.playground-test-tools button,
.playground-test-head-actions button {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.15) !important;
  color: var(--pc-apex-black) !important;
}
.playground-test-form input {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.16) !important;
  color: var(--pc-apex-black) !important;
}
.playground-test-form input::placeholder {
  color: rgba(17,17,17,.42) !important;
}
.playground-test-form button {
  background: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  color: #FFFFFF !important;
}
.playground-modal-backdrop {
  background: rgba(17,17,17,.58) !important;
}
.playground-modal-card {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.16) !important;
  color: var(--pc-apex-black) !important;
  box-shadow: 0 28px 90px rgba(17,17,17,.24) !important;
}
.playground-modal-card > strong,
.playground-modal-card h3,
.playground-modal-card p,
.playground-modal-check,
.playground-modal-card label {
  color: var(--pc-apex-black) !important;
}
.playground-modal-card p {
  color: rgba(17,17,17,.64) !important;
}
.playground-modal-close {
  background: rgba(17,17,17,.06) !important;
  color: var(--pc-apex-black) !important;
}
.playground-modal-input {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.18) !important;
  color: var(--pc-apex-black) !important;
}
.playground-modal-input::placeholder {
  color: rgba(17,17,17,.42) !important;
}
.playground-modal-submit {
  background: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  color: #FFFFFF !important;
}

/* Training page marked areas */
.training-dropzone {
  background: #FAF9F6 !important;
  border-color: rgba(17,17,17,.18) !important;
  color: var(--pc-apex-black) !important;
}
.training-dropzone:hover,
.training-dropzone.is-dragging {
  background: rgba(217,47,36,.045) !important;
  border-color: rgba(217,47,36,.35) !important;
}
.training-dropzone-icon,
.training-file-icon {
  background: rgba(217,47,36,.06) !important;
  border-color: rgba(217,47,36,.24) !important;
  color: var(--pc-apex-red) !important;
}
.training-dropzone strong,
.training-file-copy > strong,
.training-card-heading h2,
.training-files-head h2,
.training-toggle-row strong,
.training-guidance strong,
.training-technical-details summary {
  color: var(--pc-apex-black) !important;
}
.training-dropzone > span:last-child,
.training-card-heading p,
.training-files-head p,
.training-toggle-row p,
.training-file-copy > div,
.training-guidance p,
.training-technical-details,
.training-technical-details code,
.training-inline-check {
  color: rgba(17,17,17,.62) !important;
}
.training-guidance,
.training-technical-details {
  background: #FFFFFF !important;
  border-color: rgba(217,47,36,.18) !important;
}
.training-guidance {
  color: var(--pc-apex-red) !important;
}
.training-guidance svg {
  color: var(--pc-apex-red) !important;
}
.training-card,
.training-files-card,
.training-capabilities-card,
.training-library-card,
.training-template-card {
  background: #FFFFFF !important;
  border-color: rgba(17,17,17,.13) !important;
}

/* Users assigned workspace section */
.user-workspace-check,
.workspace-option-list,
.workspace-option,
.users-form-card .workspace-option,
.users-form-card .user-workspace-check {
  background: #FAF9F6 !important;
  border-color: rgba(17,17,17,.14) !important;
  color: var(--pc-apex-black) !important;
}
.workspace-option {
  background: #FFFFFF !important;
}
.workspace-option strong,
.user-workspace-check strong,
.workspace-option span,
.user-workspace-check span {
  color: var(--pc-apex-black) !important;
}
.workspace-option small,
.user-workspace-check small {
  color: rgba(17,17,17,.58) !important;
}
.workspace-option .role-pill,
.user-workspace-check .role-pill {
  background: #111111 !important;
  color: #FFFFFF !important;
  border-color: #111111 !important;
}

/* Leads table header row */
.app-table-scroll table thead tr,
.view .app-table-scroll table thead tr {
  background: var(--pc-apex-red) !important;
  border-bottom-color: var(--pc-apex-red) !important;
}
.app-table-scroll table thead th,
.view .app-table-scroll table thead th {
  color: #FFFFFF !important;
  border-color: rgba(255,255,255,.18) !important;
}
.app-table-scroll table tbody td {
  color: var(--pc-apex-black) !important;
}
.app-table-scroll table tbody td[style*="mono"],
.app-table-scroll table tbody td[style*="muted"] {
  color: rgba(17,17,17,.66) !important;
}

/* Remove remaining green-tinted helper text where old success color leaked */
.card small,
.card .sub,
.embedded-form-row small,
.embedded-toggle-row span,
.app-template-head span:not(.pill),
.integration-launch-card p,
.integration-launch-card small {
  color: rgba(17,17,17,.62) !important;
}
.card h2,
.card h3,
.integration-launch-card h2,
.integration-launch-card h3 {
  color: var(--pc-apex-black) !important;
}

/* Final conflict cleanup: Playground widget preview + guided tour text */
:root {
  --pc-apex-red: #D92F24;
  --pc-apex-red-dark: #B5261D;
  --pc-apex-black: #111111;
  --pc-apex-offwhite: #F7F6F3;
  --pc-apex-panel: #FFFFFF;
  --pc-apex-muted: rgba(17, 17, 17, .66);
  --pc-apex-line: rgba(17, 17, 17, .14);
}

/* Page tour popup: remove remaining green text and make all copy readable */
.app-page-tour-backdrop,
.app-tour-backdrop {
  background: rgba(17, 17, 17, .62) !important;
  backdrop-filter: blur(3px) !important;
  -webkit-backdrop-filter: blur(3px) !important;
}

.app-page-tour-dialog,
.app-tour-dialog {
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 47, 36, .15), transparent 38%),
    var(--pc-apex-black) !important;
  border-color: rgba(217, 47, 36, .38) !important;
  color: #FFFFFF !important;
  box-shadow: 0 30px 90px rgba(17, 17, 17, .55) !important;
}

.app-page-tour-dialog *,
.app-tour-dialog * {
  text-shadow: none !important;
}

.app-page-tour-progress,
.app-page-tour-progress strong,
.app-tour-progress,
.app-tour-progress strong {
  color: var(--pc-apex-red) !important;
}

.app-page-tour-dialog h2,
.app-tour-dialog h2 {
  color: #FFFFFF !important;
}

.app-page-tour-dialog p,
.app-tour-dialog p {
  color: rgba(255, 255, 255, .76) !important;
}

.app-page-tour-icon,
.app-tour-icon {
  background: rgba(217, 47, 36, .14) !important;
  border-color: rgba(217, 47, 36, .32) !important;
  color: #FFFFFF !important;
}

.app-page-tour-dots span,
.app-tour-dots span {
  background: rgba(255, 255, 255, .2) !important;
}

.app-page-tour-dots span.is-active,
.app-tour-dots span.is-active {
  background: var(--pc-apex-red) !important;
}

.app-page-tour-actions .btn-primary,
.app-tour-actions .btn-primary {
  background: var(--pc-apex-red) !important;
  border-color: var(--pc-apex-red) !important;
  color: #FFFFFF !important;
  box-shadow: 0 16px 34px rgba(217, 47, 36, .22) !important;
}

.app-page-tour-actions .btn-secondary,
.app-tour-actions .btn-secondary {
  background: #FFFFFF !important;
  border-color: rgba(255, 255, 255, .88) !important;
  color: var(--pc-apex-black) !important;
}

.is-app-tour-focus,
.is-tour-target,
.sb-item.is-tour-target {
  border-color: rgba(217, 47, 36, .72) !important;
  box-shadow: 0 0 0 4px rgba(217, 47, 36, .18), 0 18px 44px rgba(17, 17, 17, .28) !important;
}

/* Playground preview widget: keep user brand accent dynamic, fix unreadable text surfaces */
.playground-v2-widget-stage {
  background:
    linear-gradient(rgba(17, 17, 17, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, .045) 1px, transparent 1px),
    var(--pc-apex-offwhite) !important;
  border-color: var(--pc-apex-line) !important;
}

.playground-test-widget {
  background: var(--pc-apex-black) !important;
  color: #FFFFFF !important;
}

.playground-test-head,
.playground-test-form,
.playground-test-tools,
.playground-test-support-bar {
  background: var(--pc-apex-black) !important;
  border-color: rgba(255, 255, 255, .12) !important;
}

.playground-test-head strong {
  color: #FFFFFF !important;
}

.playground-test-head small {
  color: rgba(255, 255, 255, .68) !important;
}

.playground-test-head-actions button,
.playground-test-tools button,
.playground-test-support-bar button,
.playground-test-starters button {
  background: #FFFFFF !important;
  border-color: rgba(17, 17, 17, .16) !important;
  color: var(--pc-apex-black) !important;
  box-shadow: none !important;
}

.playground-test-head-actions button:hover,
.playground-test-tools button:hover,
.playground-test-support-bar button:hover,
.playground-test-starters button:hover {
  border-color: color-mix(in srgb, var(--playground-widget-accent, var(--pc-apex-red)) 46%, transparent) !important;
  color: var(--pc-apex-black) !important;
}

.playground-test-body {
  background: var(--pc-apex-offwhite) !important;
  color: var(--pc-apex-black) !important;
}

.playground-test-body .playground-test-message > span {
  color: rgba(17, 17, 17, .58) !important;
}

.playground-test-body .playground-test-message > div {
  background: #FFFFFF !important;
  border-color: rgba(17, 17, 17, .12) !important;
  color: var(--pc-apex-black) !important;
  box-shadow: 0 10px 26px rgba(17, 17, 17, .07) !important;
}

.playground-test-body .playground-test-message.is-user > div {
  background: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  border-color: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  color: #FFFFFF !important;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--playground-widget-accent, var(--pc-apex-red)) 20%, transparent) !important;
}

.playground-test-body .playground-test-message.is-assistant > div,
.playground-test-body .playground-test-message.is-system > div,
.playground-test-body .playground-test-message.is-warning > div,
.playground-test-body .playground-test-message.is-thinking > div {
  background: #FFFFFF !important;
  border-color: rgba(17, 17, 17, .12) !important;
  color: var(--pc-apex-black) !important;
}

.playground-test-body .playground-test-message.is-error > div {
  background: rgba(217, 47, 36, .08) !important;
  border-color: rgba(217, 47, 36, .30) !important;
  color: var(--pc-apex-black) !important;
}

.playground-test-form input {
  background: #FFFFFF !important;
  border-color: rgba(17, 17, 17, .16) !important;
  color: var(--pc-apex-black) !important;
}

.playground-test-form input::placeholder {
  color: rgba(17, 17, 17, .44) !important;
}

.playground-test-form button {
  background: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  border-color: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}

.playground-test-tools button {
  font-weight: 800 !important;
}

/* Visitor capture / human handoff popup inside Playground preview */
.playground-modal-backdrop {
  background: rgba(17, 17, 17, .58) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

.playground-modal-card {
  background: #FFFFFF !important;
  border-color: rgba(17, 17, 17, .16) !important;
  color: var(--pc-apex-black) !important;
  box-shadow: 0 28px 90px rgba(17, 17, 17, .24) !important;
}

.playground-modal-card,
.playground-modal-card * {
  text-shadow: none !important;
}

.playground-modal-card h3,
.playground-modal-card > strong,
.playground-modal-card label,
.playground-modal-check,
.playground-modal-check span {
  color: var(--pc-apex-black) !important;
}

.playground-modal-card p {
  color: rgba(17, 17, 17, .68) !important;
}

.playground-modal-input {
  background: #FFFFFF !important;
  border-color: rgba(17, 17, 17, .18) !important;
  color: var(--pc-apex-black) !important;
}

.playground-modal-input::placeholder {
  color: rgba(17, 17, 17, .44) !important;
}

.playground-modal-close {
  background: rgba(17, 17, 17, .06) !important;
  color: var(--pc-apex-black) !important;
}

.playground-modal-error {
  background: rgba(217, 47, 36, .08) !important;
  border: 1px solid rgba(217, 47, 36, .28) !important;
  color: var(--pc-apex-red) !important;
}

.playground-modal-submit {
  background: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  border-color: var(--playground-widget-accent, var(--pc-apex-red)) !important;
  color: #FFFFFF !important;
}

/* Remove accidental green-tint leftovers in compact helper text without changing layout */
.playground-v2-help-box span,
.playground-v2-feedback span,
.training-guidance p,
.training-technical-details,
.training-technical-details code,
.embedded-api-feedback,
.embedded-install-note,
.app-save-notice {
  color: var(--pc-apex-muted) !important;
}

.training-guidance strong,
.training-technical-details summary,
.playground-v2-help-box strong,
.playground-v2-feedback strong {
  color: var(--pc-apex-black) !important;
}


/* Integration readability refinements */
.integration-template-card .embedded-settings-head h3,
.integration-template-card .embedded-api-feedback strong,
.integration-template-card .app-template-overview strong,
.integration-modal .embedded-settings-head h3,
.integration-modal .embedded-form-row > span,
.integration-modal .embedded-toggle-row strong,
.integration-modal .integration-modal-body strong,
.integration-modal .integration-modal-body summary,
.integration-modal .integration-modal-body label,
.integration-modal .integration-modal-body h3 {
  color: #111111 !important;
}

.integration-template-card .embedded-api-feedback span,
.integration-template-card .app-template-overview span,
.integration-template-card .integration-scope-helper,
.integration-modal .integration-helper-copy,
.integration-modal .integration-business-note,
.integration-modal .integration-business-note span,
.integration-modal .embedded-form-row small,
.integration-modal .embedded-toggle-row span,
.integration-modal .integration-modal-body p,
.integration-modal .integration-modal-body small,
.integration-modal .integration-modal-body details small {
  color: rgba(17, 17, 17, 0.76) !important;
}

.integration-template-card .integration-scope-note {
  background: rgba(217, 47, 36, 0.045) !important;
  border-color: rgba(217, 47, 36, 0.18) !important;
}

.integration-modal .integration-business-note {
  background: rgba(17, 17, 17, 0.018) !important;
  border-color: rgba(17, 17, 17, 0.13) !important;
}

.integration-modal .embedded-input,
.integration-modal .embedded-input[readonly],
.integration-modal select.embedded-input,
.integration-modal textarea.embedded-input {
  color: #111111 !important;
  background: #ffffff !important;
}

.integration-modal .embedded-input::placeholder,
.integration-modal textarea.embedded-input::placeholder {
  color: rgba(17, 17, 17, 0.45) !important;
}

.integration-modal .embedded-input:disabled,
.integration-modal button:disabled {
  opacity: 0.72;
}

/* ============================================================
   Embed environment switch and final Playground widget polish
   ============================================================ */
.embedded-environment-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(17, 17, 17, 0.13);
  border-radius: 14px;
  background: #F4F3EF;
}

.embedded-environment-picker button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(17, 17, 17, 0.62);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.embedded-environment-picker button:hover {
  color: #111111;
  background: rgba(255, 255, 255, 0.72);
}

.embedded-environment-picker button.is-active {
  border-color: rgba(217, 47, 36, 0.22);
  background: #FFFFFF;
  color: #D92F24;
  box-shadow: 0 6px 18px rgba(17, 17, 17, 0.08);
}

.embedded-environment-note {
  margin-top: -2px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 47, 36, 0.16);
  border-radius: 12px;
  background: rgba(217, 47, 36, 0.045);
  color: rgba(17, 17, 17, 0.68);
  font-size: 12px;
  line-height: 1.5;
}

/* Keep the preview visually close to the installed widget instead of mixing light and dark surfaces. */
.playground-v2-widget-stage {
  display: flex !important;
  align-items: stretch !important;
  justify-content: center !important;
  padding: 12px !important;
  background:
    linear-gradient(rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.035) 1px, transparent 1px),
    #F4F3EF !important;
  background-size: 24px 24px !important;
  border-color: rgba(17, 17, 17, 0.13) !important;
}

.playground-test-widget {
  --playground-widget-bg: #000000;
  --playground-widget-elevated: #0A0A0A;
  --playground-widget-surface: rgba(255, 255, 255, 0.055);
  --playground-widget-border: rgba(255, 255, 255, 0.09);
  --playground-widget-text: #FFFFFF;
  --playground-widget-muted: rgba(255, 255, 255, 0.62);
  width: min(100%, 440px) !important;
  min-height: 520px !important;
  height: 100% !important;
  border: 1px solid var(--playground-widget-border) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  background: var(--playground-widget-bg) !important;
  color: var(--playground-widget-text) !important;
  box-shadow: 0 22px 54px rgba(17, 17, 17, 0.18) !important;
}

.playground-test-widget.is-light-theme {
  --playground-widget-bg: #FFFFFF;
  --playground-widget-elevated: #FFFFFF;
  --playground-widget-surface: rgba(17, 17, 17, 0.045);
  --playground-widget-border: rgba(17, 17, 17, 0.10);
  --playground-widget-text: #111111;
  --playground-widget-muted: rgba(17, 17, 17, 0.58);
}

.playground-test-head {
  min-height: 76px !important;
  padding: 14px 16px !important;
  background: var(--playground-widget-elevated) !important;
  border-color: var(--playground-widget-border) !important;
}

.playground-test-head strong {
  color: var(--playground-widget-text) !important;
  font-size: 15px !important;
  letter-spacing: -0.01em !important;
}

.playground-test-head small {
  color: var(--playground-widget-muted) !important;
  opacity: 1 !important;
}

.playground-test-orb {
  width: 42px !important;
  height: 42px !important;
  background: var(--playground-widget-accent, #D92F24) !important;
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--playground-widget-accent, #D92F24) 14%, transparent),
    0 0 24px color-mix(in srgb, var(--playground-widget-accent, #D92F24) 26%, transparent) !important;
}

.playground-test-head-actions button,
.playground-test-tools button,
.playground-test-support-bar button,
.playground-test-starters button {
  border-color: var(--playground-widget-border) !important;
  background: var(--playground-widget-surface) !important;
  color: var(--playground-widget-text) !important;
  box-shadow: none !important;
}

.playground-test-head-actions button:hover,
.playground-test-tools button:hover,
.playground-test-support-bar button:hover,
.playground-test-starters button:hover {
  border-color: color-mix(in srgb, var(--playground-widget-accent, #D92F24) 48%, transparent) !important;
  background: color-mix(in srgb, var(--playground-widget-accent, #D92F24) 10%, var(--playground-widget-surface)) !important;
  color: var(--playground-widget-text) !important;
}

.playground-test-body {
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--playground-widget-accent, #D92F24) 8%, transparent), transparent 48%),
    var(--playground-widget-bg) !important;
  color: var(--playground-widget-text) !important;
}

.playground-test-body .playground-test-message > span {
  color: var(--playground-widget-muted) !important;
  opacity: 1 !important;
}

.playground-test-body .playground-test-message > div,
.playground-test-body .playground-test-message.is-assistant > div,
.playground-test-body .playground-test-message.is-system > div,
.playground-test-body .playground-test-message.is-warning > div,
.playground-test-body .playground-test-message.is-thinking > div {
  border-color: var(--playground-widget-border) !important;
  background: var(--playground-widget-surface) !important;
  color: var(--playground-widget-text) !important;
  box-shadow: none !important;
}

.playground-test-body .playground-test-message.is-user > div {
  border-color: var(--playground-widget-accent, #D92F24) !important;
  background: var(--playground-widget-accent, #D92F24) !important;
  color: var(--playground-widget-accent-text, #FFFFFF) !important;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--playground-widget-accent, #D92F24) 20%, transparent) !important;
}

.playground-test-body .playground-test-message.is-error > div,
.playground-test-error {
  border-color: rgba(217, 47, 36, 0.34) !important;
  background: rgba(217, 47, 36, 0.10) !important;
  color: var(--playground-widget-text) !important;
}

.playground-test-starters {
  background: var(--playground-widget-bg) !important;
}

.playground-test-support-bar,
.playground-test-form,
.playground-test-tools {
  background: var(--playground-widget-elevated) !important;
  border-color: var(--playground-widget-border) !important;
}

.playground-test-form input {
  border-color: var(--playground-widget-border) !important;
  background: var(--playground-widget-surface) !important;
  color: var(--playground-widget-text) !important;
}

.playground-test-form input::placeholder {
  color: var(--playground-widget-muted) !important;
}

.playground-test-form button,
.playground-modal-submit {
  border-color: var(--playground-widget-accent, #D92F24) !important;
  background: var(--playground-widget-accent, #D92F24) !important;
  color: var(--playground-widget-accent-text, #FFFFFF) !important;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--playground-widget-accent, #D92F24) 22%, transparent) !important;
}

.playground-test-toast {
  border: 1px solid var(--playground-widget-border) !important;
  background: var(--playground-widget-elevated) !important;
  color: var(--playground-widget-text) !important;
}

@media (max-width: 620px) {
  .embedded-environment-picker {
    grid-template-columns: 1fr;
  }

  .playground-v2-widget-stage {
    padding: 8px !important;
  }

  .playground-test-widget {
    width: 100% !important;
    border-radius: 18px !important;
  }
}

/* Subscription access and sidebar account status */
.sb-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
}

.sb-plan-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.sb-plan-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #D92F24;
}

.sb-plan-card.is-growth::before {
  background: #22C55E;
}

.sb-plan-card.is-expired::before,
.sb-plan-card.is-unavailable::before {
  background: #F59E0B;
}

.sb-plan-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sb-plan-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 9px;
  background: rgba(217, 47, 36, 0.15);
  color: #FF786F;
}

.sb-plan-card.is-growth .sb-plan-icon {
  background: rgba(34, 197, 94, 0.14);
  color: #7CE7A2;
}

.sb-plan-card.is-expired .sb-plan-icon,
.sb-plan-card.is-unavailable .sb-plan-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #FBC45E;
}

.sb-plan-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sb-plan-eyebrow {
  color: rgba(255, 255, 255, 0.44);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.sb-plan-copy strong {
  overflow: hidden;
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-plan-detail {
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
}

.sb-plan-suggestion {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.53);
  font-size: 10.5px;
  line-height: 1.45;
}

.sb-plan-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  margin-top: 10px;
  padding: 7px 9px;
  border: 1px solid rgba(217, 47, 36, 0.5);
  border-radius: 9px;
  background: #D92F24;
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.sb-plan-action svg {
  flex: 0 0 auto;
}

.sb-plan-action:hover {
  transform: translateY(-1px);
  background: #C5271D;
  box-shadow: 0 10px 22px rgba(217, 47, 36, 0.24);
}

.sb-plan-action:focus-visible {
  outline: 3px solid rgba(217, 47, 36, 0.3);
  outline-offset: 3px;
}

.sb-footer .sb-status {
  margin-top: 0;
  padding: 13px 10px 4px;
}

.sb-status.is-live .sb-status-dot {
  background: #22C55E !important;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14), 0 0 16px rgba(34, 197, 94, 0.42) !important;
}

.sb-status.is-setup .sb-status-dot {
  background: #F59E0B !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14), 0 0 16px rgba(245, 158, 11, 0.34) !important;
}

.sb-status.is-paused .sb-status-dot,
.sb-status.is-checking .sb-status-dot {
  background: #8B8B8B !important;
  box-shadow: 0 0 0 4px rgba(139, 139, 139, 0.12) !important;
}

.app-content.has-subscription-lock {
  position: relative;
  min-height: calc(100vh - 68px);
  overflow: hidden !important;
  isolation: isolate;
}

.subscription-locked-content {
  min-height: inherit;
  pointer-events: none;
  user-select: none;
  filter: blur(7px);
  opacity: 0.46;
  transform: scale(1.008);
  transform-origin: center;
}

.subscription-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 34px;
  overflow-y: auto;
  background: rgba(247, 246, 243, 0.42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.subscription-lock-card {
  width: min(100%, 590px);
  padding: 34px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  color: #111111;
  text-align: center;
  box-shadow: 0 28px 90px rgba(17, 17, 17, 0.18);
}

.subscription-lock-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border: 1px solid rgba(217, 47, 36, 0.2);
  border-radius: 18px;
  background: rgba(217, 47, 36, 0.08);
  color: #D92F24;
  box-shadow: 0 12px 28px rgba(217, 47, 36, 0.12);
}

.subscription-lock-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(217, 47, 36, 0.18);
  border-radius: 999px;
  background: rgba(217, 47, 36, 0.07);
  color: #B8251B;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subscription-lock-card h2 {
  margin: 14px 0 10px;
  color: #111111 !important;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.subscription-lock-card > p {
  max-width: 510px;
  margin: 0 auto;
  color: rgba(17, 17, 17, 0.66) !important;
  font-size: 14.5px;
  line-height: 1.7;
}

.subscription-lock-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
  padding: 13px 14px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 14px;
  background: #F8F7F4;
  color: rgba(17, 17, 17, 0.72);
  text-align: left;
  font-size: 12.5px;
  line-height: 1.55;
}

.subscription-lock-summary svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #D92F24;
}

.subscription-lock-cta {
  justify-content: center;
  min-width: 220px;
  min-height: 44px;
  text-decoration: none;
}

.subscription-lock-card > small {
  display: block;
  margin-top: 14px;
  color: rgba(17, 17, 17, 0.5) !important;
  font-size: 11.5px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .subscription-lock-overlay {
    padding: 20px 14px;
  }

  .subscription-lock-card {
    padding: 26px 20px;
    border-radius: 18px;
  }

  .subscription-lock-card h2 {
    font-size: 26px;
  }

  .subscription-lock-cta {
    width: 100%;
    min-width: 0;
  }

  .sb-footer {
    display: flex;
    flex: 0 0 auto;
    margin-top: 0;
    padding-top: 0;
    gap: 0;
  }

  .sb-plan-card {
    width: 152px;
    min-height: 46px;
    padding: 6px 8px;
    border-radius: 10px;
  }

  .sb-plan-head {
    gap: 7px;
  }

  .sb-plan-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .sb-plan-eyebrow,
  .sb-plan-suggestion,
  .sb-plan-action {
    display: none !important;
  }

  .sb-plan-copy strong {
    font-size: 11.5px;
  }

  .sb-plan-detail {
    margin: 2px 0 0 35px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Stripe checkout status */
.billing-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.billing-notice-card {
  width: min(100%, 520px);
  padding: 32px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  color: #111111;
  text-align: center;
  box-shadow: 0 30px 100px rgba(17, 17, 17, 0.22);
}

.billing-notice-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border: 1px solid rgba(217, 47, 36, 0.18);
  border-radius: 18px;
  background: rgba(217, 47, 36, 0.08);
  color: #D92F24;
}

.billing-notice-card.is-success .billing-notice-icon {
  border-color: rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.09);
  color: #16803C;
}

.billing-notice-card.is-error .billing-notice-icon {
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.08);
  color: #B91C1C;
}

.billing-notice-plan-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0 auto 8px;
  padding: 6px 12px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.04);
  color: rgba(17, 17, 17, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.billing-notice-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(217, 47, 36, 0.16);
  border-radius: 999px;
  background: rgba(217, 47, 36, 0.06);
  color: #B8251B;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-notice-card h2 {
  margin: 14px 0 10px;
  color: #111111 !important;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.billing-notice-card p {
  max-width: 440px;
  margin: 0 auto;
  color: rgba(17, 17, 17, 0.66) !important;
  font-size: 14.5px;
  line-height: 1.65;
}

.billing-notice-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.billing-notice-actions .btn {
  min-height: 42px;
  text-decoration: none;
}

.billing-notice-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgba(217, 47, 36, 0.18);
  border-top-color: #D92F24;
  border-radius: 50%;
  animation: billingNoticeSpin 700ms linear infinite;
}

@keyframes billingNoticeSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 620px) {
  .billing-notice-overlay {
    padding: 16px;
  }

  .billing-notice-card {
    padding: 26px 20px;
    border-radius: 18px;
  }

  .billing-notice-actions {
    flex-direction: column;
  }

  .billing-notice-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
