:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --text: #17202a;
  --muted: #64717f;
  --border: #d9e1e7;
  --primary: #146c63;
  --primary-strong: #0d4f49;
  --accent: #b15d22;
  --danger: #a33b3b;
  --shadow: 0 10px 28px rgba(33, 45, 58, 0.08);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-pop: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

.toast {
  background: #14251f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(18, 27, 35, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 13px;
  position: fixed;
  right: 18px;
  top: 72px;
  z-index: 40;
}

.toast:not([hidden]) {
  animation: toastIn 220ms var(--ease-pop) both;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  min-height: 38px;
  padding: 0 14px;
  transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease), color 160ms var(--ease), opacity 160ms var(--ease), transform 160ms var(--ease);
}

button:hover {
  background: var(--primary-strong);
  box-shadow: 0 7px 16px rgba(20, 108, 99, 0.16);
  transform: translateY(-1px);
}

button:active {
  box-shadow: none;
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

button.secondary,
button.chip {
  background: #e6ecef;
  color: #18323b;
}

button.secondary:hover,
button.chip:hover,
button.chip.active {
  background: #cddfe0;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #842d2d;
}

.app-header {
  align-items: center;
  background: #17202a;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 56px;
  padding: 10px 18px;
}

.app-header h1 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
}

.app-header p {
  color: #c6d0d7;
  font-size: 14px;
  margin: 0;
}

.module-tabs {
  align-items: center;
  display: flex;
  gap: 8px;
}

.module-tab {
  background: rgba(255, 255, 255, 0.12);
  color: #d7e5ea;
  min-height: 34px;
  overflow: hidden;
  position: relative;
}

.module-tab:hover,
.module-tab.active {
  background: #fff;
  color: #17202a;
}

.module-screen[hidden] {
  display: none;
}

.header-actions,
.tools,
.preset-row {
  display: flex;
  gap: 8px;
}

.tools {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.fetch-mode {
  align-items: center;
  display: flex;
  gap: 6px;
}

.mode-option {
  align-items: center;
  background: #e6ecef;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #18323b;
  display: flex;
  flex-direction: row;
  font-size: 12px;
  gap: 6px;
  min-height: 38px;
  margin: 0;
  padding: 0 10px;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
  white-space: nowrap;
}

.mode-option:has(input[type="radio"]:checked) {
  background: #d3e8e5;
  border-color: #8dbbb5;
  color: var(--primary-strong);
  font-weight: 700;
}

.mode-option input[type="radio"] {
  min-height: auto;
  width: auto;
}

.mode-option input[type="number"] {
  min-height: 34px;
  padding: 6px 8px;
  width: 72px;
}

.mode-option:has(input[type="radio"]:not(:checked)) input[type="number"] {
  opacity: 0.5;
}

.mode-option.inactive {
  color: var(--muted);
}

.inline-control {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin: 0;
  min-width: 260px;
}

.inline-control select {
  min-width: 180px;
}

.layout {
  display: grid;
  gap: 16px;
  grid-template-columns: 320px minmax(0, 1fr);
  padding: 16px;
}

.operation-module {
  padding: 16px;
}

.filters,
.workspace {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}

.filters {
  align-self: start;
  max-height: calc(100vh - 124px);
  overflow: auto;
  padding: 14px;
  position: sticky;
  top: 16px;
}

.filters section + section {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 14px;
}

.filters h2 {
  font-size: 14px;
  margin: 0 0 12px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 6px;
  margin-bottom: 12px;
}

.hint {
  background: #f7fafb;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 4px 0 0;
  padding: 8px 9px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  min-height: 36px;
  padding: 7px 9px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease);
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(20, 108, 99, 0.15);
  box-shadow: 0 0 0 4px rgba(20, 108, 99, 0.08);
}

textarea {
  line-height: 1.55;
  resize: vertical;
}

