:root {
  --ink: #221429;
  --muted: #866f8d;
  --brand: #923999;
  --brand-2: #c35ba9;
  --soft: #fbf2fb;
  --line: rgba(146, 57, 153, 0.18);
  --paper: rgba(255, 255, 255, 0.88);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(195, 91, 169, 0.18), transparent 34%),
    linear-gradient(135deg, #fff7ff, #f5e8f6 54%, #ffffff);
}

.admin-shell {
  width: min(1320px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(94, 42, 102, 0.12);
  backdrop-filter: blur(14px);
}

.brand img {
  display: block;
  width: 150px;
  height: auto;
  transform: translate(-7px, 3px);
}

.admin-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-header button,
.admin-header a,
.section-head button,
.section-actions button,
.promo-create button,
.reply-form button,
.dialog-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  padding: 0 13px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.admin-header button.active,
.section-head button,
.section-actions button,
.promo-create button,
.reply-form button {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.auth-panel,
.admin-section,
.lead-dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(94, 42, 102, 0.12);
  backdrop-filter: blur(14px);
}

.auth-panel {
  display: none;
  padding: 28px;
}

body.auth-required .auth-panel {
  display: block;
}

body.auth-required .admin-section {
  display: none;
}

body.auth-required .admin-header nav {
  display: none;
}

.auth-panel h1,
.auth-panel p {
  margin: 0 0 12px;
}

.bot-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 12px;
}

