:root {
  --bg: #f4f5fb;
  --surface: #fff;
  --line: #e4e6f0;
  --line-strong: #d3d6e4;
  --text: #1e2233;
  --muted: #8a8fa3;
  --sidebar: #171a2b;
  --sidebar-soft: #242842;
  --primary: #6366f1;
  --primary-2: #9333ea;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #9333ea 100%);
  --primary-soft: #eef0ff;
  --primary-glow: rgba(99, 102, 241, 0.16);
  --green: #6366f1;
  --green-soft: #eef0ff;
  --success: #10b981;
  --success-soft: #e7f8f1;
  --amber: #d97706;
  --amber-soft: #fef4e2;
  --red: #ef4444;
  --red-soft: #fdecec;
  --blue: #3b82f6;
  --blue-soft: #e9f1fe;
  --shadow: 0 4px 20px rgba(99, 102, 241, 0.10);
  --shadow-hover: 0 8px 28px rgba(99, 102, 241, 0.18);
  --radius-card: 16px;
  --radius-modal: 20px;
  --radius-input: 12px;
  --radius-pill: 999px;
}
[hidden] {
  display: none !important;
}
.icon-button.mobile-back {
  display: none;
}
@media (max-width: 760px) {
  .icon-button.mobile-back {
    display: grid;
  }
}

/* Web parity modules and compact-navigation overrides. */
#mobile-more {
  display: none;
}
#utility-nav {
  border-top: 1px solid #333c43;
  margin-top: 12px;
  padding-top: 12px;
}
.sidebar {
  overflow-y: auto;
}
.broadcast-options {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.broadcast-options summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 650;
  list-style: none;
}
.broadcast-options summary span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.broadcast-options summary svg {
  width: 16px;
  color: var(--green);
}
.broadcast-option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding-top: 12px;
}
.broadcast-option-grid > label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}
.broadcast-option-grid input,
.broadcast-option-grid select,
.broadcast-option-grid textarea {
  width: 100%;
}
.broadcast-option-grid textarea {
  min-height: 76px;
  resize: vertical;
}
.broadcast-option-grid .broadcast-wide {
  grid-column: span 2;
}
.broadcast-option-grid .check-field {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.broadcast-option-grid .check-field input {
  width: auto;
}
.broadcast-option-grid .check-field span {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}
.operations-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.operations-tabs button {
  min-height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
}
.operations-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--green);
  font-weight: 650;
}
.operation-panel {
  display: none;
}
.operation-panel.active {
  display: block;
}
.listener-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.listener-field {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 12px;
}
.listener-field header {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.listener-field header span,
.listener-field header label,
.listener-field > label > span {
  color: var(--muted);
  font-size: 12px;
}
.listener-field textarea,
.listener-field select {
  width: 100%;
}
.listener-source-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.listener-account-list {
  height: 118px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-bottom: 8px;
  padding: 4px;
}
.listener-account-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 7px;
}
.listener-account-list label + label {
  border-top: 1px solid var(--line);
}
.listener-policy {
  display: grid;
  grid-template-columns: repeat(5, minmax(105px, 1fr)) repeat(2, auto);
  gap: 9px;
  align-items: end;
  margin-top: 10px;
}
.listener-policy > label > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.listener-policy input[type="number"] {
  width: 100%;
}
.listener-policy > label > div {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 5px;
}
.listener-policy b {
  color: var(--muted);
  font-size: 11px;
}
.listener-check {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.listener-preview {
  min-height: 44px;
  margin-top: 10px;
  padding: 9px 11px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.listener-actions {
  margin-top: 8px;
}
.listener-results-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.8fr) minmax(620px, 1.2fr);
  gap: 12px;
}
.listener-results-grid > section {
  min-width: 0;
}
.listener-results-grid .section-header {
  margin-top: 6px;
}
.operation-panel .toolbar > input[type="number"] {
  width: 130px;
}
.operation-panel .toolbar > input:not([type]) {
  min-width: 180px;
}
.rule-editor {
  grid-template-columns: minmax(150px, 0.6fr) minmax(150px, 0.6fr) auto minmax(280px, 1.4fr) auto;
}
.rule-editor textarea {
  grid-column: auto;
}
.mobile-menu {
  display: none;
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }
  .sidebar {
    height: calc(62px + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .sidebar nav {
    grid-template-columns: repeat(5, 1fr);
  }
  #utility-nav {
    display: none;
  }
  #main-nav > button {
    display: none;
  }
  #main-nav > button[data-task-center],
  #main-nav > button[data-action="send_group_campaign"],
  #main-nav > button[data-action="join_group"],
  #main-nav > button[data-view="support"],
  #main-nav > #mobile-more {
    display: flex;
  }
  .view {
    min-height: calc(100dvh - 146px - env(safe-area-inset-bottom));
  }
  .broadcast-option-grid {
    grid-template-columns: 1fr 1fr;
  }
  .broadcast-option-grid .broadcast-wide {
    grid-column: 1 / -1;
  }
  .rule-editor {
    grid-template-columns: 1fr;
  }
  .listener-policy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .listener-results-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .rule-editor textarea {
    grid-column: 1;
  }
  .mobile-menu:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
  }
  .mobile-menu-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(20, 27, 31, 0.5);
  }
  .mobile-menu-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-radius: 8px 8px 0 0;
    padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(20, 27, 31, 0.2);
  }
  .mobile-menu-sheet header {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
  }
  .mobile-menu-sheet > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .mobile-menu-sheet > div > button {
    min-height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
  }
  .mobile-menu-sheet svg {
    width: 18px;
    color: var(--green);
  }
}

@media (max-width: 520px) {
  .inline-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .inline-editor button {
    width: 100%;
  }
  .task-basics,
  .task-input-grid,
  .task-editor.grouped-scope .task-basics {
    grid-template-columns: minmax(0, 1fr);
  }
  .task-input-grid .task-target-source,
  .task-input-grid .task-targets,
  .task-input-grid .task-message,
  .task-input-grid .task-destination,
  .task-input-grid .task-limit,
  .task-input-grid .task-participant-dedupe,
  .task-input-grid .task-backfill {
    grid-column: 1;
  }
  .task-steps {
    grid-template-columns: 34px 1fr 34px;
  }
  .task-steps button span {
    display: none;
  }
  .broadcast-option-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .listener-config-grid,
  .listener-policy,
  .listener-source-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .listener-check {
    white-space: normal;
  }
  .broadcast-option-grid .broadcast-wide {
    grid-column: 1;
  }
  .workspace {
    overflow-x: hidden;
  }
}

