@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap");
:root {
  --color-navy: #043873;
  --color-ink: #1f2428;
  --color-ink-soft: #2a2f34;
  --color-muted: #6b7280;
  --color-border: #d7dce2;
  --color-surface: #ffffff;
  --color-surface-muted: #f5f7fb;
  --color-accent: #0b4aa6;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 45px rgba(4, 56, 115, 0.12);
  --shadow-tight: 0 8px 20px rgba(31, 36, 40, 0.12);
}


* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: radial-gradient(circle at top left, rgba(4, 56, 115, 0.12), transparent 50%),
    linear-gradient(135deg, #f2f5fa, #f7f9fc 55%, #eef2f8);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: var(--shadow-tight);
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}

.sidebar-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-brand span {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-navy);
  letter-spacing: 0.01em;
}

.sidebar-nav {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-muted);
  margin-top: 4px;
}

.sidebar-section-title + .sidebar-menu {
  margin-top: 4px;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  display: grid;
  gap: 10px;
  align-content: start;
  grid-auto-rows: max-content;
  padding-right: 20px;
  margin-right: -20px;
  scrollbar-gutter: stable;
}

.sidebar-menu::-webkit-scrollbar {
  width: 6px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(4, 56, 115, 0.2);
  border-radius: 999px;
}

.sidebar-item {
  display: grid;
  gap: 6px;
}

.sidebar-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px 7px 8px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.sidebar-link:hover {
  background: rgba(4, 56, 115, 0.06);
}


.sidebar-link.is-active {
  background: rgba(4, 56, 115, 0.12);
  color: var(--color-navy);
}

.sidebar-link.is-active .menu-icon svg {
  stroke: var(--color-navy);
}

.menu-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.menu-icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
}

.menu-icon.small {
  width: 14px;
  height: 14px;
  color: #4b5563;
}

.menu-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 1.8px;
}

.menu-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.submenu {
  list-style: none;
  margin: 0;
  padding: 0 0 0 28px;
  display: grid;
  gap: 6px;
  position: relative;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease;
}

.submenu.is-collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
}

.submenu:not(.is-collapsed) {
  max-height: 480px;
  opacity: 1;
  transform: translateY(0);
}

.submenu::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: rgba(4, 56, 115, 0.2);
  border-radius: 999px;
}

.actions-integrations-list {
  padding-left: 0;
  margin-top: 6px;
}

.actions-integrations-list::before {
  display: none;
}

[data-actions-integrations-wrapper] > .submenu-link {
  padding-left: 12px;
}

.actions-integrations-list .submenu-link {
  padding-left: 12px;
}



.submenu-link {
  display: block;
  padding: 4px 6px 4px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  background: transparent;
  border: 1px solid transparent;
}


.submenu-link:hover {
  background: rgba(4, 56, 115, 0.06);
  color: #111827;
}

.submenu-link.is-active {
  background: rgba(4, 56, 115, 0.12);
  color: var(--color-navy);
  border-color: rgba(4, 56, 115, 0.2);
}

.hidden {
  display: none;
}

.submenu-link .menu-dot {
  width: 6px;
  height: 6px;
  background: rgba(4, 56, 115, 0.4);
}

.submenu-link .menu-label {
  width: 100%;
  justify-content: flex-start;
}

.app-loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(4, 56, 115, 0.08), rgba(4, 56, 115, 0.02));
  display: grid;
  place-items: center;
  z-index: 9999;
}

.app-loader-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  box-shadow: var(--shadow-tight);
  padding: 32px 36px;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  animation: loader-fade 1.2s ease-in-out infinite alternate;
}

.app-loader-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.app-loader-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-navy);
}

.app-loader-subtext {
  font-size: 12px;
  color: var(--color-ink-soft);
}

.app-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-shell.is-loading {
  visibility: hidden;
}

@keyframes loader-fade {
  0% {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  }
  100% {
    transform: translateY(2px);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
  }
}

.submenu-meta .submenu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.chevron {
  font-size: 12px;
  color: var(--color-muted);
  transition: transform 0.2s ease;
}

.menu-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(4, 56, 115, 0.5);
  display: inline-block;
}

.sidebar-link.is-open .chevron {
  transform: rotate(180deg);
}

.sidebar-credits {
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
  display: grid;
  gap: 8px;
}

.untrained-card {
  border: 1px solid rgba(234, 179, 8, 0.5);
  background: rgba(234, 179, 8, 0.12);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.untrained-copy {
  display: grid;
  gap: 4px;
}

.untrained-title {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
}

.untrained-subtitle {
  font-size: 11px;
  color: #92400e;
}

.untrained-card .button-ghost {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
}

.untrained-status {
  font-size: 12px;
  color: var(--color-muted);
}

.untrained-hint {
  position: fixed;
  z-index: 80;
  max-width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  font-size: 12px;
  color: #111827;
}

.untrained-hint::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -8px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #fff;
  filter: drop-shadow(-1px 0 0 rgba(15, 23, 42, 0.12));
}

.untrained-hint button {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 6px;
}

.untrained-hint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 6px;
}

.untrained-hint-body {
  line-height: 1.4;
  color: #4b5563;
}

.storage-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-ink);
}

.storage-meta strong {
  font-weight: 600;
}

.credits-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

.credits-bar {
  height: 8px;
  background: #edf1f6;
  border-radius: 999px;
  overflow: hidden;
}

.credits-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-navy), var(--color-accent));
  transition: width 0.4s ease;
}

.credits-meta {
  font-size: 12px;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.credits-meta [data-credits-usage],
.credits-meta [data-credits-extra] {
  color: #4b5563;
  font-weight: 600;
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.header-center {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
  gap: 12px;
}

body.nav-locked .sidebar-nav,
body.nav-locked .sidebar-credits {
  display: none;
}

body.workspace-selected:not(.agent-selected) .sidebar-nav [data-nav-item] {
  display: none;
}

body.workspace-selected:not(.agent-selected) .sidebar-nav [data-nav-section] {
  display: none;
}

body.workspace-selected:not(.agent-selected) .sidebar-nav [data-settings-section],
body.workspace-selected:not(.agent-selected) .sidebar-nav [data-settings-item] {
  display: list-item;
}

body.workspace-selected:not(.agent-selected) .sidebar-credits {
  display: none;
}

body.workspace-selected:not(.workspace-owner) .sidebar-nav [data-settings-section],
body.workspace-selected:not(.workspace-owner) .sidebar-nav [data-settings-item] {
  display: none;
}

.header-context {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #111827;
}

.header-link {
  border: none;
  background: none;
  padding: 0;
  font-weight: 600;
  color: var(--color-navy);
  cursor: pointer;
}

.header-link:hover {
  text-decoration: underline;
}

.header-separator {
  color: #9aa3af;
  font-weight: 500;
}

.header-separator.is-hidden {
  display: none;
}

.header-agent {
  color: #111827;
  cursor: pointer;
}

.header-agent:hover {
  text-decoration: underline;
}

.header-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-navy);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  flex: 1;
}

.icon-link {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  background: #fff;
}

.icon-link:hover {
  background: rgba(4, 56, 115, 0.06);
  border-color: rgba(4, 56, 115, 0.18);
}

.user-name {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.user-menu {
  position: relative;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-tight);
  padding: 8px;
  min-width: 160px;
  display: none;
  z-index: 40;
}

.user-menu.is-open .user-dropdown {
  display: grid;
  gap: 6px;
}

.user-dropdown button {
  border: none;
  background: rgba(4, 56, 115, 0.06);
  color: var(--color-ink);
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

.user-dropdown button:hover {
  background: rgba(4, 56, 115, 0.12);
}

.button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.button-primary {
  background: var(--color-navy);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.button-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-ink);
}

.icon-button {
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.menu-toggle {
  padding: 8px 10px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.menu-line {
  width: 18px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 999px;
  display: block;
}


.content {
  padding: 32px 32px 48px;
}

body.activity-full .content,
body.playground-full .content,
body.chat-page-full .content,
body.apps-full .content,
body.dynamic-sources-full .content,
body.live-channels-full .content {
  padding: 0;
}

body.apps-full .app-shell,
body.apps-full .main {
  height: 100vh;
}

body.apps-full .main {
  min-height: 0;
  overflow: hidden;
}

body.apps-full .content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

body.apps-full .workspace {
  min-height: 100%;
}

.workspace {
  min-height: calc(100vh - 160px);
  transition: opacity 0.2s ease;
}

.workspace.is-fading {
  opacity: 0;
}


.workspace-ready {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  box-shadow: var(--shadow-tight);
  padding: 24px;
  max-width: 520px;
  font-weight: 600;
  color: #111827;
}

.workspace-page {
  display: grid;
  gap: 24px;
  width: 100%;
  max-width: none;
}

.team-page {
  justify-items: center;
  text-align: center;
}

.team-page .page-header p {
  margin: 0 auto;
  max-width: 520px;
}

.team-page .team-card {
  width: 100%;
}

.team-page .team-form {
  text-align: left;
}

.team-page .team-list h2 {
  text-align: left;
}

.activity-page {
  display: grid;
  grid-template-columns: minmax(300px, 38%) minmax(0, 62%);
  gap: 0;
  align-items: stretch;
  min-height: calc(100vh - 80px);
  height: calc(100vh - 80px);
}

.activity-list,
.activity-detail {
  min-height: 100%;
  height: 100%;
}

.activity-list {
  background: #f8fafc;
  border-right: 1px solid rgba(4, 56, 115, 0.1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 20px 16px 0;
}

.activity-detail {
  background: #fff;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.activity-header-text h1 {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.activity-header-text p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 12px;
}

.activity-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 2px;
}

.activity-actions .icon-button.is-active-filter {
  background: rgba(4, 56, 115, 0.1);
  color: var(--color-navy);
}

.activity-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.14);
  border-radius: 10px;
  padding: 0 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.activity-search:focus-within {
  border-color: rgba(4, 56, 115, 0.4);
  box-shadow: 0 0 0 3px rgba(4, 56, 115, 0.06);
}

.activity-search i {
  color: var(--color-muted);
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.activity-search input {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 0;
  font-size: 13px;
  color: #111827;
  outline: none;
}

.activity-search input::placeholder {
  color: #9ca3af;
}

.activity-filters {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.1);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.activity-filters.is-collapsed {
  display: none;
}

.activity-filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.activity-filters label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.activity-filters input,
.activity-filters select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(4, 56, 115, 0.14);
  font-size: 12px;
  background: #f8fafc;
  color: #111827;
}

.activity-clear-filters {
  margin-top: 10px;
  border: none;
  background: none;
  color: var(--color-navy);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.activity-count {
  display: block;
  font-size: 11px;
  color: var(--color-muted);
  margin-bottom: 6px;
  padding: 0 2px;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 2px 20px;
  min-width: 0;
}

.conversation-card {
  border: 1px solid rgba(4, 56, 115, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  flex-shrink: 0;
}

.conversation-card:hover {
  border-color: rgba(4, 56, 115, 0.25);
  box-shadow: 0 2px 8px rgba(4, 56, 115, 0.06);
}

.conversation-card.is-active {
  background: #fff;
  border-color: var(--color-navy);
  box-shadow: 0 4px 14px rgba(4, 56, 115, 0.12);
}

.conversation-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.conversation-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(4, 56, 115, 0.07);
  color: var(--color-navy);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.conversation-time {
  font-size: 11px;
  color: var(--color-muted);
  white-space: nowrap;
}

.conversation-title {
  display: block;
  font-weight: 600;
  font-size: 13px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  min-height: 1.4em;
}

.conversation-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 1.4em;
}

.conversation-subtitle {
  display: block;
  font-size: 11.5px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.conversation-count {
  font-size: 10.5px;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-load-more {
  margin-top: 4px;
  border: 1px dashed rgba(4, 56, 115, 0.2);
  background: none;
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px;
  border-radius: 10px;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
}

.activity-load-more:hover {
  background: rgba(4, 56, 115, 0.04);
  border-color: rgba(4, 56, 115, 0.35);
}

.activity-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--color-muted);
}

.activity-empty-state i {
  width: 36px;
  height: 36px;
  opacity: 0.35;
}

.activity-empty-state p {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.activity-empty-state span {
  font-size: 12px;
  color: #9ca3af;
  max-width: 220px;
  line-height: 1.5;
}

.activity-empty-state.detail-empty {
  padding: 80px 40px;
}

.activity-empty-state.detail-empty i {
  width: 48px;
  height: 48px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid rgba(4, 56, 115, 0.1);
  padding: 14px 16px 12px 20px;
  background: #fafbfc;
}

.detail-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.detail-header-source {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.detail-header-source h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-menu {
  position: relative;
  flex-shrink: 0;
}

.detail-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 12px;
  box-shadow: var(--shadow-tight);
  padding: 6px;
  display: none;
  min-width: 190px;
  z-index: 5;
}

.detail-menu.is-open .detail-dropdown {
  display: grid;
}

.detail-dropdown button {
  border: none;
  background: rgba(180, 35, 24, 0.07);
  color: #b42318;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.detail-dropdown button i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.detail-tabs {
  display: inline-flex;
  gap: 4px;
  background: rgba(4, 56, 115, 0.06);
  border-radius: 8px;
  padding: 3px;
}

.detail-tabs .tab {
  border: none;
  background: none;
  padding: 5px 12px;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.detail-tabs .tab.is-active {
  background: #fff;
  color: var(--color-navy);
  box-shadow: 0 1px 4px rgba(4, 56, 115, 0.1);
}

.detail-body {
  padding: 20px 20px 24px;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.detail-body.hidden {
  display: none;
}

.detail-body[data-tab-content="chat"] {
  flex: 1;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
}

.chat-message {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-content: start;
  align-items: start;
}

.chat-message .bubble {
  padding: 10px 14px;
  border-radius: 16px;
  width: fit-content;
  max-width: 75%;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  min-width: 0;
  height: fit-content;
  align-self: start;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-message.user {
  justify-items: end;
}

.chat-message.user .bubble {
  background: #111827;
  color: #fff;
  border-bottom-right-radius: 4px;
  justify-self: end;
}

.chat-message.bot .bubble {
  background: #f1f5f9;
  color: #111827;
  border-bottom-left-radius: 4px;
  justify-self: start;
  width: fit-content;
  max-width: 75%;
  display: block;
  overflow: visible;
}

.chat-message.bot .bubble > *:first-child {
  margin-top: 0;
}

.chat-message.bot .bubble > *:last-child {
  margin-bottom: 0;
}

.chat-message.bot .bubble :where(p, ul, ol, li, blockquote, pre) {
  margin-block-start: 0;
  margin-block-end: 0;
}

.chat-message.bot .bubble p {
  margin: 0 0 0.28em;
}

.chat-message.bot .bubble ul,
.chat-message.bot .bubble ol {
  margin: 0.12em 0 0.28em;
  padding-left: 1.1em;
}

.chat-message.bot .bubble li + li {
  margin-top: 0.08em;
}

.chat-message.bot .bubble p + ul,
.chat-message.bot .bubble p + ol {
  margin-top: 0.08em;
}

.chat-message.bot .bubble ul + p,
.chat-message.bot .bubble ol + p {
  margin-top: 0.16em;
}

.chat-time {
  font-size: 10.5px;
  color: #9ca3af;
  padding: 0 4px;
}

.chat-message.user .chat-time {
  justify-self: end;
}

.details-grid {
  display: grid;
  gap: 0;
  border: 1px solid rgba(4, 56, 115, 0.1);
  border-radius: 12px;
  overflow: hidden;
}

.details-grid div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.07);
}

.details-grid div:last-child {
  border-bottom: none;
}

.details-grid div:nth-child(odd) {
  background: #fafbfc;
}

.details-grid span {
  color: var(--color-muted);
  font-size: 12px;
}

.details-grid strong {
  font-weight: 600;
  color: #111827;
}

@media (max-width: 980px) {
  .activity-page {
    grid-template-columns: 1fr;
  }
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.page-header p {
  margin: 0;
  color: var(--color-ink-soft);
}

.select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 360px));
  gap: 20px;
  align-items: stretch;
  justify-content: start;
}

.select-card {
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  background: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 220px;
  box-shadow: var(--shadow-tight);
  cursor: pointer;
  text-align: left;
  position: relative;
  gap: 14px;
  align-self: stretch;
}

.select-card:not(.create-card):not(.limit-card) .card-visual {
  flex: 1;
  min-height: 140px;
}

.select-card.create-card {
  justify-content: center;
  padding: 24px;
}

.select-card.create-card .create-form {
  margin-top: 0;
}


.select-card:hover {
  border-color: rgba(4, 56, 115, 0.25);
  transform: translateY(-2px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.select-card.create-card,
.select-card.limit-card {
  cursor: default;
}

.card-visual {
  border-radius: 14px;
  min-height: 90px;
  background:
    linear-gradient(135deg, rgba(4, 56, 115, 0.12), rgba(255, 255, 255, 0.7)),
    repeating-linear-gradient(
      0deg,
      rgba(4, 56, 115, 0.12) 0,
      rgba(4, 56, 115, 0.12) 1px,
      transparent 1px,
      transparent 10px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(4, 56, 115, 0.12) 0,
      rgba(4, 56, 115, 0.12) 1px,
      transparent 1px,
      transparent 10px
    );
  border: 1px solid rgba(4, 56, 115, 0.22);
  position: relative;
  overflow: hidden;
}

.card-visual::after {
  content: "";
  position: absolute;
  inset: 16px 20px;
  border: 1px dashed rgba(4, 56, 115, 0.35);
  border-radius: 10px;
}

.card-visual-workspace {
  background:
    radial-gradient(circle at top right, rgba(4, 56, 115, 0.2), transparent 65%),
    repeating-linear-gradient(
      0deg,
      rgba(4, 56, 115, 0.12) 0,
      rgba(4, 56, 115, 0.12) 1px,
      transparent 1px,
      transparent 10px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(4, 56, 115, 0.12) 0,
      rgba(4, 56, 115, 0.12) 1px,
      transparent 1px,
      transparent 10px
    );
}

.card-visual-agent {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(235, 241, 249, 0.9));
  border: 1px solid rgba(4, 56, 115, 0.18);
}

.card-visual-create {
  background:
    radial-gradient(circle at top left, rgba(4, 56, 115, 0.18), transparent 55%),
    repeating-linear-gradient(
      0deg,
      rgba(4, 56, 115, 0.12) 0,
      rgba(4, 56, 115, 0.12) 1px,
      transparent 1px,
      transparent 10px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(4, 56, 115, 0.12) 0,
      rgba(4, 56, 115, 0.12) 1px,
      transparent 1px,
      transparent 10px
    );
}

.card-visual-limit {
  background:
    radial-gradient(circle at center, rgba(31, 36, 40, 0.12), transparent 60%),
    repeating-linear-gradient(
      0deg,
      rgba(31, 36, 40, 0.1) 0,
      rgba(31, 36, 40, 0.1) 1px,
      transparent 1px,
      transparent 10px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(31, 36, 40, 0.1) 0,
      rgba(31, 36, 40, 0.1) 1px,
      transparent 1px,
      transparent 10px
    );
}

.card-title {
  margin-top: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.card-title.centered-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-navy);
  text-align: center;
  position: relative;
  z-index: 1;
}

.card-visual {
  display: grid;
  place-items: center;
  pointer-events: none;
}







.card-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

.menu-button {
  border: 1px solid rgba(4, 56, 115, 0.2);
  background: rgba(4, 56, 115, 0.08);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1f2937;
  z-index: 2;
}

.menu-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.15);
  border-radius: 12px;
  box-shadow: var(--shadow-tight);
  padding: 8px;
  display: none;
  min-width: 160px;
  z-index: 10;
}

