/* PulseBot v21.9.0 — tickets editors, counters and automod channel profiles cleanup. */

body#pulsebot-app:is(.dashboard-active-tickets,.dashboard-active-automod) {
  --pb2190-blue: #3b82f6;
  --pb2190-blue-hover: #4a8cf4;
  --pb2190-blue-soft: rgba(59,130,246,.08);
  --pb2190-blue-line: rgba(59,130,246,.28);
  --pb2190-line: rgba(255,255,255,.075);
  --pb2190-line-strong: rgba(255,255,255,.13);
  --pb2190-bg: #0a0e13;
  --pb2190-surface: #0e1319;
  --pb2190-surface-2: #111720;
  --pb2190-text: #edf2f8;
  --pb2190-muted: #919ba9;
  --pb2190-soft: #697482;
}

/* Shared premium label: text only, no purple chip. */
body#pulsebot-app:is(.dashboard-active-tickets,.dashboard-active-automod) .premium-inline-badge {
  display: inline !important;
  margin-left: 8px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #82aff8 !important;
  font-size: .66rem !important;
  font-weight: 600 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
  box-shadow: none !important;
}

/* Ticket panel and form lists. */
body#pulsebot-app.dashboard-active-tickets .ticket-panel-list,
body#pulsebot-app.dashboard-active-tickets .ticket-questions-section .message-list {
  display: grid !important;
  gap: 10px !important;
  margin-top: 14px !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-card,
body#pulsebot-app.dashboard-active-tickets .ticket-question-card {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 72px !important;
  display: grid !important;
  grid-template-columns: minmax(0,1fr) auto !important;
  gap: 18px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 15px 16px !important;
  border: 1px solid var(--pb2190-line) !important;
  border-radius: 11px !important;
  background: rgba(255,255,255,.018) !important;
  box-shadow: none !important;
  transform: none !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-card:hover,
body#pulsebot-app.dashboard-active-tickets .ticket-question-card:hover {
  border-color: var(--pb2190-line-strong) !important;
  background: rgba(255,255,255,.026) !important;
  transform: none !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-card-main {
  border-color: rgba(59,130,246,.18) !important;
  background: rgba(59,130,246,.035) !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-card-copy,
body#pulsebot-app.dashboard-active-tickets .ticket-question-card > div:first-child {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: 34px minmax(0,1fr) !important;
  gap: 13px !important;
  align-items: center !important;
}

body#pulsebot-app.dashboard-active-tickets .premium-panel-index {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 1px solid var(--pb2190-blue-line) !important;
  border-radius: 9px !important;
  background: var(--pb2190-blue-soft) !important;
  color: #a8c9ff !important;
  font-size: .68rem !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-card-text,
body#pulsebot-app.dashboard-active-tickets .ticket-question-card > div:first-child > div {
  min-width: 0 !important;
  display: grid !important;
  gap: 4px !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-card strong,
body#pulsebot-app.dashboard-active-tickets .ticket-question-card strong {
  color: var(--pb2190-text) !important;
  font-size: .84rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-card small,
body#pulsebot-app.dashboard-active-tickets .ticket-question-card span {
  max-width: 760px !important;
  overflow: hidden !important;
  color: var(--pb2190-muted) !important;
  font-size: .73rem !important;
  line-height: 1.5 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-card-actions,
body#pulsebot-app.dashboard-active-tickets .ticket-question-card .message-rule-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 7px !important;
  flex-wrap: wrap !important;
}

/* Ticket form counters — readable, no tiny boxed fractions. */
body#pulsebot-app.dashboard-active-tickets :is(.ticket-panels-section,.ticket-questions-section) .action-row {
  min-height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  margin-top: 18px !important;
  padding: 13px 0 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--pb2190-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panels-section,.ticket-questions-section) .counter-pill {
  width: auto !important;
  min-width: 50px !important;
  min-height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 9px !important;
  overflow: visible !important;
  border: 1px solid var(--pb2190-line) !important;
  border-radius: 8px !important;
  background: rgba(255,255,255,.025) !important;
  color: var(--pb2190-muted) !important;
  font-size: .72rem !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panels-section,.ticket-questions-section) .counter-pill > span {
  display: inline !important;
  min-width: 0 !important;
  color: #9fc3fc !important;
  font: inherit !important;
  font-weight: 600 !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panels-section,.ticket-questions-section) .action-row .notice {
  min-width: 0 !important;
  color: var(--pb2190-muted) !important;
  font-size: .76rem !important;
  line-height: 1.5 !important;
}

