:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #162033;
  --muted: #667085;
  --line: #d9e0ea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16803c;
  --danger: #c2410c;
  --shadow: 0 18px 50px rgba(25, 42, 70, 0.10);
}

.recharge-card-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(460px, 1.2fr);
  gap: 16px;
  margin-bottom: 16px;
}

.recharge-card-config-form,
.recharge-card-batch-form {
  align-content: start;
  margin: 0;
}

.recharge-card-batch-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recharge-card-batch-form .actions {
  align-items: end;
}

.recharge-card-generated-panel {
  margin-bottom: 16px;
}

#rechargeCardGeneratedKeys {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  line-height: 1.55;
}

.recharge-card-filter {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 220px) auto auto;
}

.recharge-card-modal {
  width: min(420px, calc(100vw - 32px));
}

.recharge-card-purchase-link {
  display: flex;
  justify-content: center;
  width: 100%;
}

.recharge-card-purchase-link.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

@media (max-width: 900px) {
  .recharge-card-admin-grid,
  .recharge-card-batch-form,
  .recharge-card-filter {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  background: var(--primary-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:disabled:hover {
  background: var(--primary);
}

#userSaveBtn:disabled,
#projectSaveBtn:disabled,
#templateSaveBtn:disabled,
#announcementSaveBtn:disabled,
#userSaveBtn:disabled:hover,
#projectSaveBtn:disabled:hover,
#templateSaveBtn:disabled:hover,
#announcementSaveBtn:disabled:hover {
  background: #cbd5e1;
  color: #64748b;
  opacity: 1;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
}

select[multiple] {
  min-height: 104px;
  padding: 8px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #475569;
  font-size: 13px;
  background: #f8fafc;
}

.select-cell {
  width: 44px;
  min-width: 44px;
  text-align: center;
  vertical-align: middle;
}

.select-cell input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.10), transparent 36%),
    linear-gradient(300deg, rgba(22, 128, 60, 0.10), transparent 34%),
    var(--bg);
}

.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 42px;
}

.login-panel h1 {
  margin: 8px 0 14px;
  font-size: 34px;
}

.form {
  display: grid;
  gap: 16px;
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #101827;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: #2563eb;
  font-weight: 800;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: #aab6ca;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-button,
.ghost-button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #cbd5e1;
}

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

.nav-count {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.nav-button:hover,
.nav-button.active {
  background: #1f2a44;
  color: #fff;
}

.ghost-button {
  margin-top: auto;
  border: 1px solid #334155;
  text-align: center;
}

.content {
  min-width: 0;
  padding: 28px;
}

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

.topbar h2 {
  margin-top: 5px;
  font-size: 26px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 7px;
  padding: 0 10px;
  background: #e8f1ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stats-grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(25, 42, 70, 0.06);
}

.stats-grid article {
  padding: 18px;
}

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

.stats-grid strong {
  display: block;
  margin-top: 9px;
  font-size: 28px;
}

.panel {
  overflow: hidden;
}

.panel + .panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
}

.bill-table th:nth-child(3),
.bill-table td:nth-child(3),
.bill-table th:nth-child(7),
.bill-table td:nth-child(7) {
  white-space: nowrap;
}

.bill-table td:nth-child(3) .status {
  white-space: nowrap;
}

.bill-table td:nth-child(6) {
  min-width: 280px;
}

.result-box {
  width: 100%;
  min-height: 150px;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.sms-cell {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

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

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

.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.secondary:hover {
  background: #cbd5e1;
}

.secondary:disabled:hover {
  background: #e2e8f0;
}

.danger-button {
  background: #fee2e2;
  color: #b91c1c;
}

.danger-button:hover {
  background: #fecaca;
}

.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.template-price-input {
  min-width: 96px;
  min-height: 34px;
  padding: 0 9px;
}

.template-name-input {
  min-width: 180px;
}

.template-users-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid #dbe4f2;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  white-space: nowrap;
}

.template-users-trigger strong {
  color: #1d4ed8;
  font-size: 14px;
}

.template-users-trigger span {
  font-size: 12px;
}

.template-users-trigger:hover {
  border-color: #93b4f4;
  background: #eff6ff;
}

.template-users-empty {
  color: var(--muted);
  white-space: nowrap;
}

.template-editor {
  margin-top: 18px;
}

.template-editor-actions {
  grid-column: span 2;
  align-self: end;
}

.template-item-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-height: 380px;
}

.template-project-item {
  align-items: center;
}

.template-sale-input {
  width: 104px;
}

.balance-quick-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.balance-quick-actions {
  display: inline-flex;
  gap: 4px;
}

.balance-adjust-button {
  width: 30px;
  min-width: 30px;
  padding: 0;
}

#usersTable td:nth-child(10) {
  width: 260px;
  max-width: 260px;
}