.card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.menu-dropdown button {
  border: none;
  background: rgba(4, 56, 115, 0.06);
  color: #111827;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}

.menu-dropdown button:hover {
  background: rgba(4, 56, 115, 0.12);
}

.menu-dropdown .danger {
  background: rgba(180, 35, 24, 0.08);
  color: #b42318;
}

.menu-dropdown .danger:hover {
  background: rgba(180, 35, 24, 0.16);
}

.card-subtitle {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.create-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.create-form label {
  font-size: 13px;
  color: var(--color-muted);
}

.create-form input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
}

.create-form button {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  background: var(--color-navy);
  color: #fff;
  cursor: pointer;
}

.form-helper {
  font-size: 12px;
  color: var(--color-muted);
}

.form-helper.error,
.form-helper.is-error {
  color: #b91c1c;
  font-weight: 600;
}

.empty-note {
  margin: 0;
  color: var(--color-muted);
}

.team-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 24px;
  display: grid;
  gap: 20px;
  max-width: 720px;
}

.apps-preview-stage {
  position: relative;
  display: grid;
  gap: 0;
  min-height: calc(100vh - 80px);
  height: calc(100vh - 80px);
}

.apps-preview-page {
  position: relative;
  gap: 0;
  min-height: 100%;
}

.apps-preview-page.is-busy .apps-preview-stage {
  pointer-events: none;
  user-select: none;
}

.apps-preview-page.is-locked .apps-preview-stage {
  filter: none;
  pointer-events: none;
  user-select: none;
}

.apps-preview-page-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 17, 31, 0.46);
  z-index: 3;
}

.apps-preview-page-overlay-card {
  min-width: min(100%, 360px);
  max-width: 420px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(4, 56, 115, 0.14);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.apps-preview-page-overlay-card .spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.apps-preview-page-overlay-copy {
  display: grid;
  gap: 4px;
}

.apps-preview-page-overlay-copy h3 {
  margin: 0;
  font-size: 18px;
  color: var(--color-ink-soft);
}

.apps-preview-page-overlay-copy p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.5;
}

.apps-preview-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 17, 31, 0.62);
  z-index: 2;
}

.apps-preview-overlay-card {
  width: min(100%, 640px);
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(4, 56, 115, 0.14);
  padding: 28px;
  display: grid;
  gap: 20px;
  justify-items: start;
}

.apps-preview-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  align-items: stretch;
  min-height: 100%;
  height: 100%;
}

.apps-preview-column {
  display: grid;
  gap: 0;
  align-content: start;
  min-height: 100%;
  min-width: 0;
}

.apps-preview-column-apps {
  border-bottom: 1px solid rgba(4, 56, 115, 0.12);
}

.apps-preview-section-header h2 {
  margin: 0;
  font-size: 22px;
  color: var(--color-ink-soft);
}

.apps-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.apps-preview-card {
  background: #fff;
  border-top: 1px solid rgba(4, 56, 115, 0.12);
  border-right: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 0;
  box-shadow: none;
  padding: 24px;
  display: grid;
  gap: 22px;
  min-height: 220px;
}

.apps-preview-card-top,
.apps-preview-card-bottom,
.apps-preview-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.apps-preview-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 56, 115, 0.08);
  color: var(--color-navy);
}

.apps-preview-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(31, 36, 40, 0.08);
  color: #4b5563;
}

.apps-preview-copy h3 {
  margin: 0 0 8px;
}

.apps-preview-copy p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.apps-preview-docs {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--color-navy);
  font-weight: 700;
  justify-self: end;
}

.apps-preview-manage-group {
  margin-left: auto;
  display: inline-flex;
  align-items: stretch;
  height: 38px;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  overflow: hidden;
  background: #eef2f7;
}

.apps-preview-manage-group.is-enabled {
  background: rgba(22, 163, 74, 0.14);
}

.apps-preview-manage-group.is-disabled {
  background: rgba(107, 114, 128, 0.12);
}

.apps-preview-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  height: 100%;
  background: transparent;
}

.apps-preview-manage-group.is-enabled .apps-preview-status {
  color: #15803d;
}

.apps-preview-manage-group.is-disabled .apps-preview-status {
  color: #556376;
}

.apps-preview-manage {
  min-width: 102px;
  height: calc(100% + 2px);
  min-height: calc(100% + 2px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfd8e3 !important;
  border-radius: 999px !important;
  padding: 0 !important;
  font-weight: 700;
  background: #fff !important;
  margin: -1px -1px -1px -8px !important;
  box-shadow: none;
  color: #0f172a;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.apps-preview-manage:hover {
  background: #f8fafc !important;
  box-shadow: 0 0 0 1px rgba(4, 56, 115, 0.1);
}

.apps-preview-manage:active {
  transform: translateY(1px);
}

.apps-preview-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.apps-preview-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.apps-preview-switch-track {
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: #d8dee8;
  border: none;
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
  box-sizing: border-box;
}

.apps-preview-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.1);
  transition: transform 0.18s ease;
  box-sizing: border-box;
}

.apps-preview-switch input:checked + .apps-preview-switch-track {
  background: rgba(39, 169, 111, 0.78);
}

.apps-preview-switch input:checked + .apps-preview-switch-track::after {
  transform: translateX(22px);
}

.apps-preview-panel {
  width: 100%;
  max-width: none;
}

.apps-preview-gate {
  width: 100%;
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.apps-preview-gate-copy {
  display: grid;
  gap: 8px;
}

.apps-preview-gate-copy h2 {
  margin: 0;
  font-size: 22px;
}

.apps-preview-gate-copy p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.apps-users-table {
  background: #fff;
  min-height: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
}

.apps-users-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.12);
}

.apps-users-table-head h2 {
  margin: 0;
  font-size: 22px;
}

.apps-users-toolbar,
.apps-users-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.apps-users-icon-button,
.apps-users-row-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(4, 56, 115, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--color-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.apps-preview-apps-head {
  position: relative;
  background: #fff;
  border-bottom: 1px solid rgba(4, 56, 115, 0.12);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

.apps-preview-open-portal {
  border: none;
  background: transparent;
  color: var(--color-navy);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  justify-self: center;
  padding: 0;
}

.apps-preview-open-portal:hover {
  opacity: 0.78;
}

.apps-preview-open-portal i,
.apps-preview-open-portal svg {
  width: 15px;
  height: 15px;
}

.apps-preview-apps-head > h2 {
  justify-self: start;
}

.apps-preview-apps-head .apps-preview-menu-shell {
  justify-self: end;
}

.apps-preview-menu-shell {
  position: relative;
}

.apps-preview-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(4, 56, 115, 0.14);
  padding: 8px;
  z-index: 5;
}

.apps-preview-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--color-navy);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.apps-preview-menu-item:hover {
  background: rgba(4, 56, 115, 0.08);
}

.apps-preview-menu-item-danger {
  color: #b42318;
}

.apps-preview-menu-item-danger:hover {
  background: rgba(180, 35, 24, 0.08);
}

.apps-users-icon-button:hover,
.apps-users-row-button:hover {
  background: rgba(4, 56, 115, 0.05);
}

.apps-users-table-grid {
  display: grid;
  align-content: start;
  background: #fff;
}

.apps-users-table-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 420px) minmax(160px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #edf1f6;
  background: #fff;
}

.apps-users-table-row > :nth-child(2) {
  justify-self: center;
}

.apps-users-table-row > :nth-child(3) {
  justify-self: end;
}

.apps-users-table-row-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: rgba(4, 56, 115, 0.03);
}

.apps-preview-column-users {
  background: #fff;
}

.apps-users-table-user {
  display: grid;
  gap: 4px;
}

.apps-users-table-user strong,
.apps-users-table-user span {
  display: block;
}

.apps-users-table-user span {
  color: var(--color-muted);
}

.apps-users-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 24px 32px;
  color: var(--color-muted);
  background: #fff;
}

.apps-users-empty-loading {
  align-items: center;
}

.apps-user-modal-card {
  width: min(560px, 100%);
  position: relative;
}

.apps-config-modal-card {
  width: min(520px, calc(100vw - 32px));
}

.apps-config-modal-header {
  align-items: flex-start;
}

.apps-config-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(4, 56, 115, 0.18);
  background: #fff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.apps-config-close:hover {
  border-color: rgba(4, 56, 115, 0.35);
}

.apps-config-modal-body {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.apps-config-note {
  margin: 0;
  color: var(--color-muted);
  font-size: 14px;
}

.apps-user-form {
  display: grid;
  gap: 16px;
}

.apps-user-form-fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  gap: 16px;
}

.apps-user-form-fieldset[disabled] {
  pointer-events: none;
}

.apps-user-field,
.apps-user-access-group,
.apps-user-access-fields {
  display: grid;
  gap: 8px;
}

.apps-user-field span,
.apps-user-access-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink-soft);
}

.apps-user-access-group {
  gap: 10px;
}

.apps-user-access-group.is-empty .apps-user-access-fields {
  padding: 14px 16px;
}

.apps-user-field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(4, 56, 115, 0.16);
  font-size: 14px;
}

.apps-user-password-wrap {
  position: relative;
}

.apps-user-password-wrap input {
  padding-right: 46px;
}

.apps-user-password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
}

.apps-user-password-toggle:hover {
  background: rgba(4, 56, 115, 0.06);
  color: var(--color-navy);
}

.apps-user-access-fields {
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  grid-template-columns: 1fr;
}

.apps-user-access-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-top: 1px solid rgba(4, 56, 115, 0.08);
  cursor: pointer;
}

.apps-user-access-row:first-of-type {
  border-top: none;
}

.apps-user-access-empty {
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
}

.apps-user-access-copy {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-ink-soft);
}

.apps-user-toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.apps-user-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.apps-user-toggle-track {
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: #d8dee8;
  border: none;
  position: relative;
  transition: background 0.18s ease;
  box-sizing: border-box;
}

.apps-user-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.1);
  transition: transform 0.18s ease;
  box-sizing: border-box;
}

.apps-user-toggle input:checked + .apps-user-toggle-track {
  background: rgba(39, 169, 111, 0.78);
}

.apps-user-toggle input:checked + .apps-user-toggle-track::after {
  transform: translateX(22px);
}

.apps-user-form-helper {
  min-height: 18px;
  margin: 0;
  color: #b42318;
  font-size: 13px;
}

.apps-user-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.apps-user-modal-card.is-busy .apps-user-form {
  opacity: 0.62;
}

.apps-user-modal-lock {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  z-index: 2;
}

.apps-user-modal-lock p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-ink-soft);
}

.apps-disable-modal-body {
  display: grid;
  gap: 10px;
}

.apps-disable-modal-body p {
  margin: 0;
  color: var(--color-ink-soft);
  line-height: 1.6;
}

.apps-disable-modal-warning {
  color: #b42318;
  font-weight: 600;
}

@media (max-width: 1180px) {
  .apps-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .apps-preview-card {
    min-height: 208px;
    padding: 22px;
  }

  .apps-users-table-row {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 300px) auto;
  }
}

@media (max-width: 860px) {
  .apps-preview-page,
  .apps-preview-stage {
    min-height: auto;
    height: auto;
  }

  .apps-preview-layout {
    min-height: auto;
    height: auto;
  }

  .apps-preview-column,
  .apps-users-table {
    min-height: auto;
    height: auto;
  }

  .apps-preview-grid {
    grid-template-columns: 1fr;
  }

  .apps-preview-card {
    min-height: 0;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid rgba(4, 56, 115, 0.12);
  }

  .apps-users-table-head,
  .apps-preview-apps-head {
    padding: 20px;
  }

  .apps-users-table-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "user actions"
      "access access";
    padding: 16px 20px;
    gap: 12px;
  }

  .apps-users-table-row > :nth-child(1) {
    grid-area: user;
  }

  .apps-users-table-row > :nth-child(2) {
    grid-area: access;
    justify-self: start;
  }

  .apps-users-table-row > :nth-child(3) {
    grid-area: actions;
    justify-self: end;
  }

  .apps-users-table-row-header {
    display: none;
  }
}

@media (max-width: 560px) {
  .apps-preview-overlay {
    padding: 16px;
  }

  .apps-preview-overlay-card {
    width: 100%;
    padding: 22px 20px;
    border-radius: 18px;
  }

  .apps-users-table-head,
  .apps-preview-apps-head {
    padding: 18px 16px;
  }

  .apps-preview-card {
    padding: 18px 16px;
  }

  .apps-preview-copy p {
    line-height: 1.5;
  }

  .apps-users-table-row {
    padding: 16px;
  }

  .apps-user-form-actions {
    flex-direction: column-reverse;
  }

  .apps-user-form-actions .button {
    width: 100%;
  }

  .apps-preview-switch-track {
    width: 48px;
    height: 28px;
  }

  .apps-preview-switch-track::after {
    width: 22px;
    height: 22px;
  }

  .apps-preview-switch input:checked + .apps-preview-switch-track::after {
    transform: translateX(20px);
  }
}

.team-form {
  display: grid;
  gap: 10px;
}

.team-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.team-input-row input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
}

.team-input-row button {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  background: var(--color-navy);
  color: #fff;
  cursor: pointer;
}

.team-input-row button:disabled {
  background: #9fb3d1;
  color: #f8fafc;
  cursor: not-allowed;
}

.team-list h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.team-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.team-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.04);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team-item.empty {
  color: var(--color-muted);
  background: rgba(4, 56, 115, 0.02);
}


.team-actions {
  display: inline-flex;
  gap: 8px;
}

.team-action {
  border: 1px solid rgba(4, 56, 115, 0.2);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #111827;
}

.team-action.danger {
  border-color: rgba(180, 35, 24, 0.4);
  color: #b42318;
}

.identity-page {
  gap: 24px;
  justify-items: center;
}

.identity-page .page-header {
  text-align: center;
}

.identity-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 24px;
  width: min(720px, 100%);
}

.identity-form {
  display: grid;
  gap: 12px;
}

.identity-form label {
  font-size: 13px;
  color: var(--color-muted);
}

.identity-form input,
.identity-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
  resize: vertical;
}

.identity-form input::placeholder,
.identity-form textarea::placeholder {
  color: #9aa3af;
}

.role-field {
  position: relative;
  display: grid;
}

.role-field textarea {
  padding-right: 52px;
  min-height: 120px;
}

.info-chip {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(4, 56, 115, 0.2);
  background: rgba(4, 56, 115, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
  cursor: help;
}

.info-tooltip {
  position: absolute;
  right: 0;
  top: 38px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--color-ink);
  width: 220px;
  box-shadow: var(--shadow-tight);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.info-chip:hover .info-tooltip {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.field-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-muted);
}

.field-count {
  font-weight: 600;
  color: #111827;
}

.identity-policies-list {
  display: grid;
  gap: 8px;
}

.identity-policy-trigger {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px dashed rgba(4, 56, 115, 0.5);
  background: transparent;
  color: var(--color-navy);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.identity-policy-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.identity-policy-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.identity-policy-entry[hidden] {
  display: none;
}

.identity-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-helper.is-success {
  color: #0f766e;
  font-weight: 600;
}

.faqs-page {
  gap: 24px;
}

.faqs-shell {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 8px;
  box-shadow: none;
  max-width: 1200px;
  margin: 0;
}

.faqs-list {
  display: grid;
  gap: 16px;
}

.faqs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.faqs-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.faq-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-header h3 {
  margin: 0;
  font-size: 16px;
}

.faq-card-menu {
  position: relative;
}

.faq-card-menu .menu-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.faq-card-menu .menu-dropdown {
  top: 36px;
}

.faq-card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.faq-card-menu .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.faq-card-menu .menu-dropdown svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}

.notes-page {
  gap: 24px;
}

.notes-shell {
  padding: 0 8px;
  max-width: 1200px;
  margin: 0;
}