.two-col {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.toggle {
  align-items: center;
  color: var(--text);
  display: flex;
  gap: 8px;
}

.toggle input {
  min-height: auto;
  width: auto;
}

.collapse-toggle {
  align-items: center;
  background: #e6ecef;
  color: #18323b;
  display: flex;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 10px;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
  width: 100%;
}

.collapse-toggle:hover {
  background: #cddfe0;
}

.collapse-toggle span:first-child {
  font-weight: 700;
}

.chevron {
  color: var(--muted);
  font-size: 12px;
}

.collapse-panel {
  margin-top: 10px;
}

.collapse-panel:not([hidden]) {
  animation: panelIn 180ms var(--ease-pop) both;
}

.collapsible textarea {
  margin-bottom: 0;
}

.workspace {
  min-width: 0;
  overflow: hidden;
}

.operation-workspace {
  min-height: calc(100vh - 88px);
}

.operation-field-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.operation-fields-modal {
  max-width: 680px;
}

.operation-fields-modal .modal-toolbar {
  align-items: flex-start;
}

.operation-fields-modal .modal-footer {
  justify-content: flex-end;
}

.operation-field-list {
  background: #f7fafb;
  display: flex;
  flex-direction: column;
  max-height: min(520px, calc(100vh - 236px));
  overflow: auto;
  padding: 8px;
}

.operation-field-option {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: grab;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 6px;
  min-height: 44px;
  padding: 9px 10px;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), box-shadow 140ms var(--ease), transform 140ms var(--ease);
}

.operation-field-option:last-child {
  margin-bottom: 0;
}

.operation-field-option:hover {
  background: #fbfcfd;
  border-color: #cddfe0;
}

.operation-field-option.dragging {
  box-shadow: 0 12px 30px rgba(18, 27, 35, 0.16);
  cursor: grabbing;
  opacity: 0.62;
}

.operation-field-option.drop-before {
  border-top-color: var(--primary);
  box-shadow: 0 -3px 0 var(--primary);
}

.operation-field-option.drop-after {
  border-bottom-color: var(--primary);
  box-shadow: 0 3px 0 var(--primary);
}

.operation-field-option label {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  gap: 7px;
  margin: 0;
  min-width: 0;
}

.operation-field-option input {
  min-height: auto;
  width: auto;
}

.operation-field-drag-handle {
  align-items: center;
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  grid-template-columns: repeat(2, 4px);
  padding: 2px;
}

.operation-field-drag-handle span {
  background: #9aabb4;
  border-radius: 999px;
  height: 4px;
  width: 4px;
}

.operation-field-state {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
}

.operation-field-option.is-hidden .operation-field-state {
  color: #8a98a1;
}

#sendModule .operation-workspace {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 88px);
  min-height: 0;
}

.toolbar {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 14px;
}

.pager {
  align-items: center;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 56px;
  padding: 10px 14px;
}

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

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

.pager-actions label {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin: 0;
}

.pager-actions select {
  min-height: 34px;
  width: 86px;
}

.pager-actions input {
  min-height: 34px;
  text-align: center;
  width: 72px;
}

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

.table-action {
  font-size: 12px;
  min-height: 30px;
  padding: 0 10px;
}

.table-icon-action {
  align-items: center;
  background: #e6ecef;
  color: #18323b;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 14px;
  justify-content: center;
  min-height: 26px;
  padding: 0;
  width: 26px;
}

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

.send-email-cell {
  align-items: start;
  display: flex;
  gap: 7px;
}

.send-email-cell span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.row-check {
  cursor: pointer;
  min-height: 18px;
  width: 18px;
}

.status {
  align-items: baseline;
  display: flex;
  gap: 10px;
}

.status strong {
  font-size: 24px;
}

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