.user-project-list-short {
  display: block;
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-project-preview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 4px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.user-project-preview:hover,
.user-project-preview:focus {
  background: #eff6ff;
  color: inherit;
  outline: 1px solid var(--line, #bfdbfe);
}

.user-project-summary {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-project-count {
  color: #2563eb;
  font-size: 12px;
  white-space: nowrap;
}

.user-project-popover {
  position: fixed;
  z-index: 220;
  display: none;
  width: min(360px, calc(100vw - 16px));
  max-height: min(320px, calc(100vh - 16px));
  padding: 14px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
  color: #0f172a;
  cursor: default;
}

.user-project-preview:focus .user-project-popover {
  display: block;
}

.user-project-popover > strong {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.user-project-popover-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.user-project-popover-list > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #dbe4f0;
  border-radius: 5px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 7px;
  padding: 0 8px;
  background: #dcfce7;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.status.disabled {
  background: #fee2e2;
  color: #b91c1c;
}

.record-amount-badge {
  display: inline-flex;
  min-width: 34px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.record-amount-badge.is-zero {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

.record-amount-badge.is-charged {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.user-status-cell {
  display: flex;
  min-width: 142px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.user-status-cell small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.user-disable-popover {
  position: fixed;
  z-index: 140;
  width: min(240px, calc(100vw - 16px));
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.user-disable-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.user-disable-popover-head .icon-button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  font-size: 18px;
}

.user-disable-popover p {
  margin: 0 0 8px;
  font-size: 13px;
}

.user-disable-popover label {
  display: grid;
  gap: 5px;
  font-size: 13px;
}

.user-disable-popover input {
  width: 100%;
  min-height: 34px;
}

.user-disable-popover > small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.user-disable-popover .error {
  min-height: 18px;
  margin: 3px 0;
  font-size: 12px;
}

.user-disable-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.user-disable-popover-actions button {
  min-height: 32px;
  padding: 0 12px;
}

.project-block-popover {
  width: min(270px, calc(100vw - 16px));
}

.project-block-permanent {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  margin-top: 10px;
}

.project-block-permanent input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.line-stats-filter {
  align-items: center;
}

.line-stats-filter input[type="date"] {
  min-width: 150px;
}

.line-stats-card .table-wrap {
  overflow-x: auto;
}

.line-block-status {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.line-block-status small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.demo-account-notice {
  margin-bottom: 16px;
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.role-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.role-badge.manager {
  background: #dbeafe;
  color: #1d4ed8;
}

.role-badge.user {
  background: #ffedd5;
  color: #c2410c;
}

.role-badge.card-store {
  background: #fce7f3;
  color: #9d174d;
}

.role-badge.demo {
  background: #fef3c7;
  color: #92400e;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 13px 16px;
  box-shadow: var(--shadow);
}

.admin-reference .content {
  background: linear-gradient(145deg, #f0f4ff, #fff 42%, #f8faff);
}

.agent-topbar,
.page-header,
.filter-bar,
.notice-bar,
.quick-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(25, 42, 70, 0.06);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.agent-topbar h2 {
  margin-top: 5px;
  font-size: 24px;
}

.topbar-actions,
.quick-buttons,
.filter-bar,
.api-profile-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.api-profile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 7px;
  padding: 0 14px;
  text-decoration: none;
}

.dashboard-page,
.report-page,
.records-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.notice-bar {
  justify-content: flex-start;
  background: #fffbe6;
  border-color: #fde68a;
  color: #57420a;
}

.notice-bar span {
  color: #6b5a20;
}

.system-announcement-bar {
  align-items: flex-start;
}

.system-announcement-bar strong {
  flex: 0 0 auto;
}

.system-announcement-bar span {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.system-announcement-bar .compact-button {
  flex: 0 0 auto;
  margin-left: auto;
}

.qqzc-auth-alert {
  margin-top: 12px;
  background: #fff1f2;
  border-color: #fda4af;
  color: #9f1239;
}

.qqzc-auth-alert span {
  color: #9f1239;
  font-weight: 600;
}

.announcement-editor {
  display: grid;
  gap: 12px;
  margin: -10px 0 18px;
  padding: 16px 18px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
}

.announcement-editor textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.announcement-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.announcement-editor-actions .muted {
  margin-right: auto;
}

.stat-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.stat-item {
  min-height: 118px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 2px 10px rgba(25, 42, 70, 0.06);
  padding: 22px;
}

.stat-item span {
  color: var(--muted);
  font-size: 14px;
}

.stat-item strong {
  display: block;
  margin-top: 10px;
  color: #1f2937;
  font-size: 28px;
}

.stat-item small {
  display: block;
  margin-top: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.stat-item.profit-detail-entry {
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stat-item.profit-detail-entry:hover,
.stat-item.profit-detail-entry:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.13);
  outline: none;
  transform: translateY(-1px);
}

.quick-entry {
  display: block;
  text-align: center;
  padding: 22px;
}

.quick-entry h3 {
  margin-bottom: 14px;
}

.quick-buttons {
  justify-content: center;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 2px;
}

.segmented-control button {
  min-height: 32px;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  padding: 0 12px;
}

.segmented-control button:hover,
.segmented-control button.active {
  background: var(--primary);
  color: #fff;
}

.quick-btn {
  min-width: 140px;
}

.filter-bar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  width: auto;
  min-width: 180px;
}

.filter-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-filter {
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
}

.status-filter:hover,
.status-filter.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
}

.table-card {
  border-radius: 8px;
}

.project-list-toolbar {
  margin: 0;
  border-width: 1px 0;
  border-radius: 0;
  box-shadow: none;
}

.project-list-toolbar input {
  min-width: 160px;
}

.project-list-toolbar #projectSearch {
  min-width: min(420px, 100%);
}

#dashboardProjects td.project-name-cell {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 180px;
  max-width: 280px;
}

.api-settings-panel {
  display: block;
  overflow: visible;
}

.api-profile-list {
  display: grid;
  gap: 14px;
  padding: 18px 18px 0;
}

.api-profile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.api-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.api-profile-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.api-provider-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 700;
}

.compact-form {
  padding: 14px;
}

.radio-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 13px;
}

.radio-line input {
  width: 16px;
  min-height: 16px;
}

.project-permission-box {
  display: grid;
  gap: 10px;
}

.api-save-actions {
  align-items: center;
  padding: 18px;
  gap: 12px;
}

.settings-save-status {
  color: var(--muted);
  font-size: 13px;
}

.settings-save-status.pending {
  color: #1d4ed8;
}

.settings-save-status.success {
  color: var(--success);
}

.settings-save-status.error {
  color: #b91c1c;
}

.compact-page-header {
  margin-bottom: 14px;
}

.catfee-order-modal {
  width: min(520px, calc(100vw - 32px));
}

.catfee-product-note {
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e3a5f;
}

.catfee-product-note strong {
  display: block;
  margin-bottom: 9px;
}

.catfee-product-note p {
  margin: 4px 0;
}

.catfee-order-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.endless-send-content-field {
  position: relative;
}

.endless-send-content-field textarea {
  min-height: 104px;
  resize: vertical;
}

.endless-send-content-field small {
  align-self: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.energy-orders-card code {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.energy-order-message {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

@media (max-width: 480px) {
  .catfee-order-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .catfee-order-summary strong {
    white-space: nowrap;
  }
}

.field-title {
  display: block;
  color: #334155;
  font-size: 13px;
}

.form-hint,
.muted-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.project-permission-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.template-project-filters {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.template-project-filters select {
  flex: 0 0 180px;
  min-width: 0;
}

.template-project-filters input {
  flex: 1 1 260px;
  min-width: 0;
}

.template-selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-selection-actions > button {
  min-height: 40px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #334155;
  white-space: nowrap;
}

.check-line input {
  width: 16px;
  min-height: 16px;
}

.project-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.project-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 9px;
  background: #f8fafc;
}

.project-check-item input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.project-check-item span,
.project-check-item small {
  display: block;
}

.project-check-item strong {
  overflow-wrap: anywhere;
}

.project-check-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.status.pending {
  background: #fef3c7;
  color: #92400e;
}

.manager-template-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.manager-template-list {
  display: grid;
  gap: 8px;
}

.manager-template-pagination {
  width: 100%;
  margin-top: 8px;
  padding: 12px 0 0;
  border-top: 1px solid #e2e8f0;
}

.manager-template-pagination .pagination-controls {
  flex-wrap: nowrap;
}

.manager-template-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 11px;
  cursor: pointer;
}

.manager-template-option:hover,
.manager-template-option.selected {
  border-color: #93c5fd;
  background: #eff6ff;
}

.manager-template-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.manager-template-option span,
.manager-template-option small {
  display: block;
}

.manager-template-option strong {
  overflow-wrap: anywhere;
}

.manager-template-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.manager-template-preview {
  display: flex;
  min-width: 0;
  min-height: 0;
  margin-top: 6px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.template-preview-more {
  color: var(--muted);
  font-size: 12px;
}

.template-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.template-preview-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 13px;
}

.template-preview-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.template-preview-item strong {
  color: var(--primary);
  white-space: nowrap;
}

.template-preview-more {
  margin-top: 8px;
}

#settingsSaveBtn.saved {
  background: #bfdbfe;
  color: #1d4ed8;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 2px 2px;
}

.pagination-info {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pagination-summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-size-select {
  width: auto;
  min-width: 92px;
  height: 34px;
  min-height: 34px;
  padding: 4px 28px 4px 10px;
  border: 1px solid #d5deec;
  border-radius: 6px;
  background-color: #ffffff;
  color: #334155;
  font-size: 13px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
}

.pagination-jump input {
  width: 58px;
  min-width: 58px;
  height: 34px;
  min-height: 34px;
  padding: 4px 6px;
  border: 1px solid #d5deec;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  text-align: center;
}

.pagination-jump-button {
  min-width: 48px;
  min-height: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid #d5deec;
  background: #eef2f7;
  color: #334155;
  font-size: 13px;
}

.pagination-jump-button:hover {
  border-color: #bfdbfe;
  background: #dbeafe;
  color: #1d4ed8;
}

.pagination-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 1px solid #d5deec;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.pagination-button:hover:not(:disabled),
.pagination-button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.pagination-ellipsis {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-inline {
  width: 100%;
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.project-dropdown .pagination-inline {
  position: sticky;
  bottom: 0;
  z-index: 1;
}

.project-dropdown .pagination-compact {
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 4px 2px;
}

.project-dropdown .pagination-compact .pagination-summary,
.project-dropdown .pagination-compact .pagination-controls {
  flex-wrap: nowrap;
  gap: 5px;
}

.project-dropdown .pagination-compact .pagination-size-select {
  min-width: 68px;
  padding-right: 24px;
}

.project-dropdown .pagination-compact .pagination-jump {
  gap: 3px;
  margin-left: 0;
}

.project-dropdown .pagination-compact .pagination-jump input {
  width: 44px;
  min-width: 44px;
}

.project-dropdown .pagination-compact .pagination-jump-button {
  min-width: 42px;
  padding: 0 6px;
}

.pagination-current {
  min-width: 42px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-controls {
    justify-content: flex-start;
  }
}

.client-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(37, 99, 235, 0.12), transparent 38%),
    linear-gradient(320deg, rgba(22, 128, 60, 0.10), transparent 34%),
    var(--bg);
}

.client-login-card {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 32px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 38px;
}

.client-login-card h1 {
  margin: 8px 0 12px;
  font-size: 32px;
}

.client-shell {
  min-height: 100vh;
  padding: 28px;
}

.client-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.client-topbar h1 {
  margin-top: 5px;
  font-size: 28px;
}

.client-user,
.client-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.client-user span {
  color: var(--muted);
  font-size: 14px;
}

.client-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  margin-bottom: 18px;
}

.client-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(25, 42, 70, 0.06);
  padding: 18px;
}

.client-card + .client-card {
  margin-top: 0;
}

.client-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.client-card-head h2 {
  margin-top: 5px;
  font-size: 22px;
}

.monitor-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 5px;
}

.monitor-title-row h2 {
  margin-top: 0;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.audio-toggle input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

.audio-toggle:has(input:checked) {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--primary);
}

.client-card-head strong {
  color: var(--primary);
  white-space: nowrap;
}

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

.client-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 18px;
}

.client-meta div,
.code-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #f8fafc;
}

.client-meta dt,
.code-box span {
  color: var(--muted);
  font-size: 12px;
}

.client-meta dd {
  margin: 6px 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.client-meta .wide {
  grid-column: 1 / -1;
}

.client-meta input {
  margin-top: 6px;
  font-weight: 700;
}

.code-box {
  margin-bottom: 14px;
}

.code-box strong {
  display: block;
  margin-top: 8px;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.client-message {
  min-height: 48px;
  margin-bottom: 16px;
}

.active-card #clientPhone {
  overflow-wrap: anywhere;
}

.user-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px 1fr;
  background: var(--bg);
}

.user-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: #101827;
  color: #fff;
}

.user-content {
  min-width: 0;
  padding: 28px;
}