.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.notes-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.notes-list {
  display: grid;
  gap: 16px;
}

.note-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.note-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.note-title {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.note-content {
  margin: 0;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.5;
}

.note-card-menu {
  position: relative;
}

.note-card-menu .menu-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.note-card-menu .menu-dropdown {
  top: 36px;
}

.note-card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.note-card-menu .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-card-menu .menu-dropdown svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}

.note-form-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-tight);
}

.note-form-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.note-form-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.note-form-header p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.note-storage {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 8px;
}

.note-storage strong {
  color: #111827;
}

.note-form {
  display: grid;
  gap: 10px;
}

.note-form input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.note-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
  resize: vertical;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.products-page {
  gap: 24px;
}

.products-shell {
  padding: 0 8px;
  max-width: 1200px;
  margin: 0;
}

.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.products-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.products-list {
  display: grid;
  gap: 16px;
}

.product-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.product-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.product-header h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.product-description {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.product-card-menu {
  position: relative;
}

.product-card-menu .menu-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.product-card-menu .menu-dropdown {
  top: 36px;
}

.product-card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.product-card-menu .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card-menu .menu-dropdown svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}

.product-form-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-tight);
}

.product-form-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.product-form-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.product-form-header p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.product-storage {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 8px;
}

.product-storage strong {
  color: #111827;
}

.product-form {
  display: grid;
  gap: 10px;
}

.product-form input,
.product-form textarea,
.product-form select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.product-form textarea {
  resize: vertical;
}

.product-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-api-page {
  gap: 24px;
}

.custom-api-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.custom-api-usage {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-tight);
  min-width: 200px;
}

.custom-api-usage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.custom-api-usage-value {
  margin-top: 4px;
  font-size: 13px;
  color: #111827;
}

.custom-api-usage-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.12);
  overflow: hidden;
}

.custom-api-usage-bar span {
  display: block;
  height: 100%;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.custom-api-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 0 8px;
  max-width: 1200px;
  margin: 0;
}

.custom-api-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.custom-api-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.custom-api-list {
  display: grid;
  gap: 16px;
}

.custom-api-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.custom-api-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.custom-api-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-api-card-menu {
  position: relative;
}

.custom-api-card-menu .menu-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.custom-api-card-menu .menu-dropdown {
  top: 36px;
}

.custom-api-card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.custom-api-card-menu .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-api-card-menu .menu-dropdown svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}

.custom-api-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.custom-api-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.custom-api-method {
  background: rgba(4, 56, 115, 0.08);
  color: var(--color-navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.custom-api-url {
  font-size: 12px;
  color: var(--color-muted);
  word-break: break-all;
}

.custom-api-form-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-tight);
  width: 100%;
}

.custom-api-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.custom-api-form-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.custom-api-form-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.custom-api-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.custom-api-form input,
.custom-api-form textarea,
.custom-api-form select {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.custom-api-form textarea {
  resize: vertical;
}

.custom-api-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 12px;
}

.custom-api-row > div {
  min-width: 0;
}

.custom-api-row input,
.custom-api-row select {
  width: 100%;
}

.custom-api-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-api-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.02);
}

.custom-api-group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.custom-api-group-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.custom-api-group-header p {
  margin: 0;
  font-size: 12px;
  color: var(--color-ink-soft);
}

.custom-api-items {
  display: grid;
  gap: 10px;
}

.custom-api-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.custom-api-item[data-body-item] {
  grid-template-columns: minmax(0, 1fr) 140px auto auto auto auto auto;
}

.custom-api-item input,
.custom-api-item select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 13px;
  font-family: var(--font-body);
}

.custom-api-type-locked {
  display: none;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: rgba(17, 24, 39, 0.04);
}

.custom-api-type-locked.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.custom-api-item.is-object-locked select {
  display: none;
}

.custom-api-array,
.custom-api-required {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
}

.custom-api-array input,
.custom-api-required input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.custom-api-shell.is-creating {
  grid-template-columns: 1fr;
}

@media (max-width: 960px) {
  .custom-api-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .custom-api-shell {
    grid-template-columns: 1fr;
  }
}

.custom-button-page {
  gap: 24px;
}

.custom-button-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.custom-button-usage {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-tight);
  min-width: 200px;
}

.custom-button-usage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.custom-button-usage-value {
  margin-top: 4px;
  font-size: 13px;
  color: #111827;
}

.custom-button-usage-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.12);
  overflow: hidden;
}

.custom-button-usage-bar span {
  display: block;
  height: 100%;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.custom-button-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 0 8px;
  max-width: 1200px;
  margin: 0;
}

.custom-button-shell.is-creating {
  grid-template-columns: minmax(0, 1fr);
}

.custom-button-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.custom-button-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.custom-button-list {
  display: grid;
  gap: 16px;
}

.custom-button-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.custom-button-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.custom-button-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-button-card-menu {
  position: relative;
}

.custom-button-card-menu .menu-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.custom-button-card-menu .menu-dropdown {
  top: 36px;
}

.custom-button-card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.custom-button-card-menu .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-button-card-menu .menu-dropdown svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}
.zapier-card-menu {
  position: relative;
}

.zapier-card-menu .menu-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.zapier-card-menu .menu-dropdown {
  top: 36px;
}

.zapier-card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.zapier-card-menu .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zapier-card-menu .menu-dropdown svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}
.make-card-menu {
  position: relative;
}

.make-card-menu .menu-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.make-card-menu .menu-dropdown {
  top: 36px;
}

.make-card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.make-card-menu .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.make-card-menu .menu-dropdown svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}
.slack-card-menu {
  position: relative;
}

.slack-card-menu .menu-button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.slack-card-menu .menu-dropdown {
  top: 36px;
}

.slack-card-menu.is-open .menu-dropdown {
  display: grid;
  gap: 6px;
}

.slack-card-menu .menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slack-card-menu .menu-dropdown svg {
  width: 16px;
  height: 16px;
  stroke-width: 2px;
}
.gmail-page {
  gap: 24px;
}

.gmail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.gmail-usage {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-tight);
  min-width: 200px;
}

.gmail-usage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.gmail-usage-value {
  margin-top: 4px;
  font-size: 13px;
  color: #111827;
}

.gmail-usage-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.12);
  overflow: hidden;
}

.gmail-usage-bar span {
  display: block;
  height: 100%;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.gmail-shell {
  display: grid;
  gap: 18px;
  max-width: 960px;
}

.gmail-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.gmail-section {
  display: grid;
  gap: 12px;
}

.gmail-section-divider {
  border-top: 1px solid rgba(4, 56, 115, 0.12);
  padding-top: 16px;
}

.gmail-card h2 {
  margin: 0;
  font-size: 18px;
}

.gmail-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.gmail-card label {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.gmail-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.gmail-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.gmail-status-pill {
  background: rgba(4, 56, 115, 0.08);
  color: var(--color-navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.gmail-status-pill.is-connected {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.gmail-status-meta {
  font-size: 12px;
  color: var(--color-muted);
}

.gmail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gmail-action-item {
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.gmail-action-item p {
  margin-top: 4px;
}

.gmail-action-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.gmail-action-item .button.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.calendar-page {
  gap: 24px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.calendar-usage {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-tight);
  min-width: 200px;
}

.calendar-usage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.calendar-usage-value {
  margin-top: 4px;
  font-size: 13px;
  color: #111827;
}

.calendar-usage-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.12);
  overflow: hidden;
}

.calendar-usage-bar span {
  display: block;
  height: 100%;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.calendar-shell {
  display: grid;
  gap: 18px;
  max-width: 960px;
}

.calendar-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.calendar-card h2 {
  margin: 0;
  font-size: 18px;
}

.calendar-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.calendar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.calendar-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.calendar-status-pill {
  background: rgba(4, 56, 115, 0.08);
  color: var(--color-navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.calendar-status-pill.is-connected {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.calendar-status-meta {
  font-size: 12px;
  color: var(--color-muted);
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-access-toggle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.08);
  border: 1px solid rgba(4, 56, 115, 0.12);
  isolation: isolate;
}

.calendar-access-toggle::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-tight);
  transform: translateX(calc(var(--access-index, 0) * 100%));
  transition: transform 0.25s ease;
  z-index: 0;
}

.calendar-access-option {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-soft);
  border-radius: 999px;
  transition: color 0.2s ease;
}

.calendar-access-option.is-active {
  color: var(--color-navy);
}

.calendar-access-toggle.is-disabled {
  opacity: 0.7;
}

.calendar-access-option.is-disabled {
  cursor: not-allowed;
}

.calendar-access-hint {
  font-size: 12px;
  color: var(--color-muted);
}

.calendar-settings {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.calendar-settings-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.calendar-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.calendar-field input,
.calendar-field select {
  border: 1px solid rgba(4, 56, 115, 0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--color-ink);
  background: #fff;
}

.calendar-field input:disabled,
.calendar-field select:disabled {
  background: rgba(4, 56, 115, 0.04);
  color: var(--color-muted);
}

.calendar-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--color-ink-soft);
}

.calendar-checkbox input {
  width: 16px;
  height: 16px;
}

.calendar-settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 720px) {
  .calendar-settings-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tickets-page {
  gap: 24px;
  padding: 0;
}

.tickets-loading {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--color-muted);
}

.tickets-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.tickets-provider-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.tickets-provider-value {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.tickets-handling-table {
  display: grid;
  gap: 12px;
}

.tickets-setup-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow-tight);
}

.tickets-setup-card h2 {
  margin: 0;
  font-size: 18px;
}

.tickets-setup-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.tickets-setup-note {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.tickets-setup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(241, 245, 249, 0.9);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 2;
  pointer-events: auto;
}

.tickets-setup-overlay.hidden {
  display: none;
}

.tickets-setup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tickets-assignable {
  display: grid;
  gap: 10px;
}

.tickets-assignable h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.tickets-assignable-list {
  display: grid;
  gap: 8px;
}

.tickets-assignable-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.tickets-assignable-empty {
  font-size: 12px;
  color: var(--color-muted);
}

.tickets-setup-overlay .tickets-setup-card {
  width: min(640px, 100%);
  padding: 22px;
  gap: 16px;
}

.tickets-setup-options {
  display: grid;
  gap: 10px;
}

.tickets-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-ink-soft);
}

.tickets-layout {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  align-items: start;
  overflow-x: hidden;
}

.tickets-layout.is-disabled {
  pointer-events: none;
}

.tickets-sidebar {
  display: grid;
  gap: 20px;
  align-content: start;
  background: #fff;
  border-right: 1px solid rgba(4, 56, 115, 0.12);
  padding: 18px 16px;
  min-height: calc(100vh - 72px);
}

.tickets-sidebar-actions {
  display: flex;
  justify-content: flex-end;
}

.tickets-sidebar-section {
  display: grid;
  gap: 10px;
}

.tickets-sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.tickets-nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  color: #1f2a44;
}

.tickets-nav-item.is-active {
  background: rgba(4, 56, 115, 0.08);
  border-color: rgba(4, 56, 115, 0.12);
}

.tickets-nav-count {
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 600;
}

.tickets-handling-list {
  display: grid;
  gap: 10px;
}

.tickets-handling-item {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #1f2a44;
  box-shadow: var(--shadow-tight);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tickets-handling-item:active {
  transform: translateY(1px);
}

.tickets-handling-item:hover {
  border-color: rgba(4, 56, 115, 0.24);
  box-shadow: var(--shadow-soft);
}

.tickets-handling-item small {
  color: var(--color-muted);
  font-size: 12px;
}

.tickets-handling-empty {
  font-size: 12px;
  color: var(--color-muted);
}

.tickets-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  background: #fff;
  height: calc(100vh - 72px);
  overflow: hidden;
}

.tickets-main-header {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.12);
}

.tickets-sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tickets-sidebar-actions .icon-button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  padding: 4px;
}

.tickets-sidebar-actions .icon-button svg {
  width: 14px;
  height: 14px;
}
.tickets-attention {
  font-size: 14px;
  font-weight: 600;
  color: #1f2a44;
  padding: 0 20px 8px;
}

/* Deprecated: pagination replaced by in-table load more row. */

.tickets-page-info {
  font-size: 12px;
  color: var(--color-muted);
}

.tickets-stats-group {
  display: grid;
  gap: 10px;
}

.tickets-stats-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.tickets-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(130px, max-content);
  gap: 12px;
  width: auto;
}

.tickets-stat {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  min-width: 130px;
  text-align: center;
}

.tickets-stat span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.tickets-stat strong {
  font-size: 18px;
  color: #111827;
}

.tickets-table {
  display: grid;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.tickets-row {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.08);
  cursor: pointer;
  background: #fff;
}

.tickets-row:hover {
  background: rgba(4, 56, 115, 0.04);
}

.tickets-row-header {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  cursor: default;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 2;
}

.tickets-row-header:hover {
  background: #f8fafc;
}

.tickets-row-empty {
  grid-template-columns: 1fr;
  cursor: default;
}

.tickets-row-empty:hover {
  background: #fff;
}

.tickets-row-empty .tickets-cell {
  color: var(--color-muted);
  padding: 6px 0;
}

.tickets-row-section {
  grid-template-columns: 1fr;
  background: rgba(4, 56, 115, 0.02);
  cursor: default;
}

.tickets-row-section:hover {
  background: rgba(4, 56, 115, 0.02);
}

.tickets-row-section .tickets-cell {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.tickets-row-more {
  justify-items: center;
}

.tickets-row-more .button {
  background: transparent;
}

@media (max-width: 1200px) {
  .tickets-main-header {
    flex-direction: column;
  }

  .tickets-stats {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }
}

@media (max-width: 900px) {
  .tickets-layout {
    grid-template-columns: 1fr;
  }

  .tickets-main-header {
    display: none;
  }

  .tickets-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(4, 56, 115, 0.12);
    min-height: auto;
  }

  .tickets-main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tickets-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .tickets-main-header {
    display: none;
  }

  .tickets-attention {
    padding-top: 16px;
  }
}

@media (max-width: 640px) {

  .tickets-stats {
    grid-template-columns: 1fr;
  }

  .tickets-row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr) minmax(0, 1fr);
  }

  .tickets-row .tickets-cell.requested,
  .tickets-row .tickets-cell.assignee {
    display: none;
  }
}

.tickets-cell {
  font-size: 14px;
  color: #111827;
  min-width: 0;
  overflow-wrap: anywhere;
}

.tickets-cell.subject {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.ticket-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.priority-high {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.priority-normal {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.priority-low {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.tickets-modal-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 10px 0 4px;
  align-content: start;
}

.tickets-modal-info {
  display: grid;
  gap: 14px;
}

.tickets-modal-info span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

.tickets-modal-summary h3,
.tickets-modal-chat h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.tickets-modal-summary p {
  margin: 0;
  color: var(--color-ink-soft);
}

.tickets-chat {
  display: grid;
  gap: 10px;
  background: rgba(4, 56, 115, 0.04);
  border-radius: 12px;
  padding: 12px;
  max-height: 100%;
  overflow: auto;
  padding-right: 4px;
}

.tickets-assign-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.tickets-assign-panel.hidden {
  display: none;
}

.tickets-assign-panel h3 {
  margin: 0;
  font-size: 14px;
}

.tickets-assign-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tickets-assign-empty {
  font-size: 12px;
  color: var(--color-muted);
}

.button.button-ghost.tickets-close-secondary {
  background: #f3f4f6;
  border-color: rgba(148, 163, 184, 0.35);
  color: #111827;
}

.button.button-ghost.tickets-close-secondary:hover {
  background: #e5e7eb;
}

.tickets-chat-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  max-width: 92%;
}

.tickets-chat-bubble.user {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
}

.tickets-chat-bubble.agent {
  background: rgba(4, 56, 115, 0.12);
  justify-self: end;
}

.tickets-modal {
  width: min(1320px, 96vw);
  height: min(90vh, 920px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.tickets-email-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.modal-wide:not(.tickets-modal) {
  width: min(760px, 92vw);
}
.custom-button-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.custom-button-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.custom-button-pill {
  background: rgba(4, 56, 115, 0.08);
  color: var(--color-navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.custom-button-url {
  font-size: 12px;
  color: var(--color-muted);
  word-break: break-all;
}

.custom-button-form-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-tight);
}

.custom-button-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.custom-button-form-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.custom-button-form-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.custom-button-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
  align-items: start;
}

.custom-button-form {
  display: grid;
  gap: 10px;
}

.custom-button-form input,
.custom-button-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.custom-button-form textarea {
  resize: vertical;
}

.custom-button-colors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.custom-button-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-button-color-row input[type="text"] {
  flex: 1;
  min-width: 0;
}

.custom-button-colors input[type="color"] {
  padding: 0;
  height: 42px;
  border: none;
  background: transparent;
}

.custom-button-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-button-preview {
  background: #f8fafc;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.custom-button-preview-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.custom-button-preview .chat-widget {
  width: min(360px, 100%);
  height: 520px;
  margin: 0 auto;
  box-shadow: var(--shadow-tight);
}

.custom-button-preview .chat-body {
  min-height: 260px;
}

.custom-button-preview-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-ink-soft);
  text-align: center;
}

.chat-action-button {
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  background: #111827;
  color: #fff;
  cursor: pointer;
  align-self: flex-start;
}

@media (max-width: 960px) {
  .custom-button-builder {
    grid-template-columns: 1fr;
  }
}

.settings-page {
  gap: 24px;
}

.settings-grid {
  display: grid;
  gap: 18px;
  max-width: 720px;
}

.settings-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 20px;
  display: grid;
  gap: 10px;
}

.settings-card h2 {
  margin: 0;
  font-size: 18px;
}

.settings-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.settings-form {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.settings-form input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.danger-zone {
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.us-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 8px 6px 24px;
  gap: 18px;
}

.us-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 6px 2px;
}