.summary-grid {
  background: var(--surface-2);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-grid div {
  background: var(--surface);
  padding: 12px 14px;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}

.summary-grid div:hover {
  background: #fbfcfd;
}

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

.summary-grid strong {
  font-size: 20px;
}

.operation-actions {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 14px;
}

.operation-actions h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.operation-actions p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.send-config-panel {
  border-bottom: 1px solid var(--border);
  padding: 14px;
}

.send-action-panel {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
}

.send-action-panel[hidden] {
  display: none;
}

.send-status-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.send-status-tab {
  background: #e6ecef;
  color: #18323b;
  min-height: 34px;
}

.send-status-tab.active,
.send-status-tab:hover {
  background: #d3e8e5;
  color: var(--primary-strong);
}

.send-status-tab span {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  margin-left: 6px;
  min-width: 24px;
  padding: 5px 7px;
}

.dashboard-workspace {
  padding: 0;
}

.settings-workspace {
  min-height: calc(100vh - 88px);
  padding: 0;
}

.dashboard-header {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px;
}

.dashboard-header h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.dashboard-header p,
.dashboard-header span {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.settings-header {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px;
}

.settings-header h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.settings-header p,
.settings-header span {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.settings-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
  padding: 14px;
}

.settings-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.settings-panel-header {
  background: #f7fafb;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
}

.settings-panel-header h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.settings-panel-header span {
  color: var(--muted);
  font-size: 12px;
}

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

.settings-form-grid label {
  margin: 0;
}

.settings-toggle {
  align-items: center;
  grid-column: 1 / -1;
}

.settings-panel > .hint {
  border-top: 1px solid var(--border);
  margin: 0;
  padding: 11px 14px;
}

.dashboard-card-grid {
  background: var(--surface-2);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-card {
  background: #fff;
  min-height: 108px;
  padding: 16px 14px;
  transition: background-color 160ms var(--ease), transform 160ms var(--ease);
}

.dashboard-card:hover {
  background: #fbfcfd;
  transform: translateY(-1px);
}

.dashboard-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}

.dashboard-card strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.dashboard-card small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 8px;
}

.dashboard-card.highlight {
  background: #edf8f4;
}

.dashboard-panels {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  padding: 14px;
}

.dashboard-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.dashboard-panel-title {
  align-items: center;
  background: #f7fafb;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.dashboard-panel-title h3 {
  font-size: 15px;
  margin: 0;
}

.dashboard-panel-title span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-table-wrap {
  max-height: calc(100vh - 380px);
  overflow: auto;
}

.dashboard-table {
  min-width: 760px;
  width: 100%;
}

.dashboard-table th {
  cursor: default;
}

#batchSendHint,
#failedSendHint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

#batchSendHint,
#failedSendHint {
  background: #f7fafb;
  border: 1px solid var(--border);
  border-radius: 6px;
  flex: 0 0 auto;
  max-width: 320px;
  padding: 7px 9px;
}

.send-config-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.custom-send-modal {
  max-width: 760px;
}

.duplicate-add-modal {
  max-width: 760px;
}

.custom-send-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.custom-send-form label {
  margin: 0;
}

#customSendBody {
  min-height: 160px;
}

.duplicate-add-content {
  padding: 14px;
}

.duplicate-add-content p {
  color: #27343d;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 10px;
}

.duplicate-add-list {
  border: 1px solid var(--border);
  border-radius: 7px;
  max-height: 340px;
  overflow: auto;
}

.duplicate-add-item {
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.duplicate-add-item:last-child {
  border-bottom: 0;
}

.duplicate-add-item strong {
  color: #1d2d36;
  font-size: 14px;
}

.duplicate-add-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.send-action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.batch-send-progress {
  margin-top: 10px;
}

.table-wrap {
  max-height: calc(100vh - 292px);
  overflow: auto;
  width: 100%;
}

.operation-table-wrap {
  max-height: calc(100vh - 280px);
}

.send-table-wrap {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

#sendModule .toolbar,
#sendModule .summary-grid,
#sendModule .send-config-panel,
#sendModule .send-action-panel {
  flex: 0 0 auto;
}

#sendModule table {
  min-height: 100%;
}