.user-workbench {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.user-workbench.filter-enabled {
  grid-template-columns: minmax(280px, 340px) minmax(250px, 300px) minmax(0, 1fr);
}

.phone-filter-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.phone-filter-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.phone-filter-switch {
  position: relative;
  width: 38px;
  height: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  background: #e2e8f0;
  transition: background 160ms ease, border-color 160ms ease;
}

.phone-filter-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  transition: transform 160ms ease;
}

.phone-filter-toggle input:checked + .phone-filter-switch {
  border-color: var(--primary);
  background: var(--primary);
}

.phone-filter-toggle input:checked + .phone-filter-switch::after {
  transform: translateX(16px);
}

.phone-filter-toggle input:focus-visible + .phone-filter-switch {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  outline-offset: 2px;
}

.phone-filter-toggle.blocked {
  color: #b45309;
  cursor: not-allowed;
}

.phone-filter-toggle.blocked .phone-filter-switch {
  border-color: #f59e0b;
  background: #fef3c7;
}

.phone-filter-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #ffffff;
}

.phone-filter-wallet > div span,
.phone-filter-wallet > div strong {
  display: block;
}

.phone-filter-wallet > div span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.phone-filter-wallet > div strong {
  color: #1d4ed8;
  font-size: 24px;
  line-height: 1;
}

.phone-filter-preview-note {
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.phone-check-preview {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.phone-check-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(320px, 410px) minmax(0, 1fr);
  gap: 18px;
}

.phone-check-form-card,
.phone-check-result-card {
  min-width: 0;
  min-height: 410px;
}

.preview-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
}

.phone-check-form {
  display: grid;
  gap: 14px;
}

.phone-check-form label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.phone-check-form-row {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 12px;
}

.phone-check-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.phone-check-empty {
  min-height: 290px;
  display: grid;
  place-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  text-align: center;
}

.phone-check-empty strong,
.phone-check-empty span {
  display: block;
}