.us-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(135deg, #043873, #0b4aa6);
  box-shadow: 0 10px 24px rgba(4, 56, 115, 0.25);
}

.us-hero-text h1 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.08;
  color: #0f172a;
}

.us-hero-text p {
  margin: 8px 0 0;
  color: #4b5563;
  font-size: 15px;
}

.us-panel {
  display: grid;
  gap: 14px;
}

.us-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  overflow: hidden;
}

.us-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px 12px;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid rgba(4, 56, 115, 0.1);
}

.us-section-icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.9px;
  color: #1f2937;
}

.us-section-body {
  padding: 16px 18px 18px;
  display: grid;
  gap: 14px;
}

.us-row {
  display: grid;
  grid-template-columns: minmax(200px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

form.us-row {
  margin: 0;
}

.us-row-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.us-row-hint {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.us-row-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.us-row-control input {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 460px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
  color: #111827;
}

.us-row-control input::placeholder {
  color: #9ca3af;
}

.us-row-control input:focus {
  outline: none;
  border-color: rgba(4, 56, 115, 0.45);
  box-shadow: 0 0 0 3px rgba(4, 56, 115, 0.12);
}

.us-row-control .button {
  height: 40px;
  padding: 0 18px;
}

.us-row-control .form-helper {
  width: 100%;
}

.us-row-divider {
  height: 1px;
  border: 0;
  background: rgba(4, 56, 115, 0.12);
  margin: 2px 0;
}

.us-danger-section {
  border-color: rgba(180, 35, 24, 0.25);
}

.us-danger-section > summary {
  list-style: none;
  cursor: pointer;
}

.us-danger-section > summary::-webkit-details-marker {
  display: none;
}

.us-danger-section > summary.us-section-label {
  border-bottom: none;
}

.us-danger-section[open] > summary.us-section-label {
  border-bottom: 1px solid rgba(180, 35, 24, 0.18);
}

.us-danger-label {
  color: #7f1d1d;
  border-bottom-color: rgba(180, 35, 24, 0.18);
}

.us-danger-label .us-section-icon {
  color: #b42318;
}

.us-danger-chevron {
  margin-left: auto;
  width: 18px;
  height: 18px;
  color: #b42318;
  transition: transform 0.18s ease;
}

.us-danger-section[open] .us-danger-chevron {
  transform: rotate(180deg);
}

.us-danger-control .button {
  border-radius: 999px;
}

.us-danger-control .button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.us-delete-modal-card {
  width: min(560px, 100%);
}

.us-delete-modal-note {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
  line-height: 1.5;
}

.us-delete-modal-message {
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.08);
  color: #7f1d1d;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.us-delete-modal-message.is-success {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.us-delete-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 960px) {
  .us-page {
    max-width: 100%;
    padding: 4px 0 18px;
  }

  .us-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .us-row-control input {
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .us-hero {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 2px 0;
  }

  .us-avatar {
    width: 48px;
    height: 48px;
    font-size: 14px;
  }

  .us-section-label {
    font-size: 18px;
    padding: 12px 14px 10px;
  }

  .us-section-body {
    padding: 14px;
  }
}

.stripe-page {
  gap: 24px;
}

.stripe-page .page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.stripe-usage {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-tight);
  min-width: 200px;
}

.stripe-usage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.stripe-usage-value {
  margin-top: 4px;
  font-size: 13px;
  color: #111827;
}

.stripe-usage-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.12);
  overflow: hidden;
}

.stripe-usage-bar span {
  display: block;
  height: 100%;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.zapier-page {
  gap: 24px;
}

.zapier-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.zapier-usage {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-tight);
  min-width: 200px;
}

.zapier-usage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.zapier-usage-value {
  margin-top: 4px;
  font-size: 13px;
  color: #111827;
}

.zapier-usage-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.12);
  overflow: hidden;
}

.zapier-usage-bar span {
  display: block;
  height: 100%;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.zapier-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 0 8px;
  max-width: 1200px;
  margin: 0;
}

.zapier-shell.is-creating {
  grid-template-columns: 1fr;
}

.zapier-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.zapier-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.zapier-list {
  display: grid;
  gap: 16px;
}

.zapier-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.zapier-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.zapier-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zapier-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.zapier-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.zapier-url {
  font-size: 12px;
  color: var(--color-muted);
  word-break: break-all;
}

.zapier-form-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-tight);
}

.zapier-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.zapier-form-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.zapier-form-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.zapier-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.zapier-form input,
.zapier-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.zapier-form textarea {
  resize: vertical;
}

.zapier-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zapier-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.02);
}

.zapier-group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.zapier-group-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.zapier-group-header p {
  margin: 0;
  font-size: 12px;
  color: var(--color-ink-soft);
}

.zapier-items {
  display: grid;
  gap: 10px;
}

.zapier-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.zapier-item[data-zapier-body-item] {
  grid-template-columns: minmax(0, 1fr) 140px auto auto auto auto auto;
}

.zapier-item input,
.zapier-item select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 13px;
  font-family: var(--font-body);
}

.zapier-type-locked {
  display: none;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: rgba(17, 24, 39, 0.04);
}

.zapier-type-locked.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zapier-item.is-object-locked select {
  display: none;
}

.zapier-array,
.zapier-required {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
}

.zapier-array input,
.zapier-required input {
  width: 14px;
  height: 14px;
  margin: 0;
}

@media (max-width: 960px) {
  .zapier-shell {
    grid-template-columns: 1fr;
  }
}

.make-page {
  gap: 24px;
}

.make-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.make-usage {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-tight);
  min-width: 200px;
}

.make-usage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.make-usage-value {
  margin-top: 4px;
  font-size: 13px;
  color: #111827;
}

.make-usage-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.12);
  overflow: hidden;
}

.make-usage-bar span {
  display: block;
  height: 100%;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.make-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 0 8px;
  max-width: 1200px;
  margin: 0;
}

.make-shell.is-creating {
  grid-template-columns: 1fr;
}

.make-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.make-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.make-list {
  display: grid;
  gap: 16px;
}

.make-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.make-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.make-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.make-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.make-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.make-url {
  font-size: 12px;
  color: var(--color-muted);
  word-break: break-all;
}

.make-form-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-tight);
}

.make-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.make-form-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.make-form-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.make-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.make-form input,
.make-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.make-form textarea {
  resize: vertical;
}

.make-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.make-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.02);
}

.make-group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.make-group-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.make-group-header p {
  margin: 0;
  font-size: 12px;
  color: var(--color-ink-soft);
}

.make-items {
  display: grid;
  gap: 10px;
}

.make-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.make-item[data-make-body-item] {
  grid-template-columns: minmax(0, 1fr) 140px auto auto auto auto auto;
}

.make-item input,
.make-item select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 13px;
  font-family: var(--font-body);
}

.make-type-locked {
  display: none;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: rgba(17, 24, 39, 0.04);
}

.make-type-locked.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.make-item.is-object-locked select {
  display: none;
}

.make-array,
.make-required {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
}

.make-array input,
.make-required input {
  width: 14px;
  height: 14px;
  margin: 0;
}

@media (max-width: 960px) {
  .make-shell {
    grid-template-columns: 1fr;
  }
}

.slack-page {
  gap: 24px;
}

.slack-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.slack-usage {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--shadow-tight);
  min-width: 200px;
}

.slack-usage-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.slack-usage-value {
  margin-top: 4px;
  font-size: 13px;
  color: #111827;
}

.slack-usage-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(4, 56, 115, 0.12);
  overflow: hidden;
}

.slack-usage-bar span {
  display: block;
  height: 100%;
  background: var(--color-navy);
  transition: width 0.2s ease;
}

.slack-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 0 8px;
  max-width: 1200px;
  margin: 0;
}

.slack-shell.is-creating {
  grid-template-columns: 1fr;
}

.slack-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.slack-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.slack-list {
  display: grid;
  gap: 16px;
}

.slack-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 18px;
  display: grid;
  gap: 10px;
}

.slack-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.slack-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slack-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.slack-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.slack-url {
  font-size: 12px;
  color: var(--color-muted);
  word-break: break-all;
}

.slack-form-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-tight);
}

.slack-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.slack-form-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.slack-form-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.slack-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.slack-form input,
.slack-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.slack-form textarea {
  resize: vertical;
}


.slack-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}



@media (max-width: 960px) {
  .slack-shell {
    grid-template-columns: 1fr;
  }
}

.stripe-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 960px;
}

.stripe-form-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.stripe-form-card h2 {
  margin: 0;
  font-size: 18px;
}

.stripe-form-card p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.stripe-status-pill {
  justify-self: start;
  background: rgba(4, 56, 115, 0.08);
  color: var(--color-navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.stripe-status-pill.is-live {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.stripe-status-meta {
  font-size: 12px;
  color: var(--color-muted);
}

.stripe-status-key {
  font-size: 13px;
  color: #111827;
  font-weight: 600;
}

.stripe-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stripe-status-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stripe-form {
  display: grid;
  gap: 10px;
}

.stripe-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.stripe-form input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.stripe-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stripe-label-row .info-chip {
  position: relative;
  right: auto;
  top: auto;
  width: 24px;
  height: 24px;
}

.stripe-label-row .info-tooltip {
  right: 0;
  top: 28px;
  width: 240px;
}

.stripe-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stripe-actions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stripe-actions-card {
  margin-top: 18px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 20px;
  display: grid;
  gap: 16px;
  max-width: 960px;
}

.stripe-actions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stripe-actions-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.stripe-actions-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.stripe-actions-note {
  font-size: 12px;
  color: var(--color-muted);
}

.stripe-actions-list {
  display: grid;
  gap: 12px;
}

.stripe-actions-list.is-disabled {
  opacity: 0.6;
}

.stripe-actions-footer .button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.api-deploy-page {
  gap: 24px;
  display: grid;
  justify-items: center;
}

.api-deploy-shell {
  display: grid;
  gap: 18px;
  max-width: 960px;
  width: 100%;
}

.api-deploy-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 20px;
  display: grid;
  gap: 12px;
}

.api-deploy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.api-deploy-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.api-deploy-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-ink-soft);
}

.api-key-row input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
}

.api-key-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.api-key-row {
  display: block;
}

.api-key-input-wrap {
  position: relative;
}

.api-key-input-wrap input {
  padding-right: 120px;
}

.api-key-icon-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(4, 56, 115, 0.14);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
  cursor: pointer;
}

.api-key-icon-btn i {
  width: 16px;
  height: 16px;
}

.api-key-inline-copy {
  position: absolute;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(4, 56, 115, 0.14);
  background: #fff;
  color: var(--color-navy);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.api-generated-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.api-generated-row input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
}

.api-revoke-modal-card .modal-header {
  justify-content: center;
  text-align: center;
}

.modal-card.api-revoke-modal-card {
  width: fit-content;
  max-width: calc(100vw - 48px);
  justify-items: center;
  padding: 24px 28px;
}

.api-revoke-modal-card .team-actions {
  justify-content: center;
}

.api-deploy-instructions pre {
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.05);
  padding: 12px;
  overflow-x: auto;
}

.api-deploy-instructions code {
  font-family: "Consolas", "SFMono-Regular", "Menlo", monospace;
  font-size: 13px;
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
}

.stripe-divider {
  height: 1px;
  background: rgba(4, 56, 115, 0.12);
  margin: 4px 0 6px;
}

.stripe-action-otp {
  border: 1px solid rgba(16, 185, 129, 0.18);
  background: rgba(16, 185, 129, 0.08);
}

.stripe-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.03);
}

.stripe-action-item strong {
  display: block;
  font-size: 14px;
  color: #111827;
}

.stripe-action-item span {
  display: block;
  font-size: 12px;
  color: var(--color-ink-soft);
  margin-top: 4px;
}

.stripe-action-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stripe-action-tag {
  margin-top: 0;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  padding: 2px 8px;
  border-radius: 999px;
}

.stripe-action-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

@media (max-width: 960px) {
  .stripe-shell {
    grid-template-columns: 1fr;
  }
  .stripe-form-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.playground-page {
  padding: 0;
}

.web-embed-page {
  padding: 0;
}

.web-embed-shell {
  position: relative;
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 80px);
  min-height: calc(100vh - 80px);
  overflow: hidden;
}

.web-embed-menu {
  background: #fff;
  border-right: 1px solid rgba(4, 56, 115, 0.12);
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
}

.web-embed-menu h2 {
  margin: 0;
  font-size: 16px;
}

.web-embed-section {
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.web-embed-section h3 {
  margin: 0;
  font-size: 13px;
  color: #1f2937;
}

.web-embed-heading-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.web-embed-heading-logo img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.web-embed-label {
  font-size: 12px;
  color: var(--color-muted);
}

.web-embed-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #1f2937;
}

.web-embed-hint {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.web-embed-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.web-embed-color-row input[type="color"] {
  width: 44px;
  height: 34px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 8px;
  background: #fff;
  padding: 0;
}

.web-embed-color-row input[type="text"] {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.web-embed-text-input {
  width: 100%;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.web-embed-code {
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
  line-height: 1.5;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(15, 23, 42, 0.03);
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.web-embed-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.web-embed-page .button.is-copied {
  border-color: rgba(22, 163, 74, 0.35);
  color: #166534;
  background: rgba(22, 163, 74, 0.08);
  animation: webEmbedCopiedPulse 220ms ease;
}

.web-embed-page .button-copy-check {
  display: inline-block;
  font-weight: 700;
  transform-origin: center;
  animation: webEmbedCheckPop 220ms ease;
}

.web-embed-snippet-help {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.web-embed-snippet-help p {
  margin: 0;
  font-size: 12px;
  color: var(--color-muted);
}

.web-embed-snippet-help code {
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 11px;
}

.web-embed-help-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.web-embed-help-list li {
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.45;
  display: grid;
  gap: 2px;
}

.web-embed-help-list li strong {
  font-weight: 700;
}

.web-embed-help-list li span {
  color: var(--color-muted);
}

.web-embed-wordpress-help {
  font-size: 14px !important;
  line-height: 1.5;
}

.web-embed-wordpress-link {
  color: #3b6ea8;
  font-weight: 600;
  text-decoration: underline;
}

.web-embed-wordpress-link:hover {
  color: #325f93;
}

@keyframes webEmbedCopiedPulse {
  0% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes webEmbedCheckPop {
  0% {
    transform: scale(0.4) rotate(-14deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.web-embed-board {
  position: relative;
  min-height: 0;
  padding: 36px;
  background:
    radial-gradient(circle at top right, rgba(4, 56, 115, 0.18), transparent 55%),
    radial-gradient(circle at 30% 20%, rgba(11, 74, 166, 0.12), transparent 45%),
    radial-gradient(circle, rgba(4, 56, 115, 0.16) 1.2px, transparent 1.2px);
  background-size: 100% 100%, 100% 100%, 20px 20px;
  display: grid;
  place-items: center;
}

.web-embed-preview-frame {
  position: relative;
  width: min(410px, 100%);
  height: calc(100vh - 170px);
  min-height: 620px;
  max-height: 760px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(4, 56, 115, 0.16);
  box-shadow: var(--shadow-tight);
  background: #fff;
}

.web-embed-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.web-embed-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.web-embed-overlay-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(4, 56, 115, 0.14);
  box-shadow: var(--shadow-tight);
  padding: 18px;
  display: grid;
  gap: 10px;
  text-align: center;
  width: min(320px, 100%);
}

.web-embed-overlay-card h3 {
  margin: 0;
  font-size: 18px;
}

.web-embed-overlay-card p {
  margin: 0;
  color: var(--color-muted);
}

.chat-page-deploy-textarea {
  width: 100%;
  resize: vertical;
  min-height: 100px;
}

.chat-page-deploy-theme-group {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.chat-page-deploy-theme-group + .chat-page-deploy-theme-group {
  margin-top: 18px;
}

.chat-page-deploy-page .chat-page-deploy-section {
  border: 0;
  border-radius: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.12);
}

.web-embed-page .web-embed-deploy-section {
  border: 0;
  border-radius: 0;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.12);
}

.web-embed-deploy-section-bottom {
  margin-top: auto;
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.web-embed-deploy-danger {
  border-top: 1px solid rgba(4, 56, 115, 0.12);
  padding-top: 10px;
}

.web-embed-deploy-danger summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.web-embed-deploy-danger summary::-webkit-details-marker {
  display: none;
}

.web-embed-deploy-danger summary i {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

.web-embed-deploy-danger[open] summary i {
  transform: rotate(180deg);
}

.web-embed-deploy-danger-body {
  padding-top: 12px;
}

.chat-page-deploy-section-grouped {
  padding-bottom: 16px;
}

.chat-page-deploy-section-bottom {
  margin-top: auto;
  border-bottom: 0;
  padding-bottom: 0;
}

.chat-page-deploy-danger {
  border-top: 1px solid rgba(4, 56, 115, 0.12);
  padding-top: 10px;
}

.chat-page-deploy-danger summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-page-deploy-danger summary::-webkit-details-marker {
  display: none;
}

.chat-page-deploy-danger summary i {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

.chat-page-deploy-danger[open] summary i {
  transform: rotate(180deg);
}

.chat-page-deploy-danger-body {
  padding-top: 12px;
}

.chat-page-deploy-theme-head {
  display: grid;
  gap: 4px;
}

.chat-page-deploy-theme-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-ink);
}

.chat-page-deploy-theme-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-muted);
}

.chat-page-deploy-select {
  width: 100%;
}

.chat-page-custom-domain-panel {
  margin-top: 4px;
  display: grid;
  gap: 10px;
}

.chat-page-custom-domain-panel.is-locked .chat-page-custom-domain-body {
  opacity: 0.5;
  pointer-events: none;
}

.chat-page-custom-domain-required {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.chat-page-custom-domain-body {
  display: grid;
  gap: 10px;
}

.chat-page-custom-domain-dns {
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 10px;
  background: rgba(4, 56, 115, 0.03);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.chat-page-custom-domain-dns h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-ink);
}

.chat-page-custom-domain-empty {
  font-size: 12px;
  color: var(--color-muted);
}

.chat-page-custom-domain-dns-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--color-muted);
}

.chat-page-custom-domain-dns-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--color-ink);
}

.chat-page-deploy-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px dashed rgba(4, 56, 115, 0.18);
  border-radius: 12px;
  background: rgba(4, 56, 115, 0.02);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.chat-page-deploy-upload:hover,
.chat-page-deploy-upload:focus-visible,
.chat-page-deploy-upload.is-dragover {
  border-color: rgba(4, 56, 115, 0.34);
  background: rgba(4, 56, 115, 0.05);
}

.chat-page-deploy-upload.is-uploading {
  opacity: 0.72;
  pointer-events: none;
}

.chat-page-deploy-upload-preview {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.chat-page-deploy-upload-preview[hidden],
.chat-page-deploy-upload-placeholder[hidden] {
  display: none !important;
}

.chat-page-deploy-upload-delete[hidden] {
  display: none !important;
}

.chat-page-deploy-upload-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.04);
  color: rgba(4, 56, 115, 0.45);
  display: grid;
  place-items: center;
}

.chat-page-deploy-upload-placeholder i,
.chat-page-deploy-upload-placeholder svg {
  width: 18px;
  height: 18px;
}

.chat-page-deploy-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.chat-page-deploy-upload-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.chat-page-deploy-upload-copy strong {
  font-size: 13px;
  color: var(--color-ink);
}

.chat-page-deploy-upload-copy span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--color-muted);
}

