:root {
  --ju-bg: #f6f7fb;
  --ju-panel: #ffffff;
  --ju-text: #172033;
  --ju-muted: #667085;
  --ju-muted-strong: #344054;
  --ju-border: #dfe4ee;
  --ju-primary: #4f46e5;
  --ju-primary-dark: #3730a3;
  --ju-danger: #c2410c;
  --ju-success: #047857;
  --ju-warning: #b45309;
  --ju-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}

body.unicorn-template-body,
.customer-platform-body,
.creator-body,
.marketplace-body {
  background: var(--ju-bg);
  color: var(--ju-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.unicorn-template-body {
  --bs-secondary-color: var(--ju-muted-strong);
  --bs-secondary-color-rgb: 52, 64, 84;
}

.unicorn-template-body .text-muted,
.unicorn-template-body .fw-normal,
.unicorn-template-body .card-body > p,
.unicorn-template-body .creator-inline-agent strong,
.unicorn-template-body .creator-inline-agent span:not(.creator-badge),
.unicorn-template-body .marketplace-compare-slot strong,
.unicorn-template-body .marketplace-compare-slot small {
  color: var(--ju-muted-strong) !important;
}

a {
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(79, 70, 229, .38);
  outline-offset: 3px;
}

.topbar button.nav-link {
  appearance: none;
  background: transparent;
  border: 0;
}

.page-content .container-xxl {
  padding-bottom: 24px;
}

.unicorn-avatar {
  align-items: center;
  background: var(--ju-primary);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
  color: var(--ju-primary);
}

.unicorn-template-body .brand .logo,
.unicorn-template-body .startbar .nav-link {
  min-height: 44px;
  min-width: 44px;
}

.unicorn-template-body .update-msg .btn {
  align-items: center;
  display: inline-flex;
  min-height: 44px;
}

.navbar-nav .nav-link.active .menu-icon,
.navbar-nav .nav-link:hover .menu-icon {
  color: var(--ju-primary);
}

.alert,
.notice,
[role="alert"],
[role="status"] {
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 12px 14px;
}

.notice.success {
  background: #ecfdf5;
  color: #065f46;
}

.notice.error {
  background: #fff7ed;
  color: #9a3412;
}

.login-screen,
.subscription-required {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel,
.subscription-required > section,
.admin-panel,
.creator-panel,
.creator-card,
.marketplace-agent-card,
.marketplace-trust-strip > div,
.marketplace-compare-guide,
.marketplace-coverage-item,
.marketplace-compare-slot {
  background: var(--ju-panel);
  border: 1px solid var(--ju-border);
  border-radius: 8px;
  box-shadow: var(--ju-shadow);
  min-width: 0;
}

.login-panel,
.subscription-required > section {
  max-width: 560px;
  padding: 28px;
  width: 100%;
}

.admin-panel,
.creator-panel {
  margin: 0 0 16px;
  padding: 0;
}

.admin-panel {
  overflow: hidden;
}

.admin-panel > :not(.panel-head):not(.records-toolbar):not(.admin-table-wrap):not(.creator-table-wrap),
.creator-panel-body,
.creator-card,
.marketplace-agent-card {
  padding: 16px;
}

.login-brand,
.admin-brand,
.creator-brand,
.creator-nav-link,
.creator-help,
.creator-page-header,
.creator-panel-header,
.creator-filter-bar,
.creator-actions,
.creator-card-footer,
.marketplace-agent-card-header,
.marketplace-agent-tools,
.marketplace-compare-actions,
.panel-head,
.topbar-actions,
.records-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.creator-page-header,
.creator-panel-header,
.panel-head,
.records-toolbar {
  justify-content: space-between;
}

.panel-head,
.creator-panel-header {
  border-bottom: 1px solid var(--ju-border);
  padding: 16px;
}

.panel-head.align-end,
.creator-panel-header.align-end {
  align-items: flex-end;
}

.panel-head.compact-head {
  padding: 12px 16px;
}

.panel-head h2,
.creator-panel-title h2,
.creator-panel-title h3,
.creator-page-header h1,
.login-copy h1 {
  letter-spacing: 0;
  margin: 0;
}

.panel-head p,
.creator-panel-title p,
.creator-title-block p,
.login-copy p,
.login-brand small,
.admin-brand small,
.creator-brand small,
.creator-nav-link small,
.creator-muted-text,
.creator-stat-card span {
  color: var(--ju-muted);
  margin: 0;
}

.login-copy h1 {
  font-size: 30px;
  margin: 24px 0 8px;
}

.brand-mark,
.creator-brand-mark,
.creator-agent-icon,
.creator-metric-icon {
  align-items: center;
  background: var(--ju-primary);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 44px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.login-promise,
.settings-facts,
.summary-strip,
.creator-tabs,
.marketplace-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-promise,
.settings-facts {
  margin: 16px 0;
}

.login-promise span,
.settings-facts div,
.summary-strip > div,
.creator-badge,
.marketplace-chip,
.creator-tabs a,
.status-badge,
.marketplace-status-badge {
  background: #eef2ff;
  border: 1px solid #dbe4ff;
  border-radius: 8px;
  color: #3730a3;
}

.settings-facts div,
.summary-strip > div {
  display: grid;
  gap: 4px;
  min-width: 140px;
  padding: 10px 12px;
}

.summary-strip {
  margin: 0 0 16px;
}

.summary-strip span,
.settings-facts span {
  color: var(--ju-muted);
  font-size: .82rem;
}

.admin-form,
.admin-form.stacked,
.creator-grid,
.creator-field,
.creator-confirm-copy {
  display: grid;
  gap: 14px;
}

.admin-form label,
.creator-field {
  display: grid;
  gap: 6px;
}

.unicorn-template-body label:has(> input[type="checkbox"]),
.marketplace-checkbox-line {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 44px;
}

.unicorn-template-body label > input[type="checkbox"] {
  flex: 0 0 auto;
  height: 18px;
  margin: 0;
  width: 18px;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.creator-input,
.creator-select,
.creator-textarea,
.records-tools input,
.marketplace-hero-search input,
.marketplace-hero-search select {
  background: #fff;
  border: 1px solid var(--ju-border);
  border-radius: 8px;
  color: var(--ju-text);
  min-height: 44px;
  min-width: 0;
  padding: 10px 12px;
  width: 100%;
}

.admin-form textarea,
.creator-textarea {
  min-height: 110px;
}

.admin-button,
.admin-icon-button,
.creator-button,
.creator-icon-button,
.creator-tabs a,
.marketplace-chip {
  align-items: center;
  background: #fff;
  border: 1px solid var(--ju-border);
  border-radius: 8px;
  color: var(--ju-text);
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 14px;
}

.admin-icon-button,
.creator-icon-button {
  padding: 0;
}

.admin-button.primary,
.creator-button.primary,
.creator-icon-button.is-active {
  background: var(--ju-primary);
  border-color: var(--ju-primary);
  color: #fff;
}

.admin-button.danger,
.creator-button.danger,
.admin-icon-button.danger-icon,
.creator-icon-button.danger,
.creator-icon-button.danger-icon {
  color: var(--ju-danger);
}

.admin-button.full-width,
.creator-button.full-width {
  width: 100%;
}

.admin-button:disabled,
.admin-icon-button:disabled,
.creator-button:disabled,
.creator-icon-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.creator-tabs,
.marketplace-chip-row {
  margin: 0 0 16px;
}

.creator-tabs a.is-active,
.marketplace-chip.is-active {
  background: var(--ju-primary);
  border-color: var(--ju-primary);
  color: #fff;
}

.settings-grid,
.creator-grid.two {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr);
}

.creator-grid.three,
.marketplace-dashboard-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.creator-grid,
.marketplace-agent-grid,
.marketplace-trust-strip,
.marketplace-compare-guide-grid,
.marketplace-coverage-grid,
.marketplace-compare-slots {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.marketplace-agent-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.marketplace-trust-strip,
.marketplace-compare-guide-grid,
.marketplace-coverage-grid,
.marketplace-compare-slots {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.marketplace-hero-search {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  margin: 0 0 16px;
}

.records-toolbar {
  border-bottom: 1px solid var(--ju-border);
  padding: 14px 16px;
}

.records-toolbar > div:first-child {
  display: grid;
  gap: 2px;
}

.records-toolbar > div:first-child span {
  color: var(--ju-muted);
}

.records-tools {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.records-tools input {
  width: min(260px, 100%);
}

.admin-table-wrap,
.creator-table-wrap,
.marketplace-compare-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.admin-table,
.creator-table,
.marketplace-compare-table {
  min-width: 760px;
  width: 100%;
}

.admin-table th,
.admin-table td,
.creator-table th,
.creator-table td,
.marketplace-compare-table th,
.marketplace-compare-table td {
  border-bottom: 1px solid var(--ju-border);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.admin-table th,
.creator-table th,
.marketplace-compare-table th {
  color: var(--ju-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.creator-card strong,
.creator-card p,
.admin-table td,
.creator-table td,
.creator-inline-agent span:not(.creator-badge),
.marketplace-compare-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.creator-badge,
.status-badge,
.marketplace-status-badge {
  display: inline-flex;
  font-size: .82rem;
  line-height: 1.2;
  min-height: 28px;
  padding: 5px 8px;
}

.creator-empty,
.empty-state {
  color: var(--ju-muted);
  padding: 24px;
  text-align: center;
}

.creator-inline-agent {
  align-items: center;
  display: flex;
  gap: 12px;
}

.creator-agent-icon {
  flex: 0 0 40px;
  height: 40px;
  width: 40px;
}

.creator-admin-actions {
  display: grid;
  gap: 12px;
  min-width: 240px;
}

.creator-admin-actions form {
  display: grid;
  gap: 8px;
}

.action-menu,
.creator-inline-edit,
.metadata-details {
  position: relative;
}

.action-menu summary,
.creator-inline-edit summary,
.metadata-details summary {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  list-style: none;
}

.action-menu summary::-webkit-details-marker,
.creator-inline-edit summary::-webkit-details-marker,
.metadata-details summary::-webkit-details-marker {
  display: none;
}

.action-menu summary {
  background: #fff;
  border: 1px solid var(--ju-border);
  height: 40px;
  justify-content: center;
  width: 40px;
}

.action-menu-list {
  background: #fff;
  border: 1px solid var(--ju-border);
  border-radius: 8px;
  box-shadow: var(--ju-shadow);
  display: grid;
  gap: 6px;
  min-width: 190px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
}

.action-menu-list .admin-button,
.action-menu-list .creator-button,
.action-menu-list > form > button,
.action-menu-list > button,
.action-menu-list > a {
  align-items: center;
  background: #fff;
  border: 1px solid var(--ju-border);
  border-radius: 8px;
  color: var(--ju-text);
  display: inline-flex;
  gap: 8px;
  justify-content: flex-start;
  min-height: 40px;
  padding: 9px 12px;
  width: 100%;
}

.action-menu-list > form {
  margin: 0;
}

.action-menu-list > form > button {
  font: inherit;
}

.action-menu-list > form > button:disabled,
.action-menu-list > button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.creator-inline-edit {
  margin-top: 8px;
}

.creator-inline-edit summary:not(.creator-icon-button),
.metadata-details summary {
  background: #f8fafc;
  border: 1px solid var(--ju-border);
  color: var(--ju-text);
  min-height: 38px;
  padding: 8px 12px;
}

.creator-inline-edit[open] {
  background: #f8fafc;
  border: 1px solid var(--ju-border);
  border-radius: 8px;
  padding: 10px;
}

.metadata-details pre {
  background: #111827;
  border-radius: 8px;
  color: #f9fafb;
  margin: 10px 0 0;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.creator-action-card,
[id] {
  scroll-margin-top: 96px;
}

.is-anchor-target {
  animation: anchorTargetPulse 1.6s ease;
  outline: 2px solid rgba(79, 70, 229, .35);
  outline-offset: 4px;
}

@keyframes anchorTargetPulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .3); }
  70% { box-shadow: 0 0 0 12px rgba(79, 70, 229, 0); }
  100% { box-shadow: none; }
}

.marketplace-checkbox-line,
.toggle-row label {
  align-items: center;
  display: flex;
  gap: 8px;
}

.marketplace-timeline,
.creator-timeline {
  display: grid;
  gap: 12px;
}

.marketplace-timeline-item,
.creator-timeline-item {
  display: grid;
  gap: 8px;
  grid-template-columns: 16px minmax(0, 1fr);
}

.marketplace-timeline-dot,
.creator-timeline-dot {
  background: var(--ju-primary);
  border-radius: 999px;
  height: 12px;
  margin-top: 6px;
  width: 12px;
}

.locked-organization-field {
  background: #f8fafc;
  border: 1px dashed var(--ju-border);
  border-radius: 8px;
  padding: 10px 12px;
}

.admin-modal[hidden],
#creatorConfirmDialog[hidden] {
  display: none;
}

.admin-modal {
  background: rgba(15, 23, 42, .48);
  bottom: 0;
  box-shadow: none;
  display: block;
  left: 0;
  margin: 0;
  max-width: none;
  overflow-y: auto;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  width: auto;
  z-index: 1050;
}

.admin-modal > * {
  max-width: 980px;
}

.admin-modal.admin-panel {
  background: rgba(15, 23, 42, .48);
}

.admin-modal.admin-panel::before {
  content: "";
  display: block;
}

.admin-modal.admin-panel > .panel-head,
.admin-modal.admin-panel > .admin-form,
.admin-modal.admin-panel > .records-toolbar,
.admin-modal.admin-panel > .admin-table-wrap,
.admin-modal.admin-panel > .settings-facts,
.admin-modal.admin-panel > .creator-grid,
.admin-modal.admin-panel > .summary-strip,
.admin-modal.admin-panel > p,
.admin-modal.admin-panel > div:not(.panel-head) {
  background: #fff;
  margin-left: auto;
  margin-right: auto;
  max-width: 980px;
}

.admin-modal.admin-panel > .panel-head {
  border-radius: 8px 8px 0 0;
  margin-top: 24px;
}

.admin-modal.admin-panel > :last-child {
  border-radius: 0 0 8px 8px;
  margin-bottom: 24px;
}

body.modal-open,
body.creator-confirm-open {
  overflow: hidden;
}

#creatorConfirmDialog {
  align-items: center;
  background: rgba(15, 23, 42, .48);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 20px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1060;
}

.creator-confirm-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--ju-shadow);
  display: grid;
  gap: 14px;
  max-width: 440px;
  padding: 20px;
  width: 100%;
}

.creator-confirm-icon {
  color: var(--ju-warning);
  font-size: 28px;
}

.creator-confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .settings-grid,
  .creator-grid.two,
  .creator-grid.three,
  .marketplace-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .marketplace-hero-search {
    grid-template-columns: 1fr;
  }

  .marketplace-hero-search .creator-button,
  .records-tools,
  .records-tools input {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .login-screen,
  .subscription-required {
    padding: 14px;
  }

  .login-panel,
  .subscription-required > section {
    padding: 20px;
  }

  .admin-modal {
    padding: 12px;
  }

  .panel-head,
  .creator-panel-header {
    align-items: flex-start;
  }
}