.phone-check-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.phone-check-state,
.phone-check-match {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.phone-check-state.new {
  background: #dcfce7;
  color: #15803d;
}

.phone-check-state.old {
  background: #dbeafe;
  color: #1d4ed8;
}

.phone-check-state.locked {
  background: #fef3c7;
  color: #a16207;
}

.phone-check-state.banned {
  background: #fee2e2;
  color: #b91c1c;
}

.phone-check-match.matched {
  background: #ecfdf5;
  color: #047857;
}

.phone-check-match.missed {
  background: #fff1f2;
  color: #be123c;
}

.phone-filter-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.phone-filter-status.checking {
  color: #1d4ed8;
}

.phone-filter-status.matched > span:last-child {
  color: #047857;
}

.phone-filter-status.missed > span:last-child {
  color: #be123c;
}

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

.phone-check-facts > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.phone-check-facts span,
.phone-check-facts strong {
  display: block;
}

.phone-check-facts span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.phone-check-facts strong {
  overflow-wrap: anywhere;
}

.phone-check-account-list {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.phone-check-account-row {
  display: grid;
  grid-template-columns: 34px minmax(100px, 1fr) 90px 90px;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.phone-check-account-row:last-child {
  border-bottom: 0;
}

.phone-check-account-row span {
  color: var(--muted);
  font-size: 13px;
}

.phone-check-no-account {
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
}

.phone-check-history-card table {
  min-width: 850px;
}

.project-picker-card {
  align-self: start;
}

.project-select-wrap {
  position: relative;
  margin-bottom: 14px;
}

.endless-number-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.endless-number-filters label {
  min-width: 0;
}

.endless-number-filters select {
  width: 100%;
}

@media (max-width: 620px) {
  .template-editor-actions {
    grid-column: 1 / -1;
    gap: 4px;
    max-width: 320px;
  }

  .template-editor-actions > button {
    flex: 1 0 auto;
    padding-inline: 0;
    white-space: nowrap;
  }

  .endless-number-filters {
    grid-template-columns: 1fr;
  }
}

.client-balance-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #f8fafc;
}

.client-balance-summary span {
  color: var(--muted);
  font-size: 13px;
}

.client-balance-summary strong {
  color: #1d4ed8;
  font-size: 18px;
}

.project-select-btn {
  width: 100%;
  min-height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.project-select-btn:hover {
  background: #f8fafc;
}

.project-dropdown {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 12px;
}

.project-dropdown.open {
  display: block;
}

.project-search {
  margin-bottom: 10px;
}

.project-options {
  width: 100%;
}

.project-option {
  width: 100%;
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.project-option:hover,
.project-option.active {
  background: #e8f1ff;
  color: #1d4ed8;
}

.project-option small {
  color: var(--muted);
}

.full-button {
  width: 100%;
  margin-top: 10px;
}

.compact-note {
  margin-top: 12px;
  font-size: 13px;
}

.monitor-card {
  min-height: 360px;
}

.monitor-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  text-align: center;
}

.monitor-empty strong,
.monitor-empty span {
  display: block;
}

.monitor-list {
  display: grid;
  gap: 12px;
}

.monitor-task {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.monitor-task-head,
.monitor-task-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monitor-task-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.6fr;
  margin: 12px 0;
}

.monitor-task-grid.has-phone-filter {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monitor-task-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.monitor-close {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.monitor-close:hover {
  background: #f1f5f9;
  color: var(--text);
}

.monitor-task-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 10px;
}

.monitor-task-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.copy-value {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  text-align: left;
  overflow-wrap: anywhere;
}

.copy-value:hover {
  background: transparent;
  color: var(--primary);
}

.code-value {
  color: var(--primary);
  font-size: 20px;
}

.monitor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.modal-panel .form {
  padding: 18px;
}

.project-request-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.project-request-conversation-modal {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.project-request-conversation-modal > .modal-head {
  flex: 0 0 auto;
}

.project-request-conversation-modal .modal-head h3 {
  margin: 3px 0;
}

.project-request-conversation-body,
.project-request-view {
  min-height: 0;
}

.project-request-conversation-body {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  overflow: hidden;
}

.project-request-conversation-messages {
  min-height: 220px;
  max-height: 52vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
  background: #f8fafc;
}

.project-request-message {
  width: fit-content;
  max-width: 78%;
  padding: 11px 13px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  color: #1f2937;
}

.project-request-message.is-super {
  align-self: flex-end;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.project-request-message.is-user {
  align-self: flex-start;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.project-request-message-head,
.project-request-list-item-head,
.project-request-list-item-meta,
.project-request-list-toolbar,
.project-request-conversation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-request-message-head time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.project-request-message p {
  margin: 8px 0 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.project-request-message-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 120px));
  gap: 8px;
  margin-top: 9px;
}

.project-request-message-images a,
.project-request-file-preview {
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.project-request-message-images img,
.project-request-file-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.project-request-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.project-request-composer label > span,
.project-request-upload small {
  display: block;
}

.project-request-composer label > span {
  margin-bottom: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.project-request-composer textarea {
  width: 100%;
  resize: vertical;
}

.project-request-upload small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.project-request-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, 88px);
  gap: 9px;
}

.project-request-file-preview {
  position: relative;
}

.project-request-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 17px;
  line-height: 1;
}

.project-request-composer > .error,
.project-request-composer > .actions {
  grid-column: 1 / -1;
}

.project-request-view {
  max-height: calc(100vh - 112px);
  overflow-y: auto;
}

.project-request-list-toolbar,
.project-request-conversation-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.project-request-list-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.project-request-list {
  min-height: 260px;
  max-height: 62vh;
  display: grid;
  align-content: start;
  gap: 9px;
  overflow-y: auto;
  padding: 14px 18px 18px;
  background: #f8fafc;
}

.project-request-list-item {
  width: 100%;
  display: grid;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #fff;
  color: #1f2937;
  text-align: left;
}

.project-request-list-item:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.project-request-list-item-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-request-list-item-meta {
  color: var(--muted);
  font-size: 12px;
}

.project-request-list-item-meta b {
  color: #1d4ed8;
}

.project-request-list-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.project-request-new-form {
  border-top: 0;
}

.hidden-balance-modal {
  width: min(560px, 100%);
}

.hidden-balance-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hidden-balance-project-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  grid-column: 1 / -1;
}

.hidden-balance-preview {
  min-height: 22px;
  margin: 4px 0 0;
  color: #1d4ed8;
  font-weight: 600;
}

.copy-template-source {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

body.modal-open {
  overflow: hidden;
}

.template-users-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.38);
}

.template-users-drawer {
  width: min(440px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #ffffff;
  box-shadow: -18px 0 42px rgba(15, 23, 42, 0.16);
}

.template-users-drawer-body {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.template-users-search {
  display: grid;
  gap: 7px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.template-users-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.template-user-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border: 0;
  border-bottom: 1px solid #edf1f7;
  border-radius: 0;
  background: #ffffff;
  color: #172033;
  text-align: left;
}

.template-user-row:hover {
  background: #f6f9ff;
}

.template-user-row > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.template-user-row strong,
.template-user-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-user-row small {
  color: var(--muted);
  font-size: 12px;
}

.template-user-open {
  flex: 0 0 auto;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.template-users-message {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.template-users-pagination {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.agent-profit-modal {
  width: min(1240px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.batch-user-modal {
  width: min(880px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.batch-user-modal .modal-head h3 {
  margin: 0;
  font-size: 22px;
}

.batch-user-modal-body {
  overflow: auto;
  padding: 0 20px 20px;
}

.batch-user-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.batch-user-result {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.batch-user-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.batch-user-result h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.batch-user-result table {
  background: #fff;
}

.batch-user-result code {
  color: var(--primary-dark);
  font-weight: 700;
}

.agent-profit-modal .modal-head h3,
.agent-profit-modal .modal-head p {
  margin: 0;
}

.agent-profit-modal-body {
  overflow: auto;
  padding: 0 20px 20px;
}

.agent-profit-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 -20px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.agent-profit-summary > div {
  min-height: 86px;
  padding: 17px 20px;
  border-right: 1px solid var(--line);
}

.agent-profit-summary > div:last-child {
  border-right: 0;
}

.agent-profit-summary span,
.agent-profit-form-band label span,
.agent-profit-preview span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.agent-profit-summary strong {
  font-size: 23px;
}

.agent-profit-range-summary > div {
  display: flex;
  min-height: 82px;
  align-items: baseline;
  gap: 16px;
}

.agent-profit-range-summary span {
  margin-bottom: 0;
}

.agent-profit-range-summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.agent-profit-range-summary small.error {
  color: #b91c1c;
}

.agent-profit-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 0.42fr) repeat(2, minmax(190px, 0.58fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.agent-profit-filter-bar label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.agent-profit-filter-bar button {
  min-width: 92px;
}

#agentProfitBatchForm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 12px;
}

#agentProfitBatchForm label {
  display: flex;
  align-items: center;
  gap: 8px;
}

#agentProfitBatchForm label span {
  margin: 0;
  white-space: nowrap;
}

#agentProfitBatchPrice {
  width: 110px;
  min-height: 32px;
  padding: 5px 8px;
}

#agentProfitBatchForm button {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}

.agent-profit-logic-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #dbe7f5;
  background: #f6f9fd;
  color: #475569;
  font-size: 13px;
  line-height: 1.65;
}

.agent-profit-logic-note strong {
  flex: 0 0 auto;
  color: #1e3a5f;
}

.agent-profit-form-band {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(130px, 0.45fr) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.agent-profit-form-band > div:first-child {
  align-self: center;
}

.agent-profit-form-band > div:first-child span {
  display: block;
  margin-top: 4px;
}

.agent-profit-order-editor {
  grid-template-columns: minmax(150px, 0.8fr) repeat(2, minmax(100px, 0.4fr)) minmax(170px, 1fr) minmax(90px, 0.4fr) auto;
  background: #f8fafc;
  margin: 0 -20px;
  padding: 16px 20px;
}

.agent-profit-preview {
  align-self: center;
}

.smsjs-auth-entry { display: grid; gap: 6px; align-content: end; }
.smsjs-auth-entry button { justify-self: start; }
.smsjs-login-panel { width: min(540px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.smsjs-login-image-box { position: relative; width: 100%; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; touch-action: none; cursor: crosshair; }
.smsjs-login-image-box img { display: block; width: 100%; height: auto; user-select: none; }
#smsjsLoginMarkers { position: absolute; inset: 0; pointer-events: none; }
#smsjsLoginMarkers span { position: absolute; display: grid; place-items: center; width: 24px; height: 24px; transform: translate(-50%, -50%); border-radius: 50%; color: #fff; background: #165f55; border: 2px solid #fff; font-size: 13px; }
.smsjs-login-panel .actions { flex-wrap: wrap; }

.agent-profit-preview strong {
  font-size: 18px;
}

.agent-profit-editor-actions {
  display: flex;
  gap: 8px;
}

.agent-profit-table-wrap {
  margin-top: 18px;
}

.agent-profit-table-wrap table {
  min-width: 1180px;
}

.agent-profit-table-wrap td {
  vertical-align: top;
}

.agent-profit-table-wrap td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  white-space: nowrap;
}

.agent-profit-terminal-cell {
  color: #64748b;
}

.agent-profit-settlement-head,
.agent-profit-settlement-cell {
  background: #eff6ff;
}

.agent-profit-settlement-cell strong {
  color: #1d4ed8;
  font-size: 14px;
}

.agent-profit-cost-cell {
  color: #9a5b13;
}

.profit-source {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.profit-source-system {
  background: #dbeafe;
  color: #1d4ed8;
}

.profit-source-manual {
  background: #ffedd5;
  color: #c2410c;
}

.profit-source-refund {
  background: #fee2e2;
  color: #b91c1c;
}

.profit-positive {
  color: #15803d;
  font-weight: 700;
}

.profit-negative {
  color: #b91c1c;
  font-weight: 700;
}

.agent-profit-phone-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.records-card {
  padding: 0;
  overflow: hidden;
}

.records-card table {
  min-width: 860px;
}

.records-card .client-card-head {
  padding: 18px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}

.records-card-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: min(620px, 100%);
}

.records-card-tools input {
  flex: 1 1 0;
  min-width: 0;
}

.records-card-tools select {
  flex: 0 0 112px;
  min-width: 0;
}

.records-card-tools button {
  flex: 0 0 auto;
}

.request-content-cell {
  max-width: 560px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.compact-copy {
  margin: 6px 0 0;
}

.usdt-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.usdt-summary .stat-item {
  min-height: 104px;
  padding: 18px;
}

.usdt-summary .stat-item strong {
  font-size: 22px;
}

.usdt-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(440px, 1.18fr);
  gap: 18px;
  align-items: start;
}

.usdt-create-panel,
.usdt-payment-card {
  padding: 20px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading h3,
.panel-heading p {
  margin: 0;
}

.panel-heading p {
  margin-top: 5px;
}

.usdt-order-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usdt-close-button {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
}

.usdt-close-button:hover {
  background: #eef2f7;
  color: #1f2937;
}

.usdt-payment-info small {
  font-size: 12px;
}

.usdt-create-panel label {
  display: grid;
  gap: 7px;
}

.usdt-calculation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
  padding: 13px 14px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
}

.usdt-calculation strong {
  color: #075985;
  font-size: 20px;
}

.usdt-create-panel > button {
  width: 100%;
  margin-top: 12px;
}

.usdt-payment-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.usdt-qr {
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.usdt-payment-info {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.usdt-payment-info > div {
  display: grid;
  gap: 4px;
}

.usdt-payment-info span {
  color: var(--muted);
  font-size: 13px;
}

.usdt-payment-info strong {
  font-size: 20px;
}

.address-row code {
  display: block;
  max-width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.compact-button {
  min-height: 32px;
  padding: 5px 10px;
}

.address-row .compact-button,
.usdt-payment-info .compact-button {
  width: fit-content;
}

.warning-copy {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  line-height: 1.6;
}

#usdtTermsEditor { margin-block: 12px; padding: 14px 18px; }
#usdtTermsEditor summary { cursor: pointer; font-weight: 650; }
#usdtTermsForm { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 14px; }
#usdtTermsForm label { display: grid; gap: 6px; min-width: 0; }
#usdtTermsForm label:first-child { flex: 1 1 300px; }
#usdtTermsForm input { width: 100%; }

.usdt-history-heading {
  margin-top: 24px;
}

.usdt-history-section {
  margin-top: 28px;
}

#usdtRecharge table {
  min-width: 760px;
}

.table-actions {
  display: flex;
  gap: 6px;
  min-width: 118px;
}

.openapi-page > .page-header {
  margin-bottom: 18px;
}

.openapi-page .compact-copy,
.openapi-section-head h3,
.openapi-section-head p,
.openapi-reference-block h4 {
  margin: 0;
}

.openapi-key-panel,
.openapi-reference,
.openapi-examples,
.openapi-debugger {
  padding: 18px;
}

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

.openapi-section-head p {
  margin-top: 5px;
}

.openapi-key-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.openapi-key-meta > div {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.openapi-key-meta > div:last-child {
  border-right: 0;
}

.openapi-key-meta span,
.openapi-key-meta strong {
  display: block;
}

.openapi-key-meta span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.openapi-key-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.openapi-key-actions {
  margin-top: 14px;
}

.openapi-one-time-key {
  margin-top: 14px;
  border-left: 3px solid #d97706;
  background: #fffbeb;
  padding: 13px 14px;
}

.openapi-one-time-key > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.openapi-one-time-key span {
  color: #92400e;
  font-size: 13px;
}

.openapi-key-copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.openapi-key-copy-row input,
.openapi-code,
.openapi-endpoint-list pre,
.openapi-endpoint-list code,
.openapi-reference-block code {
  font-family: Consolas, "Courier New", monospace;
}

.openapi-endpoint-list {
  border-top: 1px solid var(--line);
}

.openapi-endpoint-list details {
  border-bottom: 1px solid var(--line);
  padding: 0 4px;
}

.openapi-endpoint-list summary {
  display: grid;
  grid-template-columns: 58px minmax(180px, 1fr) minmax(100px, auto);
  align-items: center;
  gap: 12px;
  min-height: 52px;
  cursor: pointer;
  list-style: none;
}

.openapi-endpoint-list summary::-webkit-details-marker {
  display: none;
}

.openapi-endpoint-list details > p,
.openapi-endpoint-list details > pre {
  margin: 0 0 14px 70px;
}

.openapi-endpoint-list pre {
  overflow-x: auto;
  border-radius: 6px;
  background: #f1f5f9;
  padding: 12px;
}

.http-method {
  display: inline-flex;
  width: 52px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.http-method.get {
  background: #047857;
}

.http-method.post {
  background: #2563eb;
}

.openapi-reference-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  margin-top: 24px;
}

.openapi-reference-block {
  min-width: 0;
}

.openapi-reference-block h4 {
  margin-bottom: 10px;
}

.openapi-reference-block table {
  min-width: 440px;
}

.openapi-language-tabs {
  margin-bottom: 12px;
}

.openapi-code {
  min-height: 178px;
  overflow: auto;
  margin: 0;
  border: 1px solid #334155;
  border-radius: 7px;
  background: #111827;
  color: #e5e7eb;
  padding: 16px;
  line-height: 1.65;
  white-space: pre;
}

.openapi-debugger-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
  gap: 14px;
}

.openapi-debugger-form > label:first-child,
.openapi-debugger-form .wide {
  grid-column: 1 / -1;
}

.openapi-debugger-form textarea {
  min-height: 104px;
  font-family: Consolas, "Courier New", monospace;
}

.openapi-debug-output {
  min-height: 132px;
  margin-top: 14px;
}

.user-row-actions {
  display: flex;
  flex-wrap: wrap;
  min-width: 126px;
  gap: 4px;
}

.user-row-actions > button {
  white-space: nowrap;
}

@media (max-width: 1200px) and (min-width: 901px) {
  .user-workbench.filter-enabled {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .user-workbench.filter-enabled .monitor-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .login-panel,
  .app-shell,
  .client-login-card,
  .client-grid,
  .user-app,
  .user-workbench,
  .phone-check-layout,
  .usdt-layout {
    grid-template-columns: 1fr;
  }

  .openapi-reference-grid {
    grid-template-columns: 1fr;
  }

  .phone-check-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-app {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .user-workbench.filter-enabled {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-sidebar,
  .user-content {
    width: 100%;
    min-width: 0;
  }

  .usdt-summary {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

@media (max-width: 900px) {
  .agent-profit-summary {
    grid-template-columns: 1fr;
  }

  .agent-profit-filter-bar,
  .agent-profit-form-band,
  .agent-profit-order-editor {
    grid-template-columns: 1fr 1fr;
  }

  .agent-profit-remark-field,
  .agent-profit-search-field,
  .agent-profit-form-band > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .modal-backdrop {
    padding: 8px;
  }

  .project-request-conversation-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .project-request-conversation-messages {
    max-height: 46vh;
    padding: 12px;
  }

  .project-request-message {
    max-width: 92%;
  }

  .project-request-composer {
    grid-template-columns: 1fr;
    padding: 13px;
  }

  .project-request-composer > *,
  .project-request-preview {
    grid-column: 1;
  }

  .project-request-list-toolbar,
  .project-request-conversation-toolbar {
    align-items: flex-start;
    padding: 12px;
  }

  .project-request-list {
    padding: 12px;
  }

  .agent-profit-modal {
    max-height: calc(100vh - 16px);
  }

  .batch-user-modal {
    max-height: calc(100vh - 16px);
  }

  .hidden-balance-form-grid,
  .hidden-balance-project-fields {
    grid-template-columns: 1fr;
  }

  .agent-profit-modal-body {
    padding: 0 14px 14px;
  }

  .batch-user-modal-body {
    padding: 0 14px 14px;
  }

  .batch-user-result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-profit-summary {
    margin: 0 -14px;
  }

  .agent-profit-range-summary > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .agent-profit-range-summary small {
    margin-left: 0;
  }

  .agent-profit-logic-note {
    flex-direction: column;
    gap: 3px;
    margin: 0 -14px;
    padding: 12px 14px;
  }

  .agent-profit-filter-bar,
  .agent-profit-form-band,
  .agent-profit-order-editor {
    grid-template-columns: 1fr;
  }

  .agent-profit-remark-field,
  .agent-profit-search-field,
  .agent-profit-form-band > div:first-child {
    grid-column: auto;
  }

  .agent-profit-order-editor {
    margin: 0 -14px;
    padding: 14px;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 18px;
  }

  .login-panel {
    padding: 26px;
  }

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

  .project-permission-tools {
    grid-template-columns: 1fr;
  }

  .template-project-filters {
    flex-direction: column;
  }

  .template-project-filters select,
  .template-project-filters input {
    width: 100%;
    flex-basis: auto;
  }

  .template-selection-actions {
    flex-wrap: wrap;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-topbar h2 {
    white-space: nowrap;
  }

  .records-card-tools {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  #usdtRecharge > .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #usdtRecharge > .page-header > button {
    width: 100%;
  }

  .openapi-page > .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .openapi-page > .page-header > button {
    width: 100%;
  }

  .openapi-key-meta,
  .openapi-debugger-form {
    grid-template-columns: 1fr;
  }

  .openapi-key-meta > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .openapi-key-meta > div:last-child {
    border-bottom: 0;
  }

  .openapi-debugger-form > label:first-child,
  .openapi-debugger-form .wide {
    grid-column: auto;
  }

  .openapi-section-head,
  .openapi-one-time-key > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .openapi-key-copy-row {
    grid-template-columns: 1fr;
  }

  .openapi-endpoint-list summary {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .openapi-endpoint-list summary strong {
    grid-column: 2;
  }

  .openapi-endpoint-list details > p,
  .openapi-endpoint-list details > pre {
    margin-left: 0;
  }

  .openapi-language-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .client-shell {
    padding: 18px;
  }

  .client-topbar,
  .client-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-meta {
    grid-template-columns: 1fr;
  }

  .user-sidebar {
    position: static;
  }

  .monitor-task-grid,
  .monitor-task-grid.has-phone-filter {
    grid-template-columns: 1fr;
  }

  .phone-check-form-row,
  .phone-check-actions,
  .phone-check-facts {
    grid-template-columns: 1fr;
  }

  .phone-check-account-row {
    grid-template-columns: 28px minmax(90px, 1fr);
  }

  .phone-check-account-row span:nth-child(n + 3) {
    grid-column: 2;
  }

  .usdt-payment-body {
    grid-template-columns: 1fr;
  }

  .usdt-qr {
    width: min(260px, 100%);
    height: auto;
    aspect-ratio: 1;
    justify-self: center;
  }
}
.ttkka-candidate-editor {
  display: grid;
  gap: 8px;
}

.ttkka-candidate-head,
.ttkka-candidate-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ttkka-candidate-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) minmax(160px, 0.5fr) minmax(175px, auto) auto;
}

.ttkka-candidate-head {
  align-items: center;
  justify-content: space-between;
}

.ttkka-candidate-rows {
  display: grid;
  gap: 8px;
}

.ttkka-candidate-row > label:not(.ttkka-candidate-enabled) {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ttkka-candidate-row > label:not(.ttkka-candidate-enabled) > span {
  display: inline;
  margin-bottom: 0;
  white-space: nowrap;
}

.ttkka-candidate-row > label:not(.ttkka-candidate-enabled) input {
  min-width: 0;
  flex: 1 1 auto;
}

.ttkka-candidate-enabled {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  white-space: nowrap;
}

.ttkka-candidate-enabled input {
  width: 16px;
  height: 16px;
}

.ttkka-stats-inline {
  min-width: 0;
  margin-left: auto;
}

.ttkka-stats-inline-head {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ttkka-stats-inline-head > span {
  display: inline;
  margin: 0;
  color: #475569;
  font-size: 13px;
}

.ttkka-stats-inline .segmented-control {
  display: inline-flex;
}

.ttkka-candidate-rate {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

.ttkka-candidate-rate strong {
  color: var(--primary);
  font-weight: 700;
}

.ttkka-stats-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ttkka-stats-scroll { overflow-x: auto; margin-top: 8px; }
.ttkka-stats-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.ttkka-stats-table th, .ttkka-stats-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.ttkka-stats-table th { color: #475569; font-size: 12px; font-weight: 600; }
.ttkka-stat-rate { color: var(--primary); font-weight: 700; }

@media (max-width: 760px) {
  .ttkka-candidate-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ttkka-stats-inline {
    width: 100%;
    margin-left: 0;
    order: 3;
  }

  .ttkka-candidate-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ttkka-candidate-row > label:not(.ttkka-candidate-enabled) {
    width: 100%;
  }
}


.project-connection-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.project-form-header {
  display: grid;
  grid-template-columns: subgrid;
  gap: inherit;
}

.project-uid-value {
  display: flex;
  min-height: 40px;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#projects .project-config-table th,
#projects .project-config-table td { text-align: center; }
#projects .project-config-table .select-cell input { margin-inline: auto; }

#projectForm > label { justify-content: flex-start; }
#projectForm label > .project-code-input { margin-bottom: 0; }

.project-code-input { display: flex; align-items: center; gap: 8px; min-width: 0; }
.project-code-input > input { flex: 1; width: 0; min-width: 0; }
.project-code-input > button { flex: none; white-space: nowrap; }

.project-connection-toolbar label {
  min-width: 220px;
  flex: 1 1 260px;
}

.endless-connection-candidates {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  margin-top: 8px;
}

.endless-connection-candidate {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.endless-connection-candidate:hover {
  border-color: var(--primary);
}

.endless-connection-candidate.disabled {
  opacity: 0.55;
  background: var(--surface-muted, #f8fafc);
}

.endless-connection-candidate.over-cost {
  background: #fff7f7;
  border-color: #fecaca;
}

.endless-connection-candidate-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.endless-connection-candidate-main small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endless-connection-stats {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.endless-connection-price {
  white-space: nowrap;
  font-weight: 600;
}

.endless-connection-price.over-cost-text {
  color: var(--danger);
}

@media (max-width: 760px) {
  #projectEndlessConnectionConfig,
  #endlessConnectionCandidates {
    min-width: 0;
    max-width: 100%;
  }

  #endlessConnectionCandidates {
    grid-template-columns: minmax(0, 1fr);
  }

  #endlessConnectionCandidates .endless-connection-candidate {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
  }

  #endlessConnectionCandidates .endless-connection-candidate-main,
  #endlessConnectionCandidates .endless-connection-stats {
    grid-column: 1 / -1;
  }

  #endlessConnectionCandidates .endless-connection-candidate-main strong,
  #endlessConnectionCandidates .endless-connection-stats,
  #endlessConnectionCandidates .endless-connection-price {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #endlessConnectionCandidates [data-endless-connection-toggle] {
    min-width: 64px;
    min-height: 40px;
  }
}

/* Compact filter controls sit above the project picker; recharge alone opens the dialog. */
.compact-filter-bar { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; border: 1px solid #dbe4f0; border-radius: 10px; background: #fff; }
.compact-filter-bar .phone-filter-wallet { display: flex; align-items: center; gap: 6px; padding: 0; }
.compact-filter-bar .phone-filter-wallet > div { display: flex; align-items: center; gap: 5px; }
.compact-filter-bar .phone-filter-preview-note { display: none; }

.compact-filter-bar > label:not(.phone-filter-toggle) { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.compact-filter-bar select { max-width: 150px; }
.project-request-message.is-mine { align-self: flex-end; border-color: #bfdbfe; background: #eff6ff; }
.project-request-message.is-other { align-self: flex-start; border-color: #bbf7d0; background: #f0fdf4; }
.auto-block-settings-rows { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.auto-block-rule { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px; border-bottom: 1px solid #e2e8f0; }
.auto-block-rule strong { min-width: 130px; }
.auto-block-rule label { display: inline-flex; gap: 6px; align-items: center; }
.auto-block-rule input[type="number"] { width: 75px; }

@media (max-width: 680px) {
  .modal-backdrop {
    padding: 10px;
  }


}


/* Larger, searchable automatic-block settings dialog. */
.auto-block-settings-panel {
  width: min(960px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  border: 0;
  border-radius: 18px;
  background: #f6f8fc;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.auto-block-settings-head { padding: 20px 24px 18px; background: linear-gradient(135deg, #fff 0%, #f3f7ff 100%); }
#autoBlockSettingsTitle { margin: 0; font-size: 21px; }
.auto-block-settings-head .icon-button { flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border: 1px solid #dbe4f0; border-radius: 11px; background: #fff; color: #475569; font-size: 24px; line-height: 1; }
.auto-block-settings-head .icon-button:hover { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.auto-block-settings-body { padding: 18px 24px 24px; }
.auto-block-settings-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) auto; gap: 16px; align-items: end; margin-bottom: 14px; }
.auto-block-project-search { display: grid; gap: 7px; }
.auto-block-project-search > span { color: #334155; font-size: 13px; font-weight: 700; }
.auto-block-project-search input { min-height: 42px; border-radius: 10px; background: #fff; }
.auto-block-settings-summary { display: flex; align-items: baseline; gap: 6px; min-height: 42px; padding: 9px 15px; border: 1px solid #dbeafe; border-radius: 10px; background: #eff6ff; color: #475569; white-space: nowrap; }
.auto-block-settings-summary strong { color: #1d4ed8; font-size: 20px; }
.auto-block-settings-rows { display: grid; gap: 10px; max-height: min(62vh, 620px); padding-right: 5px; overflow-y: auto; }
.auto-block-rule { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(105px, .65fr) minmax(145px, .8fr) minmax(170px, .95fr) auto; gap: 14px; align-items: end; padding: 16px; border: 1px solid #e2e8f0; border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgba(15, 23, 42, .04); transition: border-color .16s ease, box-shadow .16s ease; }
.auto-block-rule:hover { border-color: #cbd5e1; box-shadow: 0 7px 20px rgba(15, 23, 42, .07); }
.auto-block-rule.is-enabled { border-color: #bfdbfe; background: linear-gradient(135deg, #fff 0%, #f5f9ff 100%); }
.auto-block-rule-project { display: grid; gap: 4px; align-self: center; min-width: 0; }
.auto-block-rule-project strong { min-width: 0; overflow: hidden; color: #0f172a; text-overflow: ellipsis; white-space: nowrap; }
.auto-block-rule-project small { color: #94a3b8; }
.auto-block-rule label { display: grid; gap: 7px; align-items: center; color: #475569; font-size: 13px; font-weight: 700; }
.auto-block-switch-field { align-self: center; grid-template-columns: auto 22px; justify-content: start; }
.auto-block-switch-field input { width: 18px; min-height: 18px; margin: 0; accent-color: #2563eb; }
.auto-block-input-wrap { position: relative; display: block; }
.auto-block-rule .auto-block-input-wrap input[type="number"] { width: 100%; min-height: 40px; padding-right: 34px; border-radius: 9px; background: #fff; }
.auto-block-input-wrap b { position: absolute; right: 12px; top: 50%; color: #64748b; font-size: 13px; transform: translateY(-50%); pointer-events: none; }
.auto-block-save { min-width: 92px; min-height: 40px; border-radius: 9px; }
.auto-block-empty { display: grid; place-items: center; gap: 6px; min-height: 180px; border: 1px dashed #cbd5e1; border-radius: 13px; background: #fff; color: #64748b; text-align: center; }
.auto-block-empty strong { color: #334155; }
@media (max-width: 860px) {
  .auto-block-settings-panel { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
  .auto-block-rule { grid-template-columns: minmax(180px, 1fr) minmax(110px, auto) minmax(140px, 1fr); }
  .auto-block-number-field:last-of-type { grid-column: 1 / 3; }
  .auto-block-save { grid-column: 3; }
}
@media (max-width: 620px) {
  .auto-block-settings-panel { width: 100%; max-height: calc(100vh - 20px); border-radius: 13px; }
  .auto-block-settings-head { padding: 16px 18px; }
  .auto-block-settings-body { padding: 14px 16px 18px; }
  .auto-block-settings-toolbar { grid-template-columns: 1fr; gap: 10px; }
  .auto-block-settings-summary { justify-content: center; }
  .auto-block-settings-rows { max-height: calc(100vh - 245px); }
  .auto-block-rule { grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
  .auto-block-rule-project, .auto-block-switch-field { grid-column: 1 / -1; }
  .auto-block-number-field:last-of-type { grid-column: auto; }
  .auto-block-save { grid-column: 1 / -1; width: 100%; }
}

/* Report-only compact numeric sorting control. */
#reportHead .report-sort-heading { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
#reportHead button.report-sort-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 14px; width: 14px; min-width: 0; height: 18px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; color: #94a3b8; font-size: 12px; line-height: 1; box-shadow: none; }
#reportHead button.report-sort-button:hover, #reportHead button.report-sort-button.active { background: transparent; color: #2563eb; }
#reportHead button.report-sort-button:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }

.login-extra-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin: 10px 0 0; }
.login-extra-links button { min-width: auto; min-height: 0; padding: 0; border: 0; background: transparent; color: #14685f; box-shadow: none; }
.public-support-fab { position: fixed; z-index: 900; right: 22px; bottom: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 64px; height: 64px; min-width: 0; padding: 8px; border-radius: 50%; background: var(--primary, #17665b); color: var(--on-primary, #fff); font-size: 12px; font-weight: 700; box-shadow: var(--sh-brand-lg, 0 3px 10px #17665b2b); }
.public-support-fab svg { width: 24px; height: 24px; }
.public-support-fab { touch-action: none; user-select: none; }
.public-support-fab.is-dragging { cursor: grabbing; }
.public-support-fab:hover:not(:disabled) { background: var(--primary-dark, #12564d); }
.public-support-unread { position: absolute; right: 2px; top: 2px; width: 13px; height: 13px; border: 2px solid var(--surface, #fff); border-radius: 50%; background: #ef4444; }
.public-support-dock .public-support-direct-close { flex: 0 0 30px; min-width: 30px; min-height: 30px; padding: 0; border: 0; border-radius: 50%; background: #f3f5f9; color: #536175; font-size: 22px; }
.public-support-dock .public-support-direct-close:hover { background: var(--primary-soft, #e9f2ef); color: var(--primary, #17665b); }
.public-support-dock { position: fixed; z-index: 901; inset: auto 22px 98px auto; width: min(380px, calc(100vw - 28px)); height: min(650px, calc(100dvh - 114px)); max-width: none; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid #e7e9ef; border-radius: 20px; background: #fff; color: #162033; box-shadow: 0 20px 65px #19365e33; }
.public-support-dock[open] { display: flex; flex-direction: column; }
.public-support-dock.maximized { inset: 16px; width: auto; height: auto; }
.public-support-header { display: flex; align-items: center; gap: 10px; flex-shrink: 0; height: 64px; padding: 12px 14px; border-bottom: 1px solid #e9ebef; background: #fff; }
.public-support-avatar { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft, #e9f2ef); color: var(--primary, #17665b); }
.public-support-avatar svg { width: 21px; height: 21px; }
.public-support-avatar i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: #9ca3af; }
.public-support-avatar i.connected { background: var(--brand-400, #4b907f); }
.public-support-heading { flex: 1; min-width: 0; }
.public-support-heading h2 { margin: 0 0 3px; font-size: 14px; }
.public-support-heading small { color: #818791; font-size: 12px; }
.public-support-menu { position: relative; }
.public-support-menu summary { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #f4f5f7; cursor: pointer; list-style: none; font-size: 20px; font-weight: 700; }
.public-support-menu summary::-webkit-details-marker { display: none; }
.public-support-menu > div { position: absolute; z-index: 2; top: 36px; right: -2px; width: 154px; padding: 6px; border: 1px solid #e3e5e9; border-radius: 12px; background: #fff; box-shadow: 0 3px 10px #0002; }
.public-support-menu button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 30px; padding: 4px 7px; background: #fff; color: #222; font-size: 14px; text-align: left; box-shadow: none; }
.public-support-dock .public-support-menu button:hover { background: #f3f5f9; }
.public-support-menu button.public-support-close { color: #ee3944; }
.public-support-dock .public-support-messages { flex: 1; min-height: 0; max-height: none; padding: 18px 14px; border: 0; border-radius: 0; background: #f8f9fb; overscroll-behavior: contain; }
.public-support-empty { margin: 42px 0 0; color: #8a9099; font-size: 13px; line-height: 1.7; text-align: center; }
.public-support-dock .public-support-message { flex-shrink: 0; }
.public-support-dock .public-support-message.outgoing { border-color: var(--brand-100, #d2e5df); background: var(--primary-soft, #e9f2ef); }
.public-support-form { flex-shrink: 0; display: grid; gap: 8px; padding: 12px; border-top: 1px solid #e9ebef; background: #fff; }
.public-support-composer { overflow: hidden; border: 1px solid #e0e3e9; border-radius: 14px; }
.public-support-composer:focus-within { border-color: var(--brand-300, #80b4a5); }
.public-support-composer textarea { display: block; width: 100%; min-height: 62px; max-height: 120px; margin: 0; padding: 12px 12px 4px; resize: vertical; border: 0; background: #fff; color: #162033; font: inherit; font-size: 13px; line-height: 1.5; box-shadow: none; outline: none; }
.public-support-compose-actions { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px 8px; }
.public-support-upload { position: relative; display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; overflow: hidden; border-radius: 6px; color: #7b818b; cursor: pointer; }
.public-support-upload:hover, .public-support-upload:focus-within { background: var(--primary-soft, #e9f2ef); outline: 2px solid var(--brand-300, #80b4a5); }
.public-support-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.public-support-compose-actions svg { width: 19px; height: 19px; }
.public-support-compose-actions > button { display: grid; place-items: center; width: 32px; min-width: 32px; min-height: 30px; padding: 0; border-radius: 9px; background: var(--primary, #17665b); color: var(--on-primary, #fff); }
.public-support-compose-actions > button:hover:not(:disabled) { background: var(--primary-dark, #12564d); }
.public-support-file-names { flex: 1; min-width: 0; overflow: hidden; color: #7b818b; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.public-support-form .error { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.public-support-form .error:empty { display: none; }
.public-support-footer { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px; margin: 0; color: #949aa4; font-size: 11px; }
.public-support-footer a { color: var(--primary, #17665b); }
.support-quote { display: grid; gap: 4px; min-width: 0; margin: 6px 0; padding: 8px 10px; border-left: 3px solid var(--primary, #17665b); border-radius: 5px; background: var(--surface-muted, #f0f3f2); color: var(--text, #172521); font-size: 12px; overflow-wrap: anywhere; }
.support-quote strong { font-size: 11px; color: var(--muted, #62736d); }
.support-quote span { white-space: pre-wrap; }
.support-quote-preview:not(.hidden) { display: flex; align-items: flex-start; gap: 6px; }
.support-quote-preview .support-quote { flex: 1; margin: 0; max-height: 100px; overflow: auto; }
.support-quote-preview > button { flex: 0 0 auto; min-height: 28px; padding: 2px 8px; background: transparent; color: var(--muted, #62736d); box-shadow: none; }
.support-message-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.public-support-message.outgoing .support-message-actions { justify-content: space-between; }
.public-support-message .support-message-actions .public-support-read-receipt { margin: 0; line-height: 20px; }
.public-support-message .support-quote-reply { display: inline-block; flex: 0 0 auto; width: auto; min-width: 0; height: 20px; min-height: 20px; margin: 0; padding: 0 2px; border: 0; border-radius: 3px; background: transparent; color: var(--muted, #62736d); font-size: 11px; line-height: 20px; box-shadow: none; }
.public-support-message .support-quote-reply:hover { color: var(--primary, #17665b); background: var(--primary-soft, #e9f2ef); }
.kupeng-quantity-box { margin: 4px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-sunken, #f6f8f7); }
.kupeng-quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kupeng-quantity-row > label { margin: 0; font-size: 13px; font-weight: 600; }
.kupeng-quantity-stepper { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.kupeng-quantity-stepper > button { min-width: 30px; min-height: 32px; margin: 0; padding: 2px 8px; border: 0; border-radius: 0; background: var(--primary); color: var(--on-primary, #fff); box-shadow: none; }
.kupeng-quantity-stepper > input { width: 54px; min-width: 0; min-height: 32px; padding: 4px; border: 0; border-radius: 0; text-align: center; appearance: textfield; }
.kupeng-quantity-stepper input::-webkit-inner-spin-button { appearance: none; }
.kupeng-quantity-box > small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.kupeng-quantity-box strong { color: var(--primary); }
.public-support-form .public-portal-captcha { grid-template-columns: minmax(0, 1fr) 145px; gap: 8px; font-size: 12px; }
.public-support-form .public-portal-captcha label { display: grid; gap: 4px; }
.public-support-form .public-portal-captcha input { min-width: 0; height: 36px; }
.public-support-form .captcha-image-button { min-height: 36px; }
.public-support-form .captcha-image-button img { height: 36px; }
.public-support-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #f5f7f5; }
.public-support-landing { width: min(620px, 100%); padding: clamp(24px, 6vw, 52px); border: 1px solid #e0e8e5; border-radius: 20px; background: #fff; box-shadow: 0 18px 55px #102a2717; }
.public-support-landing h1 { margin: 16px 0 10px; }
.public-support-landing > p { color: #62736d; line-height: 1.7; }
.public-support-landing > button { margin: 12px 0 4px; }
.public-portal-dialog { width: min(540px, calc(100vw - 24px)); max-height: min(760px, calc(100vh - 24px)); padding: 20px; border: 1px solid #dbe4e2; border-radius: 16px; background: var(--surface, #fff); color: var(--text, #172521); box-shadow: 0 22px 70px #102a2733; }
.public-portal-dialog::backdrop { background: #0b1715a8; backdrop-filter: blur(3px); }
.public-portal-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.public-portal-dialog > header h2 { margin: 0; }
.public-support-contact { margin: 0 0 12px; color: #64746f; font-size: 13px; }
.public-support-messages { display: flex; flex-direction: column; gap: 10px; min-height: 90px; max-height: 310px; overflow: auto; padding: 10px; border: 1px solid #e1e8e6; border-radius: 12px; background: #f6f8f7; }
.public-support-message { max-width: 88%; padding: 10px 12px; border: 1px solid #e1e8e6; border-radius: 12px 12px 12px 4px; background: #fff; overflow-wrap: anywhere; }
.public-support-message.outgoing { align-self: flex-end; border-color: #c8e8dd; border-radius: 12px 12px 4px 12px; background: #eaf7f1; }
.public-support-message small { display: block; color: #71817c; font-size: 11px; }
.public-support-message p { margin: 6px 0 0; white-space: normal; }
.public-support-images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.public-support-images button { padding: 0; border: 0; background: transparent; border-radius: 8px; }
.public-support-images img { width: 76px; height: 76px; border-radius: 8px; object-fit: cover; }
.support-image-dialog { width: min(1400px, 96vw); max-width: 96vw; max-height: 96vh; padding: 12px; }
.support-preview-media { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(90vh - 64px); max-height: calc(90dvh - 64px); margin: auto; object-fit: contain; }
.support-preview-media:is(video) { width: min(100%, 1080px); background: #111; }
.public-portal-dialog .form { margin-top: 12px; }
.public-portal-dialog .success { color: #16804b; }
.public-portal-captcha { display: grid; grid-template-columns: minmax(0, 1fr) 145px; align-items: end; gap: 10px; }
.captcha-image-button { min-width: 145px; min-height: 42px; padding: 0; overflow: hidden; }
.captcha-image-button img { display: block; width: 145px; height: 42px; object-fit: cover; }
.public-registration-settings { max-width: 640px; }
.role-badge.registered { color: #6d28d9; background: #f1eafe; }
.public-registration-settings .form { max-width: 480px; margin-top: 18px; }
.public-support-admin-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 14px; }
.public-support-inbox-list { display: grid; align-content: start; gap: 7px; max-height: 650px; overflow-y: auto; }
.public-support-inbox-item { display: grid; gap: 4px; width: 100%; padding: 11px; border: 1px solid #e1e8e6; border-radius: 10px; background: #fff; color: inherit; text-align: left; }
.public-support-inbox-item.active { border-color: #147768; background: #eff8f4; }
.public-support-inbox-item span, .public-support-inbox-item small { overflow: hidden; color: #65736f; text-overflow: ellipsis; white-space: nowrap; }
.public-support-admin-chat { display: flex; flex-direction: column; min-width: 0; min-height: 420px; }
.public-support-admin-chat-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding-bottom: 8px; }
.public-support-admin-chat-header .muted { min-width: 0; overflow-wrap: anywhere; }
.public-support-admin-chat-header button { flex: 0 0 32px; width: 32px; min-width: 32px; min-height: 32px; padding: 0; font-size: 22px; }
.public-support-admin-chat .public-support-messages { flex: none; height: clamp(220px, 42dvh, 440px); min-height: 0; max-height: none; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.public-support-admin-chat .public-support-message { flex-shrink: 0; min-width: 0; }
.public-support-admin-chat .public-support-message img { max-width: 100%; }
.public-support-admin-chat #publicSupportReplyText { max-height: 140px; resize: vertical; }
#publicSupport .public-support-admin-layout { grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 16px; }
#publicSupport .public-support-admin-layout > .panel { margin: 0; }
#publicSupport .public-support-inbox { padding: 0; min-width: 0; }
#publicSupport .public-support-inbox-header { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
#publicSupport .public-support-inbox-header h4 { margin: 0; flex: none; font-size: 14px; }
#publicSupportSearch { flex: 1; width: 0; min-width: 0; min-height: 32px; padding: 4px 8px; font-size: 13px; }
#publicSupport .public-support-inbox-list { display: flex; flex-direction: column; gap: 0; max-height: calc(100dvh - 230px); }
#publicSupport .public-support-inbox-item { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: stretch; align-content: start; flex: none; gap: 5px; padding: 14px 16px; min-width: 0; border: 0; border-left: 3px solid transparent; border-bottom: 1px solid var(--line-faint); border-radius: 0; background: var(--surface); color: var(--text); text-align: left; box-shadow: none; }
#publicSupport .public-support-inbox-item:last-child { border-bottom: 0; }
#publicSupport .public-support-inbox-item:hover { background: var(--surface-hover); }
#publicSupport .public-support-inbox-item.active { border-left-color: var(--primary); background: var(--primary-soft); }
#publicSupport .public-support-inbox-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -3px; }
#publicSupport .public-support-inbox-item > * { display: block; width: 100%; min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
#publicSupport .public-support-inbox-item strong { font-size: 14px; line-height: 1.4; }
#publicSupport .public-support-inbox-item span { font-size: 12px; font-weight: 400; color: var(--text-secondary); }
#publicSupport .public-support-inbox-item small { font-size: 11px; font-weight: 400; color: var(--muted); }
#publicSupport .public-support-inbox-item.has-attention { position: relative; padding-right: 24px; }
#publicSupport .public-support-inbox-item.has-attention::after {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d92d20;
  content: "";
  pointer-events: none;
}
.public-support-inbox-menu {
  position: fixed;
  z-index: 100;
  min-width: 112px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 20px #0003;
}
.public-support-inbox-menu[hidden] { display: none; }
.public-support-inbox-menu button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.public-support-inbox-menu button:is(:hover, :focus-visible) { background: var(--surface-hover); }
#publicSupport .public-support-inbox-list > .muted { margin: 0; padding: 20px 16px; }
#publicSupport .public-support-admin-chat { height: clamp(520px, calc(100dvh - 160px), 900px); min-height: 0; padding: 0; overflow: hidden; }
#publicSupport .public-support-admin-chat-header { flex: none; min-height: 60px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
#publicSupportAdminTitle { color: var(--text); font-size: 14px; font-weight: 700; }
#publicSupport .public-support-admin-chat .public-support-messages { flex: 1; height: auto; padding: 20px; gap: 16px; border: 0; border-radius: 0; background: var(--surface-sunken); }
#publicSupport .public-support-admin-chat .public-support-message { align-self: flex-start; width: fit-content; max-width: min(84%, 680px); padding: 12px 14px; background: var(--surface); border-color: var(--line); color: var(--text); }
#publicSupport .public-support-admin-chat .public-support-message.outgoing { align-self: flex-end; background: var(--primary-soft); border-color: var(--line); }
#publicSupport .public-support-message small { font-size: 11px; color: var(--muted); }
#publicSupport .public-support-message p { margin: 7px 0 0; font-size: 14px; line-height: 1.65; }
#publicSupportReplyForm { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px 16px; margin: 0; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface); }
#publicSupportReplyForm.hidden { display: none; }
#publicSupportReplyForm > label { display: grid; gap: 6px; margin: 0; min-width: 0; color: var(--text-secondary); font-size: 12px; }
#publicSupportReplyForm > label:first-child { grid-column: 1 / -1; }
#publicSupportReplyText { min-height: 76px; height: 76px; margin: 0; font-size: 14px; line-height: 1.5; }
#publicSupportReplyFiles { max-width: 380px; min-width: 0; height: 34px; margin: 0; padding: 3px; font-size: 12px; }
#publicSupportReplyForm small { color: var(--muted); font-size: 11px; line-height: 1.4; }
#publicSupportReplyError { grid-column: 1 / -1; margin: 0; }
#publicSupportReplyError:empty { display: none; }
#publicSupportReplyForm > button { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; min-width: 100px; width: auto; min-height: 38px; margin: 0; padding: 8px 22px; }
@media (max-width: 1000px) and (min-width: 721px) {
  #publicSupport .public-support-admin-layout { grid-template-columns: 230px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  #publicSupport .public-support-admin-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #publicSupport .public-support-inbox-list { max-height: 220px; }
  #publicSupport .public-support-admin-chat { height: 620px; max-height: none; }
  #publicSupport .public-support-admin-chat-header { padding: 10px 14px; }
  #publicSupport .public-support-admin-chat .public-support-messages { padding: 14px; }
  #publicSupport .public-support-admin-chat .public-support-message { max-width: 92%; }
  #publicSupportReplyForm { padding: 12px 14px; grid-template-columns: minmax(0, 1fr); }
  #publicSupportReplyForm > button { grid-column: 1; grid-row: auto; }
}
.announcement-editor > label { display: grid; gap: 6px; margin-bottom: 12px; }
.announcement-editor > label > span { font-weight: 700; }
.announcement-editor > label > small { justify-self: end; }
@media (max-width: 720px) {
  .public-support-admin-layout { grid-template-columns: 1fr; }
  .public-support-inbox-list { max-height: 240px; }
  .public-support-admin-chat { min-height: 360px; }
  .public-support-fab { right: 14px; bottom: 14px; }
  .public-support-dock { right: 14px; bottom: 90px; height: min(650px, calc(100dvh - 104px)); }
  .public-support-dock.maximized { inset: 8px; }
}

.public-support-videos { display: grid; gap: 8px; min-width: 0; margin-top: 8px; }

/* Dedicated connection metadata stays readable beside price and reply-rate controls. */
#endlessConnectionCandidates .endless-connection-details { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.65; }
#endlessConnectionCandidates .endless-connection-candidate-main strong { overflow-wrap: anywhere; }

.public-support-message .public-support-read-receipt { display: block; margin-top: 5px; font-size: 11px; color: var(--muted, #687b80); text-align: right; }
.public-support-message .public-support-read-receipt.is-read { color: var(--primary, #19685e); }