/* Ticket editors: quiet, structured and consistent. */
body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor,.ticket-question-editor) {
  padding: 18px !important;
  border: 0 !important;
  background: transparent !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor,.ticket-question-editor)::backdrop {
  background: rgba(0,0,0,.72) !important;
  backdrop-filter: blur(2px) !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) {
  width: min(840px, calc(100vw - 32px)) !important;
  max-height: min(88vh, 920px) !important;
  padding: 0 !important;
  overflow: auto !important;
  border: 1px solid var(--pb2190-line-strong) !important;
  border-radius: 15px !important;
  background: var(--pb2190-bg) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,.42) !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .modal-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
  min-height: 64px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin: 0 !important;
  padding: 0 20px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--pb2190-line) !important;
  background: rgba(10,14,19,.96) !important;
  backdrop-filter: blur(10px) !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .modal-head h3 {
  margin: 0 !important;
  color: var(--pb2190-text) !important;
  font-size: .95rem !important;
  font-weight: 600 !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) > :not(.modal-head):not(.savebar):not(input[type="hidden"]) {
  margin-left: 20px !important;
  margin-right: 20px !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) > .module-grid:first-of-type,
body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) > .field:first-of-type {
  margin-top: 22px !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .module-grid {
  gap: 18px 22px !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .field {
  margin-bottom: 20px !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .field label {
  color: #d9e0e9 !important;
  font-size: .82rem !important;
  font-weight: 600 !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) :is(input,select,textarea,.multi-picker-trigger) {
  border-color: var(--pb2190-line-strong) !important;
  border-radius: 9px !important;
  background: #090d12 !important;
  color: var(--pb2190-text) !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) :is(input,select,textarea,.multi-picker-trigger):focus {
  border-color: rgba(59,130,246,.52) !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,.10) !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-editor-card textarea {
  min-height: 108px !important;
  resize: vertical !important;
}

body#pulsebot-app.dashboard-active-tickets .ticket-panel-editor-card [data-ticket-panel-field="panelDescription"],
body#pulsebot-app.dashboard-active-tickets .ticket-panel-editor-card [data-ticket-panel-field="createdDescription"] {
  min-height: 132px !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .check {
  min-height: 50px !important;
  border-color: var(--pb2190-line) !important;
  border-radius: 9px !important;
  background: rgba(255,255,255,.018) !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .savebar {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 3 !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin: 10px 0 0 !important;
  padding: 16px 20px !important;
  border: 0 !important;
  border-top: 1px solid var(--pb2190-line) !important;
  background: rgba(10,14,19,.97) !important;
  backdrop-filter: blur(10px) !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .modal-close {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 1px solid var(--pb2190-line) !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #aeb7c3 !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .modal-close:hover {
  border-color: var(--pb2190-line-strong) !important;
  background: rgba(255,255,255,.035) !important;
  color: #fff !important;
}

/* Automod channel profiles and editor. */
body#pulsebot-app.dashboard-active-automod .automod-premium-profiles {
  border-color: var(--pb2190-line) !important;
  background: var(--pb2190-surface) !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-list {
  display: grid !important;
  gap: 10px !important;
  margin-top: 14px !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-card,
body#pulsebot-app.dashboard-active-automod .automod-escalation-card {
  min-width: 0 !important;
  padding: 14px 15px !important;
  border: 1px solid var(--pb2190-line) !important;
  border-radius: 11px !important;
  background: rgba(255,255,255,.018) !important;
  box-shadow: none !important;
  transform: none !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-card:hover,
body#pulsebot-app.dashboard-active-automod .automod-escalation-card:hover {
  border-color: var(--pb2190-line-strong) !important;
  background: rgba(255,255,255,.026) !important;
  transform: none !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-index {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border: 1px solid var(--pb2190-blue-line) !important;
  border-radius: 9px !important;
  background: var(--pb2190-blue-soft) !important;
  color: #a8c9ff !important;
  font-size: .7rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-card-copy strong,
body#pulsebot-app.dashboard-active-automod .automod-escalation-card strong {
  color: var(--pb2190-text) !important;
  font-weight: 600 !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-card-copy span,
body#pulsebot-app.dashboard-active-automod .automod-escalation-card span {
  color: var(--pb2190-muted) !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-editor-card,
body#pulsebot-app.dashboard-active-automod .automod-escalation-editor-card {
  border: 1px solid var(--pb2190-line-strong) !important;
  border-radius: 15px !important;
  background: var(--pb2190-bg) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,.42) !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-editor-card .form-section-mini,
body#pulsebot-app.dashboard-active-automod .automod-escalation-editor-card .form-section-mini {
  gap: 14px !important;
  padding: 17px !important;
  border: 1px solid var(--pb2190-line) !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.018) !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-editor-card .form-section-mini > strong {
  color: #dce3ec !important;
  font-size: .8rem !important;
  font-weight: 600 !important;
}

body#pulsebot-app.dashboard-active-automod .automod-day-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0,1fr)) !important;
  gap: 8px !important;
}

body#pulsebot-app.dashboard-active-automod .automod-day-grid label {
  min-width: 0 !important;
}

body#pulsebot-app.dashboard-active-automod .automod-day-grid span {
  min-width: 0 !important;
  min-height: 38px !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 8px !important;
  border: 1px solid var(--pb2190-line-strong) !important;
  border-radius: 8px !important;
  background: #090d12 !important;
  color: var(--pb2190-muted) !important;
  font-size: .72rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease !important;
}

body#pulsebot-app.dashboard-active-automod .automod-day-grid label:hover span {
  border-color: rgba(59,130,246,.28) !important;
  background: rgba(59,130,246,.035) !important;
  color: #c8d9f4 !important;
}

body#pulsebot-app.dashboard-active-automod .automod-day-grid input:checked + span {
  border-color: rgba(59,130,246,.52) !important;
  background: rgba(59,130,246,.12) !important;
  color: #d9e8ff !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-automod .automod-day-grid input:focus-visible + span {
  outline: 2px solid rgba(59,130,246,.35) !important;
  outline-offset: 2px !important;
}