.batch-state-stack,
.invite-result-summary-head,
.task-target-guidance {
  align-items: center;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.target-state-badge {
  display: inline-flex;
  margin-left: 6px;
}
.invite-result-summary {
  border-bottom: 1px solid var(--line, #e5e7eb);
  padding: 12px 0 14px;
}
.invite-result-summary-head {
  justify-content: space-between;
}
.invite-result-summary-head > span:not(.badge) {
  color: var(--muted, #667085);
  font-size: 12px;
}
.target-result-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-height: 96px;
  overflow: auto;
}
.target-result-chip {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 999px;
  font-size: 12px;
  padding: 3px 8px;
}
.target-result-chip.verified { color: #18794e; }
.target-result-chip.pending_verification { color: #9a6700; }
.target-result-chip.failed { color: #b42318; }
.target-result-chip.cancelled { color: #667085; }
.task-target-guidance {
  border-left: 3px solid #d69e2e;
  color: var(--muted, #667085);
  margin-bottom: 10px;
  padding: 7px 10px;
}

/* Customer service workspace */
body[data-view="support"] .workspace {
  padding: 0;
}
body[data-view="support"] .topbar {
  display: none;
}
body[data-view="support"] #view-support.support-view.active {
  height: auto;
  min-height: 0;
  display: block;
}
#view-support.support-view {
  --support-blue: #3390ec;
  --support-blue-soft: #e6f2fd;
  --support-canvas: #dfe8ee;
  --support-ink: #202b33;
  --support-subtle: #70808c;
  padding: 0;
  margin: 0;
}
.support-workbench {
  height: 100vh;
  min-height: 580px;
  grid-template-columns: 72px 360px minmax(520px, 1fr);
  border-top: 0;
  background: #fff;
}
.support-account-pane {
  grid-template-rows: 64px minmax(0, 1fr) 52px;
  border-right-color: #dce3e8;
  background: #f3f6f8;
}
.support-account-header {
  min-height: 64px;
  grid-template-columns: 1fr;
  justify-items: center;
  border-bottom-color: #dce3e8;
  padding: 10px;
}
.support-product-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #3390ec;
}
.support-account-header .support-account-copy,
.support-account-header .support-icon-button,
.support-team-summary,
.support-account-item .support-account-identity,
.support-account-footer .support-account-copy {
  display: none;
}
.support-account-copy strong {
  color: #253238;
  font-size: 13px;
}
.support-team-summary {
  padding: 16px 13px 6px;
  text-transform: none;
}
.support-account-list {
  padding: 7px;
}
.support-account-item {
  min-height: 58px;
  grid-template-columns: 46px;
  justify-content: center;
  border-radius: 8px;
  padding: 6px;
}
.support-account-item:hover {
  background: #e5ebef;
}
.support-account-item.active {
  background: #dbeeff;
  box-shadow: inset 3px 0 #3390ec;
}
.support-account-item.active .support-account-identity strong {
  color: #2679c5;
}
.support-account-item > b,
.conversation .unread {
  background: #3390ec;
}
.support-account-item > b {
  position: absolute;
  top: 2px;
  right: 0;
  border: 2px solid #f3f6f8;
}
.support-account-footer {
  display: grid;
  place-items: center;
  border-top-color: #dce3e8;
  background: #f3f6f8;
  padding: 0;
}
.support-account-footer .support-online-dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 5px #e2f5eb;
}
.support-inbox-pane {
  border-right-color: #dce3e8;
}
.support-inbox-header {
  padding: 10px 12px 9px;
  border-bottom-color: #dce3e8;
}
.support-inbox-title strong {
  color: #253238;
  font-size: 15px;
}
.support-search {
  height: 38px;
  border-color: #d6dfe0;
  border-radius: 6px;
  background: #f3f6f6;
}
.support-search:focus-within {
  border-color: #77b7ee;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.12);
}
.support-state-tabs {
  border: 0;
  border-radius: 5px;
  padding: 3px;
  background: #eef2f2;
}
.support-state-tabs button {
  height: 29px;
  border: 0;
  border-radius: 4px;
}
.support-state-tabs button.active {
  border: 0;
  background: #fff;
  color: #247bc8;
  box-shadow: 0 1px 3px rgba(33, 52, 57, 0.12);
}
.conversation-list {
  scrollbar-color: #c4cdce transparent;
}
.conversation {
  min-height: 88px;
  grid-template-columns: 18px 44px minmax(0, 1fr) auto;
  gap: 9px;
  border-bottom-color: #e8eded;
  padding: 10px 12px 10px 8px;
}
.conversation:hover {
  background: #f4f8f7;
}
.conversation.active {
  background: #3390ec;
  color: #fff;
  box-shadow: none;
}
.conversation.active .conversation-content p,
.conversation.active .conversation-content footer,
.conversation.active .conversation-content time,
.conversation.active .conversation-state {
  color: rgba(255, 255, 255, 0.78);
}
.conversation.active .conversation-content header strong,
.conversation.active .draft-indicator {
  color: #fff;
}
.conversation.active .conversation-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.conversation.active .unread {
  background: #fff;
  color: #3390ec;
}
.conversation-content header strong {
  font-size: 13px;
}
.conversation-content p {
  margin: 6px 0;
  color: #66757b;
  font-size: 11px;
}
.conversation-content footer {
  color: #879297;
}
.draft-indicator {
  margin-right: 4px;
  color: #c14c45;
  font-weight: 650;
}
.conversation-tag {
  border-radius: 3px;
  padding: 2px 5px;
  background: #fff1cf;
  color: #8a6418;
}
.support-batch-bar {
  background: #f8faf9;
}
.chat-pane {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  background: var(--support-canvas);
}
.support-chat-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}
.support-chat-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--support-canvas);
}
.chat-header {
  min-height: 58px;
  gap: 10px;
  border-bottom-color: #dce3e8;
  padding: 8px 14px;
}
.chat-header > .support-avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}
.support-chat-identity strong {
  color: #253238;
  font-size: 14px;
}
.support-header-account {
  display: none;
}
.support-context-bar {
  display: none;
}
.support-context-bar .support-route {
  color: #3390ec;
}
.support-message-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.messages {
  height: 100%;
  gap: 6px;
  padding: 20px clamp(18px, 3vw, 52px);
  background: #dfe8ee;
  scrollbar-color: #becaca transparent;
}
.support-message-day span {
  background: #859493;
}
.bubble {
  max-width: min(76%, 640px);
  border: 1px solid #e0e7e6;
  border-radius: 7px 7px 7px 2px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 49, 52, 0.08);
  padding: 8px 10px 6px;
}
.bubble.outgoing {
  border-color: #c9eab3;
  border-radius: 7px 7px 2px 7px;
  background: #e2ffc7;
}
.support-message-row.grouped {
  margin-bottom: -4px;
}
.support-avatar-spacer {
  width: 28px;
  height: 1px;
  flex: 0 0 28px;
}
.support-scroll-bottom {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #6e7e89;
  box-shadow: 0 2px 10px rgba(42, 61, 73, 0.2);
}
.support-scroll-bottom:hover {
  color: #3390ec;
}
.support-scroll-bottom svg {
  width: 19px;
}
.support-message-row.pending .bubble {
  opacity: 0.74;
}
.support-message-content {
  color: #27363b;
  font-size: 12px;
  line-height: 1.55;
}
.support-message-meta span {
  font-size: 8px;
}
.support-spin {
  animation: support-spin 0.9s linear infinite;
}
@keyframes support-spin {
  to { transform: rotate(360deg); }
}
.composer {
  border-top-color: #d5dede;
  padding: 8px 12px 9px;
  background: #fff;
}
.support-composer-toolbar {
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
}
.support-composer-toolbar .support-quick-select {
  min-width: 0;
  margin: 0;
}
.support-quick-select select {
  max-width: 240px;
  height: 29px;
  color: #4f6065;
}
.support-composer-toolbar .support-icon-button {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}
.support-emoji-control {
  position: relative;
  flex: 0 0 auto;
}
.support-emoji-control > .support-icon-button {
  width: 42px;
  height: 44px;
  color: #7b8992;
}
.support-emoji-menu {
  position: absolute;
  z-index: 12;
  left: 0;
  bottom: 52px;
  width: 244px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  border: 1px solid #d7e0e5;
  border-radius: 7px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 8px 28px rgba(36, 54, 66, 0.2);
}
.support-emoji-menu button {
  width: 44px;
  height: 40px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 20px;
}
.support-emoji-menu button:hover {
  background: #e9f3fc;
}
.support-delivery-route {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  overflow: hidden;
  color: #738086;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-delivery-route svg {
  width: 13px;
  color: #3390ec;
}
.composer .support-compose-row textarea {
  min-height: 44px;
  height: 44px;
  border-color: #cfdadb;
  border-radius: 6px;
  padding: 10px 12px;
}
.composer .support-compose-row textarea:focus {
  border-color: #77b7ee;
  box-shadow: 0 0 0 3px rgba(51, 144, 236, 0.12);
}
.support-send-button {
  height: 44px;
  border-color: #3390ec;
  border-radius: 6px;
  background: #3390ec;
  padding: 0 16px;
}
.support-send-button:hover:not(:disabled) {
  background: #2782d8;
}
.support-send-button:disabled {
  border-color: #aebbbc;
  background: #aebbbc;
}
.support-composer-footer {
  min-height: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 2px 0;
  color: #879297;
  font-size: 8px;
}
.support-connection-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #397dad;
}
.support-connection-state svg {
  width: 11px;
  height: 11px;
}
.support-customer-panel {
  min-width: 0;
  min-height: 0;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid #d8e0e1;
  background: #fff;
}
.support-customer-panel > header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dfe6e7;
  padding: 10px 14px;
}
.support-customer-panel > header strong {
  color: #253238;
  font-size: 13px;
}
.support-customer-panel > header .support-icon-button {
  display: grid;
}
.chat-pane.profile-open .support-chat-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
}
.chat-pane.profile-open .support-customer-panel {
  display: grid;
}
.support-customer-scroll {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: #c4cdce transparent;
}
.support-profile-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid #e5ebeb;
  padding: 20px 14px 18px;
  text-align: center;
}
.support-profile-summary .support-avatar {
  width: 58px;
  height: 58px;
  flex-basis: 58px;
  margin-bottom: 10px;
  font-size: 19px;
}
.support-profile-summary strong {
  max-width: 100%;
  overflow: hidden;
  color: #253238;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-profile-summary > span {
  margin-top: 4px;
  color: #7a878c;
  font-size: 10px;
}
.support-profile-summary em {
  margin-top: 9px;
  border-radius: 10px;
  padding: 3px 8px;
  background: #e4f4ed;
  color: #237a5b;
  font-size: 9px;
  font-style: normal;
}
.support-profile-summary em.resolved {
  background: #eef1f2;
  color: #6f7a7f;
}
.support-detail-section {
  border-bottom: 1px solid #e7ecec;
  padding: 14px;
}
.support-detail-section h3,
.support-note-field > span {
  display: block;
  margin: 0 0 9px;
  color: #879296;
  font-size: 9px;
  font-weight: 650;
}
.support-detail-row {
  min-height: 29px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 5px;
  font-size: 10px;
}
.support-detail-row > span {
  color: #7c888d;
}
.support-detail-row > strong {
  overflow: hidden;
  color: #344247;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-detail-row > button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #829095;
}
.support-detail-row > button:hover {
  background: #e9f3fc;
  color: #3390ec;
}
.support-detail-row > button svg {
  width: 13px;
}
.support-contact-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: #e1e8e8;
}
.support-contact-stats > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #fff;
  padding: 4px;
}
.support-contact-stats strong {
  max-width: 100%;
  overflow: hidden;
  color: #344247;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-contact-stats span {
  color: #8a9599;
  font-size: 8px;
}
.support-customer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.support-customer-tags button {
  min-height: 26px;
  border: 1px solid #d9e1e1;
  border-radius: 4px;
  background: #fff;
  color: #66757a;
  padding: 0 8px;
  font-size: 9px;
}
.support-customer-tags button:hover {
  border-color: #7fb6b1;
}
.support-customer-tags button.active {
  border-color: #96c6f2;
  background: #e7f3fe;
  color: #2679c5;
}
.support-note-field textarea {
  width: 100%;
  resize: vertical;
  border-color: #d4dddd;
  border-radius: 5px;
  background: #f8fafa;
  padding: 8px;
  font-size: 10px;
  line-height: 1.5;
}
.support-note-field textarea:focus {
  border-color: #65aaa6;
  outline: 0;
}
.support-note-field small {
  display: block;
  margin-top: 5px;
  color: #96a0a4;
  font-size: 8px;
}
.support-chat-empty {
  height: 100%;
  min-height: 360px;
  gap: 7px;
  background: #edf2f1;
}
.support-chat-empty .support-empty-illustration {
  width: 58px;
  height: 58px;
  border: 1px solid #d9e4e2;
  border-radius: 8px;
  background: #fff;
  color: #3390ec;
  box-shadow: none;
}
.support-chat-empty strong {
  color: #344247;
}
.support-chat-empty span {
  color: #7c888d;
}

@media (max-width: 1440px) {
  .support-workbench {
    grid-template-columns: 72px 348px minmax(440px, 1fr);
  }
  .support-account-pane {
    grid-template-rows: 64px minmax(0, 1fr);
  }
  .support-account-header {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px;
  }
  .support-account-header .support-account-copy,
  .support-account-header .support-icon-button,
  .support-team-summary,
  .support-account-footer,
  .support-account-item .support-account-identity {
    display: none;
  }
  .support-account-list {
    padding: 7px;
  }
  .support-account-item {
    min-height: 58px;
    grid-template-columns: 42px;
    justify-content: center;
    padding: 8px;
  }
  .support-account-item > b {
    position: absolute;
    top: 3px;
    right: 1px;
  }
  .support-presence {
    left: auto;
    top: 38px;
    right: 8px;
  }
}

@media (max-width: 1280px) {
  .support-chat-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .support-customer-panel {
    position: absolute;
    z-index: 8;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 92%);
    display: none;
    box-shadow: -12px 0 30px rgba(31, 49, 52, 0.16);
  }
  .chat-pane.profile-open .support-customer-panel {
    display: grid;
  }
  .support-customer-panel > header .support-icon-button {
    display: grid;
  }
}

@media (max-width: 920px) and (min-width: 761px) {
  .support-workbench {
    grid-template-columns: 68px 320px minmax(300px, 1fr);
  }
  .support-header-account,
  .support-context-bar span:nth-child(2) {
    display: none;
  }
  .support-context-bar {
    gap: 8px;
  }
  .bubble {
    max-width: 84%;
  }
}

@media (max-width: 760px) {
  #view-support.support-view {
    margin: 0;
  }
  .support-workbench {
    height: calc(100dvh - 62px - env(safe-area-inset-bottom));
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 70px minmax(0, 1fr);
  }
  .support-account-pane {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid #d8e0e1;
  }
  .support-account-header {
    min-height: 0;
    border-right: 1px solid #d8e0e1;
    border-bottom: 0;
    padding: 8px;
  }
  .support-product-mark {
    width: 36px;
    height: 36px;
  }
  .support-account-list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
  }
  .support-account-item {
    width: 54px;
    min-width: 54px;
    min-height: 54px;
  }
  .support-inbox-header {
    padding: 9px 12px 8px;
  }
  .support-workbench .chat-pane {
    display: none;
  }
  #view-support .support-workbench .chat-pane {
    display: none;
  }
  .support-workbench.chat-open {
    display: block;
  }
  .support-workbench.chat-open .support-account-pane,
  .support-workbench.chat-open .support-inbox-pane {
    display: none;
  }
  .support-workbench.chat-open .chat-pane {
    width: 100%;
    height: 100%;
    display: block;
  }
  #view-support .support-workbench.chat-open .chat-pane {
    display: block;
  }
  .support-chat-layout {
    height: 100%;
  }
  .chat-header {
    min-height: 60px;
    padding: 8px 10px;
  }
  .chat-header .mobile-back {
    display: grid;
  }
  .chat-header > .support-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  .support-header-account {
    display: none;
  }
  .support-context-bar {
    min-height: 30px;
    padding: 5px 12px;
  }
  .support-context-bar span:nth-child(2) {
    display: none;
  }
  .messages {
    padding: 14px 10px;
  }
  .bubble {
    max-width: 86%;
  }
  .composer {
    padding: 6px 8px calc(7px + env(safe-area-inset-bottom));
  }
  .support-delivery-route {
    display: none;
  }
  .support-send-button {
    width: 44px;
    padding: 0;
  }
  .support-send-button span {
    display: none;
  }
  .support-customer-panel {
    width: 100%;
  }
  .support-emoji-menu {
    left: -2px;
    width: 224px;
    grid-template-columns: repeat(5, 40px);
  }
  .support-emoji-menu button {
    width: 40px;
  }
}

@media (max-width: 420px) {
  .conversation {
    grid-template-columns: 18px 40px minmax(0, 1fr) auto;
    padding-right: 9px;
  }
  .conversation .support-avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .support-message-row > .support-avatar {
    display: none;
  }
  .support-composer-footer .support-connection-state {
    display: none;
  }
  .support-composer-footer {
    justify-content: flex-end;
  }
}

/* Keep the production workspace above generic console selectors below. */
#view-support .conversation-list {
  height: auto;
  border: 0;
}
#view-support .conversation {
  padding: 10px 12px 10px 8px;
  border: 0;
  border-bottom: 1px solid #e8eded;
  background: #fff;
}
#view-support .conversation:hover {
  background: #f1f6fa;
}
#view-support .conversation.active {
  background: #3390ec;
  color: #fff;
  box-shadow: none;
}
#view-support .conversation-content p {
  margin: 6px 0;
  color: #66737b;
}
#view-support .chat-pane {
  display: block;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
#view-support .chat-header {
  padding: 8px 14px;
}
#view-support .chat-header > .support-header-account {
  display: none;
}
#view-support .messages {
  gap: 6px;
  padding: 20px clamp(18px, 3vw, 52px);
}
#view-support .bubble {
  max-width: min(76%, 640px);
  border: 1px solid #e0e7e6;
  padding: 8px 10px 6px;
  border-radius: 7px 7px 7px 2px;
  background: #fff;
}
#view-support .bubble.outgoing {
  border-color: #c9eab3;
  border-radius: 7px 7px 2px 7px;
  background: #e2ffc7;
}
#view-support .bubble time {
  display: inline;
  margin: 0;
}
#view-support .composer {
  padding: 8px 12px 9px;
}

@media (max-width: 760px) {
  #view-support .chat-header {
    padding: 8px 10px;
  }
  #view-support .messages {
    padding: 14px 10px;
  }
  #view-support .bubble {
    max-width: 86%;
  }
  #view-support .composer {
    padding: 6px 8px calc(7px + env(safe-area-inset-bottom));
  }
}