.chat-page-deploy-upload-delete {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(180, 35, 24, 0.14);
  background: rgba(180, 35, 24, 0.04);
  color: #b42318;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.chat-page-deploy-upload-delete:hover {
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.22);
}

.chat-page-deploy-upload-delete i,
.chat-page-deploy-upload-delete svg {
  width: 15px;
  height: 15px;
}

.chat-page-password-fields.hidden {
  display: none !important;
}

.chat-page-deploy-switch {
  position: relative;
  width: 40px;
  height: 24px;
  display: inline-flex;
  flex: 0 0 auto;
}

.chat-page-deploy-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.chat-page-deploy-switch-slider {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.24);
  border: 1px solid rgba(100, 116, 139, 0.2);
  position: relative;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.chat-page-deploy-switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: transform 0.16s ease;
}

.chat-page-deploy-switch input:checked + .chat-page-deploy-switch-slider {
  background: #0f172a;
  border-color: #0f172a;
}

.chat-page-deploy-switch input:checked + .chat-page-deploy-switch-slider::after {
  transform: translateX(16px);
}

.chat-page-password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.chat-page-password-input-shell {
  position: relative;
}

.chat-page-password-input-shell .chat-page-deploy-text-input {
  padding-right: 44px;
}

.chat-page-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.chat-page-password-toggle i,
.chat-page-password-toggle svg {
  width: 16px;
  height: 16px;
}

.chat-page-password-save-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(4, 56, 115, 0.14);
  background: rgba(4, 56, 115, 0.05);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.chat-page-password-save-icon:hover {
  background: rgba(4, 56, 115, 0.09);
  border-color: rgba(4, 56, 115, 0.22);
}

.chat-page-password-save-icon i,
.chat-page-password-save-icon svg {
  width: 15px;
  height: 15px;
}

.chat-page-password-save-icon.is-loading {
  cursor: wait;
  opacity: 0.82;
}

.chat-page-password-save-icon.is-loading i,
.chat-page-password-save-icon.is-loading svg {
  animation: chatPagePasswordSpin 0.8s linear infinite;
}

@keyframes chatPagePasswordSpin {
  to {
    transform: rotate(360deg);
  }
}

.chat-page-deploy-board {
  padding: 0;
  background: transparent;
  display: block;
  min-height: 0;
  height: 100%;
}

.chat-page-deploy-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.chat-page-deploy-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  display: block;
}

.chat-page-deploy-link-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.web-embed-link-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-page-deploy-link-actions .button {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  gap: 8px;
  line-height: 1;
  box-shadow: none;
}

.web-embed-link-actions .button {
  flex: 0 0 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  gap: 8px;
  line-height: 1;
  box-shadow: none;
}

.chat-page-deploy-link-actions .button.button-ghost {
  border-color: rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.04);
  color: #0f172a;
}

.web-embed-link-actions .button.button-ghost {
  border-color: rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.04);
  color: #0f172a;
}

.chat-page-deploy-link-actions .button.button-ghost:hover {
  border-color: rgba(4, 56, 115, 0.18);
  background: rgba(4, 56, 115, 0.08);
}

.web-embed-link-actions .button.button-ghost:hover {
  border-color: rgba(4, 56, 115, 0.18);
  background: rgba(4, 56, 115, 0.08);
}

.chat-page-deploy-link-actions .button i,
.chat-page-deploy-link-actions .button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.web-embed-link-actions .button i,
.web-embed-link-actions .button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.chat-page-deploy-link-actions .button span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.web-embed-link-actions .button span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.chat-page-deploy-page .button.is-copied {
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.08);
  color: #0f766e;
}

.chat-page-deploy-page .button-copy-check {
  font-size: 12px;
  font-weight: 700;
}

.chat-page-deploy-overlay-card h3,
.chat-page-deploy-overlay-card p {
  margin: 0;
}

.chat-page-deploy-overlay-card p {
  color: var(--color-muted);
}

.chat-page-deploy-overlay {
  border-radius: 0;
}

.playground-shell {
  display: grid;
  grid-template-columns: minmax(380px, 440px) 1fr;
  min-height: calc(100vh - 80px);
  border-radius: 0;
  overflow: visible;
}

.playground-menu {
  background: #fff;
  border-right: 1px solid rgba(4, 56, 115, 0.12);
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
}

.playground-menu h2 {
  margin: 0;
  font-size: 20px;
}

.playground-menu > p {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
}

.playground-identity-form {
  gap: 10px;
}

.playground-identity-form .role-field textarea {
  min-height: 220px;
}

.identity-form .role-field textarea {
  min-height: 220px;
}

[data-playground-setup-overlay] {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 36px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
}

[data-playground-setup-overlay][hidden] {
  display: none !important;
}

.playground-setup-modal {
  width: 100%;
  display: flex;
  justify-content: center;
}

.playground-setup-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.14);
  border-radius: 16px;
  box-shadow: var(--shadow-tight);
  padding: 24px;
  display: grid;
  gap: 12px;
}

.playground-setup-card h3,
.playground-setup-card p {
  margin: 0;
}

.playground-setup-card p {
  color: var(--color-muted);
}

.playground-setup-form .identity-actions {
  justify-content: flex-end;
}

.playground-board {
  position: relative;
  padding: 40px;
  background:
    radial-gradient(circle at top right, rgba(4, 56, 115, 0.18), transparent 55%),
    radial-gradient(circle at 30% 20%, rgba(11, 74, 166, 0.12), transparent 45%),
    radial-gradient(circle, rgba(4, 56, 115, 0.16) 1.2px, transparent 1.2px);
  background-size: 100% 100%, 100% 100%, 20px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
}

.chat-widget {
  position: relative;
  width: min(400px, 100%);
  height: calc(100% - 80px);
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  box-shadow: var(--shadow-tight);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #111827;
  color: #fff;
  min-height: 56px;
}

.chat-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chat-title img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.chat-header h3 {
  margin: 0;
  font-size: 14px;
}

.chat-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
  overflow-y: auto;
}

.chat-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 70%;
  width: fit-content;
}

.chat-bubble.bot {
  background: rgba(4, 56, 115, 0.08);
  color: #111827;
  align-self: flex-start;
}

.chat-bubble-action {
  display: grid;
  gap: 10px;
  max-width: 75%;
}

.chat-bubble-action .chat-action-button {
  align-self: flex-start;
}

.chat-bubble.user {
  background: #111827;
  color: #fff;
  align-self: flex-end;
}

.chat-footer {
  padding: 12px 14px 14px;
  display: grid;
  gap: 8px;
}

.chat-powered {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(31, 41, 55, 0.3);
  justify-self: center;
}

.chat-powered img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  opacity: 0.3;
}

.chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 14px;
  padding: 6px 8px 6px 14px;
}

.chat-input input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 12px;
  outline: none;
}

.chat-mic,
.chat-send {
  border: none;
  background: transparent;
  color: rgba(17, 24, 39, 0.35);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.chat-mic svg,
.chat-send svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.chat-mic:enabled,
.chat-send:enabled {
  color: #111827;
}

.chat-mic:disabled,
.chat-send:disabled {
  color: rgba(17, 24, 39, 0.35);
  cursor: not-allowed;
}

.chat-bubble {
  white-space: pre-wrap;
}

.chat-bubble-enter {
  opacity: 0;
  transform: translateY(-6px);
  animation: chatBubbleEnter 220ms ease forwards;
}

@keyframes chatBubbleEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble.bot.is-pending {
  opacity: 0.7;
  white-space: normal;
  padding-top: 9px;
  padding-bottom: 9px;
}

.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 14px;
}

.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.45;
  animation: chatTypingBounce 1s infinite ease-in-out;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.12s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes chatTypingBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-4px);
    opacity: 0.9;
  }
}

.chat-word {
  opacity: 0;
  filter: blur(2px);
  transform: translateY(2px);
  transition: opacity 220ms ease, filter 220ms ease, transform 220ms ease;
}

.chat-word.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.chat-menu-button {
  border: none;
  background: transparent;
  color: #fff;
  padding: 4px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
}

.chat-menu-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 960px) {
  .web-embed-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .chat-page-deploy-preview-frame,
  .chat-page-deploy-preview-frame iframe {
    min-height: 640px;
    height: 640px;
  }

  .web-embed-preview-frame {
    width: 100%;
    max-height: 720px;
    min-height: 560px;
  }

  .playground-shell {
    grid-template-columns: 1fr;
  }

  .chat-widget {
    position: static;
    width: 100%;
  }
}

.dynamic-sources-page {
  gap: 0;
  min-height: calc(100vh - 80px);
}

.dynamic-sources-shell {
  padding: 0;
  max-width: none;
  margin: 0;
  display: grid;
  gap: 0;
  min-height: calc(100vh - 80px);
  grid-template-rows: auto 1fr;
}

.dynamic-sources-topbar {
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(11, 74, 166, 0.09), rgba(247, 249, 252, 0) 42%),
    linear-gradient(180deg, #f8fbff, #f2f6fc);
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 0;
  box-shadow: none;
  padding: 14px 0 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: stretch;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 6;
}


.dynamic-topbar-middle {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid rgba(4, 56, 115, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  margin-left: 0;
  flex: 0 0 auto;
}

.dynamic-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dynamic-topbar-controls {
  display: inline-flex;
  align-items: stretch;
  align-self: auto;
  min-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  gap: 0;
  border: 1px solid rgba(4, 56, 115, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
  overflow: hidden;
}

.dynamic-control-tile {
  min-height: 100%;
  padding: 0 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: transparent;
  border-radius: 0;
}

.dynamic-control-label {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.dynamic-control-value {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.dynamic-name-tile {
  min-width: 260px;
  cursor: text;
}

.dynamic-name-tile:hover {
  background: rgba(11, 74, 166, 0.05);
}

.dynamic-name-inline-input {
  width: 100%;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  font-family: var(--font-body);
}

.dynamic-name-inline-input.hidden {
  display: none;
}

.dynamic-enabled-tile {
  min-width: 170px;
}

.dynamic-control-divider {
  width: 1px;
  background: rgba(4, 56, 115, 0.14);
}

.dynamic-enabled-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 22px;
}

.dynamic-topbar-main {
  display: grid;
  gap: 10px;
}

.dynamic-topbar-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #274472;
  font-weight: 700;
}

.dynamic-topbar-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dynamic-stat-chip {
  border: 1px solid rgba(4, 56, 115, 0.16);
  background: rgba(255, 255, 255, 0.74);
  border-radius: 6px;
  min-height: 30px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1f2937;
}

.dynamic-stat-chip svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.1;
  color: #4b6282;
}

.dynamic-stat-chip strong {
  font-size: 13px;
  font-weight: 800;
  color: #0b4aa6;
}

.dynamic-stat-chip em {
  font-style: normal;
  font-size: 12px;
  color: #475569;
}

.dynamic-settings {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dynamic-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #111827;
}

.dynamic-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dynamic-switch-slider {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #c7d1e0;
  position: relative;
  transition: background 0.2s ease;
}

.dynamic-switch-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.dynamic-switch-input:checked + .dynamic-switch-slider {
  background: #0b4aa6;
}

.dynamic-switch-input:checked + .dynamic-switch-slider::after {
  transform: translateX(18px);
}

.dynamic-switch-input:focus-visible + .dynamic-switch-slider {
  outline: 2px solid rgba(11, 74, 166, 0.35);
  outline-offset: 2px;
}

.dynamic-topbar-controls {
  display: inline-flex;
  align-items: stretch;
  align-self: auto;
  min-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  gap: 0;
  border: 1px solid rgba(4, 56, 115, 0.14);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
  overflow: hidden;
}

.dynamic-topbar-middle {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid rgba(4, 56, 115, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  margin-left: 0;
  flex: 0 0 auto;
}

.dynamic-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dynamic-csv-button {
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  white-space: nowrap;
}

.dynamic-csv-button svg {
  width: 14px;
  height: 14px;
}

.dynamic-csv-button span {
  display: none;
}

@media (min-width: 1280px) {
  .dynamic-csv-button span {
    display: inline;
  }
}

.dynamic-search-field,
.dynamic-filter-field {
  display: grid;
  gap: 4px;
}

.dynamic-search-field > i {
  display: none;
}

.dynamic-search-field > span,
.dynamic-filter-field > span {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.dynamic-search-field input,
.dynamic-filter-field input,
.dynamic-filter-field select {
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(4, 56, 115, 0.16);
  background: #fff;
  font-size: 13px;
  color: #111827;
  padding: 0 10px;
  font-family: var(--font-body);
}

.dynamic-search-field input {
  min-width: 200px;
}

.dynamic-filter-field select,
.dynamic-filter-field input {
  min-width: 130px;
}

.dynamic-menu-select {
  position: relative;
  min-width: 130px;
}

[data-ds-filter-column-select] {
  min-width: 170px;
}

[data-ds-filter-operator-select] {
  min-width: 190px;
}

.dynamic-menu-trigger {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(4, 56, 115, 0.2);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  cursor: pointer;
}

.dynamic-menu-trigger:hover {
  border-color: rgba(4, 56, 115, 0.36);
}

.dynamic-menu-trigger:focus-visible {
  outline: none;
  border-color: #0b4aa6;
  box-shadow: 0 0 0 3px rgba(11, 74, 166, 0.12);
}

.dynamic-menu-trigger svg {
  width: 14px;
  height: 14px;
  color: #516379;
}

.dynamic-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 230px;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.22);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  padding: 6px;
  display: none;
  z-index: 30;
}

.dynamic-menu-select.is-open .dynamic-menu-list {
  display: grid;
  gap: 4px;
}

[data-ds-filter-column-select] .dynamic-menu-list {
  min-width: 200px;
}

[data-ds-filter-operator-select] .dynamic-menu-list {
  min-width: 250px;
}

[data-ds-column-type-select] {
  width: 100%;
  min-width: 0;
}

[data-ds-column-type-select] .dynamic-menu-trigger {
  height: 40px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}

[data-ds-column-type-select] .dynamic-menu-list {
  min-width: 100%;
}

.dynamic-menu-item {
  border: none;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.dynamic-menu-item:hover {
  background: rgba(11, 74, 166, 0.08);
}

.dynamic-menu-item.is-selected {
  background: rgba(11, 74, 166, 0.14);
  color: #0b4aa6;
}

.dynamic-filter-field select,
.dynamic-form-field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid rgba(4, 56, 115, 0.2);
  padding-right: 34px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23516379' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-position: right 10px center;
  background-size: 14px 14px;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.dynamic-filter-field select:hover,
.dynamic-form-field select:hover {
  border-color: rgba(4, 56, 115, 0.36);
}

.dynamic-filter-field select:focus,
.dynamic-form-field select:focus {
  outline: none;
  border-color: #0b4aa6;
  box-shadow: 0 0 0 3px rgba(11, 74, 166, 0.12);
}

.dynamic-filter-field select option,
.dynamic-form-field select option {
  color: #0f172a;
  background: #fff;
}

.dynamic-filter-add,
.dynamic-filter-clear {
  height: 34px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dynamic-filter-add-icon {
  width: 34px;
  min-width: 34px;
  padding: 0;
  justify-content: center;
}

.dynamic-filter-add-icon svg {
  width: 16px;
  height: 16px;
}

.dynamic-filters-dropdown {
  position: relative;
}

.dynamic-filters-toggle {
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.dynamic-filters-dropdown.is-open .dynamic-filters-toggle {
  border-color: rgba(11, 74, 166, 0.35);
  background: rgba(11, 74, 166, 0.08);
}

.dynamic-filters-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: min(92vw, 320px);
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.2);
  border-radius: 10px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
  padding: 10px;
  display: none;
  z-index: 32;
}

.dynamic-filters-dropdown.is-open .dynamic-filters-menu {
  display: block;
}

.dynamic-active-filters {
  width: 100%;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
}

.dynamic-active-filter-chip {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 28px;
  border: 1px solid rgba(4, 56, 115, 0.18);
  border-radius: 999px;
  background: rgba(11, 74, 166, 0.07);
  color: #1f2937;
  padding: 4px 9px;
  font-size: 13px;
  line-height: 1.25;
}

.dynamic-active-filter-chip span,
.dynamic-active-filter-chip strong,
.dynamic-active-filter-chip em {
  font-size: 13px;
  line-height: 1.25;
}

.dynamic-active-filter-chip strong {
  color: #1e3a66;
  font-weight: 700;
}

.dynamic-active-filter-chip em {
  font-style: normal;
  color: #1f2937;
  font-weight: 600;
}

.dynamic-active-filter-chip button {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.dynamic-active-filter-empty {
  font-size: 12px;
  color: #64748b;
  padding: 4px 2px;
}

.dynamic-filters-menu-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(4, 56, 115, 0.12);
  display: flex;
  justify-content: flex-end;
}

.dynamic-filters-menu-actions .dynamic-filter-clear {
  height: 30px;
  font-size: 12px;
}

.dynamic-import-error-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 40px));
  background: #fff;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
  z-index: 210;
  padding: 16px;
}

