:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #667085;
  --line: #d9e0e7;
  --blue: #2463eb;
  --green: #16845b;
  --amber: #b7791f;
  --red: #c43d3d;
  --teal: #087f8c;
  --shadow: 0 12px 28px rgba(20, 33, 45, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

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

button {
  min-height: 36px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  padding: 0 14px;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
}

button:hover {
  filter: brightness(0.96);
}

button.ghost {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

button.danger {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

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

.is-hidden {
  display: none !important;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

input,
select {
  height: 38px;
  padding: 0 10px;
}

textarea {
  resize: vertical;
  padding: 10px;
  line-height: 1.55;
}

code {
  padding: 2px 4px;
  border-radius: 4px;
  background: #eef2f6;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f4f6f8 0%, #e7edf3 100%);
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-brand {
  color: var(--ink);
}

.auth-card h2 {
  margin: 8px 0 0;
  font-size: 24px;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-status {
  min-height: 20px;
  color: var(--muted);
}

.account-admin {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-admin h3 {
  margin: 0 0 6px;
}

.account-admin p {
  margin: 0 0 12px;
  color: var(--muted);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #111827;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.brand p {
  margin: 3px 0 0;
  color: #b6c2cf;
}

.workspace {
  padding: 22px;
}

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

.topbar h2 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.top-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button-row.slim button {
  min-height: 32px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel:not(.compact) {
  padding: 18px;
}

.panel.compact {
  padding: 14px;
  color: var(--ink);
  background: #fff;
}

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

.panel-head h3 {
  margin: 0;
  font-size: 17px;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.section-grid.two {
  grid-template-columns: 1fr 1fr;
}

.console-section {
  margin-bottom: 16px;
}

.console-grid {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

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

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

.rules-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

label.check input {
  width: 16px;
  height: 16px;
}

.steps {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.steps a {
  padding: 9px 10px;
  border-radius: 6px;
  color: #dce5ee;
  text-decoration: none;
}

.steps a.active,
.steps a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.account-box {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.account-box button {
  width: 100%;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.save-row {
  align-items: center;
}

.save-status {
  display: inline-block;
  min-width: 58px;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: #eef2f6;
}

.save-status.ok {
  color: var(--green);
  background: #eaf8f0;
}

.save-status.pending {
  color: var(--amber);
  background: #fff7e6;
}

.save-status.bad {
  color: var(--red);
  background: #fdecec;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.save-row strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.link-button:disabled {
  color: var(--muted);
  cursor: progress;
}

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

.progress div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.api-box {
  margin-top: 12px;
}

.api-panel {
  margin-bottom: 16px;
  border-color: #b8c7ff;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.api-counts {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
}

.api-counts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.api-counts strong {
  color: var(--ink);
}

.console-overview-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dfe8ff;
  border-radius: 8px;
  background: #fbfdff;
}

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

.console-overview-head strong {
  font-size: 14px;
}

.console-overview-head span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.console-overview-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.console-overview-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

.console-overview-item strong,
.console-overview-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-overview-item span {
  color: var(--muted);
  font-size: 12px;
}

.console-overview-item.ok {
  border-color: #bbefd7;
  background: #f0fdf6;
}

.console-overview-item.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.console-overview-item.bad {
  border-color: #fecaca;
  background: #fff1f2;
}

.console-next-action {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  line-height: 1.55;
  color: var(--ink);
  font-weight: 600;
}

.console-next-action a {
  color: var(--blue);
}

.strategy-brief-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.strategy-brief-head strong {
  font-size: 14px;
}

.strategy-brief-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.strategy-brief-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.strategy-brief-item strong,
.strategy-brief-item span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.strategy-brief-item strong {
  color: var(--muted);
  font-size: 12px;
}

.strategy-brief-item span {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
}

.strategy-brief-item.ok {
  border-color: #bbefd7;
  background: #f0fdf6;
}

.strategy-brief-item.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.strategy-brief-item.bad {
  border-color: #fecaca;
  background: #fff1f2;
}

.readiness-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.publish-workflow-card {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.publish-workflow-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.publish-step {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.publish-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e6ebf0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.publish-step strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-step small {
  color: var(--muted);
  line-height: 1.4;
}

.publish-step.done {
  border-color: #bbefd7;
  background: #f0fdf6;
}

.publish-step.done .publish-step-index {
  background: #10b981;
  color: #fff;
}

.publish-step.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.publish-step.active .publish-step-index {
  background: var(--blue);
  color: #fff;
}

.publish-step.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.publish-step.warn .publish-step-index {
  background: #f59e0b;
  color: #fff;
}

.publish-step.blocked {
  border-color: #fecaca;
  background: #fff1f2;
}

.publish-step.blocked .publish-step-index {
  background: #dc2626;
  color: #fff;
}

.publish-next-hint {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.55;
}

.publish-score-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.publish-score-panel.ok {
  border-color: #bbefd7;
  background: #f5fdf8;
}

.publish-score-panel.warn {
  border-color: #f1d58f;
  background: #fff9eb;
}

.publish-score-panel.bad {
  border-color: #f3b7b7;
  background: #fff4f4;
}

.publish-score-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.publish-score-value {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.publish-score-panel.ok .publish-score-value {
  background: #059669;
}

.publish-score-panel.warn .publish-score-value {
  background: #b7791f;
}

.publish-score-panel.bad .publish-score-value {
  background: #dc2626;
}

.publish-score-main strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.publish-score-main span:not(.publish-score-value) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.publish-score-actions {
  display: grid;
  gap: 5px;
  max-width: 520px;
  margin: 0;
  padding-left: 18px;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

.lead-workflow-card {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.lead-workflow-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.lead-step {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lead-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e6ebf0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lead-step strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-step small {
  color: var(--muted);
  line-height: 1.4;
}

.lead-step.done {
  border-color: #bbefd7;
  background: #f0fdf6;
}

.lead-step.done .lead-step-index {
  background: #10b981;
  color: #fff;
}

.lead-step.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.lead-step.active .lead-step-index {
  background: var(--blue);
  color: #fff;
}

.lead-step.blocked {
  border-color: #fecaca;
  background: #fff1f2;
}

.lead-step.blocked .lead-step-index {
  background: #dc2626;
  color: #fff;
}

.lead-next-hint {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.55;
}

.readiness-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.readiness-item strong {
  color: var(--ink);
}

.readiness-item.ok {
  border-color: #bbefd7;
  background: #f0fdf6;
  color: #047857;
}

.readiness-item.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.readiness-item.bad {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.confirm-notice {
  grid-column: 1 / -1;
  font-size: 13px;
  line-height: 1.6;
}

.confirm-notice.ok {
  border-color: #bbefd7;
  background: #f0fdf6;
  color: #047857;
}

.confirm-notice.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.confirm-notice.bad {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.api-form-main {
  margin-bottom: 12px;
}

.api-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.api-status-row button {
  min-height: 34px;
}

.security-note {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #cfe0ff;
  border-radius: 6px;
  background: #f8fbff;
  color: #334155;
}

.security-note strong {
  color: var(--ink);
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.manual-panel {
  opacity: 0.92;
}

.manual-tools {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.manual-tools summary {
  width: max-content;
  padding: 6px 0;
  color: var(--muted);
}

.manual-tools[open] summary {
  color: var(--blue);
  margin-bottom: 10px;
}

summary {
  cursor: pointer;
  color: var(--blue);
}

.api-form {
  margin: 12px 0;
}

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

.draft-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
}

.draft {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.draft-summary,
.draft-detail {
  display: grid;
  gap: 8px;
}

.draft-title-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
}

.draft-index {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 6px;
  color: #fff;
  background: var(--teal);
  font-weight: 700;
}

.draft-subject {
  font-weight: 650;
}

.draft-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.draft-detail {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.draft-rendered-body {
  max-width: 680px;
  min-height: 120px;
  padding: 18px 20px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: 15px/1.65 Arial, Helvetica, sans-serif;
}

.draft-rendered-body [data-maodou-email] {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.draft-rendered-body p {
  margin: 0 0 14px;
}

.draft-rendered-body a {
  color: #1d4ed8;
  text-decoration: underline;
}

.draft-rendered-body div {
  max-width: 100%;
}

.badges {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.subject-helper {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.subject-helper.ok {
  border-color: #bfead1;
  background: #f2fbf6;
  color: #147a43;
}

.subject-helper.warn {
  border-color: #f2d99b;
  background: #fff8e7;
  color: #8a5a00;
}

.subject-helper.bad {
  border-color: #f3b7b7;
  background: #fff0f0;
  color: #a32020;
}

.badge {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2f6;
}

.badge.ok {
  color: var(--green);
  background: #e8f5ef;
}

.badge.warn {
  color: var(--amber);
  background: #fff6df;
}

.badge.bad {
  color: var(--red);
  background: #ffe8e8;
}

.export-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.publish-panel {
  margin-top: 16px;
}

.publish-panel .panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.publish-actions {
  margin-top: 12px;
}

.publish-actions button.is-warn {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #fff;
}

.publish-actions button.is-blocked,
.publish-actions button.is-blocked:disabled {
  border-color: #cbd5e1;
  background: #eef2f6;
  color: #64748b;
  cursor: not-allowed;
}

.send-cadence-card {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.send-cadence-card.ok {
  border-color: #bbefd7;
  background: #f8fffb;
}

.send-cadence-card.warn {
  border-color: #fde68a;
  background: #fffdf5;
}

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

.send-cadence-head strong {
  font-size: 14px;
}

.send-cadence-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.send-cadence-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.send-cadence-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.send-cadence-item span {
  color: var(--muted);
  font-size: 12px;
}

.send-cadence-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-cadence-item.ok {
  border-color: #bbefd7;
}

.send-cadence-item.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.send-cadence-advice {
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}

.publish-help {
  align-self: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.publish-help p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.suppression-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e6ebf0;
  border-radius: 6px;
  background: #fbfcfe;
}

.suppression-summary {
  color: var(--muted);
  line-height: 1.5;
}

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

.suppression-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suppression-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  color: #92400e;
  background: #fffbeb;
  font-size: 12px;
}

.suppression-pill strong {
  color: #78350f;
  font-size: 12px;
}

.suppression-list ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.suppression-list li {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid #edf1f5;
}

.suppression-list code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suppression-list li span {
  color: var(--muted);
  line-height: 1.45;
}

.suppression-memory {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #edf1f5;
}

.suppression-memory > div:first-child {
  display: grid;
  gap: 3px;
}

.suppression-memory strong {
  color: var(--ink);
}

.suppression-memory span {
  color: var(--muted);
  font-size: 12px;
}

.campaigns-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.campaign-group {
  display: grid;
  gap: 10px;
}

.campaign-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #e6ebf0;
  border-radius: 6px;
  background: #fff;
}

.campaign-group-head strong {
  font-size: 14px;
}

.campaign-group-head span {
  color: var(--muted);
  font-size: 12px;
}

.campaign-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.campaign-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.campaign-main strong,
.campaign-main span,
.campaign-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-main small {
  color: var(--muted);
}

.campaign-main .campaign-variant-summary {
  color: #334155;
  font-weight: 600;
}

.campaign-action {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.campaign-action strong {
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.campaign-action.ok {
  border-color: #bbefd7;
  background: #f0fdf6;
  color: #047857;
}

.campaign-action.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.campaign-action.bad {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.campaign-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.campaign-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.campaign-metrics strong {
  color: var(--ink);
  font-size: 12px;
}

.campaign-metrics .ok {
  border-color: #bbefd7;
  background: #f0fdf6;
  color: #047857;
}

.campaign-metrics .warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.campaign-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
}

.email-check-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.email-check-summary {
  margin-top: 8px;
  color: var(--muted);
}

.email-check-results {
  display: grid;
  gap: 6px;
  max-height: 260px;
  margin-top: 10px;
  overflow: auto;
}

.email-check-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(140px, 0.8fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.email-check-address,
.email-check-reason {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-check-badge {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2f6;
}

.email-check-row.ok .email-check-badge {
  color: var(--green);
  background: #e8f5ef;
}

.email-check-row.warn .email-check-badge {
  color: var(--amber);
  background: #fff6df;
}

.email-check-row.bad .email-check-badge {
  color: var(--red);
  background: #ffe8e8;
}

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

.settings-safety,
.operation-log-panel {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.settings-safety p {
  margin: 6px 0 12px;
  color: var(--muted);
}

.backup-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.backup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.backup-row strong,
.backup-row span {
  display: block;
}

.backup-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.diagnostics-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.diagnostic-row {
  display: grid;
  grid-template-columns: 130px 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.diagnostic-row span {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.diagnostic-row.ok span {
  color: var(--green);
  background: #eaf8f0;
}

.diagnostic-row.warn span {
  color: var(--amber);
  background: #fff7e6;
}

.diagnostic-row.bad span {
  color: var(--red);
  background: #fdecec;
}

.diagnostic-row em {
  color: var(--muted);
  font-style: normal;
  overflow-wrap: anywhere;
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.44);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 60;
}

.modal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  max-height: min(760px, 92vh);
  max-width: 760px;
  overflow: auto;
  padding: 22px;
  width: 100%;
}

.modal-card h3 {
  margin: 0 0 14px;
}

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

.confirm-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.confirm-grid span,
.operation-log-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.confirm-grid strong {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.operation-log-list {
  display: grid;
  gap: 8px;
}

.operation-log-row {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 150px 150px 1fr;
  padding: 9px 10px;
}

.operation-log-row strong {
  font-size: 13px;
}

.operation-log-row em {
  color: var(--text);
  font-size: 13px;
  font-style: normal;
  overflow-wrap: anywhere;
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  min-width: 220px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #111827;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

.runtime-error-banner {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(820px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  color: #7f1d1d;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  transform: translateX(-50%);
}

.runtime-error-banner.is-hidden {
  display: none;
}

.runtime-error-banner strong {
  white-space: nowrap;
}

.runtime-error-banner span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-error-banner div {
  display: flex;
  gap: 8px;
}

.runtime-error-banner button {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .section-grid,
  .section-grid.two {
    grid-template-columns: 1fr;
  }

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

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

  .publish-workflow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .send-cadence-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .publish-score-panel {
    display: grid;
  }

  .publish-score-main {
    min-width: 0;
  }

  .lead-workflow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .console-overview-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .strategy-brief-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .email-check-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13.5px;
  }

  button {
    min-height: 40px;
    padding: 0 12px;
  }

  .button-row.slim button {
    min-height: 40px;
  }

  .publish-workflow-steps {
    grid-template-columns: 1fr 1fr;
  }

  .send-cadence-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .send-cadence-item strong {
    white-space: normal;
  }

  .lead-workflow-steps {
    grid-template-columns: 1fr 1fr;
  }

  .console-overview-list {
    grid-template-columns: 1fr 1fr;
  }

  .strategy-brief-head {
    align-items: stretch;
    flex-direction: column;
  }

  .strategy-brief-head button {
    width: 100%;
  }

  .strategy-brief-list {
    grid-template-columns: 1fr;
  }

  .strategy-brief-item span {
    white-space: normal;
  }

  .publish-step,
  .lead-step {
    padding: 9px;
  }

  input,
  select {
    height: 40px;
  }

  .sidebar {
    position: static;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid #223043;
  }

  .brand {
    gap: 10px;
    margin-bottom: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    margin-top: 1px;
    font-size: 12px;
  }

  .sidebar .panel.compact {
    padding: 10px;
    box-shadow: none;
  }

  .sidebar .stat-row {
    margin-bottom: 5px;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
  }

  .steps a {
    min-height: 38px;
    display: grid;
    place-items: center;
    padding: 8px 6px;
    text-align: center;
    white-space: nowrap;
  }

  .account-box {
    grid-template-columns: minmax(0, 1fr) 92px;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
  }

  .account-box button {
    min-height: 38px;
  }

  .workspace {
    padding: 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .topbar h2 {
    font-size: 21px;
  }

  .topbar p {
    line-height: 1.55;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .panel:not(.compact) {
    padding: 14px;
  }

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

  .panel-head button {
    width: 100%;
  }

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

  .api-status-row {
    flex-direction: column;
    gap: 6px;
  }

  .draft {
    padding: 12px;
  }

  .draft-title-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .draft-index {
    height: 40px;
  }

  .draft-meta {
    grid-template-rows: auto;
  }

  .publish-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .publish-actions button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
  }

  #createListmonkCampaignBtn,
  #openListmonkBtn {
    grid-column: 1 / -1;
  }

  .email-check-panel .publish-actions {
    grid-template-columns: 1fr;
  }

  .email-check-row {
    gap: 6px;
  }

  .email-check-address,
  .email-check-reason {
    white-space: normal;
  }

  .publish-help {
    padding: 12px;
  }

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

  .suppression-list li {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .suppression-memory {
    align-items: stretch;
    flex-direction: column;
  }

  .suppression-memory .button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .campaign-side {
    justify-content: space-between;
  }

  #toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
    max-width: none;
  }

  .runtime-error-banner {
    left: 12px;
    right: 12px;
    bottom: 68px;
    width: auto;
    grid-template-columns: 1fr;
    transform: none;
  }

  .runtime-error-banner strong,
  .runtime-error-banner span {
    white-space: normal;
  }

  .runtime-error-banner div {
    flex-wrap: wrap;
  }
}

@media (max-width: 380px) {
  .publish-actions {
    grid-template-columns: 1fr;
  }
}

/* MAODOU unified admin skin, aligned with the Listmonk backend. */
:root {
  --bg: #f3f6f9;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #637083;
  --line: #dbe3ea;
  --blue: #0b64c0;
  --green: #18a16f;
  --amber: #c28a1a;
  --red: #d94d4d;
  --teal: #00a7a3;
  --shadow: none;
}

body {
  background: var(--bg);
  font-family: Arial, "Segoe UI", sans-serif;
}

button {
  border-radius: 5px;
  font-weight: 600;
}

button.ghost {
  color: var(--blue);
}

input,
textarea,
select {
  border-radius: 5px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #7db5e8;
  box-shadow: 0 0 0 2px rgba(11, 100, 192, 0.12);
}

.app-shell {
  grid-template-columns: 248px 1fr;
}

.sidebar {
  background: #fff;
  color: var(--ink);
  border-right: 1px solid #dfe5eb;
  padding: 0;
}

.brand {
  min-height: 82px;
  margin: 0;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf1f5;
}

.sidebar > .brand {
  justify-content: center;
  min-height: 62px;
  padding: 10px 18px;
}

.brand.home-link {
  color: inherit;
  text-decoration: none;
}

.brand.home-link:hover .brand-logo,
.brand.home-link:focus-visible .brand-logo {
  opacity: 0.9;
}

.brand.home-link:focus-visible {
  outline: 2px solid rgba(11, 100, 192, 0.35);
  outline-offset: -2px;
}

.brand-logo {
  width: 114px;
  height: 40px;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

.sidebar > .brand .brand-logo {
  width: 154px;
  height: 42px;
}

.auth-brand .brand-logo {
  width: 142px;
  height: 48px;
}

.brand h1 {
  font-size: 17px;
  color: var(--ink);
  letter-spacing: 0;
}

.brand p {
  color: var(--muted);
}

.sidebar .panel.compact {
  margin: 18px 14px 8px;
  border: 1px solid #e6ebf0;
  border-radius: 6px;
  background: #f8fafc;
}

.steps {
  gap: 0;
  margin: 14px 0 0;
  padding: 0 8px;
}

.steps a {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 5px;
  color: #26313d;
  font-weight: 600;
}

.steps a::before {
  width: 20px;
  text-align: center;
  color: #536172;
  font-size: 15px;
}

.steps a:nth-child(1)::before { content: "⌂"; }
.steps a:nth-child(2)::before { content: "◎"; }
.steps a:nth-child(3)::before { content: "▤"; }
.steps a:nth-child(4)::before { content: "✈"; }
.steps a:nth-child(5)::before { content: "◉"; }
.steps a:nth-child(6)::before { content: "⇩"; }
.steps a:nth-child(7)::before { content: "⚙"; }

.steps a.active,
.steps a:hover {
  color: #111827;
  background: #eef5ff;
}

.steps a.active::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #f26b6b;
}

.account-box {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 16px;
  color: var(--muted);
}

.account-box button {
  border-color: #d9e0e7;
  color: var(--ink);
  background: #fff;
}

.workspace {
  padding: 0;
}

.topbar {
  min-height: 96px;
  margin: 0;
  padding: 24px 28px;
  border-bottom: 1px solid #dfe5eb;
  background: #fff;
}

.topbar h2 {
  font-size: 26px;
  color: #111827;
}

.topbar p {
  font-size: 14px;
}

.workspace > .panel,
.workspace > .console-section,
.workspace > .section-grid {
  margin: 18px 28px;
}

.panel {
  border: 1px solid #dfe5eb;
  border-radius: 6px;
  box-shadow: none;
}

.panel:not(.compact) {
  padding: 18px 20px;
}

.panel-head {
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f5;
}

.panel-head h3 {
  font-size: 18px;
}

.api-panel {
  border-color: #dfe5eb;
  background: #fff;
}

.api-counts span,
.draft,
.campaign-card,
.publish-help,
.email-check-panel,
.empty-state,
.lead-import,
.lead-summary,
.review-card,
.review-advice {
  border-radius: 6px;
  background: #fbfcfe;
}

.lead-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: stretch;
}

.lead-import,
.lead-summary {
  border: 1px solid #e6ebf0;
  padding: 14px;
}

.lead-summary {
  display: grid;
  gap: 10px;
}

.mini-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #edf1f5;
  border-radius: 5px;
  background: #fff;
}

.mini-metric span,
.review-card span {
  color: var(--muted);
  font-size: 13px;
}

.mini-metric strong,
.review-card strong {
  color: var(--ink);
  font-size: 22px;
}

.lead-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 10px;
  color: var(--muted);
}

.lead-toolbar label {
  max-width: 240px;
}

.lead-table-wrap {
  overflow-x: auto;
  border: 1px solid #e6ebf0;
  border-radius: 6px;
  background: #fff;
}

.lead-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.lead-table th,
.lead-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
  vertical-align: top;
}

.lead-table th {
  color: #5d6978;
  font-size: 12px;
  font-weight: 700;
  background: #f8fafc;
}

.lead-table input,
.lead-table select {
  min-height: 34px;
  padding: 7px 8px;
  font-size: 13px;
}

.lead-company-input {
  min-width: 180px;
}

.lead-email-input {
  min-width: 210px;
}

.lead-website-input {
  min-width: 210px;
}

.lead-note-input {
  min-width: 180px;
}

.empty-cell {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

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

.review-card {
  display: grid;
  gap: 6px;
  border: 1px solid #e6ebf0;
  padding: 14px;
}

.review-card small {
  color: var(--muted);
}

.review-advice {
  margin-bottom: 12px;
  border: 1px solid #e6ebf0;
  padding: 12px 14px;
  color: #344054;
}

.draft-index {
  background: #008c95;
}

.badge {
  border-radius: 5px;
}

#toast {
  border-radius: 6px;
}

.auth-screen {
  background: #f3f6f9;
}

.auth-card {
  border-radius: 6px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .account-box {
    position: static;
    margin: 12px 14px 16px;
  }

  .workspace > .panel,
  .workspace > .console-section,
  .workspace > .section-grid {
    margin: 14px;
  }

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

  .confirm-grid,
  .operation-log-row,
  .diagnostic-row,
  .backup-row {
    grid-template-columns: 1fr;
  }

  .lead-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-toolbar label {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .workspace {
    min-width: 0;
  }

  .sidebar {
    border-bottom: 1px solid #dfe5eb;
  }

  .brand {
    min-height: 70px;
    padding: 12px;
  }

  .sidebar > .brand {
    min-height: 58px;
    padding: 9px 12px;
  }

  .brand-logo {
    width: 108px;
    height: 38px;
  }

  .sidebar > .brand .brand-logo {
    width: 142px;
    height: 39px;
  }

  .steps {
    padding: 0 10px 10px;
  }

  .steps a {
    justify-content: flex-start;
    text-align: left;
  }

  .topbar {
    min-height: 0;
    padding: 16px 14px;
  }

  .workspace > .panel,
  .workspace > .console-section,
  .workspace > .section-grid {
    margin: 12px;
  }
}