#sendModule .empty {
  min-height: 260px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: max-content;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

th {
  background: #f7fafb;
  color: #33434f;
  cursor: pointer;
  font-size: 12px;
  position: sticky;
  top: 0;
  user-select: none;
  z-index: 1;
}

tr:hover td {
  background: #fbfcfd;
}

.game-name {
  font-weight: 700;
}

.subtle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.badge.good {
  background: #dff1ea;
  color: #12634f;
}

.badge.reply {
  background: #d8efe8;
  color: #0f5f6a;
}

.badge.warn {
  background: #f7e7d7;
  color: #8f4e17;
}

.badge.wait {
  background: #e6ecef;
  color: #33434f;
}

.badge.sending {
  background: #dbeafe;
  color: #1d4f8f;
}

.badge.danger {
  background: #f3dada;
  color: #8a2f2f;
}

.score {
  color: var(--primary-strong);
  font-size: 16px;
  font-weight: 800;
  transition: color 160ms var(--ease), transform 160ms var(--ease);
}

.empty {
  color: var(--muted);
  height: 180px;
  text-align: center;
  vertical-align: middle;
}

.field-help {
  border-top: 1px solid var(--border);
}

.field-help-toggle {
  align-items: center;
  background: #f7fafb;
  border-radius: 0;
  color: #33434f;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 14px;
  width: 100%;
}

.field-help-toggle:hover {
  background: #eef3f6;
}

.field-help-toggle span {
  color: var(--muted);
  font-size: 12px;
}

.field-help-panel {
  background: #fff;
  padding: 12px 14px 14px;
}

.field-help-panel:not([hidden]) {
  animation: panelIn 180ms var(--ease-pop) both;
}

.field-help-panel dl {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: 96px minmax(0, 1fr);
  margin: 0;
}

.field-help-panel dt {
  color: #27343d;
  font-size: 13px;
  font-weight: 800;
}

.field-help-panel dd {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.modal-backdrop {
  align-items: center;
  background: rgba(18, 27, 35, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 20;
}

.modal-backdrop[hidden] {
  display: none;
}

#duplicateAddModal {
  z-index: 25;
}

.modal-backdrop:not([hidden]) {
  animation: backdropIn 160ms ease-out both;
}

.modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(18, 27, 35, 0.24);
  max-height: min(720px, calc(100vh - 40px));
  max-width: 760px;
  overflow: hidden;
  width: 100%;
}

.modal-backdrop:not([hidden]) .modal {
  animation: modalIn 220ms var(--ease-pop) both;
}

.modal-header,
.modal-footer,
.modal-toolbar {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 12px 14px;
}

.modal-header,
.modal-toolbar {
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-top: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 16px;
  margin: 0;
}

.save-list-modal {
  max-width: 520px;
}

.confirm-modal {
  max-width: 520px;
}

.email-edit-modal {
  max-width: 560px;
}

.save-list-form {
  padding: 14px;
}

.email-edit-form {
  padding: 14px;
}

.email-edit-form label {
  margin: 12px 0 10px;
}

.confirm-content {
  padding: 14px;
}

.confirm-content p {
  color: #27343d;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.confirm-content .danger-note {
  background: #fff3f3;
  border: 1px solid #f0c8c8;
  border-radius: 7px;
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  padding: 9px 10px;
}

.confirm-action-content p:first-child {
  font-weight: 700;
}

.progress-box {
  background: #f7fafb;
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-top: 12px;
  padding: 10px;
}

.progress-meta {
  align-items: center;
  color: #33434f;
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-track {
  background: #e3ebef;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--primary), #3f9f93);
  border-radius: inherit;
  height: 100%;
  transition: width 180ms var(--ease);
  width: 0%;
}

.save-list-form label {
  margin-bottom: 10px;
}

#saveListNameHint,
#deleteListHint,
#emailEditHint {
  color: var(--muted);
  font-size: 13px;
}