.dynamic-import-error-modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #991b1b;
}

.dynamic-import-error-modal p {
  margin: 0;
  color: #1f2937;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 280px;
  overflow: auto;
}

.dynamic-import-error-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}


.dynamic-table-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: visible;
}

.dynamic-table-scroll {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  border-top: none;
}

.dynamic-table {
  width: max-content;
  min-width: 0;
  border-collapse: collapse;
}

.dynamic-table th,
.dynamic-table td {
  border: 1px solid rgba(4, 56, 115, 0.14);
  padding: 0;
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
  color: #1f2937;
  background: #ffffff;
  height: 46px;
  min-height: 46px;
  white-space: nowrap;
}

.dynamic-table th:not(.dynamic-select-header-cell):not(.dynamic-add-header-cell),
.dynamic-table td:not(.dynamic-row-index-cell):not(.dynamic-first-cell) {
  min-width: 170px;
}

.dynamic-table thead th {
  background: #f3f6fb;
  color: #111827;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 4;
}

.dynamic-column-header-cell {
  cursor: grab;
  user-select: none;
  position: relative;
}

.dynamic-column-header-cell:hover {
  background: #eaf2ff;
}

.dynamic-column-header-cell.is-dragging {
  opacity: 0.55;
}

.dynamic-column-header-cell.is-drop-target {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px rgba(11, 74, 166, 0.28);
}

.dynamic-col-head {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 8px;
}

.dynamic-col-name {
  font-size: 14px;
  font-weight: 600;
}

.dynamic-col-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dynamic-col-type-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.dynamic-col-type-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2px;
}

.dynamic-col-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dynamic-col-filter-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  color: #64748b;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dynamic-col-filter-icon svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.7;
}

.dynamic-col-actions .icon-button,
.dynamic-row-index-cell .icon-button {
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  background: transparent;
  color: #6b7280;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dynamic-col-actions .icon-button:hover,
.dynamic-row-index-cell .icon-button:hover {
  color: #111827;
  border-color: rgba(4, 56, 115, 0.2);
  background: rgba(4, 56, 115, 0.06);
}

.dynamic-select-header-cell {
  width: 42px;
  min-width: 42px;
  background: #eef3fb;
}

.dynamic-add-header-cell,
.dynamic-row-index-cell {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.dynamic-trailing-cell {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  background: #ffffff;
}

.dynamic-add-header-cell,
.dynamic-first-cell,
.dynamic-row-insert-cell {
  cursor: pointer;
}

.dynamic-add-header-cell:focus-visible,
.dynamic-first-cell:focus-visible,
.dynamic-row-insert-cell:focus-visible {
  outline: 2px solid rgba(11, 74, 166, 0.35);
  outline-offset: -2px;
}

.dynamic-add-header-cell:hover,
.dynamic-first-cell:hover,
.dynamic-row-insert-cell:hover {
  background: #eef5ff;
}

.dynamic-row-index-cell[data-ds-edit-row] {
  cursor: pointer;
}

.dynamic-row-index-cell[data-ds-edit-row]:hover {
  background: #eef5ff;
}

.dynamic-trailing-cell[data-ds-edit-row] {
  cursor: pointer;
}

.dynamic-trailing-cell[data-ds-edit-row]:hover {
  background: #eef5ff;
}

.dynamic-row-index-cell {
  padding: 0;
  color: #64748b;
  background: #f7f9fc;
}

.dynamic-row-index {
  font-size: 14px;
  display: inline-block;
  min-width: 16px;
}

.dynamic-table tbody tr:hover td {
  background: #f8fbff;
}

.dynamic-empty-cell {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  padding: 0;
  height: 46px;
  background: #ffffff;
}

.dynamic-first-cell {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  height: 46px;
  text-align: center;
  padding: 0;
  background: #ffffff;
}

.dynamic-insert-row td {
  background: #fbfdff;
  height: 40px;
  min-height: 40px;
}

.dynamic-insert-row {
  cursor: pointer;
}

.dynamic-insert-row-label {
  color: #6b7280;
  font-size: 14px;
  padding: 0 8px;
  text-align: center;
}

.dynamic-cell-input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: #eef5ff;
  text-align: center;
  font-size: 14px;
  color: #111827;
  font-family: var(--font-body);
  border-radius: 0;
}

td.is-editing {
  padding: 0;
}

.dynamic-cell-bool-editor {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef5ff;
}

.dynamic-cell-bool-editor .dynamic-switch-slider {
  transform: scale(0.92);
}

.dynamic-row-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
  border-top: 1px solid rgba(4, 56, 115, 0.14);
  background: #ffffff;
}

.dynamic-empty-state {
  border: 1px dashed rgba(4, 56, 115, 0.28);
  border-radius: 8px;
  padding: 20px;
  display: grid;
  gap: 12px;
  justify-items: center;
  margin: 12px;
  background: #ffffff;
}

.dynamic-empty-state p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

.dynamic-inline-form {
  border-bottom: 1px solid rgba(4, 56, 115, 0.14);
  background: #f9fbff;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.dynamic-modal-form {
  display: grid;
  gap: 12px;
}

.dynamic-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(540px, 94vw);
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid rgba(4, 56, 115, 0.16);
  box-shadow: -18px 0 36px rgba(15, 23, 42, 0.16);
  z-index: 120;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  pointer-events: none;
}

.dynamic-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.dynamic-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.12);
}

.dynamic-drawer-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.dynamic-drawer-header p {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
}

.dynamic-drawer .dynamic-modal-form {
  align-content: start;
  padding: 16px 18px 20px;
  overflow-y: auto;
}

.dynamic-drawer .dynamic-form-grid {
  grid-template-columns: 1fr;
}

.dynamic-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dynamic-row-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dynamic-form-field {
  display: grid;
  gap: 6px;
}

.dynamic-form-field label {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.dynamic-form-field input,
.dynamic-form-field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  font-family: var(--font-body);
}

.dynamic-checkbox {
  align-self: end;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1f2937;
}

.dynamic-filter-switch {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

.dynamic-filter-switch-control {
  display: inline-flex;
  align-items: center;
}

.dynamic-inline-help {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(4, 56, 115, 0.25);
  background: rgba(4, 56, 115, 0.06);
  color: var(--color-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.dynamic-inline-tooltip {
  position: absolute;
  right: 0;
  left: auto;
  top: 24px;
  width: 280px;
  max-width: min(280px, calc(100vw - 48px));
  border: 1px solid rgba(4, 56, 115, 0.18);
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 9;
}

.dynamic-inline-help:hover .dynamic-inline-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.dynamic-bool-switch {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: #1f2937;
}

.dynamic-bool-field-row {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.dynamic-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dynamic-table-card .status-text {
  padding: 8px 0 0;
  color: #6b7280;
}

.dynamic-plus-glyph {
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  color: #0b4aa6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

@media (max-width: 980px) {
  .dynamic-sources-topbar {
    align-items: flex-start;
  }

  .dynamic-topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dynamic-topbar-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 0;
    margin-bottom: 0;
  }

  .dynamic-topbar-middle {
    width: 100%;
    min-width: 0;
  }

  .dynamic-control-divider {
    width: 100%;
    height: 1px;
  }

  .dynamic-name-tile,
  .dynamic-enabled-tile {
    min-width: 0;
  }
}

@media (max-width: 860px) {
  .dynamic-form-grid,
  .dynamic-row-grid {
    grid-template-columns: 1fr;
  }
}

.notion-page {
  gap: 24px;
}

.notion-shell {
  padding: 0 8px;
  max-width: 1200px;
  margin: 0;
}

.notion-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.notion-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.notion-title {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: center;
}

.notion-title img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.notion-title h2 {
  margin: 0;
  font-size: 18px;
}

.notion-title p {
  grid-column: 1 / -1;
}

.tag-success {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.3);
}

.button-danger {
  background: #b42318;
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.button-danger:hover {
  background: #922018;
}

.button-outline-danger {
  background: transparent;
  color: #b42318;
  border-radius: 999px;
  padding: 8px 16px;
  border: 1px solid rgba(180, 35, 24, 0.4);
  font-weight: 600;
  cursor: pointer;
}

.button-outline-danger:hover {
  background: rgba(180, 35, 24, 0.08);
}

.notion-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.notion-header p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.notion-connect {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 24px;
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.notion-connect h3 {
  margin: 0;
  font-size: 16px;
}

.notion-connect p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.notion-list {
  display: grid;
  gap: 12px;
}

.notion-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.notion-item {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 16px;
  box-shadow: var(--shadow-tight);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notion-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.notion-item-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  min-height: 16px;
}

.notion-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.notion-item p {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
}

.docs-page {
  gap: 24px;
}

.docs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.docs-card {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  box-shadow: var(--shadow-tight);
  padding: 20px;
  display: grid;
  gap: 16px;
}

.docs-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.docs-card-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.docs-card-header p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.dropzone {
  border: 1px dashed rgba(4, 56, 115, 0.35);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(4, 56, 115, 0.08), rgba(255, 255, 255, 0.8));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.dropzone.is-dragging {
  border-color: rgba(4, 56, 115, 0.6);
  box-shadow: 0 10px 24px rgba(4, 56, 115, 0.12);
}

.dropzone-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(4, 56, 115, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
}

.dropzone-title {
  font-weight: 600;
  color: #111827;
}

.dropzone-meta {
  font-size: 12px;
  color: var(--color-muted);
}

.docs-uploads {
  display: grid;
  gap: 12px;
}

.docs-uploads-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.docs-uploads-header h3 {
  margin: 0;
  font-size: 14px;
}

.docs-uploads-list {
  display: grid;
  gap: 10px;
}

.upload-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.upload-name {
  font-weight: 600;
  font-size: 13px;
}

.upload-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 4px;
}

.upload-status.is-failed {
  color: #b42318;
}

.upload-meta {
  font-size: 12px;
  color: var(--color-muted);
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(4, 56, 115, 0.2);
  border-top-color: var(--color-navy);
  animation: spin 0.8s linear infinite;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.status-dot.is-ready {
  background: #16a34a;
}

.status-dot.is-error {
  background: #b42318;
}

.docs-list {
  display: grid;
  gap: 12px;
}

.doc-row {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.doc-name {
  font-weight: 600;
  font-size: 13px;
}

.doc-meta {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 4px;
}

.doc-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid transparent;
}

.status-badge.is-ready {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.2);
}

.status-badge.is-processing {
  background: rgba(4, 56, 115, 0.08);
  color: var(--color-navy);
  border-color: rgba(4, 56, 115, 0.2);
}

.docs-list-card .button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  z-index: 60;
}

.toast {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.18);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: #111827;
  box-shadow: var(--shadow-tight);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-success {
  border-color: rgba(22, 163, 74, 0.3);
}

.toast.toast-error {
  border-color: rgba(180, 35, 24, 0.4);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Live Channels page ───────────────────────────────────────── */

.live-channels-page {
  padding: 0 !important;
  max-width: none !important;
}

/* Two-column layout */
.lc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 80px);
  height: calc(100vh - 80px);
}

/* Left sidebar */
.lc-sidebar {
  border-right: 1px solid rgba(4, 56, 115, 0.1);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.lc-sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.08);
}

.lc-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.lc-nav {
  display: flex;
  flex-direction: column;
  padding: 10px 10px;
  gap: 2px;
}

.lc-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}

.lc-nav-item:hover {
  background: rgba(4, 56, 115, 0.05);
}

.lc-nav-item.is-active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(4, 56, 115, 0.08);
}

.lc-nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lc-nav-logo img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.lc-nav-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.lc-nav-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.lc-nav-hint {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lc-nav-status {
  flex-shrink: 0;
}

.lc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: #9ca3af;
  white-space: nowrap;
}

.lc-status-pill.is-connected {
  background: #dcfce7;
  color: #166534;
}

.lc-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Right detail panel */
.lc-main {
  background: #fff;
  overflow-y: auto;
  display: grid;
  align-content: start;
}

.lc-detail-panel {
  display: none;
  flex-direction: column;
}

.lc-detail-panel.is-active {
  display: flex;
}

/* Detail header */
.lc-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.08);
  background: #fafbfc;
}

.lc-detail-header-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid rgba(4, 56, 115, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lc-detail-header-logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.lc-detail-header h2 {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.lc-detail-header p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

/* Detail body */
.lc-detail-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Disconnected (empty) state */
.lc-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  gap: 12px;
  flex: 1;
}

.lc-detail-empty-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #f1f5f9;
  border: 1px solid rgba(4, 56, 115, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.lc-detail-empty-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.lc-detail-empty h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.lc-detail-empty p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  max-width: 300px;
  line-height: 1.5;
}

.lc-detail-connect-btn {
  margin-top: 8px;
  min-width: 180px;
  justify-content: center;
}

.lc-detail-connect-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
  max-width: 340px;
}

.lc-detail-connect-form .auth-field {
  width: 100%;
}

/* Detail sections */
.lc-detail-section {
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.07);
}

.lc-detail-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
}

.lc-label-icon {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

/* Connected info */
.lc-connected-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #166534;
}

.lc-connected-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #16a34a;
}

/* Account rows */
.lc-account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lc-account-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid rgba(4, 56, 115, 0.09);
  border-radius: 10px;
}

.lc-account-avatar-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.1);
  flex-shrink: 0;
}

.lc-account-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

.lc-phone-icon i,
.lc-user-icon i {
  width: 15px;
  height: 15px;
  color: #9ca3af;
}

.lc-account-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lc-account-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.lc-account-actions .button {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.lc-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
}

.lc-status-dot.is-connected {
  background: #16a34a;
}

.lc-empty-row {
  padding: 12px 14px;
  font-size: 12.5px;
  color: #9ca3af;
  background: #f8fafc;
  border: 1px dashed rgba(4, 56, 115, 0.12);
  border-radius: 10px;
}

/* Badges */
.lc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
}

.lc-badge-green {
  background: #dcfce7;
  color: #166534;
}

/* Info note */
.lc-info-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid rgba(4, 56, 115, 0.08);
  border-radius: 10px;
  font-size: 12.5px;
  color: #6b7280;
}

.lc-info-note i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #9ca3af;
}

/* Toggle switch */
.lc-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.lc-toggle-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.lc-toggle-hint {
  display: block;
  font-size: 12px;
  color: #9ca3af;
}

.lc-switch {
  position: relative;
  flex-shrink: 0;
}

.lc-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.lc-switch-track {
  display: block;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.2s;
  position: relative;
  cursor: pointer;
}

.lc-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.lc-switch input:checked + .lc-switch-track {
  background: var(--color-navy);
}

.lc-switch input:checked + .lc-switch-track::after {
  transform: translateX(16px);
}

/* Footer (disconnect) */
.lc-detail-footer {
  padding: 16px 28px;
  margin-top: auto;
  border-top: 1px solid rgba(4, 56, 115, 0.07);
  background: #fafafa;
}

.lc-detail-footer .button {
  font-size: 13px;
  min-height: 34px;
  padding: 6px 14px;
}

/* Loading spinner compat */
.live-channel-actions .button.is-loading {
  position: relative;
  pointer-events: none;
}

.live-channel-actions .button.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.live-channel-oauth-note {
  border: 1px dashed rgba(4, 56, 115, 0.22);
  background: rgba(4, 56, 115, 0.04);
  color: #0f172a;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Hidden legacy panel wrappers */
.live-channel-panel,
.live-channel-panel-body {
  display: none;
}

@media (max-width: 700px) {
  .lc-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }
  .lc-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(4, 56, 115, 0.1);
  }
}

/* ── CRM page ───────────────────────────────────────────────────── */

body.crm-full .content {
  padding: 0;
}

.crm-page {
  padding: 0 !important;
  max-width: none !important;
}

.crm-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 80px);
  height: calc(100vh - 80px);
}

/* Sidebar */
.crm-sidebar {
  border-right: 1px solid rgba(4, 56, 115, 0.1);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.crm-sidebar-header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.08);
}

.crm-sidebar-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 4px;
}

.crm-sidebar-note {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}

.crm-nav {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 3px;
}

.crm-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s;
}

.crm-nav-item:hover {
  background: rgba(4, 56, 115, 0.05);
}

.crm-nav-item.is-active {
  background: #fff;
  box-shadow: 0 1px 4px rgba(4, 56, 115, 0.08);
}

.crm-nav-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px;
}

.crm-nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.crm-nav-logo i {
  width: 18px;
  height: 18px;
  color: #64748b;
}

.crm-nav-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.crm-nav-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.crm-nav-hint {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.crm-nav-status {
  flex-shrink: 0;
  padding-top: 1px;
}

.crm-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: #9ca3af;
  white-space: nowrap;
}

.crm-status-pill.is-connected {
  background: #dcfce7;
  color: #166534;
}