@layer support-legacy {
/* Legacy support defaults retained for properties not replaced above. */
#view-support.support-view {
  --support-blue: #287eb8;
  --support-blue-soft: #e9f3fa;
  --support-canvas: #e8eef1;
  padding: 0;
  margin: 0 -28px -28px;
  min-height: 0;
}
#view-support.support-view.active {
  display: block;
}
.support-workbench {
  height: calc(100vh - 88px);
  min-height: 560px;
  display: grid;
  grid-template-columns: 232px 372px minmax(420px, 1fr);
  overflow: hidden;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.support-account-pane,
.support-inbox-pane,
.chat-pane {
  min-width: 0;
  min-height: 0;
}
.support-account-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #f5f7f8;
  border-right: 1px solid var(--line);
}
.support-account-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.support-product-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--support-blue);
  color: #fff;
}
.support-product-mark svg {
  width: 20px;
}
.support-account-copy {
  min-width: 0;
}
.support-account-copy strong,
.support-account-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-account-copy strong {
  font-size: 13px;
}
.support-account-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.support-icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
}
.support-icon-button:hover,
.support-icon-button.active {
  background: var(--support-blue-soft);
  color: var(--support-blue);
}
.support-icon-button.primary {
  background: var(--support-blue);
  color: #fff;
}
.support-icon-button svg {
  width: 17px;
  height: 17px;
}
.support-team-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 7px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}
.support-team-summary strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
}
.support-account-list {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 5px 7px 12px;
}
.support-account-item {
  position: relative;
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.support-account-item:hover {
  background: #eaf0f3;
}
.support-account-item.active {
  background: #dcebf5;
}
.support-account-item.active .support-account-identity strong {
  color: #1c6799;
}
.support-account-item > b {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  padding: 0 5px;
  background: var(--support-blue);
  color: #fff;
  font-size: 10px;
}
.support-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  user-select: none;
}
.support-avatar.avatar-0 { background: #2f80b7; }
.support-avatar.avatar-1 { background: #368e72; }
.support-avatar.avatar-2 { background: #bd704d; }
.support-avatar.avatar-3 { background: #7b68a7; }
.support-avatar.avatar-4 { background: #b85467; }
.support-avatar.avatar-5 { background: #71824c; }
.support-all-avatar {
  background: #55636d;
}
.support-all-avatar svg {
  width: 18px;
}
.support-presence {
  position: absolute;
  left: 37px;
  top: 39px;
  width: 11px;
  height: 11px;
  border: 2px solid #f5f7f8;
  border-radius: 50%;
  background: var(--amber);
}
.support-account-item:hover .support-presence {
  border-color: #eaf0f3;
}
.support-account-item.active .support-presence {
  border-color: #dcebf5;
}
.support-presence.online {
  background: #28a875;
}
.support-account-identity {
  min-width: 0;
}
.support-account-identity strong,
.support-account-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-account-identity strong {
  font-size: 12px;
}
.support-account-identity small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}
.support-account-footer {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.support-online-dot,
.support-mini-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #28a875;
}
.support-inbox-pane {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
  background: #fff;
}
.support-inbox-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.support-inbox-title {
  min-height: 38px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.support-inbox-title > div {
  flex: 1;
  min-width: 0;
}
.support-inbox-title strong,
.support-inbox-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-inbox-title strong {
  font-size: 15px;
}
.support-inbox-title span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.support-search {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 10px;
  background: #f5f7f8;
}
.support-search:focus-within {
  border-color: #8dbbd9;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(40, 126, 184, 0.1);
}
.support-search svg {
  width: 16px;
  color: var(--muted);
}
.support-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
}
.support-inbox-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}
.support-state-tabs {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}
.support-state-tabs button {
  height: 31px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 5px;
  font-size: 11px;
}
.support-state-tabs button.active {
  border-bottom-color: var(--support-blue);
  color: var(--support-blue);
  font-weight: 650;
}
.support-select-all,
.conversation-check {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}
.support-select-all input,
.conversation-check input {
  accent-color: var(--support-blue);
}
.conversation-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
}
.conversation {
  position: relative;
  min-height: 86px;
  display: grid;
  grid-template-columns: 18px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px 12px 10px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.conversation:hover {
  background: #f4f8fa;
}
.conversation.active {
  background: var(--support-blue);
  color: #fff;
}
.conversation.active .conversation-content p,
.conversation.active .conversation-content footer,
.conversation.active .conversation-content time,
.conversation.active .conversation-state {
  color: rgba(255, 255, 255, 0.78);
}
.conversation-check {
  width: 18px;
  height: 24px;
  opacity: 0;
}
.conversation:hover .conversation-check,
.conversation-check:has(input:checked) {
  opacity: 1;
}
.conversation-check input {
  margin: 0;
}
.conversation-content {
  min-width: 0;
}
.conversation-content header,
.conversation-content footer {
  display: flex;
  align-items: center;
  gap: 7px;
}
.conversation-content header strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.conversation-content time {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}
.conversation-content p {
  margin: 5px 0;
  color: #66737b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.conversation-content footer {
  color: #88939a;
  font-size: 9px;
}
.conversation-content footer > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation-content footer > span:first-child {
  flex: 1;
}
.support-mini-dot {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
  background: var(--amber);
}
.support-mini-dot.online {
  background: #28a875;
}
.conversation-state svg {
  width: 11px;
  height: 11px;
}
.conversation .unread {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 5px;
  background: var(--support-blue);
  font-size: 9px;
}
.conversation.active .unread {
  background: #fff;
  color: var(--support-blue);
}
.support-list-empty,
.support-message-empty,
.support-chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}
.support-list-empty {
  min-height: 300px;
  gap: 7px;
  padding: 30px;
}
.support-list-empty svg {
  width: 26px;
}
.support-list-empty strong {
  color: var(--text);
  font-size: 13px;
}
.support-list-empty span {
  font-size: 10px;
}
.support-batch-bar {
  min-height: 0;
  height: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 0 12px;
  border-top: 0 solid var(--line);
  background: #fff;
  transition: height 0.16s ease;
}
.support-batch-bar.active {
  height: 54px;
  border-top-width: 1px;
}
.support-batch-bar > span {
  flex: 1;
  color: var(--muted);
  font-size: 11px;
}
.chat-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  background: var(--support-canvas);
}
.chat-pane > .support-chat-empty {
  grid-row: 1 / -1;
}
.support-chat-empty {
  gap: 6px;
}
.support-chat-empty > div {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border-radius: 50%;
  background: #fff;
  color: var(--support-blue);
  box-shadow: 0 2px 10px rgba(40, 58, 68, 0.08);
}
.support-chat-empty svg {
  width: 28px;
}
.support-chat-empty strong {
  color: #344149;
  font-size: 14px;
}
.support-chat-empty span {
  font-size: 10px;
}
.chat-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.chat-header .mobile-back {
  display: none;
}
.chat-header > .support-avatar {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}
.support-chat-identity {
  min-width: 0;
  flex: 1;
}
.support-chat-identity strong,
.support-chat-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-chat-identity strong {
  font-size: 14px;
}
.support-chat-identity small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}
.support-header-account {
  max-width: 230px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}
.support-header-account .support-avatar {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  font-size: 10px;
}
.support-header-account > span {
  min-width: 0;
}
.support-header-account small,
.support-header-account strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-header-account small {
  color: var(--muted);
  font-size: 8px;
}
.support-header-account strong {
  margin-top: 2px;
  font-size: 10px;
}
.support-context-bar {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 18px;
  border-bottom: 1px solid rgba(189, 201, 207, 0.8);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 9px;
}
.support-context-bar span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-context-bar svg {
  width: 12px;
  height: 12px;
}
.support-context-bar .support-route {
  margin-left: auto;
  color: var(--support-blue);
}
.messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px clamp(16px, 4vw, 64px);
  background: var(--support-canvas);
}
.support-message-day {
  align-self: center;
  margin: 8px 0;
}
.support-message-day span {
  display: block;
  border-radius: 12px;
  padding: 4px 10px;
  background: rgba(86, 108, 119, 0.72);
  color: #fff;
  font-size: 9px;
}
.support-message-row {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 7px;
}
.support-message-row.outgoing {
  justify-content: flex-end;
}
.support-message-row > .support-avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 9px;
}
.bubble {
  max-width: min(72%, 680px);
  align-self: auto;
  border-radius: 7px 7px 7px 2px;
  padding: 7px 9px 5px;
  background: #fff;
  color: #28343b;
  box-shadow: 0 1px 1px rgba(39, 56, 64, 0.12);
  line-height: 1.5;
}
.bubble.outgoing {
  align-self: auto;
  border-radius: 7px 7px 2px 7px;
  background: #dff2d7;
}
.support-message-content {
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 12px;
}
.support-message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 2px;
  color: #7c8b92;
}
.bubble time {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: 8px;
}
.support-message-meta svg {
  width: 12px;
  height: 12px;
  color: #4691bf;
}
.support-message-empty {
  flex: 1;
  gap: 7px;
  font-size: 10px;
}
.support-message-empty svg {
  width: 26px;
}
.composer {
  padding: 8px 12px 11px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.support-quick-select {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  color: var(--support-blue);
}
.support-quick-select svg {
  width: 15px;
}
.support-quick-select select {
  min-width: 0;
  max-width: 260px;
  height: 28px;
  border: 0;
  padding: 0 24px 0 2px;
  background: transparent;
  color: #52616a;
  font-size: 10px;
}
.support-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}
.composer .support-compose-row textarea {
  width: auto;
  min-width: 0;
  min-height: 42px;
  height: 42px;
  max-height: 120px;
  flex: 1;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  outline: 0;
  line-height: 20px;
}
.composer .support-compose-row textarea:focus {
  border-color: #8dbbd9;
  box-shadow: 0 0 0 2px rgba(40, 126, 184, 0.1);
}
.support-send-button {
  height: 42px;
  flex: 0 0 auto;
  border-color: var(--support-blue);
  border-radius: 6px;
  background: var(--support-blue);
  padding: 0 15px;
}
.support-send-button svg {
  width: 16px;
}

@media (max-width: 1250px) {
  .support-workbench {
    grid-template-columns: 78px 328px minmax(360px, 1fr);
  }
  .support-account-pane {
    grid-template-rows: auto minmax(0, 1fr);
  }
  .support-account-header {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 10px;
  }
  .support-account-header .support-account-copy,
  .support-account-header .support-icon-button,
  .support-team-summary,
  .support-account-footer,
  .support-account-item .support-account-identity {
    display: none;
  }
  .support-account-list {
    padding: 7px;
  }
  .support-account-item {
    min-height: 60px;
    grid-template-columns: 42px;
    justify-content: center;
    padding: 8px;
  }
  .support-account-item > b {
    position: absolute;
    top: 4px;
    right: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 8px;
  }
  .support-presence {
    left: auto;
    right: 9px;
    top: 39px;
  }
  .support-header-account {
    max-width: 150px;
  }
}

@media (max-width: 880px) and (min-width: 761px) {
  .support-workbench {
    grid-template-columns: 68px 290px minmax(300px, 1fr);
  }
  .support-header-account {
    display: none;
  }
  .support-context-bar span:nth-child(2) {
    display: none;
  }
  .conversation {
    grid-template-columns: 0 40px minmax(0, 1fr) auto;
    gap: 7px;
    padding-left: 9px;
  }
  .conversation-check {
    position: absolute;
    left: 4px;
    top: 5px;
    z-index: 1;
  }
}

@media (max-width: 760px) {
  #view-support.support-view {
    margin: 0 -12px -12px;
  }
  .support-workbench {
    height: calc(100dvh - 134px - env(safe-area-inset-bottom));
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 78px minmax(0, 1fr);
  }
  .support-account-pane {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    grid-template-rows: 78px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .support-account-header {
    min-height: 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 10px;
  }
  .support-product-mark {
    width: 38px;
    height: 38px;
  }
  .support-account-list {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 7px 8px;
  }
  .support-account-item {
    width: 58px;
    min-width: 58px;
    min-height: 58px;
  }
  .support-account-item > b {
    right: 1px;
  }
  .support-presence {
    right: 5px;
  }
  .support-inbox-pane {
    border-right: 0;
  }
  .support-inbox-header {
    padding: 9px 12px 8px;
  }
  .support-inbox-title {
    min-height: 34px;
  }
  .support-search {
    height: 36px;
  }
  .support-workbench .chat-pane {
    display: none;
  }
  .support-workbench.chat-open {
    display: block;
  }
  .support-workbench.chat-open .support-account-pane,
  .support-workbench.chat-open .support-inbox-pane {
    display: none;
  }
  .support-workbench.chat-open .chat-pane {
    width: 100%;
    height: 100%;
    display: grid;
  }
  .chat-header {
    min-height: 62px;
    padding: 8px 10px;
  }
  .chat-header .mobile-back {
    display: grid;
  }
  .chat-header > .support-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  .support-header-account {
    display: none;
  }
  .support-context-bar {
    min-height: 30px;
    padding: 5px 12px;
  }
  .support-context-bar span:nth-child(2) {
    display: none;
  }
  .messages {
    padding: 12px 10px;
  }
  .bubble {
    max-width: 84%;
  }
  .composer {
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .support-quick-select {
    margin-bottom: 3px;
  }
  .support-send-button {
    width: 42px;
    padding: 0;
    border-radius: 50%;
  }
  .support-send-button span {
    display: none;
  }
}

@media (max-width: 420px) {
  .support-state-tabs button {
    font-size: 10px;
  }
  .conversation {
    grid-template-columns: 18px 42px minmax(0, 1fr) auto;
    padding-right: 9px;
  }
  .conversation .support-avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .support-message-row > .support-avatar {
    display: none;
  }
}
}