.bot-login-actions .admin-provider-link {
  min-width: 132px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.admin-provider-link img {
  width: 28px;
  height: 28px;
  display: block;
  flex: 0 0 28px;
}

.usage-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.usage-filter label {
  display: grid;
  gap: 5px;
}

.usage-filter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.usage-filter select,
.usage-filter input {
  min-height: 36px;
  border: 1px solid rgba(146, 57, 153, 0.22);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.usage-filter button {
  min-height: 36px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.usage-limits {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid rgba(146, 57, 153, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.usage-limits-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usage-limits-head p,
.usage-limits-head h2,
.usage-limits-note,
.usage-limits-status {
  margin: 0;
}

.usage-limits-head p,
.usage-limits-note,
.usage-limits-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.usage-limits-head h2 {
  color: var(--ink);
  font-size: 16px;
}

.usage-limits-head button {
  min-height: 36px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.usage-limits-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.usage-limits-grid label {
  display: grid;
  gap: 5px;
}

.usage-limits-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.usage-limits-grid input {
  min-height: 36px;
  border: 1px solid rgba(146, 57, 153, 0.22);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.usage-error {
  color: #a33b3b;
}

@media (max-width: 860px) {
  .usage-limits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .usage-limits-head {
    align-items: stretch;
    flex-direction: column;
  }

  .usage-limits-grid {
    grid-template-columns: 1fr;
  }
}

.advertiser-create {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.advertiser-create[hidden] {
  display: none;
}

.section-actions,
.advertiser-form-actions,
.advertiser-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.advertiser-fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(146, 57, 153, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
}

.advertiser-fieldset h2 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 950;
}

.advertiser-create label {
  display: grid;
  gap: 5px;
}

.advertiser-create span,
.advertiser-toggle span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.advertiser-create small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.advertiser-create input,
.advertiser-create select {
  min-height: 36px;
  border: 1px solid rgba(146, 57, 153, 0.22);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.advertiser-create input:disabled {
  border-color: rgba(126, 86, 132, 0.12);
  background: rgba(126, 86, 132, 0.08);
  color: rgba(78, 53, 84, 0.48);
}

.advertiser-toggle {
  align-content: center;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.advertiser-form-actions {
  grid-column: 1 / -1;
}

.save-status {
  min-height: 28px;
  display: inline-grid;
  grid-template-columns: 16px auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.save-status::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(126, 86, 132, 0.22);
  box-sizing: border-box;
}

.save-status.saving::before {
  border-color: rgba(146, 57, 153, 0.2);
  border-top-color: var(--brand);
  animation: saveSpin 780ms linear infinite;
}

.save-status.saved {
  color: #2f8f62;
}

.save-status.saved::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: #2f8f62;
  background: rgba(47, 143, 98, 0.1);
  color: #2f8f62;
  font-size: 10px;
  line-height: 1;
}

.save-status.failed {
  color: #b84c69;
}

.save-status.failed::before {
  border-color: #b84c69;
  background: rgba(184, 76, 105, 0.1);
}

@keyframes saveSpin {
  to { transform: rotate(360deg); }
}

.advertiser-create button,
.advertiser-card button {
  min-height: 36px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.advertiser-form-actions button:last-child,
.advertiser-card button.danger {
  background: rgba(126, 86, 132, 0.12);
  color: var(--brand);
}

.advertiser-card button.danger {
  color: #9c1d3d;
}

.advertiser-memo {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(146, 57, 153, 0.28);
  border-radius: 14px;
  background: rgba(255,255,255,.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.advertiser-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.advertiser-toolbar label {
  display: grid;
  gap: 5px;
}

.advertiser-toolbar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.advertiser-toolbar select {
  min-height: 34px;
  border: 1px solid rgba(146, 57, 153, 0.2);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.advertiser-city-summary {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
}

.advertiser-city-summary button {
  display: grid;
  gap: 2px;
  min-width: 178px;
  border: 1px solid rgba(146, 57, 153, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.advertiser-city-summary b {
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
}

.advertiser-city-summary span,
.advertiser-city-summary i {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.advertiser-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.advertiser-card {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(280px, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.66);
  padding: 12px;
}

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

.advertiser-title h3,
.advertiser-title p {
  margin: 0;
}

.advertiser-title h3 {
  font-size: 17px;
}

.advertiser-title p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.advertiser-title span {
  white-space: nowrap;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 950;
}

.advertiser-card dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px 8px;
  margin: 0;
  font-size: 12px;
}

.advertiser-card dt {
  color: var(--muted);
  font-weight: 900;
}

.advertiser-card dd {
  margin: 0;
  font-weight: 850;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.advertiser-preview {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  max-height: 72px;
  padding: 10px;
  border: 1px solid rgba(146, 57, 153, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(248,237,248,.78));
  overflow: hidden;
}

.advertiser-preview.banner {
  background-image: var(--ad-preview);
  background-size: cover;
  background-position: center;
}

.advertiser-preview img,
.advertiser-preview i {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255,255,255,.8);
}

.advertiser-preview b,
.advertiser-preview span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advertiser-preview b {
  font-size: 12px;
}

.advertiser-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.advertiser-preview small {
  display: block;
  overflow: hidden;
  color: rgba(52, 36, 58, 0.72);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.advertiser-preview em {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  padding: 0 10px;
  font-style: normal;
  font-size: 11px;
  font-weight: 950;
}

@media (max-width: 920px) {
  .advertiser-create,
  .advertiser-fieldset,
  .advertiser-toolbar,
  .advertiser-card {
    grid-template-columns: 1fr;
  }
}

.bot-login-actions button {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.auth-panel a {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 900;
}

.auth-panel a[aria-disabled="true"] {
  cursor: wait;
  opacity: .62;
}

.auth-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.admin-section {
  display: none;
  padding: 18px;
}

.admin-section.active {
  display: block;
}

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

.section-head p,
.section-head h1 {
  margin: 0;
}

.section-head p {
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.section-head h1 {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.08;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(5, 248px);
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.crm-toolbar label {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.crm-promo-filter-field {
  position: relative;
}

.crm-toolbar label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-toolbar select,
.crm-toolbar input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.crm-toolbar select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand) 50%),
    linear-gradient(135deg, var(--brand) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 17px,
    calc(100% - 12px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  padding-right: 34px;
}

.crm-toolbar select.crm-native-select {
  display: none;
}

.crm-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.crm-select-trigger::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg) translateY(-2px);
}

.crm-select-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(91, 56, 96, 0.16);
  padding: 6px;
}

.crm-select-options[hidden] {
  display: none;
}

.crm-select-option {
  display: block;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.crm-select-option:hover,
.crm-select-option:focus-visible,
.crm-select-option.active {
  background: rgba(155, 63, 145, 0.1);
  color: var(--brand);
  outline: none;
}

.crm-promo-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(91, 56, 96, 0.16);
  padding: 6px;
}

.crm-promo-options[hidden] {
  display: none;
}

.crm-promo-option {
  display: block;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.crm-promo-option:hover,
.crm-promo-option:focus-visible {
  background: rgba(155, 63, 145, 0.1);
  color: var(--brand);
  outline: none;
}

.crm-promo-option.empty {
  color: var(--muted);
  cursor: default;
}

.crm-promo-option.empty:hover {
  background: transparent;
  color: var(--muted);
}

.crm-broadcast {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 220px) auto;
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.crm-broadcast-message,
.crm-broadcast-schedule {
  align-self: stretch;
}

.crm-broadcast-schedule {
  align-self: end;
}

.crm-broadcast label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.crm-broadcast label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.crm-broadcast textarea,
.crm-broadcast input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.crm-broadcast textarea {
  min-height: 74px;
  resize: vertical;
}

.crm-broadcast-status {
  display: flex;
  align-items: center;
  min-height: 18px;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.crm-broadcast-status b {
  color: var(--brand);
  font-weight: 950;
}

.crm-broadcast-status.success {
  color: #257847;
}

.crm-broadcast-status.failed {
  color: #a8293f;
}

.crm-broadcast-actions {
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 0;
}

.crm-broadcast-actions button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 0 13px;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  cursor: pointer;
}

.crm-broadcast-actions button[data-crm-broadcast-action="schedule"] {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand);
}

.stage-column {
  width: 248px;
  min-width: 248px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
}

.stage-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  min-height: 88px;
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid rgba(146, 57, 153, 0.18);
  border-left: 4px solid var(--brand);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(248,237,248,.86));
  box-shadow: 0 10px 24px rgba(94, 42, 102, 0.08);
}

.stage-column h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.14;
}

.stage-column small {
  display: block;
  grid-column: 1 / -1;
  min-height: 30px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.stage-head b {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 26px;
  border-radius: 999px;
  background: #f4e5f6;
  color: var(--brand);
  font-size: 12px;
}

.lead-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  width: 100%;
  box-sizing: border-box;
  min-height: 174px;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid rgba(146, 57, 153, 0.2);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  box-shadow: 0 10px 24px rgba(94, 42, 102, 0.08);
  cursor: pointer;
}

.lead-card strong {
  font-size: 13px;
  line-height: 1.18;
}

.lead-card span,
.lead-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-self: end;
}

.lead-meta b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 22px;
  min-height: 22px;
  max-width: 92px;
  border-radius: 8px;
  background: #f4e5f6;
  color: var(--brand);
  padding: 0 7px;
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-access {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 132px;
  height: 22px;
  min-height: 22px;
  max-width: 132px;
  border-radius: 8px;
  background: #f4e5f6;
  color: var(--brand);
  padding: 0 7px;
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-access.paid {
  background: #e8f6ee;
  color: #257847;
}

.lead-access.partner {
  background: #fff3dc;
  color: #9a5b00;
}

.lead-access.gift {
  background: #f0e3ff;
  color: #753299;
}

.lead-access.expired {
  background: #ffe7ea;
  color: #a8293f;
}

.message-badge {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  vertical-align: middle;
}

.partner-badge {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  border-radius: 50%;
  background: #d83c8b;
  color: #fff;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  vertical-align: middle;
}

.lead-meta b.promo-status.entered_unpaid {
  background: #fff0e5;
  color: #9b4d14;
}

.lead-meta b.promo-status.payment_pending {
  background: #fff7d9;
  color: #806200;
}

.lead-meta b.promo-status.paid {
  background: #e8f6ee;
  color: #257847;
}

.promo-create {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1.2fr) minmax(130px, 1fr) minmax(116px, .9fr) minmax(86px, .7fr) minmax(86px, .7fr) minmax(76px, .7fr) minmax(86px, auto);
  align-items: end;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.promo-create label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.promo-create span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.promo-create input,
.promo-create select,
.promo-create textarea,
.reply-form textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid rgba(146, 57, 153, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  outline: none;
}

.promo-create textarea {
  min-height: 74px;
  resize: vertical;
}

.partner-account-facts {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.partner-account-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.partner-account-actions button {
  min-height: 34px;
}

.partner-social-links {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.partner-social-links a {
  color: #873c91;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.partner-credentials-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.partner-credentials-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.partner-credentials-body label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  font-weight: 900;
}

.partner-credentials-body input {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
}

.promo-create button {
  min-height: 40px;
  height: 40px;
  align-self: end;
  padding: 0 12px;
  white-space: nowrap;
}

.promo-create button[aria-busy="true"]::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-right: 7px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 720ms linear infinite;
}

.promo-active-field > span:last-child {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  color: var(--ink);
}

.promo-active-field input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--brand);
}

#cancelPromoEditBtn {
  background: rgba(126, 86, 132, 0.12);
  color: var(--brand);
}

.promo-grid,
.usage-log {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.promo-card,
.usage-card,
.usage-summary {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.promo-card h3,
.promo-card p,
.usage-card p,
.usage-summary p {
  margin: 0;
}

.usage-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.usage-summary-grid span,
.usage-breakdown span {
  display: grid;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(146, 57, 153, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  padding: 8px;
}

.usage-summary-grid b,
.usage-breakdown b {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.usage-summary-grid small,
.usage-breakdown span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.usage-breakdown {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.promo-card h3 {
  font-size: 16px;
}

.promo-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.promo-card-actions button {
  min-height: 34px;
  border: 1px solid rgba(146, 57, 153, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  padding: 0 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.promo-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.promo-title > div {
  min-width: 0;
}

.promo-select {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.promo-select input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
}

.promo-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  background: #f4e5f6;
  color: var(--brand);
  padding: 5px 8px;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  text-align: center;
}

.promo-card p,
.usage-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.promo-card dl,
.lead-details dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 6px 10px;
  margin: 10px 0 0;
  font-size: 12px;
}

.promo-card dt,
.lead-details dt {
  color: var(--muted);
}

.promo-facts dd {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.promo-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.promo-metrics div {
  min-width: 0;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(244, 229, 246, 0.75);
  padding: 9px;
}

.promo-metrics b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.15;
}

.promo-metrics span,
.promo-balance span,
.period-note,
.muted-line {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.promo-balance {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.promo-referral-box {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid rgba(168, 57, 153, 0.18);
  border-radius: 12px;
  background: rgba(255, 247, 251, 0.78);
}

.promo-referral-box > strong {
  color: #a8297b;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 950;
}

.promo-referral-box > a,
.promo-referral-box > p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 850;
}

.promo-referral-box > a {
  color: var(--brand);
}

.promo-referral-sources {
  display: grid;
  gap: 6px;
}

.promo-referral-source-head,
.promo-referral-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 58px;
  gap: 8px;
  align-items: center;
}

.promo-referral-source-head {
  padding: 0 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.promo-referral-source-row {
  min-width: 0;
  border: 1px solid rgba(146, 57, 153, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 7px;
}

.promo-referral-source-row a,
.promo-referral-source-row b,
.promo-referral-source-row small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.promo-referral-source-row a {
  color: inherit;
  text-decoration: none;
}

.promo-referral-source-row b,
.promo-referral-source-row strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
}

.promo-referral-source-row strong {
  text-align: center;
}

.promo-referral-source-row small,
.promo-referral-sources p {
  color: var(--muted);
  font-size: 9px;
}

.promo-referral-sources p {
  margin: 0;
}

.payout-details {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  min-width: 0;
  overflow: hidden;
}

.payout-details summary {
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.payout-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-width: 100%;
  min-width: 0;
}

.payout-form label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.payout-form .wide {
  grid-column: 1 / -1;
}

.payout-form label:nth-child(3) {
  grid-column: 1 / -1;
}

.payout-form span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.payout-form input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(146, 57, 153, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 7px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  outline: none;
}

.payout-form button {
  grid-column: 1 / -1;
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.period-note {
  margin-top: 8px;
}

.payout-history {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.payout-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.7);
  padding: 7px;
  font-size: 11px;
}

.payout-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
}

.payout-row small,
.payout-row a {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.payout-row small {
  color: var(--ink);
}

.payout-row a {
  color: var(--brand);
  font-weight: 900;
}

.seo-dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.seo-dashboard article {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.66);
  padding: 12px;
}

.seo-dashboard b {
  display: block;
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
}

.seo-dashboard span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.seo-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
  margin-bottom: 14px;
}

.seo-mode-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  padding: 12px 14px;
}

.seo-mode-panel p,
.seo-mode-panel h2 {
  margin: 0;
}

.seo-mode-panel p {
  color: var(--brand);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.seo-mode-panel h2 {
  margin-top: 4px;
  font-size: 17px;
  line-height: 1.18;
}

.seo-mode-tabs {
  display: inline-flex;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(244, 229, 246, 0.6);
  padding: 4px;
}

.seo-mode-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.seo-mode-tabs button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 8px 20px rgba(146, 57, 153, 0.12);
}

.seo-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  padding: 14px;
}

.seo-panel-head h2,
.seo-panel-head p,
.seo-topic-form h3 {
  margin: 0;
}

.seo-panel-head h2,
.seo-topic-form h3 {
  font-size: 18px;
  line-height: 1.15;
}

.seo-panel-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.seo-panel label,
.seo-plan-form label,
.seo-topic-form label,
.seo-topic-toolbar label,
.seo-topic-edit-grid label {
  display: grid;
  gap: 5px;
}

.seo-panel span,
.seo-topic-toolbar span,
.seo-topic-edit-grid label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.seo-panel input,
.seo-panel textarea,
.seo-panel select,
.seo-topic-toolbar input,
.seo-topic-toolbar select,
.seo-topic-edit-grid input,
.seo-topic-edit-grid textarea {
  width: 100%;
  border: 1px solid rgba(146, 57, 153, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  outline: none;
}

.seo-row {
  display: grid;
  grid-template-columns: .65fr .65fr 1fr;
  gap: 10px;
  align-items: end;
}

.seo-toggle {
  display: flex !important;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  padding: 0 10px;
}

.seo-toggle input {
  width: auto;
  margin: 0 8px 0 0;
}

.seo-panel button,
.seo-topic-actions button,
.seo-topic-actions a {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  padding: 0 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.seo-plan-form,
.seo-topic-form {
  display: grid;
  gap: 10px;
}

.seo-mode-pane:not(.active) {
  display: none;
}

.seo-help {
  display: grid;
  gap: 8px;
}

.seo-help article {
  border-radius: 13px;
  background: rgba(244, 229, 246, 0.78);
  padding: 10px;
}

.seo-help b {
  display: block;
  color: var(--brand);
  font-size: 12px;
}

.seo-help span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.seo-topic-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 12px;
}

.seo-filter-buttons {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
}

.seo-filter-buttons button {
  min-height: 30px;
  border: 1px solid rgba(146, 57, 153, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--brand);
  padding: 0 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 950;
  cursor: pointer;
}

.seo-topic-toolbar label {
  min-width: 220px;
}

.seo-topic-table {
  display: grid;
  gap: 8px;
}

.seo-topic-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  overflow: hidden;
}

.seo-topic-item.open {
  box-shadow: 0 14px 36px rgba(146, 57, 153, 0.1);
}

.seo-topic-item.rejected {
  opacity: .76;
  background: rgba(255, 231, 234, 0.76);
}

.seo-topic-item.published {
  background: rgba(232, 246, 238, 0.78);
}

.seo-topic-item.generated,
.seo-topic-item.scheduled {
  background: rgba(245, 238, 255, 0.78);
}

.seo-topic-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto minmax(110px, .25fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.seo-topic-title {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.seo-topic-title span {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 950;
}

.seo-topic-title small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
}

.seo-topic-chip,
.seo-topic-slug {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(244, 229, 246, 0.86);
  color: var(--brand);
  padding: 0 8px;
  font-size: 10px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
}

.seo-topic-chip.source {
  background: rgba(255, 255, 255, 0.9);
}

.seo-topic-slug {
  display: none;
  justify-content: flex-start;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.seo-topic-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.seo-topic-row-actions button,
.seo-topic-row-actions a,
.seo-topic-pager button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid rgba(146, 57, 153, 0.2);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  padding: 0 9px;
  font: inherit;
  font-size: 10px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
}

.seo-topic-row-actions button[data-seo-action="generate"],
.seo-topic-row-actions button[data-seo-action="publishArticle"] {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

.seo-topic-details {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px;
}

.seo-topic-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.seo-topic-edit-grid .wide {
  grid-column: 1 / -1;
}

.seo-topic-structure {
  border-radius: 12px;
  background: rgba(244, 229, 246, 0.58);
  padding: 8px 10px;
}

.seo-topic-structure summary {
  color: var(--brand);
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.seo-topic-structure ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}

.seo-topic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seo-topic-actions button,
.seo-topic-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 9px;
  font-size: 10px;
}

.seo-topic-actions [data-seo-action="reject"] {
  background: #a8293f;
}

.seo-topic-actions [data-seo-action="draft"] {
  background: #866f8d;
}

.seo-topic-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.seo-topic-pager span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
}

.seo-topic-pager button:disabled {
  cursor: default;
  opacity: .45;
}

.seo-exclusions {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  padding: 12px;
}

.seo-exclusions summary {
  color: var(--brand);
  cursor: pointer;
  font-weight: 950;
}

.seo-exclusion-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, .7fr) auto;
  gap: 8px;
  margin-top: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px;
  font-size: 12px;
}

.seo-exclusion-row span,
.seo-exclusion-row em {
  color: var(--muted);
  font-style: normal;
}

.promo-card dd,
.lead-details dd {
  margin: 0;
  font-weight: 900;
}

.usage-summary {
  margin-bottom: 12px;
}

.lead-dialog {
  width: min(760px, calc(100vw - 24px));
  height: min(86vh, 820px);
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: hidden;
}

.lead-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.lead-dialog::backdrop {
  background: rgba(34, 20, 41, 0.28);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-head p,
.dialog-head h2 {
  margin: 0;
}

.dialog-head p {
  color: var(--brand);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.dialog-head h2 {
  font-size: 22px;
}

.lead-details,
.chat-feed,
.reply-form {
  margin: 0 16px;
}

.chat-feed {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 12px 2px;
}

.chat-item {
  max-width: 86%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-item.user {
  justify-self: start;
}

.chat-item.admin {
  justify-self: end;
  background: #f4e5f6;
}

.chat-item.reminder {
  justify-self: center;
  max-width: 92%;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 12px;
}

.chat-item small {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-weight: 950;
}

.reply-form {
  display: grid;
  gap: 10px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
}

.lead-details {
  max-height: 32vh;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 10px 0 14px;
}

.lead-details summary {
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.lead-details dl {
  margin-top: 10px;
}

@media (max-width: 760px) {
  .admin-shell {
    width: min(100vw - 16px, 560px);
    padding-top: 8px;
  }

  .admin-header {
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
  }

  .brand img {
    width: 110px;
  }

  .admin-header nav {
    gap: 6px;
  }

  .admin-header button,
  .admin-header a {
    min-height: 32px;
    padding: 0 9px;
    font-size: 11px;
  }

  .admin-section {
    padding: 12px;
  }

  .kanban {
    grid-template-columns: repeat(5, 226px);
  }

  .stage-column {
    width: 226px;
    min-width: 226px;
  }

  .promo-create {
    grid-template-columns: 1fr 1fr;
  }

  .crm-broadcast {
    grid-template-columns: 1fr;
  }

  .crm-broadcast-actions {
    justify-content: flex-start;
    padding-top: 0;
  }

  .promo-create button {
    grid-column: 1 / -1;
  }

  .payout-form {
    grid-template-columns: 1fr 1fr;
  }

  .payout-form label:nth-child(3) {
    grid-column: 1 / -1;
  }

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

  .seo-workbench,
  .seo-row {
    grid-template-columns: 1fr;
  }

  .seo-mode-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .seo-mode-tabs {
    width: 100%;
  }

  .seo-mode-tabs button {
    flex: 1;
  }

  .seo-topic-summary,
  .seo-topic-edit-grid {
    grid-template-columns: 1fr;
  }

  .seo-topic-row-actions {
    justify-content: flex-start;
  }

  .seo-topic-actions {
    display: flex;
  }

  .seo-exclusion-row {
    grid-template-columns: 1fr;
  }
}