.crm-status-pill.is-locked {
  background: #fef3c7;
  color: #92400e;
  gap: 4px;
}

.crm-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Main detail area */
.crm-main {
  background: #fff;
  overflow-y: auto;
}

.crm-detail-panel {
  display: none;
  flex-direction: column;
  min-height: 100%;
}

.crm-detail-panel.is-active {
  display: flex;
}

.crm-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.08);
  background: #fafbfc;
}

.crm-detail-header-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(4, 56, 115, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px;
}

.crm-detail-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.crm-detail-header-logo i {
  width: 24px;
  height: 24px;
  color: #64748b;
}

.crm-detail-header h2 {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.crm-detail-header p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  max-width: 480px;
}

.crm-detail-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Disconnected empty state */
.crm-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  gap: 10px;
  flex: 1;
}

.crm-detail-empty-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(4, 56, 115, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  padding: 14px;
}

.crm-detail-empty-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.crm-detail-empty h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.crm-detail-empty p {
  margin: 0;
  font-size: 13.5px;
  color: #6b7280;
  max-width: 340px;
  line-height: 1.55;
}

.crm-connect-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
  max-width: 360px;
}

.crm-connect-btn {
  width: 100%;
  justify-content: center;
}

.crm-blocked-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fef9ee;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #92400e;
  max-width: 380px;
  text-align: left;
  line-height: 1.5;
  margin-top: 6px;
}

.crm-blocked-note i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #d97706;
}

/* Detail sections */
.crm-detail-section {
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.07);
}

.crm-detail-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
}

.crm-connected-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #166534;
}

.crm-connected-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #16a34a;
}

/* How it works steps */
.crm-how-it-works {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid rgba(4, 56, 115, 0.08);
  border-radius: 10px;
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
}

.crm-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Footer */
.crm-detail-footer {
  padding: 16px 28px;
  margin-top: auto;
  border-top: 1px solid rgba(4, 56, 115, 0.07);
  background: #fafafa;
}

.crm-detail-footer .button {
  font-size: 13px;
  min-height: 34px;
  padding: 6px 14px;
}

.crm-settings-form,
.crm-settings-grid {
  display: grid;
  gap: 10px;
}

.crm-settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: #334155;
}

.crm-settings-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-navy);
}

.crm-loading-state {
  display: grid;
  gap: 10px;
  place-items: center;
  text-align: center;
  padding: 80px 24px;
  color: #6b7280;
  flex: 1;
}

.crm-loading-state h3 {
  margin: 0;
  font-size: 16px;
  color: #111827;
}

.crm-loading-state p {
  margin: 0;
  font-size: 13px;
}

.crm-loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(4, 56, 115, 0.18);
  border-top-color: var(--color-navy);
  animation: crm-spin 0.8s linear infinite;
}

.crm-disconnect-modal-card {
  width: min(520px, 100%);
}

.crm-disconnect-modal-error {
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.45;
}

.crm-plan-lock {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 24px;
  border: 1px solid #d9e1ec;
  border-radius: 20px;
  background: #ffffff;
}

.crm-plan-lock-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8e7e7;
  color: #9a1c1c;
  margin-bottom: 14px;
}

.crm-plan-lock h2 {
  margin: 0 0 10px;
}

.crm-plan-lock p {
  margin: 0 0 20px;
  max-width: 620px;
  color: #526071;
}

.crm-logs-toolbar {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(2, minmax(220px, 280px));
  justify-content: start;
}

.crm-logs-filters-section {
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 8px;
}

.crm-logs-filters-section .auth-field > span {
  font-size: 12px;
}

.crm-detail-panel[data-crm-detail="lead-logs"] .crm-detail-section {
  max-width: 1100px;
  width: 100%;
  margin-inline: auto;
}

.crm-detail-panel[data-crm-detail="lead-logs"] .crm-detail-body {
  min-height: 0;
}

.crm-detail-panel[data-crm-detail="lead-logs"] .crm-detail-section:last-of-type {
  flex: 1;
  min-height: 0;
}

.crm-logs-toolbar .auth-field {
  max-width: 280px;
}

.crm-select {
  position: relative;
  width: 100%;
}

.crm-select-trigger {
  width: 100%;
  height: 40px;
  border: 1px solid #ccd6e4;
  border-radius: 10px;
  padding: 0 38px 0 12px;
  background-color: #ffffff;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23526071' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  text-align: left;
  font-family: inherit;
}

.crm-select-trigger:focus {
  outline: none;
  border-color: #0b3f86;
  box-shadow: 0 0 0 3px rgba(11, 63, 134, 0.14);
}

.crm-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 35;
  border: 1px solid #ccd6e4;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.crm-select-option {
  width: 100%;
  border: none;
  background: #ffffff;
  color: #0f172a;
  text-align: left;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}

.crm-select-option:hover {
  background: #f4f7fb;
}

.crm-select-option.is-active {
  background: #edf3fb;
  color: #0b3f86;
  font-weight: 600;
}

.crm-logs-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  flex: 1;
  min-height: 0;
}

.crm-logs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.crm-logs-table th,
.crm-logs-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f6;
  font-size: 12px;
  vertical-align: top;
}

.crm-logs-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  background: #f8fafc;
}

.crm-logs-table td:last-child {
  max-width: 280px;
  color: #b91c1c;
}

.crm-logs-empty-cell {
  color: #6b7280;
  text-align: center;
  padding: 22px 12px !important;
}

.crm-logs-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.crm-logs-page-meta {
  font-size: 12px;
  color: #64748b;
}

.crm-logs-page-actions {
  display: inline-flex;
  gap: 8px;
}

@keyframes crm-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 700px) {
  .crm-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .crm-logs-toolbar {
    grid-template-columns: 1fr;
  }

  .crm-logs-toolbar .auth-field {
    max-width: none;
  }
}

/* ── End CRM page ──────────────────────────────────────────────── */

.button-train {
  background: #16a34a;
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.button-train:hover {
  background: #15803d;
}

.button-train[disabled] {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.7;
}

.button-train[disabled]:hover {
  background: #9ca3af;
}

.faq-description {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.faq-section {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.faq-section ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.faq-answer {
  margin: 0;
  color: #111827;
}

.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-muted);
}


.faq-form {
  display: grid;
  gap: 10px;
}

.faq-form input,
.faq-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
  font-family: var(--font-body);
}

.faq-form textarea {
  resize: vertical;
}

.faq-examples {
  display: grid;
  gap: 8px;
}

.faq-form-section {
  background: #fff;
  border: 1px solid rgba(4, 56, 115, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-tight);
}

.faq-form-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.faq-form-header h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.faq-form-header p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.faq-storage {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 8px;
}

.faq-storage strong {
  color: #111827;
}

.faq-example-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.faq-examples {
  display: grid;
  gap: 8px;
}

.example-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  background: rgba(4, 56, 115, 0.04);
  font-size: 13px;
}

.faq-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 40;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 45;
  padding: 24px;
}

.modal.hidden,
.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(4, 56, 115, 0.12);
  box-shadow: var(--shadow-tight);
  padding: 24px;
  display: grid;
  gap: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.modal-header h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.modal-header p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 13px;
}

.modal-close {
  padding: 6px 10px;
}

.sidebar-backdrop {
  display: none;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: min(420px, 100%);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 24px;
}

.auth-brand {
  display: flex;
  justify-content: center;
}

.auth-split {
  display: grid;
  gap: 20px;
}

.auth-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}

.tab-button {
  border: none;
  background: none;
  padding: 0 0 8px;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-muted);
  border-bottom: 2px solid transparent;
}

.tab-button.is-active {
  color: var(--color-navy);
  border-bottom-color: var(--color-navy);
}

.auth-panel {
  display: grid;
  gap: 16px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.25s ease;
}

.auth-panel.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 800px;
}

.auth-brand img {
  width: 160px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-field label {
  font-size: 13px;
  color: var(--color-muted);
}

.auth-field input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  font-size: 14px;
}

.auth-actions {
  display: grid;
  gap: 12px;
}

.auth-links {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.auth-text-button {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.auth-text-button:hover {
  color: var(--color-navy);
}

.auth-helper {
  font-size: 12px;
  color: var(--color-muted);
}

.auth-card h1,
.auth-helper {
  text-align: center;
}

.status-text {
  font-size: 13px;
  color: var(--color-muted);
  min-height: 18px;
}

.status-text.is-error {
  color: #b42318;
}

.status-text.is-success {
  color: #15803d;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.insights-page {
  display: grid;
  gap: 16px;
}

.insights-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.insights-header h1 {
  margin: 0;
  font-size: 30px;
  color: var(--color-navy);
}

.insights-header p {
  margin: 6px 0 0;
  color: var(--color-muted);
}

.insights-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.insights-filters label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.insights-filters select {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
  color: var(--color-ink);
}

.insights-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.insights-kpi-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 16px rgba(4, 56, 115, 0.07);
  display: grid;
  gap: 6px;
}

.insights-kpi-card p {
  margin: 0;
  font-size: 12px;
  color: #111827;
  font-weight: 600;
}

.insights-kpi-card h3 {
  margin: 0;
  font-size: 24px;
  color: var(--color-navy);
}

.insights-kpi-card span {
  font-size: 12px;
  color: #4b5563;
}

.insights-grid {
  display: grid;
  gap: 12px;
}

.insights-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.insights-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.insights-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.insights-card-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--color-ink-soft);
}

.insights-card-head span {
  color: var(--color-muted);
  font-size: 12px;
}

.insights-bars {
  display: grid;
  gap: 8px;
}

.insights-bars.compact {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.insights-line-wrap {
  display: grid;
  gap: 6px;
}

.insights-line-svg {
  width: 100%;
  height: 260px;
  display: block;
}

.insights-grid-line {
  stroke: #e7ecf4;
  stroke-width: 1;
}

.insights-grid-line.is-vertical {
  stroke: #f1f4f8;
}

.insights-axis-label {
  font-size: 10px;
  fill: #6b7280;
}

.insights-axis-titles {
  display: flex;
  justify-content: space-between;
  color: #4b5563;
  font-size: 12px;
}

.insights-line-empty {
  color: var(--color-muted);
  font-size: 13px;
  padding: 18px 0;
}

.insights-bar-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.insights-bar-track {
  height: 8px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

.insights-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.insights-bar-fill.is-primary {
  background: linear-gradient(90deg, #0b4aa6, #3f78cf);
}

.insights-bar-fill.is-secondary {
  background: linear-gradient(90deg, #1f6870, #46a5b0);
}

.insights-table-wrap {
  overflow-x: auto;
}

.insights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.insights-table caption {
  text-align: left;
  color: var(--color-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.insights-table th,
.insights-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
}

.insights-table thead th {
  color: #4b5563;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.insights-channel-stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--color-muted);
}

.insights-channel-stack-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.insights-channel-stack-legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.insights-channel-stack-list {
  display: grid;
  gap: 8px;
}

.insights-channel-pie-block {
  display: grid;
  place-items: center;
  padding: 8px 0 4px;
}

.insights-donut-wrap {
  position: relative;
  width: 220px;
  height: 220px;
}

.insights-donut {
  width: 220px;
  height: 220px;
  display: block;
}

.insights-donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
}

.insights-donut-center strong {
  color: #111827;
  font-size: 24px;
}

.insights-donut-center span {
  color: var(--color-muted);
  font-size: 12px;
}

.stack-widget {
  background: #0b4aa6;
}

.stack-whatsapp {
  background: #0d907f;
}

.stack-telegram {
  background: #2796d6;
}

.stack-instagram {
  background: #cd4f8d;
}

.insights-retention-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.insights-retention-kpis div {
  border: 1px solid #edf1f6;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.insights-retention-kpis span {
  color: var(--color-muted);
  font-size: 12px;
}

.insights-retention-kpis strong {
  color: var(--color-navy);
  font-size: 20px;
}

.insights-progress-list {
  display: grid;
  gap: 10px;
}

.insights-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 240px) 1fr auto;
  gap: 10px;
  align-items: center;
}

.insights-progress-row div:first-child {
  display: grid;
  gap: 4px;
}

.insights-progress-row span {
  color: var(--color-muted);
  font-size: 12px;
}

.insights-progress-row em {
  font-style: normal;
  font-size: 12px;
  color: #374151;
}

.insights-progress-track {
  height: 10px;
  border-radius: 999px;
  background: #edf1f6;
  overflow: hidden;
}

.insights-progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0b4aa6, #58b3b3);
}

.insights-action-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.insights-action-overview div {
  border: 1px solid #edf1f6;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.insights-action-overview span {
  color: var(--color-muted);
  font-size: 12px;
}

.insights-action-overview strong {
  color: var(--color-navy);
  font-size: 20px;
}

.insights-micro-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.insights-micro-kpis div {
  border: 1px solid #edf1f6;
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

.insights-micro-kpis span {
  color: var(--color-muted);
  font-size: 11px;
}

.insights-micro-kpis strong {
  color: #111827;
  font-size: 13px;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    will-change: transform;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .docs-grid {
    grid-template-columns: 1fr;
  }

  .insights-header {
    flex-direction: column;
  }

  .insights-filters {
    width: 100%;
  }

  .insights-filters label {
    flex: 1;
    min-width: 180px;
  }

  .insights-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights-grid-two {
    grid-template-columns: 1fr;
  }

  .insights-retention-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights-micro-kpis {
    grid-template-columns: 1fr;
  }

  .insights-progress-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .apps-preview-apps-head {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title menu"
      "portal portal";
    row-gap: 12px;
  }

  .apps-preview-apps-head > h2 {
    grid-area: title;
  }

  .apps-preview-apps-head .apps-preview-menu-shell {
    grid-area: menu;
  }

  .apps-preview-open-portal {
    grid-area: portal;
  }
}

@media (max-width: 1440px) {
  body.tickets-full .app-shell {
    grid-template-columns: 1fr;
  }

  body.chat-page-full .app-shell {
    grid-template-columns: 1fr;
  }

  body.tickets-full .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    will-change: transform;
  }

  body.chat-page-full .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    will-change: transform;
  }

  body.tickets-full .sidebar.is-open {
    transform: translateX(0);
  }

  body.chat-page-full .sidebar.is-open {
    transform: translateX(0);
  }

  body.tickets-full .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.chat-page-full .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  body.tickets-full .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  body.chat-page-full .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  body.tickets-full .menu-toggle {
    display: inline-flex;
  }

  body.chat-page-full .menu-toggle {
    display: inline-flex;
  }
}

@media (min-width: 961px) {
  .menu-toggle {
    display: none;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 14px 16px;
  }

  .content {
    padding: 24px 16px 32px;
  }

  .content-card {
    padding: 24px;
  }

  .insights-kpi-grid {
    grid-template-columns: 1fr;
  }

  .insights-retention-kpis {
    grid-template-columns: 1fr;
  }

  .insights-action-overview {
    grid-template-columns: 1fr;
  }

  .insights-bar-row {
    grid-template-columns: 48px 1fr auto;
    font-size: 11px;
  }

  .insights-donut-wrap,
  .insights-donut {
    width: 190px;
    height: 190px;
  }
}

@media (max-width: 720px) {
  .select-grid {
    grid-template-columns: 1fr;
  }
}

.header-agent.is-hidden {
  display: none;
}

/* Billing */
.billing-page {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.billing-header h1 {
  margin: 0;
  font-size: 44px;
  letter-spacing: -0.03em;
}

.billing-header p {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 18px;
}

.billing-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: stretch;
}

.billing-main-grid.is-unsubscribed {
  grid-template-columns: 1fr;
}

.billing-main-left {
  display: grid;
  gap: 18px;
}

.billing-plans-shell {
  background: #fff;
  border: 0;
  border-radius: 18px;
  padding: 22px;
}

.billing-plans-shell h2 {
  margin: 0;
  font-size: 36px;
  letter-spacing: -0.02em;
}

.billing-plans-shell > p {
  margin: 8px 0 0;
  color: var(--color-muted);
}

.billing-plans-shell-unsubscribed {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.billing-plans-shell-unsubscribed h2 {
  font-size: 52px;
  letter-spacing: -0.03em;
}

.billing-plans-head {
  display: grid;
  justify-content: start;
  gap: 10px;
}

.billing-plans-head p {
  max-width: 760px;
  font-size: 18px;
  margin: 8px 0 0;
}

.billing-interval-toggle {
  display: inline-flex;
  border: 1px solid #cfd8e5;
  border-radius: 999px;
  padding: 4px;
  background: #e7edf5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  width: fit-content;
  justify-self: start;
  align-self: start;
}

.billing-interval-button {
  border: 0;
  background: transparent;
  color: #5a6d88;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.billing-interval-button.is-active {
  background: #ffffff;
  color: #0b1426;
  box-shadow: 0 1px 2px rgba(6, 24, 44, 0.16);
}

.billing-interval-badge {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #2f66ff;
}

.billing-interval-button.is-active .billing-interval-badge {
  color: #2f66ff;
}

.billing-plans-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.billing-plans-shell-unsubscribed .billing-plans-grid {
  gap: 20px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}

.billing-plan-card {
  border: 0;
  border-radius: 14px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(4, 56, 115, 0.08);
}

.billing-plans-shell-unsubscribed .billing-plan-card {
  position: relative;
  border-radius: 18px;
  padding: 22px 20px 20px;
  gap: 12px;
  margin-top: 0;
  height: 100%;
  align-content: start;
  grid-auto-rows: max-content;
}

.billing-plans-shell-unsubscribed .billing-plan-card h3 {
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.billing-plans-shell-unsubscribed .billing-plan-price {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(4, 56, 115, 0.14);
  font-size: 40px;
  line-height: 1.05;
  min-height: 62px;
}

.billing-plan-note {
  margin: 0;
  color: #4f637f;
  font-size: 17px;
}

.billing-plan-save {
  margin: -4px 0 2px;
  font-size: 13px;
  color: #2f66ff;
  font-weight: 700;
}

.billing-plan-badge {
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%);
  background: #071938;
  color: #fff;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 700;
  padding: 8px 24px;
  letter-spacing: 0;
}

.billing-plan-card-popular {
  box-shadow: 0 10px 24px rgba(4, 56, 115, 0.12);
}

.billing-plans-shell-unsubscribed .billing-plan-card-popular {
  box-shadow: 0 12px 28px rgba(74, 145, 240, 0.24);
}

.billing-plan-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: #7a8699;
  font-weight: 700;
}