/* Group library: persistent folder cards with focused link management. */
.group-library-header .summary {
  margin-left: auto;
}
.group-library-layout {
  min-height: calc(100dvh - 150px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.group-folder-pane {
  min-width: 0;
  padding: 14px 14px 14px 0;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
  gap: 10px;
}
.group-folder-pane > header,
.group-folder-pane > footer,
.group-link-header,
.group-library-dialog > header,
.group-library-dialog > footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-folder-pane h3,
.group-link-header h3 {
  margin: 0;
  font-size: 14px;
}
.group-folder-pane > header .summary {
  margin-left: auto;
}
.group-folder-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 7px;
}
.group-folder-create input {
  width: 100%;
}
.group-folder-list {
  min-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 1px 3px 1px 1px;
}
.group-folder-card {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  text-align: left;
}
.group-folder-card:hover {
  border-color: #9fc7b8;
  background: #f5faf8;
}
.group-folder-card.active {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 3px 0 0 var(--green);
}
.group-folder-card span,
.group-folder-card strong,
.group-folder-card small {
  display: block;
  min-width: 0;
}
.group-folder-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.group-folder-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-folder-card b {
  width: 30px;
  height: 25px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: #edf1f2;
  color: var(--muted);
  font-size: 11px;
}
.group-folder-card.active b {
  background: #cfe8de;
  color: #126649;
}
.group-folder-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}
.group-folder-pane > footer button {
  flex: 1;
}
.group-link-pane {
  min-width: 0;
  padding: 14px 0 14px 16px;
}
.group-link-header {
  min-height: 42px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.group-link-header > div span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.group-link-editor {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 6px;
}
.group-link-editor textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
}
.group-link-editor .command {
  height: auto;
  min-width: 112px;
}
.group-link-toolbar {
  flex-wrap: nowrap;
}
.group-link-toolbar .search {
  min-width: 180px;
  flex: 1;
}
.group-link-toolbar select {
  width: 150px;
}
.group-link-table {
  max-height: calc(100dvh - 352px);
  min-height: 260px;
  overflow: auto;
}
.group-link-table th:first-child,
.group-link-table td:first-child {
  width: 42px;
  text-align: center;
}
.group-link-table th:nth-child(3),
.group-link-table td:nth-child(3) {
  width: 28%;
}
.group-link-table th:last-child,
.group-link-table td:last-child {
  width: 170px;
}
.group-library-dialog {
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  background: var(--surface);
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}
.group-library-dialog > header {
  margin-bottom: 14px;
}
.group-library-dialog > header > div {
  flex: 1;
}
.group-library-dialog > header strong,
.group-library-dialog > header span {
  display: block;
}
.group-library-dialog > header span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.group-library-dialog-fields {
  display: grid;
  gap: 11px;
}
.group-library-dialog-fields label > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.group-library-dialog-fields input,
.group-library-dialog-fields textarea {
  width: 100%;
}
.group-library-dialog-fields textarea {
  resize: vertical;
}
.group-library-dialog > footer {
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .group-library-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .group-link-toolbar {
    flex-wrap: wrap;
  }
  .group-link-toolbar .search {
    flex-basis: 100%;
  }
}
@media (max-width: 680px) {
  .group-library-layout {
    display: block;
    min-height: 0;
  }
  .group-folder-pane {
    padding: 12px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: block;
  }
  .group-folder-create,
  .group-folder-list,
  .group-folder-pane > footer {
    margin-top: 9px;
  }
  .group-folder-list {
    min-height: 0;
    max-height: 198px;
  }
  .group-link-pane {
    padding: 14px 0;
  }
  .group-link-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .group-link-editor .command {
    height: 36px;
  }
  .group-link-toolbar select {
    width: min(160px, 100%);
  }
  .group-link-table {
    max-height: none;
  }
}

.notification-button {
  position: relative;
}
.notification-button b {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
}
.notification-center:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: block;
}
.notification-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(20, 27, 31, 0.38);
}
.notification-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: var(--surface);
  box-shadow: -8px 0 28px rgba(20, 27, 31, 0.18);
}
.notification-drawer > header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}
.notification-drawer > header strong,
.notification-drawer > header span {
  display: block;
}
.notification-drawer > header span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.notification-settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}
.notification-settings label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}
.notification-list {
  overflow-y: auto;
}
.notification-item {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  padding: 12px 14px;
}
.notification-item.unread {
  background: #f2faf7;
}
.notification-item > i,
.notification-item > svg {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  padding: 7px;
  background: var(--green-soft);
  color: var(--green);
}
.notification-item.error > i,
.notification-item.error > svg {
  background: var(--red-soft);
  color: var(--red);
}
.notification-item.warning > i,
.notification-item.warning > svg {
  background: var(--amber-soft);
  color: var(--amber);
}
.notification-item strong,
.notification-item span {
  display: block;
}
.notification-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.notification-item time {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.notification-drawer > footer {
  min-height: 58px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
@media (max-width: 520px) {
  .notification-drawer {
    top: 58px;
    width: 100%;
    border-radius: 8px 8px 0 0;
  }
  .notification-settings #browser-notification-toggle {
    width: 100%;
  }
  .notification-drawer > footer button {
    flex: 1;
  }
}
.task-editor {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}
#view-tasks.focused-task .template-fold,
#view-tasks.focused-task .task-scope-bar {
  display: none;
}
#view-tasks.focused-task .task-basics {
  grid-template-columns: minmax(220px, 1fr) 200px;
}
@media (max-width: 760px) {
  #view-tasks.focused-task .task-basics {
    grid-template-columns: minmax(0, 1fr);
  }
}
.task-steps {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(20px, 70px) minmax(110px, 1fr);
  align-items: center;
  max-width: 520px;
  margin: 0 auto 14px;
}
.task-steps > i {
  height: 1px;
  background: var(--line-strong);
}
.task-steps button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px;
}
.task-steps button b {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  font-size: 12px;
}
.task-steps button.active {
  color: var(--text);
  font-weight: 650;
}
.task-steps button.active b {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
.task-steps button.done b {
  border-color: var(--green);
  color: var(--green);
}
.task-steps button:disabled {
  cursor: default;
  opacity: 0.58;
}
.task-step-panel {
  display: none;
  min-height: 238px;
  animation: task-panel-in 0.16s ease-out;
}
.task-step-panel.active {
  display: block;
}
@keyframes task-panel-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.task-input-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 180px 190px;
  gap: 10px;
}
.task-basics {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 200px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.task-scope-bar {
  min-height: 48px;
  display: grid;
  grid-template-columns: 78px minmax(240px, 360px) 1fr;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.task-scope-bar > span {
  color: var(--muted);
  font-size: 11px;
}
.task-scope-bar > small {
  justify-self: end;
  color: var(--muted);
}
.task-assignment-editor {
  display: grid;
  gap: 14px;
}
.assignment-group {
  border-top: 1px solid var(--line-strong);
  padding-top: 12px;
}
.assignment-group:first-child {
  border-top: 0;
  padding-top: 0;
}
.assignment-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.assignment-group > header strong,
.assignment-group > header span {
  display: block;
}
.assignment-group > header span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.assignment-members {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin-bottom: 10px;
}
.assignment-members > span {
  color: var(--muted);
  font-size: 11px;
  padding-top: 7px;
}
.assignment-members > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.assignment-account-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
  background: #f7f9f9;
  cursor: pointer;
}
.assignment-account-chip.selected {
  border-color: #8fc8b6;
  background: var(--green-soft);
}
.assignment-account-chip input {
  width: auto;
}
.assignment-fields {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(200px, 0.9fr) minmax(260px, 1.4fr) minmax(260px, 1.4fr);
  gap: 9px;
}
.assignment-fields > label > span,
.assignment-destination > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.assignment-fields select,
.assignment-fields input,
.assignment-fields textarea {
  width: 100%;
}
.assignment-targets,
.assignment-message {
  min-width: 0;
}
.assignment-content-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #b9d7c8;
  background: #f1f8f4;
  border-radius: 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}