body#pulsebot-app.dashboard-active-automod :is(.automod-profile-editor-card,.automod-escalation-editor-card) :is(input,select,textarea,.multi-picker-trigger) {
  border-color: var(--pb2190-line-strong) !important;
  border-radius: 9px !important;
  background: #090d12 !important;
  color: var(--pb2190-text) !important;
  box-shadow: none !important;
}

body#pulsebot-app.dashboard-active-automod :is(.automod-profile-editor-card,.automod-escalation-editor-card) :is(input,select,textarea,.multi-picker-trigger):focus {
  border-color: rgba(59,130,246,.52) !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,.10) !important;
}

body#pulsebot-app.dashboard-active-automod .automod-profile-card-actions .btn:hover,
body#pulsebot-app.dashboard-active-automod .automod-escalation-card .btn:hover,
body#pulsebot-app.dashboard-active-automod .automod-premium-profiles .btn:hover {
  border-color: rgba(59,130,246,.34) !important;
  background: rgba(59,130,246,.08) !important;
  color: #d9e8ff !important;
  box-shadow: none !important;
  transform: none !important;
}

@media (max-width: 720px) {
  body#pulsebot-app.dashboard-active-tickets .ticket-panel-card,
  body#pulsebot-app.dashboard-active-tickets .ticket-question-card {
    grid-template-columns: 1fr !important;
  }

  body#pulsebot-app.dashboard-active-tickets .ticket-panel-card-actions,
  body#pulsebot-app.dashboard-active-tickets .ticket-question-card .message-rule-actions {
    justify-content: flex-start !important;
  }

  body#pulsebot-app.dashboard-active-tickets .ticket-panel-card small,
  body#pulsebot-app.dashboard-active-tickets .ticket-question-card span {
    white-space: normal !important;
  }

  body#pulsebot-app.dashboard-active-tickets :is(.ticket-panels-section,.ticket-questions-section) .action-row {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  body#pulsebot-app.dashboard-active-automod .automod-day-grid {
    grid-template-columns: repeat(4, minmax(0,1fr)) !important;
  }
}

@media (max-width: 480px) {
  body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) {
    width: calc(100vw - 18px) !important;
    border-radius: 12px !important;
  }

  body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) > :not(.modal-head):not(.savebar):not(input[type="hidden"]) {
    margin-left: 14px !important;
    margin-right: 14px !important;
  }

  body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .modal-head,
  body#pulsebot-app.dashboard-active-tickets :is(.ticket-panel-editor-card,.ticket-question-editor .message-editor-card) .savebar {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  body#pulsebot-app.dashboard-active-automod .automod-day-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
}