.outreach-modal {
  max-height: min(820px, calc(100vh - 40px));
  max-width: 980px;
}

.outreach-content {
  display: grid;
  gap: 1px;
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1.05fr);
  max-height: min(560px, calc(100vh - 224px));
  overflow: auto;
}

.outreach-form,
.outreach-preview-pane {
  background: #fff;
  padding: 14px;
}

.outreach-form {
  border-right: 1px solid var(--border);
}

.outreach-preview-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.outreach-stats {
  background: #f7fafb;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: #33434f;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
  padding: 9px 10px;
}

.outreach-preview {
  flex: 1;
  min-height: 320px;
  resize: none;
  white-space: pre-wrap;
}

.icon-button {
  background: #e6ecef;
  color: #18323b;
  font-size: 22px;
  font-weight: 500;
  min-height: 32px;
  padding: 0;
  width: 32px;
}

.field-picker {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 460px;
  overflow: auto;
}

.field-option {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin: 0;
  min-height: 42px;
  padding: 9px 14px;
  transition: background-color 140ms var(--ease), transform 140ms var(--ease);
}

.field-option:hover {
  background: #f7fafb;
}

.field-option input {
  min-height: auto;
  width: auto;
}

.side-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.side-actions button {
  flex: 1;
}

.side-field-picker {
  border: 1px solid var(--border);
  border-radius: 7px;
  max-height: 260px;
  overflow: auto;
}

.side-field-picker .field-option {
  min-height: 36px;
  padding: 8px 10px;
}

.log-console {
  background: #101820;
  border-radius: 7px;
  color: #d7e5ea;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  max-height: 260px;
  min-height: 160px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.log-line {
  animation: logLineIn 160ms var(--ease) both;
  margin-bottom: 4px;
}

.log-time {
  color: #79b8c7;
}

.log-muted {
  color: #8fa1aa;
}

#exportFieldHint {
  color: var(--muted);
  font-size: 13px;
}

.module-screen.active {
  animation: screenIn 220ms var(--ease-pop) both;
}

.table-wrap tbody tr {
  animation: rowIn 180ms var(--ease) both;
}

.table-wrap tbody tr:nth-child(2) {
  animation-delay: 16ms;
}

.table-wrap tbody tr:nth-child(3) {
  animation-delay: 32ms;
}

.table-wrap tbody tr:nth-child(4) {
  animation-delay: 48ms;
}

.table-wrap tbody tr:nth-child(5) {
  animation-delay: 64ms;
}

.table-wrap tbody tr:nth-child(n + 6) {
  animation-delay: 80ms;
}

.feedback-pop {
  animation: feedbackPop 420ms var(--ease-pop) both;
}

@keyframes screenIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes backdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logLineIn {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes feedbackPop {
  0% {
    transform: scale(1);
  }
  45% {
    box-shadow: 0 0 0 6px rgba(20, 108, 99, 0.14);
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  button:hover {
    transform: none;
  }
}

@media (max-width: 920px) {
  .app-header,
  .toolbar,
  .pager,
  .operation-actions,
  .dashboard-header,
  .settings-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .module-tabs {
    width: 100%;
  }

  .module-tab {
    flex: 1;
  }

  .tools,
  .pager-actions {
    justify-content: flex-start;
  }

  #batchSendHint,
  #failedSendHint {
    max-width: none;
    width: 100%;
  }

  .send-config-grid {
    grid-template-columns: 1fr 1fr;
  }

  .inline-control {
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
    width: 100%;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .filters {
    max-height: none;
    position: static;
  }

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

  .dashboard-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .operation-fields-modal .modal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .outreach-content {
    grid-template-columns: 1fr;
  }

  .outreach-form {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .send-table-wrap {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .send-config-grid,
  .settings-form-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .operation-fields-modal .modal-toolbar {
    gap: 8px;
  }
}