.assignment-content-status.incomplete {
  border-color: #dfc583;
  background: #fff8e9;
  color: #966b0b;
}
.assignment-content-status svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.assignment-targets > span {
  display: flex !important;
  justify-content: space-between;
}
.assignment-targets b {
  color: var(--green);
}
.assignment-fields textarea {
  height: 88px;
  resize: vertical;
}
.assignment-destination {
  grid-column: 3/5;
}
.assignment-destination > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.compact-segmented {
  width: 100%;
}
.assignment-add {
  justify-self: start;
}
.task-input-grid .task-targets {
  grid-column: 1/3;
}
.task-input-grid .task-target-source {
  grid-column: 1/5;
}
.task-target-source-inputs {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr);
  gap: 9px;
  max-width: 620px;
}
.task-target-source-inputs select[hidden] {
  display: none;
}
.task-targets textarea[readonly],
.assignment-targets textarea[readonly] {
  background: #f1f4f4;
  color: var(--muted);
}
.task-input-grid .task-message {
  grid-column: 3/5;
}
.task-input-grid .task-destination {
  grid-column: 1/3;
}
.task-input-grid .task-participant-dedupe {
  grid-column: 3/5;
}
.task-participant-dedupe > label {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.task-input-grid textarea {
  min-height: 150px;
}
.task-review-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.task-review-head strong,
.task-review-head span {
  display: block;
}
.task-review-head > div > span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.task-review {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.task-review-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: 20px 90px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}
.task-review-row svg {
  width: 17px;
  color: var(--green);
}
.task-review-row span {
  color: var(--muted);
  font-size: 11px;
}
.task-review-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.task-run-head {
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 11px;
}
.task-run-head strong,
.task-run-head span {
  display: block;
}
.task-run-head > div:nth-child(2) > span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.task-run-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
}
.task-run-mark.done {
  background: var(--green-soft);
  color: var(--green);
}
.task-run-mark.failed {
  background: var(--red-soft);
  color: var(--red);
}
.task-run-mark svg {
  width: 18px;
}
.task-run-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.task-run-metrics > div {
  border-right: 1px solid var(--line);
  padding: 0 12px;
}
.task-run-metrics > div:first-child {
  padding-left: 0;
}
.task-run-metrics > div:last-child {
  border-right: 0;
}
.task-run-metrics span,
.task-run-metrics strong {
  display: block;
}
.task-run-metrics span {
  color: var(--muted);
  font-size: 10px;
}
.task-run-metrics strong {
  font-size: 19px;
  margin-top: 4px;
}
.task-run-overall {
  border-bottom: 1px solid var(--line);
  padding: 9px 0 11px;
}
.task-run-overall-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.task-run-overall-head strong {
  color: var(--green);
  font-size: 15px;
}
.task-run-overall-head span {
  color: var(--muted);
  font-size: 10px;
}
.task-run-overall-track {
  height: 7px;
  border-radius: 4px;
  background: #dfe5e7;
  overflow: hidden;
}
.task-run-overall-track i {
  display: block;
  height: 100%;
  background: var(--green);
  transition: width 0.22s ease;
}
.task-run-guidance {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.task-run-guidance-main {
  display: flex;
  align-items: center;
  gap: 9px;
}
.task-run-guidance-main > svg {
  width: 18px;
  color: var(--green);
}
.task-run-guidance-main strong,
.task-run-guidance-main span {
  display: block;
}
.task-run-guidance-main span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.task-run-errors {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow: hidden;
}
.task-run-errors > span {
  min-width: 0;
  max-width: 210px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  background: var(--red-soft);
  color: #963b3b;
  padding: 0 8px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-run-errors b {
  flex: 0 0 auto;
}
.task-run-controls {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.danger-command {
  color: var(--red);
  border-color: #e1bcbc;
}
.task-run-controls button:disabled {
  cursor: wait;
  opacity: 0.6;
}
.task-run-accounts {
  max-height: 214px;
  overflow: auto;
}
.task-run-account {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(160px, 1.3fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.task-run-account > div:first-child strong,
.task-run-account > div:first-child span {
  display: block;
}
.task-run-account > div:first-child span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.task-run-progress {
  height: 6px;
  border-radius: 3px;
  background: #dfe5e7;
  overflow: hidden;
}
.task-run-progress i {
  display: block;
  height: 100%;
  background: var(--green);
}
.task-field-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 2px rgba(179, 70, 70, 0.1) !important;
}
.automation-bar {
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr) 36px;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
}
.automation-bar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.automation-bar-title > svg {
  width: 20px;
  color: var(--green);
}
.automation-bar-title strong,
.automation-bar-title span,
.pool-stat span,
.pool-stat strong {
  display: block;
}
.automation-bar-title span,
.pool-stat span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.pool-stat {
  min-height: 38px;
  border-left: 1px solid var(--line);
  padding-left: 13px;
}
.pool-stat strong {
  margin-top: 3px;
  font-size: 17px;
}
.pool-stat.selected strong {
  color: var(--green);
}
.pool-summary {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.template-fold {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.template-fold > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 2px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}
.template-fold > summary::-webkit-details-marker {
  display: none;
}
.template-fold > summary svg {
  width: 15px;
  height: 15px;
}
.template-fold .fold-caret {
  margin-left: auto;
  transition: transform 0.15s ease;
}
.template-fold[open] .fold-caret {
  transform: rotate(180deg);
}
.template-fold .template-toolbar {
  min-height: 0;
  border-bottom: 0;
  margin-bottom: 0;
  padding: 0 2px 10px;
}
.task-advanced {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 4px;
}
.task-advanced > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  list-style: none;
}
.task-advanced > summary::-webkit-details-marker {
  display: none;
}
.task-advanced > summary svg {
  width: 15px;
  height: 15px;
}
.task-advanced-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(200px, 260px);
  gap: 10px;
  padding: 0 2px 6px;
}
@media (max-width: 760px) {
  .task-advanced-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.task-policy {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  padding: 4px 2px 8px;
}
.task-policy-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-policy-section .task-advanced-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  padding: 0;
}
.task-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.task-policy .check-field {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  font-size: 13px;
}
.task-policy .check-field input {
  width: auto;
}
.task-daily-preview {
  color: var(--muted);
  font-size: 12px;
}
.task-confirm-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.task-confirm-summary span {
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
}
.template-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 10px;
}
.template-toolbar > div:first-child {
  margin-right: auto;
}
.template-toolbar strong,
.template-toolbar span {
  display: block;
}
.template-toolbar select {
  min-width: 260px;
}
.account-login-band {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  margin-bottom: 12px;
}
.account-login-band > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}
.account-login-band > summary::-webkit-details-marker { display: none; }
.account-login-band > summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.account-login-band > summary > span svg { color: var(--green); }
.account-login-band > summary small {
  margin-left: auto;
  color: var(--muted);
}
.account-login-band > summary > svg {
  width: 17px;
  color: var(--muted);
  transition: transform 0.16s ease;
}
.account-login-band[open] > summary > svg { transform: rotate(180deg); }
.account-login-content {
  padding: 12px;
  border-top: 1px solid var(--line);
}
.account-console-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 10px;
}
.account-console-metrics > div {
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.account-console-metrics span,
.account-console-metrics strong { display: block; }
.account-console-metrics span { color: var(--muted); font-size: 11px; }
.account-console-metrics strong { margin-top: 3px; font-size: 20px; }
.account-login-head {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(330px, 1fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}
.account-login-head > div:first-child strong,
.account-login-head > div:first-child span,
.account-login-head label > span,
.auth-panel label > span {
  display: block;
}
.account-login-head > div:first-child span,
.account-login-head label > span,
.auth-panel label > span {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}
#auth-method-tabs {
  grid-template-columns: repeat(3, 1fr);
}
.auth-panel {
  display: none;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
  align-items: end;
  gap: 10px;
}
.auth-panel.active {
  display: grid;
}
.auth-panel label input,
.account-login-head label input {
  width: 100%;
}
.auth-captcha {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-captcha img {
  width: auto;
  height: 38px;
  max-width: 160px;
  object-fit: contain;
  border: 1px solid var(--line);
}
.auth-captcha input {
  min-width: 110px;
}
.auth-captcha a {
  white-space: nowrap;
  color: var(--green);
  font-size: 12px;
}
.auth-status {
  min-height: 20px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.auth-status.error {
  color: var(--red);
}
.account-management {
  display: block;
}
.account-management .table-wrap {
  max-width: 100%;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(12, 24, 20, 0.45);
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] {
  display: none;
}
.modal-card {
  display: flex;
  flex-direction: column;
  width: min(680px, 100%);
  max-height: min(86vh, 860px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(12, 24, 20, 0.28);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.modal-head strong {
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-body {
  overflow-y: auto;
  padding: 16px;
  flex: 1 1 auto;
}
body.modal-open {
  overflow: hidden;
}
.account-detail-head-side {
  display: flex;
  align-items: center;
  gap: 10px;
}
.account-modal-support {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.account-modal-support input {
  width: auto;
  margin: 0;
}
#accounts-body tr {
  cursor: pointer;
}
#accounts-body tr.active-row td {
  background: #edf6f2;
}
.account-service-toggles {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.account-service-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}
.account-detail {
  min-height: 200px;
}
.account-detail-head,
.account-parameter-head,
.account-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.account-detail-head {
  justify-content: space-between;
  margin-bottom: 14px;
}
.account-detail-head strong,
.account-detail-head span {
  display: block;
}
.account-detail-head span,
.account-detail label > span {
  color: var(--muted);
  font-size: 11px;
}
.account-identity-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.account-identity-summary > span {
  min-width: 0;
  padding: 7px 9px;
  background: #f4f7f6;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.account-identity-summary b,
.account-identity-summary small { display: block; overflow: hidden; text-overflow: ellipsis; }
.account-identity-summary b { white-space: nowrap; font-size: 12px; }
.account-identity-summary small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.account-task-console {
  padding: 11px 0 13px;
  margin-bottom: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.account-task-console > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.account-task-console > header strong,
.account-task-console > header span { display: block; }
.account-task-console > header span { color: var(--muted); font-size: 10px; margin-top: 2px; }
.account-task-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 8px;
}
.account-task-metrics span {
  padding: 6px 4px;
  text-align: center;
  color: var(--muted);
  background: #f4f7f6;
  border-radius: 4px;
  font-size: 10px;
}
.account-task-metrics b { display: block; color: var(--ink); font-size: 14px; }
.account-task-metrics .attention,
.account-task-metrics .attention b { color: var(--red); background: #fff1f1; }
.account-recent-jobs { max-height: 230px; overflow-y: auto; }
.account-recent-job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px auto auto;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 6px 0;
  border-bottom: 1px solid #e8ecee;
}
.account-recent-job > div:first-child { min-width: 0; }
.account-recent-job strong,
.account-recent-job > div:first-child span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.account-recent-job strong { font-size: 11px; }
.account-recent-job > div:first-child span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.account-recent-job-progress > span { display: block; text-align: right; color: var(--muted); font-size: 9px; }
.account-recent-job-progress > i { display: block; height: 3px; margin-top: 4px; background: #dfe7e3; }
.account-recent-job-progress > i > b { display: block; height: 100%; background: var(--green); }
.account-no-jobs { padding: 18px 0; text-align: center; color: var(--muted); font-size: 11px; }
.account-detail label {
  display: block;
  margin-bottom: 10px;
}
.account-profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.account-profile-fields label {
  min-width: 0;
}
.account-about-label > span {
  display: flex !important;
  align-items: center;
  gap: 6px;
}
.account-about-label input {
  width: auto;
  margin: 0;
}
.account-no-parameters {
  padding: 14px 0;
}
.account-message-config {
  padding: 14px 0;
  margin: 2px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.account-message-config > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.account-message-config > header strong,
.account-message-config > header span {
  display: block;
}
.account-message-config > header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}
.account-message-config > header svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}
.account-message-config-grid {
  display: grid;
  gap: 8px;
}
.account-message-config-grid article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f9f8;
}
.account-message-config-grid article > div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.account-message-config-grid label {
  margin-bottom: 7px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 26, 30, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
}
.avatar-editor-dialog {
  width: min(560px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  background: var(--surface);
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}
.avatar-editor-dialog > header,
.avatar-editor-dialog > footer,
.avatar-transform-buttons,
.avatar-output-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar-editor-dialog > header {
  margin-bottom: 12px;
}
.avatar-editor-dialog > header > div {
  flex: 1;
}
.avatar-editor-dialog > header strong,
.avatar-editor-dialog > header span {
  display: block;
}
.avatar-editor-dialog > header span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
#avatar-editor-canvas {
  display: block;
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin: 0 auto 12px;
  background: #20262b;
  border: 1px solid var(--line-strong);
  cursor: grab;
  touch-action: none;
}
#avatar-editor-canvas:active {
  cursor: grabbing;
}
.avatar-editor-controls > label,
.avatar-output-controls label {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.avatar-editor-controls > label input,
.avatar-output-controls input {
  width: 100%;
}
.avatar-transform-buttons {
  margin: 10px 0;
}
.avatar-transform-buttons button {
  flex: 1;
}
.avatar-output-controls label {
  flex: 1;
}
.avatar-editor-dialog > footer {
  justify-content: space-between;
  margin-top: 14px;
}
.verification-dialog {
  width: min(460px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  background: var(--surface);
  border-radius: 6px;
  padding: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}
.captcha-settings,
.ai-settings {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) auto minmax(180px, 1fr) minmax(220px, 1.3fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.ai-settings {
  grid-template-columns: 145px 90px 130px minmax(180px, 1fr) 180px auto;
  align-items: end;
}
.ai-settings > div { grid-area: 1 / 1 / 3 / 2; align-self: center; }
.ai-settings > label:nth-of-type(1) { grid-area: 1 / 2; }
.ai-settings > label:nth-of-type(2) { grid-area: 1 / 3; }
.ai-settings > label:nth-of-type(6) { grid-area: 1 / 4; }
.ai-settings > label:nth-of-type(7) { grid-area: 1 / 5; }
.ai-settings > button { grid-area: 1 / 6; }
.ai-settings > label:nth-of-type(3) { grid-area: 2 / 2 / 3 / 4; }
.ai-settings > label:nth-of-type(4) { grid-area: 2 / 4; }
.ai-settings > label:nth-of-type(5) { grid-area: 2 / 5 / 3 / 7; }
.captcha-settings > div strong,
.captcha-settings > div span,
.captcha-settings label > span,
.ai-settings > div strong,
.ai-settings > div span,
.ai-settings label > span {
  display: block;
}
.captcha-settings > div span,
.captcha-settings label > span,
.ai-settings > div span,
.ai-settings label > span {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}
.captcha-settings input:not([type="checkbox"]),
.ai-settings input:not([type="checkbox"]),
.ai-settings select {
  width: 100%;
}
.verification-captcha {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin: 0 auto 10px;
  border: 1px solid var(--line);
}
.verification-ai-state {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}
.verification-ai-state.matched {
  color: var(--green);
}
@media (max-width: 900px) {
  .captcha-settings {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .ai-settings {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .ai-settings > * {
    grid-area: auto !important;
  }
  .captcha-settings > div,
  .captcha-key-field,
  .captcha-endpoint-field,
  .ai-settings > div,
  .ai-key-field,
  .ai-endpoint-field {
    grid-column: 1 / -1;
  }
}
.verification-dialog > header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.verification-dialog > header > div {
  flex: 1;
}
.verification-dialog > header strong,
.verification-dialog > header span {
  display: block;
}
.verification-dialog > header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.verification-message {
  padding: 12px;
  border: 1px solid var(--line);
  background: #f4f7f6;
  white-space: pre-wrap;
  line-height: 1.55;
}
.verification-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.verification-options button {
  min-width: 0;
}
.account-detail label > span {
  display: block;
  margin-bottom: 5px;
}
.account-detail textarea,
.account-detail input,
.account-detail select {
  width: 100%;
}
.account-detail .account-about-label input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}
.account-detail-actions {
  justify-content: flex-end;
  margin-bottom: 16px;
}
.account-parameter-head {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 10px;
}
.account-parameter-head strong {
  flex: 1;
}
.account-parameter-head select {
  width: 170px;
}
.account-parameter-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.tool-launcher {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 8px;
}
.tool-launcher .section-header {
  margin-top: 0;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}
.tool-grid button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  text-align: left;
}
.tool-grid button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.tool-grid svg {
  width: 18px;
  flex: 0 0 18px;
  color: var(--green);
}
.group-library-header {
  margin-top: 10px;
}
.task-editor label,
.task-field {
  min-width: 0;
}
.task-editor label > span,
.task-field > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.task-editor input,
.task-editor select,
.task-editor textarea {
  width: 100%;
}
.task-accounts {
  grid-column: 1/3;
}
.task-targets {
  grid-column: 3/5;
}
.task-message {
  grid-column: 1/4;
}
.task-destination {
  grid-column: 1/4;
}
.task-destination-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.task-editor textarea {
  height: 68px;
  resize: vertical;
}
.task-account-picker {
  display: grid;
  align-content: start;
  gap: 0;
  min-height: 106px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfc;
}
.task-account-tools {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 145px auto auto auto auto;
  gap: 7px;
  align-items: center;
  margin-bottom: 7px;
}
.task-account-tools .search.compact {
  min-width: 0;
  width: 100%;
}
.task-account-picker .task-account-row {
  display: grid;
  grid-template-columns: 18px minmax(150px, 1fr) auto 105px 64px;
  align-items: center;
  gap: 9px;
  min-height: 51px;
  border-bottom: 1px solid #e5eaec;
  padding: 5px 9px;
  background: var(--surface);
  cursor: pointer;
}
.task-account-picker .task-account-row:last-child {
  border-bottom: 0;
}
.task-account-picker .task-account-row.selected {
  background: #edf7f3;
}
.task-account-picker .task-account-row.unavailable {
  background: #f4f6f7;
  opacity: 0.68;
  cursor: default;
}
.task-account-picker input {
  width: auto;
  grid-column: 1;
}
.task-account-identity {
  grid-column: 2;
}
.task-account-row > .badge {
  grid-column: 3;
}
.task-account-identity strong,
.task-account-identity small {
  display: block;
}
.task-account-identity small,
.task-account-queue small {
  color: var(--muted);
  font-size: 10px;
}
.task-account-identity small {
  margin-top: 3px;
}
.task-account-queue {
  display: flex;
  gap: 8px;
  grid-column: 4;
}
.task-account-load {
  grid-column: 5;
  text-align: right;
  font-size: 11px;
  color: var(--green);
  white-space: nowrap;
}
.task-account-empty {
  min-height: 104px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}
.task-mode-field > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 5px;
}
.segmented {
  height: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #eef1f2;
}
.segmented button {
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 0 7px;
}
.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.task-targets > span {
  display: flex !important;
  justify-content: space-between;
}
.task-targets > span b {
  color: var(--green);
  font-weight: 650;
}
.task-plan {
  grid-column: 1/5;
  display: grid;
  grid-template-columns: minmax(310px, 0.8fr) minmax(360px, 1.2fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}
.task-plan-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.task-plan-summary > div {
  border-right: 1px solid var(--line);
  padding: 3px 10px;
}
.task-plan-summary > div:first-child {
  padding-left: 0;
}
.task-plan-summary > div:last-child {
  border-right: 0;
}
.task-plan-summary span,
.task-plan-summary strong {
  display: block;
}
.task-plan-summary span {
  color: var(--muted);
  font-size: 10px;
}
.task-plan-summary strong {
  margin-top: 4px;
  font-size: 18px;
}
.task-load-list {
  display: grid;
  gap: 5px;
  max-height: 86px;
  overflow: auto;
}
.task-load-row {
  display: grid;
  grid-template-columns: minmax(82px, 120px) 1fr 52px;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}
.task-load-account {
  min-width: 0;
}
.task-load-account > span,
.task-load-account > small {
  display: block;
}
.task-load-account > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-load-account > small {
  margin-top: 2px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-dedupe-status {
  grid-column: 1/-1;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #bfe2d4;
  border-radius: 5px;
  background: var(--green-soft);
  color: #17654d;
  font-size: 11px;
}
.task-dedupe-status svg {
  width: 16px;
  flex: 0 0 16px;
}
.task-load-row > strong {
  text-align: right;
  color: var(--muted);
}
.task-load-track {
  height: 5px;
  background: #dfe5e7;
  border-radius: 3px;
  overflow: hidden;
}
.task-load-track i {
  display: block;
  height: 100%;
  background: var(--green);
}
.account-jobs {
  display: flex;
  gap: 4px;
}
.task-backfill {
  display: flex;
  flex-direction: column;
}
.task-backfill input {
  width: 18px;
  height: 18px;
}
.task-account-messages {
  display: block;
  margin-top: 12px;
}
.task-account-messages:empty {
  display: none;
}
.task-account-content-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #b9d7c8;
  background: #f1f8f4;
  border-radius: 5px;
}
.task-account-content-status.incomplete {
  border-color: #dfc583;
  background: #fff8e9;
}
.task-account-content-status > svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}
.task-account-content-status.incomplete > svg {
  color: #966b0b;
}
.task-account-content-status strong,
.task-account-content-status span {
  display: block;
}
.task-account-content-status span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}
.task-account-message-details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.task-account-message-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text);
}
.task-account-message-details summary > span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-account-message-details summary svg {
  width: 17px;
  color: var(--green);
}
.task-account-message-details summary b {
  min-width: 24px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
}
.task-account-message-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
  padding: 0 0 12px;
}
.task-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-height: 54px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}
.task-editor-actions #task-step-error {
  color: var(--red);
  font-size: 12px;
  margin-right: auto;
}
.task-editor-actions #task-step-position {
  min-width: 38px;
  text-align: center;
}
.task-hidden {
  display: none !important;
}
@media (max-width: 760px) {
  .task-steps {
    grid-template-columns: minmax(58px, 1fr) 12px minmax(58px, 1fr);
    margin-bottom: 10px;
  }
  .task-steps button {
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    white-space: nowrap;
  }
  .task-steps button b {
    width: 25px;
    height: 25px;
  }
  .task-step-panel {
    min-height: 0;
  }
  .task-basics,
  .task-input-grid {
    grid-template-columns: 1fr 1fr;
  }
  .task-editor.grouped-scope .task-basics {
    grid-template-columns: 1fr 1fr;
  }
  .task-scope-bar {
    grid-template-columns: 1fr;
  }
  .task-scope-bar > small {
    justify-self: start;
  }
  .assignment-members {
    grid-template-columns: 1fr;
  }
  .assignment-members > span {
    padding-top: 0;
  }
  .assignment-fields {
    grid-template-columns: 1fr;
  }
  .task-target-source-inputs {
    grid-template-columns: minmax(0, 1fr);
    max-width: none;
  }
  .assignment-destination {
    grid-column: 1;
  }
  .assignment-destination > div {
    grid-template-columns: 1fr;
  }
  .task-input-grid .task-target-source,
  .task-input-grid .task-targets,
  .task-input-grid .task-message,
  .task-input-grid .task-destination,
  .task-input-grid .task-limit,
  .task-input-grid .task-participant-dedupe,
  .task-input-grid .task-backfill {
    grid-column: 1/3;
  }
  .task-input-grid textarea {
    min-height: 128px;
  }
  .task-plan {
    grid-template-columns: 1fr;
  }
  .task-account-message-grid {
    grid-template-columns: 1fr;
  }
  .task-account-tools {
    grid-template-columns: 1fr 1fr;
  }
  .task-account-tools .search,
  .task-account-tools .summary {
    grid-column: 1/3;
  }
  .task-destination-inputs {
    grid-template-columns: 1fr;
  }
  .task-editor-actions {
    flex-wrap: wrap;
  }
  .task-editor-actions #task-step-error {
    width: 100%;
    order: -1;
  }
  .task-editor-actions .command,
  .task-editor-actions .secondary {
    flex: 1;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}