.billing-plan-card h3 {
  margin: 0;
  font-size: 30px;
}

.billing-plan-price {
  margin: 0;
  font-size: 38px;
  font-weight: 700;
}

.billing-plan-price span {
  font-size: 16px;
  color: #7a8699;
  margin-left: 4px;
}

.billing-plan-price [data-plan-amount] {
  font-size: inherit;
  color: #111827;
  font-weight: 700;
  margin-left: 0;
}

.billing-plan-price [data-plan-unit] {
  font-size: 16px;
  color: #6b7a90;
}

.billing-plan-card ul {
  margin: 0;
  padding-left: 18px;
  color: #364152;
  display: grid;
  gap: 6px;
}

.billing-plans-shell-unsubscribed .billing-plan-card ul {
  list-style: none;
  padding: 0;
  gap: 8px;
  font-size: 16px;
}

.billing-plans-shell-unsubscribed .billing-plan-card li {
  position: relative;
  padding-left: 20px;
}

.billing-plans-shell-unsubscribed .billing-plan-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: #356de6;
  font-weight: 700;
}

.billing-plans-shell-unsubscribed .billing-plan-card .button {
  width: 100%;
  font-size: 16px;
  border-radius: 12px;
  padding: 10px 14px;
}

.billing-plans-shell-unsubscribed .billing-plan-card .button.button-primary {
  background: #4a91f0;
  box-shadow: none;
}

.billing-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.billing-security-card,
.billing-enterprise-card,
.billing-current-plan-card,
.billing-manage-shell,
.billing-usage-card,
.billing-addon-card,
.billing-activity {
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(4, 56, 115, 0.08);
}

.billing-security-card,
.billing-enterprise-card {
  padding: 20px;
}

.billing-security-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 18px;
}

.billing-security-copy {
  display: grid;
  gap: 10px;
}

.billing-security-trust {
  margin-top: 16px;
  font-size: 14px;
  color: #6b7a90;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.billing-security-trust-icon {
  width: 14px;
  height: 14px;
  color: #6b7a90;
  opacity: 0.85;
  transform: scale(0.95, 1.12);
  transform-origin: center;
}

.billing-security-trust-icon * {
  fill: currentColor;
  stroke: currentColor;
}

.billing-security-card h3,
.billing-enterprise-card h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.01em;
}

.billing-security-card p,
.billing-enterprise-card p {
  margin: 10px 0 0;
  color: #576273;
  line-height: 1.55;
}

.billing-enterprise-card {
  display: grid;
  align-content: start;
  gap: 16px;
  background: #032f63;
  color: #ffffff;
}

.billing-enterprise-card p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  max-width: none;
  color: #d7e5ff;
}

.billing-enterprise-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.24);
  width: 100%;
}

.billing-enterprise-cta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-weight: 700;
  color: #ffffff;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  background: transparent;
  border-radius: 0;
  padding: 0;
  width: 100%;
}

.billing-enterprise-cta i {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}

.billing-security-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
}

.billing-security-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.billing-security-visual {
  width: 78%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 20%, rgba(143, 209, 255, 0.28), transparent 55%),
    linear-gradient(155deg, rgba(1, 9, 28, 0.75), rgba(6, 38, 83, 0.92));
  display: grid;
  place-items: center;
  border: 1px solid rgba(143, 209, 255, 0.35);
}

.billing-security-visual-ring {
  width: 66%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 1px solid rgba(143, 209, 255, 0.35);
  background: radial-gradient(circle at center, rgba(143, 209, 255, 0.16), rgba(2, 12, 33, 0.45));
  display: grid;
  place-items: center;
}

.billing-security-visual-ring i {
  width: 46%;
  height: 46%;
  color: #9adaff;
  stroke-width: 1.9px;
}

.billing-current-plan-card {
  padding: 24px 28px;
  display: grid;
  gap: 16px;
}

.billing-current-plan-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.billing-current-plan-head h2 {
  margin: 8px 0 0;
  font-size: 52px;
  letter-spacing: -0.03em;
}

.billing-current-plan-card > p {
  margin: 0;
  color: #576273;
  max-width: 620px;
  font-size: 32px;
  line-height: 1.3;
}

.billing-status-pill {
  align-self: flex-start;
  background: rgba(22, 163, 74, 0.16);
  color: #15803d;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
}

.billing-status-pill.is-inactive {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.billing-current-plan-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.billing-current-plan-foot strong {
  display: block;
  font-size: 42px;
  letter-spacing: -0.02em;
}

.billing-current-plan-foot small {
  color: #7a8699;
  font-size: 14px;
}

.billing-current-plan-actions {
  display: flex;
  gap: 10px;
}

.billing-owner-note {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.billing-manage-shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}

.billing-manage-copy h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.billing-manage-copy p {
  margin: 8px 0 0;
  color: #576273;
  font-size: 15px;
}

.billing-plan-modal-card {
  width: min(1240px, 100%);
}

.billing-plan-modal-card .billing-plans-grid {
  margin-top: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 100%;
  justify-content: center;
}

.billing-plans-grid-modal .billing-plan-card {
  min-height: 100%;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 12px;
}

.billing-plans-grid-modal .billing-plan-card .button {
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 16px;
}

.billing-plans-grid-modal .billing-plan-card .button:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: transparent;
  border: 1px solid var(--color-border);
  color: #364152;
  box-shadow: none;
}

.billing-usage-card {
  background: #010710;
  color: #f8fafc;
  padding: 18px;
  display: grid;
  gap: 14px;
  box-shadow: 0 16px 34px rgba(1, 7, 16, 0.3);
}

.billing-usage-card h3 {
  margin: 0;
  font-size: 26px;
}

.billing-usage-item {
  display: grid;
  gap: 7px;
}

.billing-usage-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #c3d2ea;
}

.billing-usage-row strong {
  color: #fff;
}

.billing-usage-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.billing-usage-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f8fafc, #8fd1ff);
}

.billing-usage-item small {
  font-size: 12px;
  color: #91a4c0;
}

.billing-section {
  display: grid;
  gap: 14px;
}

.billing-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.billing-section-head-stacked {
  display: grid;
  justify-content: start;
  gap: 4px;
}

.billing-section-head h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.billing-section-head p {
  margin: 0;
  color: #6b7280;
}

.billing-section-head a {
  color: #667388;
  font-weight: 700;
  font-size: 14px;
}

.billing-activity-view-all {
  border: 0;
  background: transparent;
  color: #667388;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.billing-addon-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.billing-addon-lock-note {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.billing-addon-grid.is-locked {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.billing-addon-card {
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  overflow: hidden;
}

.billing-addon-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.billing-addon-icon i {
  width: 26px;
  height: 26px;
  stroke-width: 2.2px;
}

.billing-addon-icon.is-blue {
  background: #eaf1fd;
  color: #2f69ee;
}

.billing-addon-icon.is-purple {
  background: #f5eefc;
  color: #8a3cec;
}

.billing-addon-icon.is-orange {
  background: #fcf5e9;
  color: #cc7a0a;
}

.billing-addon-icon.is-green {
  background: #e8f8f1;
  color: #13996b;
}

.billing-addon-card h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.billing-addon-card p {
  margin: 0;
  color: #6b7280;
  min-height: 88px;
  font-size: 17px;
  line-height: 1.45;
}

.billing-addon-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e4e9f1;
}

.billing-addon-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.billing-addon-price strong {
  font-size: 20px;
}

.billing-addon-price span {
  color: #7a8699;
  font-size: 14px;
}

.billing-addon-action-link {
  border: 0;
  background: transparent;
  color: #1f2428;
  font-size: 16px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.billing-addon-manage-bottom {
  margin: 10px -18px -14px;
  width: calc(100% + 36px);
  border: 0;
  background: #5b6574;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  padding: 13px 16px;
  cursor: pointer;
  border-radius: 0 0 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 0.18s ease;
}

.billing-addon-manage-bottom:hover {
  background: #4e5866;
}

.billing-addon-add-btn {
  border: 0;
  border-radius: 4px;
  background: #020917;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
}

.billing-addon-toggle {
  position: relative;
  width: 52px;
  height: 30px;
  display: inline-flex;
  align-items: center;
}

.billing-addon-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.billing-addon-toggle-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #020917;
}

.billing-addon-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 25px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(2, 9, 23, 0.25);
}

.billing-addon-table {
  margin-top: 8px;
  border-top: 1px solid #e4e9f1;
  padding-top: 10px;
  display: grid;
  gap: 6px;
}

.billing-addon-table-title {
  font-size: 12px;
  font-weight: 700;
  color: #5f6f86;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.billing-addon-table-head,
.billing-addon-table-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.billing-addon-table-head {
  font-size: 12px;
  font-weight: 700;
  color: #7a8699;
}

.billing-addon-table-row {
  font-size: 13px;
  color: #334155;
  padding: 4px 0;
  border-top: 1px solid #f1f4f8;
}

.billing-addon-table-row:first-of-type {
  border-top: 0;
}

.billing-addon-table-empty {
  font-size: 13px;
  color: #7a8699;
  padding: 4px 0 2px;
}

.billing-activity {
  padding: 16px;
}

.billing-activity-table {
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(4, 56, 115, 0.08);
}

.billing-activity-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 0.8fr;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(4, 56, 115, 0.08);
}

.billing-activity-row:first-child {
  border-top: 0;
}

.billing-activity-row-head {
  background: #f8fafc;
  color: #667388;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.billing-activity-row .is-paid {
  color: #15803d;
  font-weight: 700;
}

.billing-activity-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.billing-activity-pager span {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
}

.billing-history-modal-card {
  width: min(1040px, 100%);
  max-height: min(86vh, 920px);
  overflow: hidden;
}

[data-billing-history-backdrop] {
  z-index: 70;
}

[data-billing-history-modal] {
  z-index: 75;
}

[data-billing-sync-backdrop] {
  z-index: 80;
}

[data-billing-sync-modal] {
  z-index: 85;
}

[data-billing-plan-confirm-backdrop] {
  z-index: 76;
}

[data-billing-plan-confirm-modal] {
  z-index: 79;
}

.billing-plan-confirm-modal-card {
  width: min(520px, 100%);
  gap: 14px;
}

.billing-plan-confirm-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid #d7dde8;
  border-radius: 12px;
  background: #f8fbff;
}

.billing-plan-confirm-amount span {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.billing-plan-confirm-amount strong {
  color: #111827;
  font-size: 19px;
}

[data-billing-plan-error-backdrop] {
  z-index: 81;
}

[data-billing-plan-error-modal] {
  z-index: 86;
}

.billing-plan-error-modal-card {
  width: min(520px, 100%);
  gap: 12px;
}

.billing-plan-error-icon {
  width: 64px;
  height: 64px;
  margin: 2px auto 4px;
  border-radius: 999px;
  background: #fff1f2;
  color: #dc2626;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.billing-plan-error-icon i {
  width: 38px;
  height: 38px;
  stroke-width: 2.2;
}

.billing-sync-modal-card {
  width: min(480px, 100%);
  justify-items: center;
  text-align: center;
  gap: 10px;
}

.billing-sync-modal-card h2 {
  margin: 0;
  font-size: 26px;
}

.billing-sync-modal-card p {
  margin: 0;
  color: #64748b;
}

.billing-sync-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(4, 56, 115, 0.18);
  border-top-color: var(--color-navy);
  animation: billing-spin 0.9s linear infinite;
}

@keyframes billing-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.billing-history-modal-card .billing-activity-table {
  max-height: min(58vh, 560px);
  overflow-y: auto;
}

.billing-history-modal-card .billing-activity-row-head {
  position: sticky;
  top: 0;
  z-index: 2;
}

.addon-manage-modal-card {
  width: min(620px, 100%);
  max-height: min(90vh, 800px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.addon-manage-content {
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 24px;
  padding: 24px 24px;
}

.addon-manage-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
}

.addon-manage-info-compact {
  margin-bottom: 4px;
}

.addon-manage-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.addon-manage-icon i {
  width: 28px;
  height: 28px;
  stroke-width: 2.2px;
}

.addon-manage-icon.is-blue {
  background: #eaf1fd;
  color: #2f69ee;
}

.addon-manage-icon.is-purple {
  background: #f5eefc;
  color: #8a3cec;
}

.addon-manage-icon.is-orange {
  background: #fcf5e9;
  color: #cc7a0a;
}

.addon-manage-icon.is-green {
  background: #e8f8f1;
  color: #13996b;
}

.addon-manage-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.addon-manage-price {
  font-weight: 600;
  font-size: 16px;
  color: #1f2428;
}

.addon-manage-details-pricing {
  width: 100%;
}

.extra-agents-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.extra-agents-price-amount {
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.extra-agents-price-unit {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

.extra-agents-price-compare {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 17px;
  font-weight: 700;
}

.extra-agents-price-compare[hidden] {
  display: none !important;
}

.extra-agents-price-compare-value {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  opacity: 0.95;
}

.addon-manage-section {
  display: grid;
  gap: 12px;
}

.addon-manage-section h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2428;
}

.addon-manage-table {
  display: grid;
  gap: 0;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  overflow: hidden;
}

.addon-manage-table-header {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 12px;
  color: #667388;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #e4e9f1;
}

.addon-manage-table-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #f1f4f8;
  align-items: center;
}

.addon-manage-table-row:last-child {
  border-bottom: 0;
}

.addon-manage-col-action {
  display: flex;
  justify-content: flex-end;
}

.addon-manage-empty {
  padding: 12px 14px;
  font-size: 13px;
  color: #7a8699;
  text-align: center;
}

.addon-manage-remove-btn {
  border: 0;
  background: transparent;
  color: #dc2626;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  transition: color 0.2s;
}

.addon-manage-remove-btn:hover {
  color: #991b1b;
}

.addon-manage-toggle-section {
  display: grid;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e4e9f1;
}

.addon-manage-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  color: #1f2428;
  font-weight: 500;
}

.addon-manage-toggle {
  position: relative;
  width: 52px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.addon-manage-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.addon-manage-toggle-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #020917;
  transition: background 0.2s;
}

.addon-manage-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(2, 9, 23, 0.25);
  transition: left 0.2s;
}

.addon-manage-toggle input:checked ~ .addon-manage-toggle-track {
  background: #13996b;
}

.addon-manage-toggle input:checked ~ .addon-manage-toggle-track::after {
  left: 25px;
}

.addon-manage-threshold {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e4e9f1;
}

.addon-manage-threshold-extra-agents {
  gap: 14px;
}

.addon-inline-cta {
  width: 100%;
  justify-content: center;
}

.addon-manage-threshold-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.addon-manage-threshold-input label {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
  flex: 1;
}

.addon-manage-threshold-input input {
  width: 80px;
  padding: 8px 12px;
  border: 1px solid #d7dce2;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1f2428;
}

.addon-manage-threshold-input select {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #d7dce2;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1f2428;
  background: #fff;
}

.addon-manage-threshold-input span {
  font-size: 14px;
  color: #7a8699;
  min-width: 50px;
}

.addon-help-inline {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
}

.addon-manage-note {
  margin: 0;
  font-size: 13px;
  color: #5b687b;
  line-height: 1.5;
}

.addon-consent-check {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.addon-consent-check input[type="checkbox"] {
  margin-top: 3px;
}

.addon-manage-custom-domain {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e4e9f1;
}

.addon-manage-custom-domain label {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
  display: block;
}

.addon-manage-domain-input-group {
  display: flex;
  gap: 8px;
}

.addon-manage-domain-input-group input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d7dce2;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1f2428;
}

.addon-manage-domain-input-group .button {
  padding: 8px 16px;
  font-size: 14px;
}

.addon-manage-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #e4e9f1;
  background: #f8fafc;
}

@media (max-width: 1280px) {
  .billing-main-grid {
    grid-template-columns: 1fr;
  }

  .billing-addon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .billing-page {
    gap: 16px;
  }

  .billing-header h1 {
    font-size: 34px;
  }

  .billing-plans-shell h2 {
    font-size: 28px;
  }

  .billing-plans-shell-unsubscribed h2 {
    font-size: 34px;
  }

  .billing-plans-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .billing-plans-head p {
    font-size: 16px;
  }

  .billing-plans-grid {
    grid-template-columns: 1fr;
  }

  .billing-bottom-grid {
    grid-template-columns: 1fr;
  }

  .billing-security-card {
    grid-template-columns: 1fr;
  }

  .billing-security-image-wrap {
    max-width: 280px;
  }

  .billing-enterprise-card p {
    font-size: 16px;
    max-width: none;
  }

  .billing-enterprise-cta {
    font-size: 18px;
  }

  .billing-current-plan-head h2 {
    font-size: 38px;
  }

  .billing-current-plan-card > p {
    font-size: 22px;
  }

  .billing-current-plan-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .billing-manage-shell {
    flex-direction: column;
    align-items: flex-start;
  }

  .billing-addon-grid {
    grid-template-columns: 1fr;
  }

  .billing-addon-card h3 {
    font-size: 28px;
  }

  .billing-addon-card p {
    min-height: 0;
    font-size: 16px;
  }

  .billing-activity-row {
    grid-template-columns: 1fr 1fr;
  }
}