button {
  cursor: pointer;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  color: #e8edef;
  padding: 20px 14px 14px;
  display: flex;
  flex-direction: column;
}
.brand {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 4px;
  margin-bottom: 22px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: #20a37a;
  color: white;
  font-weight: 800;
  border-radius: 6px;
}
.brand strong,
.brand small {
  display: block;
}
.brand strong {
  font-size: 14px;
}
.brand small {
  color: #8f9ba3;
  font-size: 10px;
  margin-top: 3px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar nav button {
  height: 43px;
  border: 0;
  background: transparent;
  color: #aeb8be;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 0 12px;
  border-radius: 5px;
  position: relative;
}
.sidebar nav button:hover {
  background: #252d33;
  color: #fff;
}
.sidebar nav button.active {
  background: var(--sidebar-soft);
  color: #fff;
}
.sidebar nav button.active:before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px;
  background: #2cc596;
}
.sidebar nav svg {
  width: 18px;
  height: 18px;
}
.sidebar nav b {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--red);
  color: white;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.sidebar-status {
  margin-top: auto;
  border: 1px solid #333c43;
  border-radius: 6px;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sidebar-status > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}
.sidebar-status > span.online {
  background: #32c28d;
}
.sidebar-status strong,
.sidebar-status small {
  display: block;
}
.sidebar-status strong {
  font-size: 12px;
}
.sidebar-status small {
  font-size: 10px;
  color: #849098;
  margin-top: 2px;
}
.workspace {
  min-width: 0;
  padding: 0 28px 28px;
}
.topbar {
  height: 88px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar small {
  color: var(--muted);
  font-size: 10px;
}
.topbar h1 {
  font-size: 22px;
  margin: 5px 0 0;
  font-weight: 650;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: var(--text);
}
.icon-button svg {
  width: 17px;
}
.view {
  display: none;
  padding-top: 22px;
  min-height: calc(100vh - 116px);
}
.view.active {
  display: block;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 17px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
}
.metric small {
  color: var(--muted);
  display: block;
}
.metric strong {
  display: block;
  font-size: 27px;
  margin-top: 8px;
  font-weight: 650;
}
.metric svg {
  width: 20px;
  color: var(--green);
}
.metric.warn svg {
  color: var(--amber);
}
.metric.danger svg {
  color: var(--red);
}
.section-header,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-header {
  margin: 24px 0 10px;
}
.section-header h2 {
  font-size: 15px;
  margin: 0;
}
.section-header .text-button {
  margin-left: auto;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--green);
}
.toolbar {
  min-height: 48px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.toolbar .summary {
  margin-left: auto;
}
.summary {
  color: var(--muted);
  font-size: 12px;
}
.search {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 10px;
}
.search svg {
  width: 16px;
  color: var(--muted);
}
.search input {
  border: 0;
  outline: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 5px;
  padding: 8px 10px;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #5a9c87;
  box-shadow: 0 0 0 2px rgba(24, 132, 99, 0.1);
}
select {
  height: 36px;
}
.table-wrap {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  overflow: auto;
  box-shadow: var(--shadow);
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
th {
  height: 39px;
  background: #e8edef;
  color: #58636b;
  font-size: 11px;
  text-align: left;
  font-weight: 650;
  border-bottom: 1px solid var(--line-strong);
  padding: 0 12px;
}
td {
  height: 47px;
  border-bottom: 1px solid #e8ecee;
  padding: 7px 12px;
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f7f9f9;
}
.primary-text {
  font-weight: 600;
}
.subtext {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #edf0f2;
  color: #59656d;
  font-size: 11px;
}
.badge.green {
  background: var(--green-soft);
  color: #126b50;
}
.badge.amber {
  background: var(--amber-soft);
  color: #815b11;
}
.badge.red {
  background: var(--red-soft);
  color: #963b3b;
}
.badge.blue {
  background: var(--blue-soft);
  color: #2d698d;
}
.progress {
  height: 6px;
  width: 110px;
  background: #dce2e4;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 5px;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--green);
}
.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.row-actions button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.row-actions svg {
  width: 15px;
}
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.task-history-layout {
  gap: 14px;
}
.batch-table {
  min-width: 940px;
  table-layout: fixed;
}
.batch-table th:nth-child(1) { width: 56px; }
.batch-table th:nth-child(2) { width: 220px; }
.batch-table th:nth-child(3) { width: 110px; }
.batch-table th:nth-child(4) { width: 90px; }
.batch-table th:nth-child(5) { width: 64px; }
.batch-table th:nth-child(6) { width: 150px; }
.batch-table th:nth-child(8) { width: 148px; }
.batch-table td:nth-child(2),
.batch-table td:nth-child(7) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-pane {
  min-height: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  position: static;
}
.detail-pane h3 {
  font-size: 15px;
  margin: 0 0 4px;
}
.detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 11px;
  margin-bottom: 10px;
}
.detail-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}
.detail-head-actions .secondary {
  min-height: 32px;
}
.job-row {
  padding: 9px 0;
  border-bottom: 1px solid #e8ecee;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.job-status-data {
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.job-progress-detail {
  color: var(--green);
}
.job-row > div {
  min-width: 0;
}
.job-row > .badge {
  align-self: start;
  justify-self: end;
}
.job-result-message {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-collection-detail {
  margin-top: 12px;
}
.member-call-bar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.member-call-bar strong,
.member-call-bar span {
  display: block;
}
.member-call-bar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.member-call-bar > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.member-call-bar .member-select-all {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.member-call-bar .member-selected-count {
  align-self: center;
  margin: 0 4px 0 0;
  white-space: nowrap;
}
.member-call-bar button {
  min-width: 102px;
}
.member-collection-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr)) auto;
  align-items: center;
  gap: 0;
  margin-bottom: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f7f9f8;
}
.member-collection-summary > span {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
  padding: 7px 12px;
  font-size: 11px;
  color: var(--muted);
}
.member-collection-summary b {
  display: block;
  margin: 0 0 2px;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
}
.member-collection-summary button {
  margin: 0 10px;
}
.member-collection-table {
  max-height: 480px;
  overflow: auto;
  box-shadow: none;
}
.member-collection-table table {
  min-width: 720px;
  table-layout: fixed;
}
.member-collection-table th,
.member-collection-table td {
  padding: 9px 12px;
}
.member-collection-table .member-check-column,
.member-collection-table .member-check-cell {
  width: 48px;
  padding-right: 7px;
  padding-left: 7px;
  text-align: center;
}
.member-collection-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
.member-name-column { width: 28%; }
.member-status-column { width: 130px; }
.member-id-column { width: 140px; }
.member-groups-column { width: auto; }
.member-name-cell,
.member-id-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-id-cell {
  color: #536069;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}
.member-groups-cell {
  white-space: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.member-collection-more {
  margin-top: 7px;
  text-align: right;
}
.batch-account-list {
  display: grid;
  gap: 10px;
}
.batch-account-group {
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.batch-account-group > header {
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: #f3f6f6;
  border-bottom: 1px solid var(--line);
}
.batch-account-group > header strong,
.batch-account-group > header span {
  display: block;
}
.batch-account-group > header > div > span {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.batch-account-group .job-row {
  padding: 9px;
}
.batch-account-group .job-row:last-child {
  border-bottom: 0;
}
.empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #8a959c;
}
.empty-state svg {
  width: 32px;
  height: 32px;
}
.inline-editor {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(320px, 1fr) auto auto;
  justify-content: start;
  align-items: start;
  gap: 8px;
  margin-bottom: 10px;
}
.inline-editor input,
.inline-editor textarea {
  width: 100%;
}
.inline-editor textarea {
  min-height: 78px;
  resize: vertical;
}
.command,
.secondary {
  height: 36px;
  border-radius: 5px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.command {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}
.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
.command svg,
.secondary svg {
  width: 16px;
}
.support-view {
  padding-top: 14px;
}
.support-filters {
  min-height: 54px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0;
}
.support-filters label {
  display: flex;
  gap: 6px;
  align-items: center;
}
.support-filters .summary {
  margin-left: auto;
  white-space: nowrap;
}
.support-grid {
  height: calc(100vh - 164px);
  min-height: 520px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.conversation-list {
  border-right: 1px solid var(--line);
  overflow: auto;
}
.conversation {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.conversation:hover,
.conversation.active {
  background: #f2f7f5;
}
.conversation-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.conversation-check {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.conversation-check input {
  margin: 0;
}
.conversation strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conversation p {
  margin: 6px 0 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.unread {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.chat-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}
.chat-header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-header > div {
  flex: 1;
  min-width: 0;
}
.chat-header strong,
.chat-header small {
  display: block;
}
.chat-header small {
  color: var(--muted);
  margin-top: 3px;
}
.messages {
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble {
  max-width: min(72%, 680px);
  padding: 9px 11px;
  border-radius: 6px;
  background: #edf1f3;
  align-self: flex-start;
}
.bubble.outgoing {
  background: var(--green-soft);
  align-self: flex-end;
}
.bubble time {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 5px;
}
.composer {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}
.composer textarea {
  width: 100%;
  height: 72px;
  resize: none;
}
.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.composer-actions select {
  max-width: 220px;
}
.composer-actions button {
  margin-left: auto;
}
.command:disabled {
  cursor: wait;
  opacity: 0.68;
}
.auto-reply-overview {
  min-height: 58px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #f1f2fb;
  border-top: 1px solid #e2e4f4;
  border-bottom: 1px solid #e2e4f4;
}
.auto-reply-overview > label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-weight: 650;
}
.auto-reply-overview .summary {
  white-space: nowrap;
}
.auto-reply-panel {
  display: none;
  padding-top: 14px;
}
.auto-reply-panel.active {
  display: block;
}
.auto-reply-account-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.auto-reply-account-toolbar .summary {
  margin-left: auto;
}
.auto-reply-account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
  align-items: start;
}
.auto-reply-account-layout > .table-wrap {
  min-width: 0;
}
.auto-reply-account-layout tbody tr {
  cursor: pointer;
}
.auto-reply-account-editor {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.auto-reply-account-editor > strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.auto-reply-account-editor > label:not(:first-of-type),
.auto-reply-delay label {
  display: grid;
  gap: 5px;
}
.auto-reply-account-editor > label > span,
.auto-reply-delay span {
  color: var(--muted);
  font-size: 11px;
}
.auto-reply-account-editor textarea {
  resize: vertical;
  min-height: 180px;
}
.auto-reply-media-picker,
.reply-media-picker {
  display: grid;
  gap: 6px;
}
.auto-reply-media-picker {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}
.auto-reply-media-preview,
.auto-reply-media-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.auto-reply-media-preview > i {
  width: 38px;
  height: 38px;
  padding: 8px;
  flex: 0 0 auto;
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.auto-reply-media-preview > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.auto-reply-media-preview strong,
.auto-reply-media-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auto-reply-media-preview strong {
  font-size: 12px;
}
.auto-reply-media-preview small {
  color: var(--muted);
  font-size: 11px;
}
.auto-reply-media-actions .file-picker {
  min-width: 0;
}
.auto-reply-media-actions button {
  width: 36px;
  height: 36px;
  padding: 0;
}
.auto-reply-media-picker label,
.file-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}
.auto-reply-media-picker input[type="file"],
.file-picker input[type="file"] {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
}
.reply-media-picker {
  grid-column: 1/-1;
}
.auto-reply-delay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rule-editor {
  grid-template-columns: minmax(160px, 0.7fr) minmax(200px, 1fr) auto;
}
.rule-editor textarea {
  min-height: 76px;
}
.editor-band {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 8px;
  margin-bottom: 14px;
}
.editor-band textarea {
  grid-column: 1/-1;
  min-height: 90px;
  resize: vertical;
}
.editor-band > input:nth-of-type(3) {
  grid-column: 1/3;
}
.editor-band > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.reply-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 10px;
}
.reply-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  min-height: 126px;
}
.reply-item header {
  display: flex;
  justify-content: space-between;
}
.reply-item h3 {
  font-size: 14px;
  margin: 0;
}
.reply-item p {
  color: #48545c;
  white-space: pre-wrap;
  line-height: 1.55;
}
.reply-item footer {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}
.reply-item footer .row-actions {
  margin-left: auto;
}
.log-terminal {
  height: calc(100vh - 178px);
  min-height: 520px;
  margin: 0;
  background: #151a1e;
  color: #d1d9dd;
  border: 1px solid #2b3338;
  border-radius: 6px;
  padding: 14px;
  overflow: auto;
  font:
    12px/1.65 Consolas,
    "Cascadia Mono",
    monospace;
  white-space: pre-wrap;
}
.log-info {
  color: #b9c8cf;
}
.log-warning {
  color: #e0b45d;
}
.log-error {
  color: #ed8b8b;
}
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  background: #20282d;
  color: #fff;
  padding: 10px 14px;
  border-radius: 5px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.18s;
}
#toast.show {
  opacity: 1;
  transform: none;
}
#toast.error {
  background: #8e3434;
}
@media (max-width: 1050px) {
  .inline-editor {
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  }
  .automation-bar {
    grid-template-columns: minmax(150px, auto) minmax(0, 1fr) 36px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .split-layout {
    grid-template-columns: 1fr;
  }
  .detail-pane {
    position: static;
  }
  .reply-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .support-grid {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .account-login-head {
    grid-template-columns: 1fr;
  }
  .account-login-head > div:first-child {
    grid-column: auto;
  }
  .auto-reply-account-layout {
    grid-template-columns: 1fr;
  }
  .auto-reply-account-editor {
    position: static;
  }
  .auth-panel {
    grid-template-columns: 1fr 1fr;
  }
  .auth-captcha {
    grid-column: 1 / -1;
  }
  .tool-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 760px) {
  body {
    padding-bottom: 62px;
  }
  .account-login-head,
  .auth-panel {
    grid-template-columns: 1fr;
  }
  .account-console-metrics {
    grid-template-columns: 1fr 1fr;
  }
  .account-login-band > summary small {
    display: none;
  }
  .account-recent-job {
    grid-template-columns: minmax(0, 1fr) 74px auto;
  }
  .account-recent-job > .badge {
    display: none;
  }
  .account-login-head > div:first-child,
  .auth-captcha {
    grid-column: auto;
  }
  #auth-method-tabs {
    min-width: 0;
  }
  .app-shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    z-index: 10;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: 62px;
    padding: 0;
    background: var(--sidebar);
  }
  .brand,
  .sidebar-status {
    display: none;
  }
  .sidebar nav {
    height: 62px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
  }
  .sidebar nav button {
    height: 62px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0;
    border-radius: 0;
    font-size: 10px;
  }
  .sidebar nav button span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
  }
  .sidebar nav button span[data-mobile-label] {
    font-size: 0;
  }
  .sidebar nav button span[data-mobile-label]::after {
    content: attr(data-mobile-label);
    font-size: 10px;
  }
  .sidebar nav button.active:before {
    left: 25%;
    top: 0;
    width: 50%;
    height: 3px;
  }
  .sidebar nav svg {
    width: 17px;
    height: 17px;
  }
  .sidebar nav b {
    position: absolute;
    right: 6px;
    top: 5px;
  }
  .workspace {
    padding: 0 12px 12px;
  }
  .topbar {
    height: 72px;
  }
  .topbar h1 {
    font-size: 19px;
  }
  .view {
    min-height: calc(100vh - 146px);
    padding-top: 14px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .metric {
    padding: 12px;
  }
  .metric strong {
    font-size: 22px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .template-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .template-toolbar > div:first-child,
  .template-toolbar select {
    width: 100%;
  }
  .template-toolbar select {
    min-width: 0;
  }
  .template-toolbar .secondary {
    flex: 1;
  }
  .detail-head {
    gap: 10px;
    flex-direction: column;
  }
  .detail-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .automation-bar {
    grid-template-columns: minmax(0, 1fr) 36px;
    min-height: 0;
    padding: 8px;
    gap: 8px;
  }
  .automation-bar-title {
    grid-column: 1/-1;
    padding: 2px 2px 2px;
  }
  .automation-bar > .icon-button {
    grid-column: 2;
    grid-row: 2;
  }
  .pool-stat {
    min-height: 36px;
    padding-left: 8px;
  }
  .pool-stat:first-of-type {
    border-left: 0;
  }
  .pool-stat strong {
    font-size: 15px;
  }
  .task-account-picker .task-account-row {
    grid-template-columns: 18px minmax(120px, 1fr) auto 58px;
  }
  .task-account-queue {
    display: none;
  }
  .task-account-load {
    grid-column: 4;
  }
  .task-plan-summary > div {
    padding: 3px 7px;
  }
  .task-plan-summary strong {
    font-size: 16px;
  }
  .task-run-account {
    grid-template-columns: minmax(100px, 1fr) minmax(70px, 1fr) auto;
    gap: 8px;
  }
  .task-run-guidance {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .task-run-errors {
    flex-wrap: wrap;
  }
  .task-run-errors > span {
    max-width: 100%;
  }
  .task-run-controls {
    justify-content: stretch;
  }
  .task-run-controls button {
    flex: 1;
  }
  .account-parameter-numbers {
    grid-template-columns: 1fr;
  }
  .modal-backdrop {
    padding: 8px;
  }
  .avatar-editor-dialog {
    max-height: calc(100dvh - 16px);
    padding: 10px;
  }
  .avatar-output-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .avatar-transform-buttons button {
    padding: 0 8px;
  }
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-grid button {
    min-height: 58px;
  }
  .search {
    min-width: 100%;
    order: -1;
  }
  .table-wrap {
    max-width: calc(100vw - 24px);
  }
  .member-collection-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .member-collection-summary > span:nth-child(2) {
    border-right: 0;
  }
  .member-collection-summary > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .member-collection-summary button {
    grid-column: 1 / -1;
    margin: 8px;
  }
  .member-call-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .member-call-bar > div:last-child {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .member-call-bar .member-select-all {
    grid-column: 1;
  }
  .member-call-bar .member-selected-count {
    grid-column: 2 / 4;
    justify-self: end;
  }
  .member-call-bar button {
    min-width: 0;
    padding: 0 7px;
  }
  .support-filters {
    height: auto;
    flex-wrap: wrap;
    margin-bottom: 8px;
  }
  .auto-reply-overview {
    align-items: flex-start;
  }
  .auto-reply-overview > label {
    width: 100%;
  }
  .auto-reply-account-toolbar {
    align-items: stretch;
  }
  .auto-reply-account-toolbar .summary {
    width: 100%;
    margin-left: 0;
  }
  .auto-reply-account-layout .table-wrap {
    max-width: calc(100vw - 24px);
  }
  .auto-reply-delay {
    grid-template-columns: 1fr;
  }
  .support-view.active {
    height: calc(100dvh - 134px);
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .support-filters .search {
    flex: 1 0 100%;
  }
  .support-filters .summary {
    width: 100%;
    margin-left: 0;
  }
  .chat-header {
    padding: 10px 12px;
  }
  .chat-header .secondary {
    padding: 0 9px;
  }
  .composer-actions {
    flex-wrap: wrap;
  }
  .composer-actions .subtext {
    order: 3;
    width: 100%;
  }
  .support-grid {
    height: auto;
    min-height: 0;
    flex: 1;
    display: block;
  }
  .conversation-list {
    height: 100%;
    border: 0;
  }
  .chat-pane {
    display: none;
    height: 100%;
  }
  .support-grid.chat-open .conversation-list {
    display: none;
  }
  .support-grid.chat-open .chat-pane {
    display: grid;
  }
  .bubble {
    max-width: 86%;
  }
  .reply-list {
    grid-template-columns: 1fr;
  }
  .editor-band {
    grid-template-columns: 1fr;
  }
  .editor-band textarea,
  .editor-band > input:nth-of-type(3) {
    grid-column: 1;
  }
  .editor-band > div {
    justify-content: stretch;
  }
  .editor-band button {
    flex: 1;
  }
  .log-terminal {
    height: calc(100vh - 220px);
    min-height: 420px;
  }
  #toast {
    left: 12px;
    right: 12px;
    bottom: 76px;
  }
  .topbar-actions #last-update {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }
  .sidebar {
    height: calc(62px + env(safe-area-inset-bottom));
    overflow: hidden;
  }
  .sidebar nav {
    grid-template-columns: repeat(5, 1fr);
  }
  #utility-nav {
    display: none;
  }
  #main-nav > button {
    display: none;
  }
  #main-nav > button[data-task-center],
  #main-nav > button[data-action="send_group_campaign"],
  #main-nav > button[data-action="join_group"],
  #main-nav > button[data-view="support"],
  #main-nav > #mobile-more {
    display: flex;
  }
  .view {
    min-height: calc(100dvh - 146px - env(safe-area-inset-bottom));
  }
  .rule-editor {
    grid-template-columns: 1fr;
  }
  .rule-editor textarea {
    grid-column: 1;
  }
  .mobile-menu:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: block;
  }
}

@media (max-width: 520px) {
  .inline-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .inline-editor button {
    width: 100%;
  }
  .task-basics,
  .task-input-grid,
  .task-editor.grouped-scope .task-basics {
    grid-template-columns: minmax(0, 1fr);
  }
  .task-input-grid .task-target-source,
  .task-input-grid .task-targets,
  .task-input-grid .task-message,
  .task-input-grid .task-destination,
  .task-input-grid .task-limit,
  .task-input-grid .task-participant-dedupe,
  .task-input-grid .task-backfill {
    grid-column: 1;
  }
  .task-steps {
    grid-template-columns: 34px 1fr 34px;
  }
  .task-steps button span {
    display: none;
  }
  .broadcast-option-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .broadcast-option-grid .broadcast-wide {
    grid-column: 1;
  }
  .workspace {
    overflow-x: hidden;
  }
}

/* ============================================================
   胶囊式现代化设计覆盖层（蓝紫渐变主题）
   ============================================================ */

/* ---- 胶囊按钮 ---- */
.command,
.secondary {
  height: 38px;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
}
.command {
  border: 0;
  background: var(--primary-gradient);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.command:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 7px 22px rgba(99, 102, 241, 0.32);
}
.command:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--primary-glow);
}
.secondary {
  border-color: #dfe2f3;
}
.secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.danger-command {
  border: 1px solid #f5c6c6;
  background: #fff;
  color: var(--red);
}
.danger-command:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-soft);
}
.text-button {
  color: var(--primary);
  font-weight: 600;
}
.text-button:hover {
  color: var(--primary-2);
}

/* ---- 圆形图标按钮 ---- */
.icon-button {
  border-radius: var(--radius-pill);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.icon-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* ---- 输入控件 ---- */
input,
select,
textarea {
  border-radius: var(--radius-input);
  padding: 9px 12px;
  border-color: #e4e6f0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 5px;
  accent-color: var(--primary);
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: none;
}
.search {
  border-radius: var(--radius-pill);
  padding: 0 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ---- 药丸徽章 ---- */
.badge {
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-weight: 600;
  background: #eef0f7;
  color: #5c647d;
}
.badge.green {
  background: var(--primary-soft);
  color: var(--primary);
}
.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}
.badge.red {
  background: var(--red-soft);
  color: #dc2626;
}
.badge.blue {
  background: var(--blue-soft);
  color: #2563eb;
}

/* ---- 卡片化表格 ---- */
.table-wrap {
  border-radius: var(--radius-card);
  border-color: #eceef7;
  box-shadow: var(--shadow);
}
th {
  background: #f6f7fd;
  color: #6b7189;
  letter-spacing: 0.4px;
}
tbody tr {
  transition: background 0.12s ease;
}
tbody tr:hover {
  background: #f8f8fe;
}

/* ---- 侧边栏品牌与导航 ---- */
.brand-mark {
  background: var(--primary-gradient);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.sidebar nav button {
  border-radius: 10px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar nav button:hover {
  background: rgba(99, 102, 241, 0.18);
  color: #fff;
}
.sidebar nav button.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.sidebar nav button.active:before {
  display: none;
}
#utility-nav {
  border-top-color: rgba(148, 163, 184, 0.18);
}

/* ---- 顶栏与指标卡 ---- */
.topbar {
  border-bottom-color: #eceef7;
}
.metric {
  border-radius: var(--radius-card);
  border-color: #eceef7;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.metric:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* ---- 进度条渐变 ---- */
.progress {
  background: #e9ebf7;
  border-radius: var(--radius-pill);
}
.progress span {
  background: var(--primary-gradient);
  border-radius: var(--radius-pill);
}

/* ---- 弹窗与提示 ---- */
.modal-overlay {
  background: rgba(23, 26, 43, 0.45);
  backdrop-filter: blur(6px);
}
.modal-card {
  border-radius: var(--radius-modal);
  border: 0;
  box-shadow: 0 24px 64px rgba(23, 26, 43, 0.30);
}
#toast {
  border-radius: var(--radius-pill);
  background: #23263c;
  padding: 11px 20px;
  box-shadow: 0 10px 30px rgba(23, 26, 43, 0.30);
  font-weight: 500;
}
#toast.error {
  background: var(--red);
}

/* ---- 标签页 ---- */
.operations-tabs button {
  transition: color 0.15s ease;
}
.operations-tabs button.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

/* ---- 移动端保护：底部导航保持直角铺满 ---- */
@media (max-width: 760px) {
  .sidebar nav button {
    border-radius: 0;
    box-shadow: none;
  }
  .command,
  .secondary {
    height: 36px;
    padding: 0 14px;
  }
}

/* ============================================================
   任务中心重设计覆盖层（卡片分区 + 胶囊步骤条）
   ============================================================ */

/* ---- 账号编排状态栏：渐变图标卡片 ---- */
#view-tasks .automation-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  margin-bottom: 14px;
}
#view-tasks .automation-bar-title {
  gap: 12px;
}
#view-tasks .automation-bar-title > svg {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 9px;
  border-radius: 12px;
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}
#view-tasks .automation-bar-title strong {
  font-size: 15px;
}
#view-tasks .automation-bar-title span,
#view-tasks .pool-summary {
  color: var(--muted);
  font-size: 12px;
}

/* ---- 任务模板折叠：卡片化 ---- */
#view-tasks .template-fold {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
#view-tasks .template-fold > summary {
  padding: 12px 18px;
}
#view-tasks .template-fold .template-toolbar {
  padding: 0 18px 14px;
}

/* ---- 任务编辑器：大卡片 ---- */
#view-tasks .task-editor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

/* ---- 步骤条：胶囊渐变 ---- */
#view-tasks .task-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 560px;
  margin: 0 auto 22px;
  min-height: 0;
}
#view-tasks .task-steps > i {
  flex: 1;
  max-width: 72px;
  height: 2px;
  margin: 0 10px;
  border-radius: 2px;
  background: var(--line-strong);
}
#view-tasks .task-steps button {
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  gap: 9px;
  font-size: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all 0.18s ease;
}
#view-tasks .task-steps button b {
  width: 24px;
  height: 24px;
  font-size: 12px;
  border: 0;
  background: #eef0f8;
  color: var(--muted);
}
#view-tasks .task-steps button.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px var(--primary-glow);
}
#view-tasks .task-steps button.active b {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
#view-tasks .task-steps button.done {
  border-color: #d9dcf5;
  color: var(--primary);
}
#view-tasks .task-steps button.done b {
  background: var(--primary-soft);
  color: var(--primary);
}
#view-tasks .task-steps button:disabled {
  opacity: 0.7;
}

/* ---- 分区标签与分隔 ---- */
#view-tasks .task-editor label > span,
#view-tasks .task-field > span {
  font-size: 12px;
  font-weight: 600;
  color: #5c647d;
  margin-bottom: 7px;
}
#view-tasks .task-basics {
  border-bottom: 1px dashed var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
  gap: 14px;
}
#view-tasks .task-scope-bar {
  border-bottom: 1px dashed var(--line);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
#view-tasks .task-field.task-accounts {
  background: #fafbff;
  border: 1px solid #eceef8;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}
#view-tasks .task-field.task-accounts > span {
  font-size: 13px;
  color: var(--text);
}

/* ---- 账号池工具条与列表 ---- */
#view-tasks .task-account-tools {
  gap: 8px;
  margin-bottom: 10px;
}
#view-tasks .task-account-tools .summary {
  color: var(--primary);
  font-weight: 650;
}
#view-tasks .task-account-picker {
  border: 1px solid #e6e8f5;
  border-radius: 12px;
  background: #fff;
  max-height: 264px;
}
#view-tasks .task-account-picker .task-account-row {
  grid-template-columns: 20px minmax(150px, 1fr) auto auto 72px;
  min-height: 56px;
  padding: 9px 12px;
  border-bottom: 1px solid #f0f1fa;
  transition: background 0.12s ease;
}
#view-tasks .task-account-picker .task-account-row:hover {
  background: #f6f7ff;
}
#view-tasks .task-account-picker .task-account-row.selected {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}
#view-tasks .task-account-picker .task-account-row.unavailable {
  background: #f6f7f9;
}
#view-tasks .task-account-picker input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}
#view-tasks .task-account-identity strong {
  font-size: 13px;
}
#view-tasks .task-account-identity small {
  font-size: 11px;
}
#view-tasks .task-account-load {
  color: var(--primary);
}

/* ---- 分段选择器：胶囊 ---- */
#view-tasks .segmented {
  border: 0;
  border-radius: var(--radius-pill);
  background: #eef0f8;
  padding: 4px;
}
#view-tasks .segmented button {
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  transition: all 0.15s ease;
}
#view-tasks .segmented button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 34, 51, 0.1);
}

/* ---- 底部操作条 ---- */
#view-tasks .task-editor-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
#view-tasks .task-editor-actions #task-step-position {
  color: var(--muted);
  font-weight: 600;
}
#view-tasks .task-editor-actions #task-step-error:not(:empty) {
  color: var(--red);
  font-size: 12px;
}

/* ---- 批次历史区：卡片 + 间距 ---- */
#view-tasks .toolbar {
  margin: 4px 0 12px;
}
#view-tasks .task-history-layout {
  gap: 14px;
}
#view-tasks .batch-table-wrap {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
#view-tasks .detail-pane {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: var(--surface);
}
#view-tasks .detail-pane .empty-state {
  color: var(--muted);
}

/* ---- 确认与运行面板的卡片化 ---- */
#view-tasks .task-confirm-summary,
#view-tasks .task-run-metrics {
  background: #fafbff;
  border: 1px solid #eceef8;
  border-radius: 14px;
  padding: 14px;
}
#view-tasks .task-run-head {
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 16px;
}

/* ---- 移动端适配 ---- */
@media (max-width: 760px) {
  #view-tasks .task-editor {
    padding: 14px;
  }
  #view-tasks .task-steps button {
    padding: 7px 12px;
    font-size: 12px;
  }
  #view-tasks .task-steps > i {
    max-width: 36px;
    margin: 0 6px;
  }
  #view-tasks .task-account-picker .task-account-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
  }
  #view-tasks .task-account-queue,
  #view-tasks .task-account-load {
    grid-column: auto;
  }
}

/* ============================================================
   账号管理弹窗 Tab 分区 + 指标卡过滤
   ============================================================ */

/* ---- 弹窗内 Tab 导航 ---- */
.account-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin: 14px 0 16px;
  background: #eef0f8;
  border-radius: var(--radius-pill);
}
.account-tabs button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.account-tabs button svg {
  width: 15px;
  height: 15px;
}
.account-tabs button:hover {
  color: var(--text);
}
.account-tabs button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 34, 51, 0.1);
}
.account-tab-panel {
  display: none;
}
.account-tab-panel.active {
  display: block;
  animation: task-panel-in 0.16s ease-out;
}

/* ---- 弹窗头部：切换导航与检测按钮 ---- */
.account-modal-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.account-modal-nav span {
  min-width: 40px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.account-modal-nav .icon-button {
  width: 24px;
  height: 24px;
}
#account-check-status {
  height: 32px;
  font-size: 12px;
  padding: 0 12px;
}
.account-detail-head-side {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.account-danger-zone {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

/* ---- 指标卡可点击过滤 ---- */
.account-console-metrics > div {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.account-console-metrics > div:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.account-console-metrics > div.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.account-console-metrics > div.active span {
  color: var(--primary);
}

@media (max-width: 760px) {
  .account-tabs button {
    font-size: 12px;
    padding: 0 4px;
  }
  .account-tabs button svg {
    display: none;
  }
  .account-detail-head-side {
    justify-content: flex-start;
  }
}


