@font-face {
  font-family: "Candara";
  src: url("/static/fonts/candara-regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Candara";
  src: url("/static/fonts/candara-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Candara";
  src: url("/static/fonts/candara-italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: "Candara";
  src: url("/static/fonts/candara-bold-italic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
}

@font-face {
  font-family: "Montserrat";
  src: url("/static/fonts/montserrat-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Montserrat";
  src: url("/static/fonts/montserrat-semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: "Montserrat";
  src: url("/static/fonts/montserrat-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --font-candara: Candara, "Segoe UI", Arial, sans-serif;
  --font-montserrat: Montserrat, "Segoe UI", Arial, sans-serif;}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;}

body.modal-open {
  overflow: hidden;
}


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

button,
.ghost-btn,
.text-link {
  transition: 0.18s ease;
}

.shell {
  display: grid;
  min-height: 100vh;}


.brand {
  display: flex;
  align-items: center;}

.brand-mark {
  display: grid;
  place-items: center;}


.brand-sub,
.user-meta {
  font-size: 0.92rem;}


.sidebar-footer {
  display: grid;}


.page-login {
  display: grid;
  place-items: center;}

.hero-card,
.panel,
.stat-card,
.list-card {
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);}

.hero-card,
.panel {
  padding: 26px;}

.login-card {
  width: min(560px, 100%);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;}


.section-header h1,
.section-header h2,
.panel h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;}


.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}


.stat-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}


.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;}

.list-card.plain {
  align-items: start;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  white-space: nowrap;}

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

.full-span {
  grid-column: 1 / -1;
}

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

.grid-form label,
.checkbox-field {
  display: grid;}

/* display:grid 会覆盖 hidden 属性的默认隐藏，这里补回来(发送方式切换 SMTP/Gmail 字段用) */
.grid-form label[hidden],
.checkbox-field[hidden] {
  display: none;
}

.grid-form span {
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);}

textarea {
  resize: vertical;}

button,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 128px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: linear-gradient(135deg, #149172, #0e7a63);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  border-color: rgba(17, 17, 17, 0.12);
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.06);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 128px;
  padding: 12px 18px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.06);
}


.secondary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.01);
}

.text-link {
  color: var(--accent);
  font-weight: 700;
}

.template-change-button {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.template-change-button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.62;
}

.campaign-template-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.92rem;}

.tip-box {
  margin-top: 18px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;}

.compact-box {
  margin-top: 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.choice-card {
  position: relative;
  display: grid;
  gap: 8px;
  border-radius: 18px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;}

.choice-card:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 122, 99, 0.24);
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.07);
}

.choice-card input[type="radio"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-card input[type="checkbox"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.choice-card-subtitle,
.choice-card-meta {
  font-size: 0.94rem;
  line-height: 1.55;
  word-break: break-word;}

.choice-card:has(input[type="radio"]:checked) {
  border-color: rgba(14, 122, 99, 0.38);
  background: rgba(14, 122, 99, 0.08);
  box-shadow: 0 14px 30px rgba(14, 122, 99, 0.12);
}

.choice-card:has(input[type="checkbox"]:checked) {
  border-color: rgba(14, 122, 99, 0.42);
  background: rgba(14, 122, 99, 0.08);
  box-shadow: 0 14px 30px rgba(14, 122, 99, 0.12);
}

.notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid transparent;}


.mini-progress {
  width: 100%;
  height: 8px;
  margin: 10px 0 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(80, 141, 216, 0.14);
}

.mini-progress span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #69b5ff, #2f73e0 58%, #5bc3ff);
  transition: width 0.35s ease;
}

.sync-progress-card {
  display: grid;
  gap: 8px;
}

.sync-progress-card[hidden] {
  display: none;
}

.reply-sync-errors {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.reply-sync-errors[hidden] {
  display: none;
}

.reply-sync-errors-title {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

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

.reply-sync-errors li {
  display: grid;
  grid-template-columns: auto minmax(140px, 220px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 12px;
  line-height: 1.45;
}

.reply-sync-errors span {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  white-space: nowrap;
}

.reply-sync-errors strong {
  overflow-wrap: anywhere;
  color: #334155;
}

.reply-sync-errors em {
  font-style: normal;
  overflow-wrap: anywhere;
  color: #64748b;
}

@media (max-width: 720px) {
  .reply-sync-errors li {
    grid-template-columns: 1fr;
  }
}

.import-progress-card {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.import-progress-card[hidden] {
  display: none;
}

.import-progress-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.import-progress-steps span {
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.running-imports-card {
  display: grid;
  gap: 10px;
  margin-top: 14px;}

.running-imports-card[hidden] {
  display: none;
}

.running-imports-head,
.running-import-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


.running-import-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;}

.running-import-item div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

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

.running-import-item span,
.running-import-item small {
  color: #64748b;
  font-size: 0.82rem;
}

.running-import-item small {
  font-weight: 800;
}

.sync-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

#reply-sync-percent {
  min-width: 44px;
  font-weight: 800;
  text-align: right;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loading-card {
  min-width: min(320px, 100%);
  padding: 24px 26px;
  text-align: center;}

.loading-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 4px solid rgba(14, 122, 99, 0.16);
  animation: spin 0.8s linear infinite;}

.loading-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.loading-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.94rem;
}

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


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


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

.inline-form input {
  min-width: 110px;
}

.empty-cell {
  padding: 24px;}

.body-preview {
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.rich-editor-field {
  display: grid;
  gap: 10px;
  min-width: 0;
  align-content: start;
}

.rich-review-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.12fr) minmax(460px, 0.88fr);
  gap: 22px;
  align-items: stretch;
}

.rich-editor {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 250, 0.92);
}

.rich-editor-toolbar .icon-btn,
.rich-editor-toolbar .mini-btn {
  min-height: 34px;
}

.rich-tool-select {
  width: auto;
  min-width: 92px;
  min-height: 34px;
  padding: 6px 10px;
}

.rich-color-palette {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.rich-color-swatch {
  position: relative;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid rgba(17, 17, 17, 0.12);
  border-radius: 999px;
  background-color: var(--swatch-color);
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 48%),
    linear-gradient(315deg, rgba(0, 0, 0, 0.1), transparent 52%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 1px 2px rgba(17, 17, 17, 0.14);
  cursor: pointer;
  flex: 0 0 auto;
}

.rich-color-swatch:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 17, 17, 0.34);
}

.rich-color-swatch.is-active,
.rich-color-swatch:focus-visible {
  border-color: #111;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.52),
    0 0 0 3px rgba(14, 122, 99, 0.16);
}

.rich-image-input {
  display: none;
}

.rich-editor-toolbar button.rich-color-swatch {
  display: inline-block;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 2px solid rgba(17, 17, 17, 0.18);
  border-radius: 50%;
  background-color: var(--swatch-color);
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 48%),
    linear-gradient(315deg, rgba(0, 0, 0, 0.1), transparent 52%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 1px 2px rgba(17, 17, 17, 0.14);
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.rich-editor-toolbar button.rich-color-swatch:hover {
  filter: none;}


.rich-editor-toolbar input.rich-image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.rich-editor-surface {
  min-height: 520px;
  max-height: calc(100vh - 330px);
  overflow: auto;
  margin: 0;
  padding: 22px;
  outline: none;
  background: #fff;
  cursor: text;
  line-height: 1.7;
  user-select: text;
  -webkit-user-select: text;
}

.rich-editor-surface:focus {
  box-shadow: inset 0 0 0 2px rgba(22, 163, 127, 0.24);
}

.rich-editor-surface img {
  max-width: 100%;
  height: auto;
}

.mail-preview-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  height: 100%;
}

.mail-preview-frame {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100%;
  min-height: 610px;
  max-height: calc(100vh - 250px);
  overflow: hidden;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 16px;
  background: #fff;}

.mail-preview-topbar {
  height: 34px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  background: linear-gradient(180deg, #f8fafc, #edf2f7);
}

.mail-preview-subject {
  padding: 18px 22px 8px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
}

.mail-preview-meta {
  padding: 0 22px 16px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
}

.mail-preview-body {
  min-height: 0;
  padding: 22px;
  overflow: auto;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}

.mail-preview-body img {
  max-width: 100%;
  height: auto;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(25, 34, 28, 0.1);
  border-radius: 10px;
  background: rgba(245, 247, 244, 0.9);
}

.mode-option {
  min-width: 120px;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;}

.mode-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
}

.mode-option.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(14, 122, 99, 0.18);
}

.variant-grid,
.reply-grid {
  display: grid;
  gap: 16px;
}

.progress-shell {
  display: grid;
  gap: 12px;
}

.progress-bar {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(17, 17, 17, 0.08);
}

.progress-bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0e7a63, #1fb58f);
  transition: width 0.35s ease;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.phase-progress-shell {
  gap: 10px;
}

.phase-progress-bar {
  height: 18px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(83, 91, 96, 0.28);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.22),
    inset 0 -2px 4px rgba(0, 0, 0, 0.16);}

.phase-progress-bar .progress-bar-fill {
  min-width: 8px;
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 38%),
    linear-gradient(90deg, #fdd447 0%, #b7e442 42%, #35dc58 100%);
  box-shadow:
    0 0 14px rgba(73, 220, 84, 0.34),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.phase-mini-progress {
  height: 14px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(83, 91, 96, 0.22);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.14);}

.phase-mini-progress span {
  min-width: 8px;
  border-radius: 5px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 38%),
    linear-gradient(90deg, #fdd447 0%, #b7e442 42%, #35dc58 100%);
  box-shadow:
    0 0 12px rgba(73, 220, 84, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.send-progress-shell {
  gap: 14px;
}

.send-blower-progress {
  width: 100%;
  min-height: 56px;
  padding: 6px 0 2px;
}

.send-blower-progress,
.send-blower-progress * {
  box-sizing: border-box;
}

.send-blower-loadingbar {
  position: relative;
  width: 100%;
  height: 34px;
  padding: 4px 34px 4px 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe06c, #f5bc23);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.48),
    inset 0 -3px 8px rgba(157, 92, 0, 0.2),
    0 14px 28px rgba(202, 134, 21, 0.18);
}

.send-blower-filler-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(142, 82, 0, 0.12);
}

.send-blower-filler {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 36%),
    linear-gradient(90deg, #ffb01f, #f07813);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 0 18px rgba(241, 120, 19, 0.28);
  transition: width 0.9s ease-out;
}

.send-blower-value {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 11;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-shadow: 0 1px 4px rgba(155, 73, 0, 0.72);
  pointer-events: none;
}

.send-blower-marker {
  position: absolute;
  right: -1px;
  top: -4px;
  z-index: 12;
  width: 42px;
  height: 42px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(180deg, #f89b17, #d97208);
  box-shadow: 0 10px 18px rgba(210, 112, 8, 0.25);
  animation: send-blower-rotate 2.8s infinite ease-in-out;
  animation-play-state: paused;
}

.send-progress-panel.is-actively-sending .send-blower-marker {
  animation-play-state: running;
}

.send-blower-marker::after {
  content: "";
  position: absolute;
  left: calc(50% - 2px);
  top: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}

.send-blower-marker span {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 100% 100% 100% 0;
  background: #fff;
}

.send-blower-marker span:nth-child(1) {
  left: 13px;
  top: 1px;
  transform: rotate(-45deg);
}

.send-blower-marker span:nth-child(2) {
  left: 1px;
  top: 13px;
  transform: rotate(-135deg);
}

.send-blower-marker span:nth-child(3) {
  left: 13px;
  bottom: 1px;
  transform: rotate(-225deg);
}

.send-blower-marker span:nth-child(4) {
  right: 1px;
  top: 13px;
  transform: rotate(-315deg);
}

.send-progress-meta {
  justify-content: flex-start;
}

@keyframes send-blower-rotate {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

@media (max-width: 640px) {
  .send-blower-progress {
    min-height: 50px;
  }

  .send-blower-loadingbar {
    height: 30px;
    padding-right: 30px;
  }

  .send-blower-marker {
    width: 38px;
    height: 38px;
  }

  .send-blower-marker span {
    width: 13px;
    height: 13px;
  }

  .send-blower-marker span:nth-child(1),
  .send-blower-marker span:nth-child(3) {
    left: 12px;
  }

  .send-blower-marker span:nth-child(2) {
    left: 1px;
    top: 12px;
  }

  .send-blower-marker span:nth-child(4) {
    right: 1px;
    top: 12px;
  }
}

.campaign-create-progress {
  margin-top: 14px;
}


.campaign-filter-form label {
  display: grid;
  gap: 6px;
}

.campaign-filter-form label span {
  color: #5f7894;
  font-size: 0.78rem;
  font-weight: 800;
}


.campaign-company-header strong {
  color: #132744;
  font-size: 0.98rem;
  font-weight: 800;
}

.campaign-company-header .muted {
  margin-left: 8px;
  font-size: 0.82rem;
}


@media (max-width: 1100px) {
  .campaign-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .campaign-filter-form {
    grid-template-columns: 1fr;
  }
}

.send-settings-form {
  align-items: start;
}

.send-template-source-panel,
.test-template-source-panel {
  display: grid;}

.send-template-source-head,
.test-template-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.send-template-source-head small,
.test-template-source-head small,
.test-template-source-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.send-template-source-panel .template-source-options,
.test-template-segment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.send-template-source-panel .template-source-options label,
.test-template-segment label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.send-template-source-panel .template-source-options label:hover,
.test-template-segment label:hover {
  border-color: rgba(14, 122, 99, 0.35);
  color: var(--text);
}

.send-template-source-panel .template-source-options input,
.test-template-segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.send-template-source-panel .template-source-options span,
.test-template-segment span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.send-template-source-panel .template-source-options label:has(input:checked),
.test-template-segment label:has(input:checked) {
  border-color: rgba(14, 122, 99, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
}

.send-template-source-panel .template-source-options label.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.test-template-source-note {
  margin: 0;
}

.reminder-template-create-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reminder-template-create-row .secondary-btn {
  min-width: 120px;
}

.reminder-new-template-summary {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(14, 122, 99, 0.22);
  border-radius: 8px;
  background: rgba(14, 122, 99, 0.08);
  color: var(--accent);
  font-weight: 600;
}

.ai-template-use-field.disabled {
  opacity: 0.55;
}

.mailbox-group-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
}

.mailbox-group-picker label {
  min-width: 240px;
  margin: 0;
}

.weekly-person-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  margin: 10px 0;
  border: 1px solid var(--border-color, #d9e0e8);
  border-radius: 8px;
  background: var(--panel-soft, #f8fafc);
}

.weekly-journal-row {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.weekly-journal-remove {
  margin-bottom: 2px;
}

.weekly-journal-remove[hidden] {
  display: none !important;
}

.weekly-progress-row td {
  padding-top: 0;
  background: #f8fafb;
}

.weekly-live-progress {
  display: grid;
  gap: 8px;
  padding: 10px 0 12px;
}

.weekly-run-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.weekly-run-summary > div,
.weekly-person-progress-head {
  display: grid;
  gap: 2px;
}

.weekly-person-progress {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(300px, 1.4fr);
  gap: 10px 18px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color, #d9e0e8);
}

.weekly-progress-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 8px;
}

.weekly-progress-metrics > span {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-left: 2px solid #8dbbab;
  background: #f5f9f8;
}

.weekly-progress-metrics small { color: var(--muted, #667085); }
.weekly-progress-bars { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.weekly-progress-bar-row { display: grid; gap: 5px; }
.weekly-progress-bar-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; color: var(--muted, #667085); font-size: 11px; }
.weekly-progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e6ecea; }
.weekly-progress-track > span { display: block; height: 100%; border-radius: inherit; background: #176b57; transition: width .25s ease; }
.weekly-job-links {
  display: flex;
  grid-column: 1 / -1;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
}

.weekly-job-link { color: #176b57; font-size: 11px; line-height: 1.45; text-decoration: none; }
.weekly-job-link:hover { text-decoration: underline; }

.weekly-person-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  align-self: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 4px;
}

.weekly-person-toggle > input[type="checkbox"] {
  width: 20px !important;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
}

.weekly-person-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.weekly-person-identity strong,
.weekly-person-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Continuous data-center dispatch console */
.loop-console { display: grid; gap: 18px; }
.loop-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding: 4px 0 2px; }
.loop-hero h1 { margin: 4px 0 8px; letter-spacing: 0; }
.loop-hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.eyebrow { color: var(--muted, #667085); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.loop-form { display: grid; gap: 18px; }
.loop-form-top { display: grid; grid-template-columns: minmax(240px, 1.35fr) repeat(2, minmax(210px, 1fr)); gap: 14px; }
.loop-mode-summary { display: grid; align-content: center; gap: 3px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 7px; background: #f7faf9; }
.loop-mode-summary > span { color: var(--muted, #667085); font-size: 12px; }
.loop-mode-summary > strong { color: #176b57; font-size: 14px; }
.loop-mode-summary > small { color: var(--muted, #667085); font-size: 12px; }
.loop-fieldset { display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 8px; background: #fbfcfd; }
.loop-fieldset legend { padding: 0 6px; font-weight: 700; }
.loop-fieldset-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; }
.loop-domain-toolbar { position: relative; align-items: center; min-height: 34px; }
.loop-exclusion-menu { position: relative; z-index: 4; }
.loop-exclusion-menu > summary { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 10px; border: 1px solid #e4b55a; border-radius: 7px; color: #895b08; background: #fff9ec; cursor: pointer; font-weight: 700; list-style: none; }
.loop-exclusion-menu > summary::-webkit-details-marker { display: none; }
.loop-exclusion-menu > summary strong { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 999px; color: #fff; background: #b7791f; font-size: 11px; }
.loop-exclusion-popover { position: absolute; top: calc(100% + 7px); right: 0; display: grid; gap: 10px; width: min(390px, calc(100vw - 48px)); max-height: 420px; padding: 14px; overflow: auto; border: 1px solid var(--border-color, #d9e0e8); border-radius: 9px; background: #fff; box-shadow: 0 16px 40px rgba(27, 43, 58, .16); }
.loop-exclusion-popover > div:first-child { display: grid; gap: 2px; }
.loop-exclusion-popover small { color: var(--muted, #667085); }
.loop-exclusion-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.loop-exclusion-options label { display: flex; flex-direction: row; align-items: center; gap: 7px; min-width: 0; padding: 7px 8px; border: 1px solid #e5e9ee; border-radius: 6px; cursor: pointer; }
.loop-exclusion-options label:has(input:checked) { border-color: #e4b55a; background: #fff9ec; }
.loop-exclusion-options span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weekly-domain-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; max-height: 390px; overflow: auto; padding: 2px; }
.weekly-domain-picker > span, .selected-domain-heading, .weekly-mailbox-note { color: var(--muted, #667085); font-size: 13px; }
.weekly-domain-option { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 9px 11px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 7px; background: #fff; cursor: pointer; }
.weekly-domain-option:has(input:checked) { border-color: #176b57; background: #f0f8f5; box-shadow: 0 0 0 1px #176b57 inset; }
.weekly-domain-option input { flex: 0 0 auto; }
.weekly-domain-option span { display: grid; gap: 2px; min-width: 0; }
.weekly-domain-option small { color: var(--muted, #667085); font-size: 11px; }
.weekly-domain-option em { display: none; margin-left: auto; color: #9a6700; font-size: 11px; font-style: normal; white-space: nowrap; }
.weekly-domain-option.is-excluded { border-style: dashed; color: #7a6a4d; background: #fffaf0; cursor: not-allowed; opacity: .72; }
.weekly-domain-option.is-excluded em { display: inline; }
.selected-domain-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.selected-domain-heading strong { color: #203448; font-size: 14px; }
.weekly-mailbox-note { margin: -3px 0 0; line-height: 1.5; }
.loop-domain-list, .loop-people-grid, .loop-list { display: grid; gap: 10px; }
.loop-domain-row { display: grid; grid-template-columns: 30px minmax(240px, 2fr) minmax(170px, 1fr) minmax(140px, auto); gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 7px; background: #fff; }
.loop-startup-assignment { grid-column: 2 / -1; display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid #e5e9ef; }
.loop-startup-assignment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.loop-startup-assignment-head small { color: var(--muted, #667085); font-size: 11px; }
.loop-startup-assignment-options { display: flex; flex-wrap: wrap; gap: 8px; }
.loop-startup-assignment-options label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 9px; border: 1px solid #d7dee7; border-radius: 6px; background: #f8fafb; font-size: 12px; cursor: pointer; }
.loop-startup-assignment-options label:has(input:checked) { border-color: #5b9b86; background: #eef7f3; color: #135b49; }
.loop-domain-order { align-self: center; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; color: #fff; background: #176b57; font-size: 12px; font-weight: 800; }
.loop-domain-identity { align-self: center; display: grid; gap: 2px; min-width: 0; }
.loop-domain-identity small { color: var(--muted, #667085); }
.loop-availability { align-self: center; color: #176b57; font-size: 13px; white-space: nowrap; }
.loop-availability.is-empty { color: #b42318; }
.loop-mail-pool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.loop-mail-pool-head > div { display: grid; gap: 3px; }
.loop-mail-pool-head p { margin: 0; }
.loop-list-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.loop-search { flex: 1 1 260px; max-width: 420px; }
.loop-outbox-groups { display: grid; gap: 14px; max-height: 430px; padding: 2px 6px 2px 2px; overflow: auto; }
.loop-outbox-groups.is-compact { max-height: 300px; margin-top: 8px; }
.loop-outbox-group { display: grid; gap: 8px; }
.loop-outbox-group + .loop-outbox-group { padding-top: 12px; border-top: 1px solid var(--border-color, #d9e0e8); }
.loop-outbox-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.loop-outbox-group-head > div { display: flex; align-items: baseline; gap: 8px; }
.loop-outbox-group-head small { color: var(--muted, #667085); }
.loop-outbox-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 7px; max-height: 340px; padding: 2px; overflow: auto; }
.loop-outbox-group .loop-outbox-picker { max-height: none; overflow: visible; }
.loop-outbox-picker.is-compact { max-height: 250px; margin-top: 8px; }
.loop-outbox-option { display: flex; flex-direction: row; align-items: center; gap: 9px; min-width: 0; padding: 9px 10px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 7px; background: #fff; cursor: pointer; }
.loop-outbox-option:has(input:checked) { border-color: #176b57; background: #f0f8f5; }
.loop-outbox-option input { flex: 0 0 auto; }
.loop-outbox-option span { display: grid; gap: 2px; min-width: 0; }
.loop-outbox-option strong, .loop-outbox-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loop-outbox-option small { color: var(--muted, #667085); }
.loop-person-card { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(260px, 1.35fr) minmax(140px, .65fr) minmax(130px, .55fr) auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 7px; background: #fff; }
.loop-person-card.is-selected { border-color: #8dbbab; box-shadow: 0 0 0 1px #d7ebe4 inset; }
.loop-person-card label > small { color: var(--muted, #667085); font-size: 11px; line-height: 1.35; }
.loop-person-card[hidden] { display: none; }
.loop-person-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.loop-person-mailbox-summary { align-self: center; color: #176b57; font-size: 12px; line-height: 1.45; }
.loop-person-auto-allocation { display: grid; gap: 5px; align-self: center; }
.loop-person-auto-allocation span { color: var(--muted, #667085); font-size: 12px; }
.loop-person-auto-allocation strong { font-size: 13px; font-weight: 650; }
.loop-modal[hidden] { display: none; }
.loop-modal { position: fixed; inset: 0; z-index: 210000; display: grid; place-items: center; padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.loop-modal-open { overflow: hidden; }
.loop-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 31, 43, .45); }
.loop-modal-dialog { position: relative; z-index: 1; display: grid; gap: 14px; width: min(620px, 100%); max-height: min(720px, calc(100vh - 40px)); padding: 20px; overflow: auto; border: 1px solid var(--border-color, #d9e0e8); border-radius: 12px; background: #fff; box-shadow: 0 24px 70px rgba(20, 38, 50, .25); }
.loop-modal-dialog-wide { width: min(820px, 100%); }
.loop-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.loop-modal-head h3 { margin: 0 0 4px; }
.loop-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.loop-picker-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; }
.loop-picker-option { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 8px; background: #fbfcfd; cursor: pointer; }
.loop-picker-option:has(input:checked) { border-color: #176b57; background: #f0f8f5; }
.loop-picker-option span { display: grid; gap: 3px; min-width: 0; }
.loop-picker-option small, .loop-detail-row small { color: var(--muted, #667085); font-size: 11px; }
.loop-detail-rows { display: grid; gap: 8px; }
.loop-detail-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(250px, 1.2fr) minmax(100px, auto); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 8px; background: #fbfcfd; }
.loop-detail-row > div { display: grid; gap: 3px; }
.loop-form-actions, .loop-run-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.loop-worker-runtime { display: grid; gap: 12px; margin-bottom: 16px; padding: 16px; border: 1px solid #cfe1db; border-radius: 9px; background: linear-gradient(180deg, #f8fcfb, #f1f8f6); }
.loop-worker-runtime-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.loop-worker-runtime-head > div { display: grid; gap: 3px; }
.loop-worker-runtime-grid .stat-card { border-color: rgba(23, 107, 87, .14); background: rgba(255, 255, 255, .9); box-shadow: 0 10px 24px rgba(23, 107, 87, .07); }
.loop-worker-runtime-grid .stat-card strong { color: #153d33; }
.loop-run-card { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 8px; background: #fff; }
.loop-run-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.loop-run-head h3 { margin: 4px 0 4px; }
.loop-mailbox-editor { display: grid; gap: 12px; padding-top: 4px; border-top: 1px solid var(--border-color, #d9e0e8); }
.loop-mailbox-editor summary { cursor: pointer; color: #176b57; font-size: 13px; font-weight: 700; }
.loop-mailbox-grid { display: grid; gap: 10px; }
.loop-paused-outbox-pool { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 7px; background: #fbfcfd; }
.loop-mailbox-row { display: grid; grid-template-columns: minmax(150px, .6fr) minmax(260px, 1.5fr); gap: 12px; align-items: end; padding: 10px; border: 1px solid var(--border-color, #d9e0e8); border-radius: 7px; background: #fbfcfd; }
.loop-mailbox-row > strong { align-self: center; color: #203448; font-size: 13px; }
.loop-other-inboxes { display: grid; gap: 8px; padding: 10px; border: 1px dashed #d9e0e8; border-radius: 7px; background: #fafcfd; }
.loop-other-inboxes summary { cursor: pointer; color: #52687b; font-size: 12px; font-weight: 700; }
.loop-other-inbox-list { display: flex; flex-wrap: wrap; gap: 6px; }
.loop-other-inbox-list span { padding: 5px 8px; border-radius: 999px; color: #657789; background: #eef2f5; font-size: 11px; }
.loop-live-progress { padding: 0; }
.loop-alerts { display: grid; gap: 4px; margin-top: 4px; }
.loop-empty { display: grid; gap: 4px; padding: 28px; text-align: center; border: 1px dashed var(--border-color, #d9e0e8); border-radius: 8px; }
.loop-run-actions { align-items: center; }
.loop-detail-entry { border-color: #176b57; color: #176b57; }
.loop-detail-page { gap: 16px; }
.loop-detail-hero { margin-bottom: 0; }
.loop-detail-commandbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px; }
.loop-detail-commandbar > div { display: grid; gap: 3px; }
.loop-detail-stat-grid { grid-template-columns: repeat(6, minmax(130px, 1fr)); }
.loop-detail-live { margin-top: 16px; padding: 14px; border-top: 1px solid var(--border-color, #d9e0e8); }
.loop-live-empty { display: block; padding: 13px 4px 2px; }
.loop-domain-switcher { display: grid; gap: 14px; min-width: 0; }
.loop-domain-tabs { display: flex; gap: 8px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: thin; }
button.loop-domain-tab:not(.icon-btn):not(.mode-option):not(.danger-ghost) { display: grid; grid-template-columns: 26px minmax(118px, 1fr); flex: 0 0 auto; align-items: center; gap: 8px; min-width: 178px; padding: 9px 11px; border: 1px solid #dce3e9; border-radius: 7px; color: #415466; background: #f8fafb; box-shadow: none; text-align: left; }
button.loop-domain-tab:not(.icon-btn):not(.mode-option):not(.danger-ghost):hover { border-color: #9fbeb6; color: #165e50; background: #f3f9f7; transform: none; }
button.loop-domain-tab:not(.icon-btn):not(.mode-option):not(.danger-ghost).is-selected { border-color: #4e9482; color: #134f43; background: #edf7f4; box-shadow: inset 0 -3px #277765; }
.loop-domain-tab.is-active .loop-domain-order { color: #fff; background: #277765; }
.loop-domain-tab > span:last-child { display: grid; min-width: 0; gap: 2px; }
.loop-domain-tab strong, .loop-domain-tab small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loop-domain-tab small { color: #6d7d8c; font-size: 11px; font-weight: 600; }
.loop-domain-panel { min-width: 0; padding: 15px; border: 1px solid #dce4e9; border-radius: 7px; background: #fbfcfd; }
.loop-domain-panel[hidden] { display: none; }
.loop-domain-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.loop-domain-panel-head > div { display: grid; gap: 2px; }
.loop-domain-panel-head small { color: var(--muted, #667085); font-size: 12px; }
.loop-domain-metrics { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); gap: 8px; margin: 0; }
.loop-domain-metrics div { display: grid; gap: 3px; min-width: 0; padding: 10px 11px; border: 1px solid #e0e6eb; border-radius: 6px; background: #fff; }
.loop-domain-metrics dt { color: var(--muted, #667085); font-size: 11px; }
.loop-domain-metrics dd { margin: 0; overflow-wrap: anywhere; color: #203448; font-size: 17px; font-weight: 800; }
.loop-domain-subsection { margin-top: 15px; }
.loop-domain-subsection-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.loop-domain-subsection-head small { color: var(--muted, #667085); font-size: 11px; }
.loop-domain-results-table table { min-width: 680px; }
.loop-domain-results-table th, .loop-domain-results-table td { padding: 9px 11px; }
.loop-domain-results-table td small { display: block; margin-top: 2px; color: var(--muted, #667085); font-size: 11px; }
.loop-detail-config-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 20px; }
.loop-detail-config-block { min-width: 0; }
.loop-detail-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color, #d9e0e8); }
.loop-detail-block-head span { color: var(--muted, #667085); font-size: 12px; }
.loop-detail-domain-config,
.loop-detail-people-config { display: grid; gap: 8px; }
.loop-detail-domain-row { display: grid; grid-template-columns: 30px minmax(140px, .75fr) minmax(330px, 1.25fr); gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid #dbe3ea; border-radius: 7px; background: #fbfcfd; }
.loop-detail-domain-row.is-active { border-color: #72ad9d; box-shadow: inset 3px 0 #176b57; background: #f5faf8; }
.loop-detail-domain-row > div { display: grid; gap: 2px; min-width: 0; }
.loop-detail-domain-row small { color: var(--muted, #667085); }
.loop-detail-domain-row dl { display: grid; grid-template-columns: repeat(4, minmax(68px, 1fr)); gap: 6px; margin: 0; }
.loop-detail-domain-row dl div { display: grid; gap: 2px; min-width: 0; }
.loop-detail-domain-row dt { color: var(--muted, #667085); font-size: 11px; }
.loop-detail-domain-row dd { margin: 0; color: #243447; font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.loop-detail-people-config > article { display: grid; grid-template-columns: minmax(130px, .75fr) minmax(190px, 1fr); gap: 8px 14px; padding: 11px 12px; border-bottom: 1px solid #e2e7ec; }
.loop-detail-people-config > article > div:first-child { display: grid; gap: 2px; }
.loop-detail-people-config small { color: var(--muted, #667085); }
.loop-detail-person-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.loop-detail-person-metrics span { color: var(--muted, #667085); font-size: 11px; }
.loop-detail-person-metrics b { display: block; color: #243447; font-size: 13px; }
.loop-detail-inboxes { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 6px; }
.loop-detail-inboxes span,
.loop-detail-outbox-strip span { padding: 4px 7px; border: 1px solid #dce3e9; border-radius: 5px; color: #48596a; background: #f7f9fa; font-size: 11px; overflow-wrap: anywhere; }
.loop-detail-inboxes span.is-warning { border-color: #efb7aa; color: #9f2d20; background: #fff5f2; }
.loop-detail-outbox-strip { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-color, #d9e0e8); }
.loop-detail-outbox-strip > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; color: #34495b; }
.loop-detail-outbox-strip > summary span { padding: 0; border: 0; color: var(--muted, #667085); background: transparent; }
.loop-detail-outbox-strip > div { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.loop-detail-editor { display: grid; gap: 14px; }
.loop-detail-editor-readonly { padding: 14px 18px; border: 1px dashed #d9e0e8; background: #fbfcfd; }
.loop-detail-editor-readonly p { margin: 0; }
.loop-detail-edit-form { display: grid; gap: 14px; }
.loop-detail-editor-modal { width: min(1120px, 100%); max-height: calc(100vh - 40px); }
.loop-detail-editor-modal .loop-fieldset { min-width: 0; }
.loop-detail-editor-outboxes { max-height: 360px; }
.loop-detail-edit-people { display: grid; gap: 8px; max-height: 560px; overflow: auto; }
.loop-detail-edit-person { display: grid; grid-template-columns: minmax(230px, 1.1fr) minmax(250px, 1.2fr) minmax(130px, .5fr); gap: 10px 14px; align-items: end; padding: 11px 12px; border: 1px solid #dbe3ea; border-radius: 8px; background: #fbfcfd; }
.loop-detail-edit-person.is-selected { border-color: #8dbbab; background: #f5faf8; box-shadow: inset 3px 0 #176b57; }
.loop-detail-edit-person-toggle { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.loop-detail-edit-person-toggle span { display: grid; gap: 3px; min-width: 0; }
.loop-detail-edit-person-toggle small { color: var(--muted, #667085); font-size: 11px; }
.loop-detail-edit-person label:not(.loop-detail-edit-person-toggle) { display: grid; gap: 4px; }
.loop-detail-edit-person label:not(.loop-detail-edit-person-toggle) > span { color: var(--muted, #667085); font-size: 11px; }
.loop-detail-edit-person > input[type="hidden"] { display: none; }
.loop-detail-domain-inbox-row { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(240px, 1.2fr); gap: 10px; align-items: center; }
.loop-detail-domain-inbox-row > strong { font-size: 12px; }
.loop-detail-project-owner { display: inline-flex !important; grid-template-columns: none !important; align-items: center; gap: 7px !important; color: inherit !important; font-size: 12px; }
.loop-detail-project-owner input { margin: 0; }
.loop-detail-domain-inboxes { grid-column: 1 / -1; border-top: 1px solid #dbe3ea; padding-top: 9px; }
.loop-detail-domain-inboxes > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; color: #344054; font-weight: 700; }
.loop-detail-domain-inboxes > summary small { color: var(--muted, #667085); font-size: 11px; font-weight: 500; }
.loop-detail-domain-inbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding-top: 10px; }
.loop-detail-domain-inbox-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.loop-detail-table table { min-width: 940px; }
.loop-detail-table td { vertical-align: top; }
.loop-detail-table details summary { cursor: pointer; }
.loop-alert-summary { color: #a13d25; font-weight: 700; }
.loop-alert-history { display: grid; gap: 5px; min-width: 260px; max-width: 520px; padding-top: 8px; color: #7d392a; font-size: 12px; white-space: normal; }
.loop-detail-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; color: var(--muted, #667085); font-size: 12px; }
.loop-item-header { align-items: flex-start; }
.loop-item-filters { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(145px, .7fr)) auto auto; gap: 8px; align-items: end; margin-bottom: 14px; }
.loop-item-filters label { min-width: 0; }
.loop-item-table .author-title-cell { max-width: 320px; }
.loop-alert-modal { z-index: 220000; }
.loop-alert-dialog { width: min(720px, 100%); border: 1px solid #e5a18e; border-radius: 8px; box-shadow: 0 26px 80px rgba(92, 35, 24, .28); }
.loop-alert-symbol { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid #b9422a; border-radius: 50%; color: #b9422a; background: #fff5f2; font-size: 25px; font-weight: 900; }
.loop-alert-message-list { display: grid; gap: 7px; padding: 12px 14px; border-left: 3px solid #c94e34; color: #792d20; background: #fff5f2; }
.loop-alert-message-list p { margin: 0; line-height: 1.5; }
.loop-alert-domain-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.loop-alert-domain { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid #dfe4e8; border-radius: 6px; background: #fafbfc; }
.loop-alert-domain.is-active { border-color: #d48670; background: #fff8f5; }
.loop-alert-domain span { color: var(--muted, #667085); font-size: 11px; }
.loop-alert-switch { margin: 0; }
@media (max-width: 1050px) {
  .loop-form-top { grid-template-columns: 1fr 1fr; }
  .loop-form-top label:first-child { grid-column: 1 / -1; }
  .loop-person-card { grid-template-columns: 1fr 1fr; }
  .loop-person-card .weekly-person-toggle { grid-column: 1 / -1; }
  .loop-detail-stat-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .loop-detail-config-grid { grid-template-columns: 1fr; }
  .loop-domain-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .loop-item-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .loop-hero { display: grid; }
  .loop-hero-actions { justify-content: flex-start; }
  .loop-form-top, .loop-person-card, .loop-mailbox-row { grid-template-columns: 1fr; }
  .loop-domain-row { grid-template-columns: 32px minmax(0, 1fr); align-items: center; }
  .loop-domain-row > label,
  .loop-domain-row > .loop-availability,
  .loop-domain-row > .loop-startup-assignment { grid-column: 1 / -1; }
  .loop-detail-row { grid-template-columns: 1fr; }
  .loop-form-top label:first-child, .loop-person-card .weekly-person-toggle { grid-column: auto; }
  .loop-availability { justify-self: start; }
  .loop-exclusion-popover { position: fixed; top: 18%; right: 16px; left: 16px; width: auto; }
  .loop-exclusion-options { grid-template-columns: 1fr; }
  .loop-mail-pool-head { display: grid; }
  .weekly-person-progress { grid-template-columns: 1fr; }
  .weekly-progress-metrics { grid-template-columns: 1fr 1fr; }
  .weekly-progress-bars { grid-template-columns: 1fr; }
  .loop-detail-commandbar { display: grid; }
  .loop-detail-commandbar .inline-actions { justify-content: flex-start; }
  .loop-detail-domain-row { grid-template-columns: 30px minmax(0, 1fr); align-items: start; }
  .loop-detail-domain-row dl { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop-detail-people-config > article { grid-template-columns: 1fr; }
  .loop-detail-inboxes { grid-column: 1; }
  .loop-domain-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop-detail-person-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop-detail-outbox-strip > summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .loop-detail-edit-person { grid-template-columns: 1fr; align-items: stretch; }
  .loop-detail-domain-inbox-grid { grid-template-columns: 1fr; }
  .loop-alert-domain-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .loop-detail-stat-grid,
  .loop-item-filters { grid-template-columns: 1fr; }
  .loop-detail-pagination { justify-content: space-between; }
}

/* Daily send report */
.daily-report-page { min-width: 0; }
.daily-report-head, .daily-report-actions, .daily-report-manual, .card-actions { display: flex; align-items: center; }
.daily-report-head { justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.daily-report-head h1 { margin: 0 0 4px; font-size: 24px; }
.daily-report-filter { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(190px, .8fr) auto; align-items: end; gap: 12px; padding: 15px; border: 1px solid #dfe6ec; border-radius: 6px; background: #f8fafb; }
.daily-report-filter label > span, .daily-report-config-card label > span { display: block; margin-bottom: 6px; color: #536477; font-size: 12px; font-weight: 700; }
.daily-report-filter select, .daily-report-filter input, .daily-report-config-card input { width: 100%; }
.daily-report-scope-field > span { display: block; margin-bottom: 6px; color: #536477; font-size: 12px; font-weight: 700; }
.daily-report-scope-field > strong { display: flex; min-height: 42px; align-items: center; padding: 0 12px; border: 1px solid #dfe6ec; border-radius: 6px; background: #fff; color: #26394b; }
.daily-report-preview { width: 100%; min-height: 760px; margin: 16px 0 22px; border: 1px solid #dfe6ec; border-radius: 6px; background: #fff; }
.daily-report-config { padding-top: 4px; }
.daily-report-config .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; border-bottom: 1px solid #dfe6ec; }
.daily-report-config .section-heading h2 { margin: 0 0 10px; font-size: 18px; }
.daily-report-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.daily-report-config-grid.is-single { grid-template-columns: minmax(0, 1fr); }
.daily-report-config-card { padding: 17px; border: 1px solid #dfe6ec; border-radius: 6px; background: #fff; }
.daily-report-config-card h3 { margin: 0 0 14px; font-size: 16px; }
.daily-report-config-card label { display: block; margin-bottom: 12px; }
.daily-report-recipient-editor { margin-bottom: 14px; }
.daily-report-recipient-heading,
.daily-report-recipient-row { display: grid; grid-template-columns: minmax(110px, .7fr) minmax(190px, 1.2fr) 88px 34px; gap: 8px; align-items: center; }
.daily-report-recipient-heading { margin-bottom: 6px; color: #536477; font-size: 12px; font-weight: 700; }
.daily-report-recipient-row { margin-bottom: 8px; }
.daily-report-recipient-row input { min-width: 0; }
.daily-report-delivery-status { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; padding: 4px 7px; border: 1px solid #d7e0e7; border-radius: 4px; background: #f7f9fb; color: #5e6c79; font-size: 12px; font-weight: 700; white-space: nowrap; }
.daily-report-delivery-status.is-sent { border-color: #afd5bb; background: #eef8f1; color: #28723e; }
.daily-report-delivery-status.is-failed { border-color: #e2b7b1; background: #fdf1ef; color: #a43f35; }
.daily-report-delivery-status.is-sending { border-color: #b9cbe2; background: #eef4fb; color: #315f91; }
.daily-report-recipient-remove { width: 34px; height: 34px; }
.daily-report-recipient-add { margin-top: 2px; }
.daily-report-config-card .switch-line { display: flex; align-items: center; gap: 8px; }
.daily-report-config-card .switch-line input { width: auto; }
.daily-report-config-card .switch-line span { margin: 0; }
.daily-report-config-card .config-error { display: block; margin-top: 8px; color: #a43f35; }
.daily-report-config-card .card-actions { justify-content: flex-end; margin-top: 13px; }
.daily-report-manual { justify-content: flex-end; margin-top: 14px; }
@media (max-width: 760px) {
  .daily-report-head { align-items: stretch; flex-direction: column; }
  .daily-report-filter, .daily-report-config-grid { grid-template-columns: 1fr; }
  .daily-report-preview { min-height: 620px; }
  .daily-report-recipient-heading { display: none; }
  .daily-report-recipient-row { grid-template-columns: minmax(0, 1fr) 38px; padding-bottom: 10px; border-bottom: 1px solid #e6ebef; }
  .daily-report-recipient-row input { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .weekly-person-card { grid-template-columns: 1fr; }
  .weekly-journal-row { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .weekly-plan-table-wrap {
    overflow: visible;
  }

  .weekly-plan-table,
  .weekly-plan-table tbody,
  .weekly-plan-table tr,
  .weekly-plan-table td {
    display: block;
    width: 100%;
  }

  .weekly-plan-table thead {
    display: none;
  }

  .weekly-plan-table tr[data-weekly-plan-row] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 14px;
    padding: 14px 0;
    border-top: 1px solid var(--border-color, #d9e0e8);
  }

  .weekly-plan-table tr[data-weekly-plan-row] td {
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .weekly-plan-table tr[data-weekly-plan-row] td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted, #667085);
    font-size: 0.78rem;
    font-weight: 600;
  }

  .weekly-plan-table tr[data-weekly-plan-row] td:nth-child(1)::before { content: "计划"; }
  .weekly-plan-table tr[data-weekly-plan-row] td:nth-child(2)::before { content: "周期"; }
  .weekly-plan-table tr[data-weekly-plan-row] td:nth-child(3)::before { content: "公司"; }
  .weekly-plan-table tr[data-weekly-plan-row] td:nth-child(4)::before { content: "状态"; }
  .weekly-plan-table tr[data-weekly-plan-row] td:nth-child(5)::before { content: "配置"; }
  .weekly-plan-table tr[data-weekly-plan-row] td:nth-child(6)::before { content: "操作"; }

  .weekly-plan-table tr[data-weekly-plan-row] td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .weekly-plan-table .weekly-progress-row td {
    padding: 12px 0 18px;
    border: 0;
  }

  .weekly-plan-table .weekly-job-links .mini-btn {
    width: 100%;
    min-height: 34px;
    height: auto;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
  }
}

/* 邀约统计 2026-08：周视图与邮箱下钻 */
.invitation-stats-page {
  gap: 16px;
}

.invitation-stats-heading {
  padding-top: 2px;
}

.invitation-stats-filter-band {
  padding: 12px 14px;
  border: 1px solid #dfe6ec;
  border-radius: 6px;
  background: #f8fafb;
}

.invitation-stats-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.invitation-stat-kpi {
  min-height: 92px;
  padding: 13px 14px 12px;
}

.invitation-stat-kpi strong {
  font-size: 1.34rem;
}

.invitation-stats-facts,
.invitation-reminder-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 44px;
  padding: 0 4px;
  border-top: 1px solid #e1e7ec;
  border-bottom: 1px solid #e1e7ec;
  color: #657585;
  background: #fbfcfd;
  font-size: 0.73rem;
}

.invitation-stats-facts span,
.invitation-reminder-strip span {
  padding: 6px 15px;
  border-right: 1px solid #e4e9ed;
  white-space: nowrap;
}

.invitation-stats-facts span:first-child,
.invitation-reminder-strip span:first-child {
  padding-left: 10px;
}

.invitation-stats-facts b,
.invitation-reminder-strip b {
  margin-left: 5px;
  color: #21384c;
  font-family: var(--font-montserrat);
}

.invitation-reminder-daily {
  margin: 12px 0 4px;
  overflow-x: auto;
  border: 1px solid #e1e7ec;
  border-radius: 6px;
  background: #fff;
}

.invitation-reminder-daily-row {
  display: grid;
  grid-template-columns: 1.2fr repeat(7, minmax(72px, 1fr));
  min-width: 680px;
  align-items: center;
  border-top: 1px solid #edf1f3;
  color: #526775;
  font-size: 0.72rem;
}

.invitation-reminder-daily-row:first-child { border-top: 0; }
.invitation-reminder-daily-row > * { padding: 8px 10px; text-align: right; }
.invitation-reminder-daily-row > :first-child { text-align: left; }
.invitation-reminder-daily-row.is-head { color: #7a8a96; background: #f8fafb; font-size: 0.66rem; }
.invitation-reminder-daily-row b { color: #21384c; font-family: var(--font-montserrat); }
.invitation-reminder-daily-row .is-positive { color: #247b61; }
.invitation-reminder-daily-row .is-negative { color: #a64c4c; }

.invitation-stats-section {
  border-top: 0;
}

.invitation-snapshot-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #d6e2e7;
  border-radius: 6px;
  color: #425968;
  background: #f5f9fa;
  font-size: 0.72rem;
}

.invitation-snapshot-status strong {
  flex: 0 0 auto;
  color: #246474;
  font-size: 0.7rem;
}

.invitation-snapshot-status.is-warning {
  border-color: #e8c98e;
  color: #78591e;
  background: #fff9ec;
}

.invitation-snapshot-status.is-warning strong {
  color: #9b6410;
}

.invitation-stats-section-head {
  padding: 18px 2px 10px;
  border-bottom: 1px solid #dfe6ec;
}

.invitation-week-section .invitation-stats-section-head {
  padding-top: 8px;
}

.invitation-drilldown-list {
  border-right: 1px solid #dfe6ec;
  border-bottom: 1px solid #dfe6ec;
  border-left: 1px solid #dfe6ec;
  background: #fff;
}

.invitation-drilldown {
  min-width: 0;
  border-bottom: 1px solid #e8edf1;
}

.invitation-drilldown:last-child {
  border-bottom: 0;
}

.invitation-drilldown > summary {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(700px, 5fr) 32px;
  align-items: center;
  min-height: 70px;
  padding: 10px 10px 10px 16px;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}

.invitation-drilldown > summary::-webkit-details-marker {
  display: none;
}

.invitation-drilldown > summary:hover {
  background: #f8fafb;
}

.invitation-drilldown[open] > summary {
  border-bottom: 1px solid #dfe6ec;
  background: #f5f8f9;
}

.invitation-drilldown-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.invitation-drilldown-title > strong,
.invitation-drilldown-title > a {
  overflow: hidden;
  color: #20384d;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-drilldown-title > small {
  overflow: hidden;
  color: #7d8995;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-drilldown-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
  align-items: stretch;
  min-width: 0;
}

.invitation-drilldown-metrics > span {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 1px 10px;
  border-left: 1px solid #e5eaee;
}

.invitation-drilldown-metrics small,
.invitation-drilldown-metrics b,
.invitation-drilldown-metrics em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-drilldown-metrics small {
  color: #7c8995;
  font-size: 0.62rem;
  font-weight: 700;
}

.invitation-drilldown-metrics b {
  margin-top: 3px;
  color: #253d52;
  font-family: var(--font-montserrat);
  font-size: 0.79rem;
}

.invitation-drilldown-metrics em {
  margin-top: 1px;
  color: #8a96a1;
  font-size: 0.58rem;
  font-style: normal;
}

.invitation-drilldown-metrics .is-reply b {
  color: #15715f;
}

.invitation-drilldown-metrics .is-failure b {
  color: #b84f53;
}

.invitation-expand-icon {
  width: 18px;
  height: 18px;
  padding: 6px;
  box-sizing: content-box;
  color: #71818f;
  transition: transform 160ms ease;
}

.invitation-drilldown[open] .invitation-expand-icon {
  transform: rotate(180deg);
}

.invitation-drilldown-body {
  padding: 0 16px 14px;
  background: #f8fafb;
}

.invitation-mailbox-detail-head,
.invitation-mailbox-detail-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) repeat(6, minmax(72px, 0.72fr));
  align-items: center;
  min-width: 980px;
  gap: 0;
}

.invitation-mailbox-detail-head.has-domain,
.invitation-mailbox-detail-row.has-domain {
  grid-template-columns: minmax(220px, 2.2fr) repeat(7, minmax(72px, 0.72fr));
  min-width: 1060px;
}

.invitation-mailbox-detail-head {
  min-height: 34px;
  color: #748290;
  font-size: 0.62rem;
  font-weight: 800;
}

.invitation-mailbox-detail-head > *,
.invitation-mailbox-detail-row > * {
  min-width: 0;
  padding: 7px 10px;
}

.invitation-mailbox-detail-list {
  overflow-x: auto;
  border: 1px solid #dce4ea;
  border-radius: 5px;
  background: #fff;
}

.invitation-mailbox-detail-row {
  min-height: 45px;
  border-bottom: 1px solid #edf1f4;
  color: #46596a;
  font-size: 0.7rem;
}

.invitation-mailbox-detail-row:last-child {
  border-bottom: 0;
}

.invitation-mailbox-detail-row:hover {
  background: #fbfcfd;
}

.invitation-mailbox-detail-row.is-unmatched {
  border-left: 3px solid #d39a32;
  background: #fffaf0;
}

.invitation-mailbox-identity {
  display: grid;
  gap: 2px;
}

.invitation-mailbox-identity strong {
  overflow-wrap: anywhere;
  color: #263f54;
  font-size: 0.72rem;
}

.invitation-mailbox-identity small {
  color: #85919c;
  font-size: 0.61rem;
}

.invitation-mailbox-detail-row b {
  color: #405466;
  font-family: var(--font-montserrat);
  font-size: 0.72rem;
}

.invitation-mailbox-detail-row b.is-positive {
  color: #15715f;
}

.invitation-mailbox-detail-row b.is-negative {
  color: #b84f53;
}

.invitation-batch-link {
  display: block;
}

@media (max-width: 1320px) {
  .invitation-stats-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .invitation-drilldown > summary {
    grid-template-columns: minmax(180px, 1fr) minmax(580px, 4fr) 28px;
    gap: 9px;
  }

  .invitation-drilldown-metrics > span {
    padding-right: 7px;
    padding-left: 7px;
  }
}

@media (max-width: 980px) {
  .invitation-drilldown > summary {
    grid-template-columns: minmax(0, 1fr) 28px;
    padding: 12px;
  }

  .invitation-drilldown-title {
    grid-column: 1;
  }

  .invitation-expand-icon {
    grid-column: 2;
    grid-row: 1;
  }

  .invitation-drilldown-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .invitation-drilldown-metrics > span:nth-child(5) {
    border-left: 0;
  }

  .invitation-drilldown-body {
    padding: 0 12px 12px;
    overflow-x: auto;
  }
}

@media (max-width: 620px) {
  .invitation-stats-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-stat-kpi {
    min-height: 86px;
  }

  .invitation-stats-facts,
  .invitation-reminder-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px 0;
  }

  .invitation-stats-facts span,
  .invitation-reminder-strip span,
  .invitation-stats-facts span:first-child,
  .invitation-reminder-strip span:first-child {
    padding: 6px 10px;
  }

  .invitation-reminder-daily-row {
    grid-template-columns: 1.35fr repeat(7, minmax(62px, 1fr));
  }

  .invitation-drilldown-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-drilldown-metrics > span:nth-child(odd) {
    border-left: 0;
  }

  .invitation-drilldown-metrics > span:nth-child(5) {
    border-left: 0;
  }

  .invitation-mailbox-detail-head {
    display: none;
  }

  .invitation-mailbox-detail-list {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .invitation-mailbox-detail-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #dce4ea;
    border-radius: 5px;
    background: #fff;
  }

  .invitation-mailbox-detail-row > *::before {
    display: block;
    margin-bottom: 2px;
    color: #8a96a1;
    content: attr(data-label);
    font-size: 0.58rem;
    font-weight: 700;
  }

  .invitation-mailbox-identity {
    grid-column: 1 / -1;
  }
}

.template-create-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.template-create-preview {
  min-height: 420px;
}

.template-create-preview iframe {
  display: block;
  width: 100%;
  min-height: 420px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 16px;
  background: #fff;
}

.form-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.rich-html-source {
  margin-top: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(244, 247, 250, 0.86);
}

.rich-html-source summary {
  cursor: pointer;
  font-weight: 700;
}

.rich-html-source textarea {
  min-height: 240px;
  margin-top: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.rich-html-source-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.outbox-picker-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.selected-outbox-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.selected-outbox-header .muted {
  margin: 4px 0 0;
}

.reply-to-bulk-row {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.reply-to-bulk-row label {
  margin: 0;
}

.reply-to-bulk-row button {
  min-height: 42px;
}

.selected-outbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.selected-outbox-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.selected-outbox-item.is-quota-waiting {
  opacity: 0.6;
  background: rgba(17, 17, 17, 0.03);
  border-style: dashed;
}

.selected-outbox-item.is-quota-waiting::after {
  content: "24小时额度已用满，仍保留在本批次，额度恢复后自动继续发送";
  font-size: 12px;
  color: #b26a00;
}

.selected-outbox-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.selected-outbox-main > div {
  min-width: 0;
}

.selected-outbox-main strong {
  display: block;
  margin-bottom: 4px;
}

.outbox-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.outbox-choice-card {
  min-width: 0;
  min-height: 136px;
  overflow: hidden;
  padding-left: 52px;
}

.outbox-choice-card .choice-card-title {
  min-width: 0;
}

.outbox-choice-card .choice-card-title > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outbox-choice-card .choice-card-subtitle,
.outbox-choice-card .choice-card-meta,
.selected-outbox-item .choice-card-subtitle {
  overflow-wrap: anywhere;
}

.outbox-choice-card:has(input:disabled) {
  opacity: 0.58;
  cursor: not-allowed;
}

.outbox-choice-indicator {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(17, 17, 17, 0.18);
  background: #fff;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.outbox-choice-indicator::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0.6);
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.outbox-choice-card:has(input:checked) .outbox-choice-indicator {
  border-color: #0e7a63;
  background: #0e7a63;
  box-shadow: 0 0 0 4px rgba(14, 122, 99, 0.12);
}

.outbox-choice-card:has(input:checked) .outbox-choice-indicator::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.outbox-choice-card:has(input:disabled) .outbox-choice-indicator {
  background: rgba(17, 17, 17, 0.06);
  border-color: rgba(17, 17, 17, 0.12);
  box-shadow: none;
}

.reply-to-picker {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.reply-to-picker span {
  color: var(--muted);
  font-size: 12px;
}

.reply-to-picker input,
.reply-to-picker select {
  min-width: 0;
  width: 100%;
}

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

.missing-reply-list label {
  margin: 0;
}

.modal-card-wide {
  width: min(1040px, 100%);
}

#outbox-picker-modal .modal-card-wide {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  height: calc(100vh - 48px);
  height: calc(100dvh - 48px);
  max-height: calc(100dvh - 48px);
  min-height: 0;
  overflow: hidden;
}

#outbox-picker-modal {
  align-items: start;
  justify-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#outbox-picker-modal .modal-backdrop {
  position: fixed;
}

#outbox-picker-modal .mailbox-group-picker {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

#outbox-picker-modal .outbox-choice-grid {
  min-height: 0;
  max-height: calc(100vh - 250px);
  max-height: calc(100dvh - 250px);
  overflow-y: auto;
  padding: 2px 8px 4px 2px;
  overscroll-behavior: contain;
}

#outbox-picker-modal .modal-actions {
  position: sticky;
  bottom: 0;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  background: #ffffff;
  z-index: 2;
}

@media (max-width: 720px) {
  #outbox-picker-modal {
    padding: 12px;
  }

  #outbox-picker-modal .modal-card-wide {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 16px;
  }

  #outbox-picker-modal .mailbox-group-picker {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #outbox-picker-modal .mailbox-group-picker label,
  #outbox-picker-modal .mailbox-group-picker button,
  #outbox-picker-modal .modal-actions button {
    width: 100%;
    min-width: 0;
  }

  #outbox-picker-modal .outbox-choice-grid {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 270px);
    max-height: calc(100dvh - 270px);
  }
}

.variant-pager,
.table-pager {
  align-items: center;
  justify-content: flex-end;
}

.variant-pager .ghost-btn,
.table-pager .ghost-btn {
  min-width: 86px;
  padding: 9px 14px;
  border-radius: 12px;
}

.page-jump-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.page-jump-form label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.page-jump-form input[type="number"] {
  width: 72px;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 10px;
  text-align: center;
}

.partial-loading {
  opacity: 0.62;
  pointer-events: none;
}

.row-highlight td {
  background: rgba(14, 122, 99, 0.12);
  transition: background 0.4s ease;
}

.variant-summary-card {
  display: grid;
  gap: 14px;
}

.variant-template-modal .modal-card {
  width: min(1560px, calc(100vw - 32px));
  max-width: none;
  padding: 28px;
}

.variant-template-scale-wrap {
  width: fit-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  transform-origin: top center;
}

.variant-template-card {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.variant-template-modal .rich-review-layout {
  grid-template-columns: minmax(560px, 1.12fr) minmax(460px, 0.88fr);
}

.template-edit-modal .modal-card {
  width: min(1480px, calc(100vw - 32px));
  max-width: none;
  padding: 28px;
}

.template-editor-card {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.template-edit-modal .rich-review-layout {
  grid-template-columns: minmax(560px, 1.12fr) minmax(460px, 0.88fr);
}

.template-edit-modal .rich-editor-surface {
  min-height: 430px;
}

.template-edit-modal .mail-preview-frame {
  min-height: 520px;
}

@media (max-width: 1100px) {
  .template-edit-modal .rich-review-layout {
    grid-template-columns: 1fr;
  }

  .template-edit-modal .mail-preview-frame,
  .template-edit-modal .rich-editor-surface {
    min-height: 360px;
  }
}

.variant-template-preview {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  margin-bottom: 16px;
}

.variant-template-preview .body-preview {
  max-height: 160px;
  overflow: auto;
}

.send-preview-card {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
  display: grid;
  gap: 14px;
}

.send-preview-subject {
  padding: 14px 16px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.send-preview-recipient {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
}

.send-preview-frame {
  width: 100%;
  min-height: 520px;
  height: min(58vh, 640px);
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
}

.send-preview-actions {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.message-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.message-body-section {
  margin-top: 16px;
}

.message-body-preview {
  max-height: 560px;
  overflow: auto;
}

.rich-message-body {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  white-space: normal;
}

.rich-message-body img {
  max-width: 100%;
  height: auto;
}

.mailbox-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.mailbox-stat {
  min-height: 152px;
}

.mailbox-stat strong {
  font-size: 1.15rem;
  line-height: 1.45;
  word-break: break-word;
}

.mailbox-table-wrap {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
}

.mailbox-table th,
.mailbox-table td {
  padding: 16px 14px;
}

.mailbox-row-title {
  font-weight: 700;
}

.mailbox-action-cell {
  min-width: 230px;
}

.mailbox-action-row {
  justify-content: flex-end;
}

.mailbox-action-row form {
  margin: 0;
}

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

.template-action-row form {
  margin: 0;
}

.mini-btn {
  min-width: 0;
  border-radius: 12px;
  font-weight: 600;}

.soft-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.88rem;
  white-space: nowrap;}

.danger-btn,
.danger-ghost {
  border-color: rgba(178, 59, 59, 0.92);}

.danger-ghost:hover,
.danger-btn:hover {
  filter: brightness(1.03);
}

.icon-btn {
  min-width: 0;
  border-color: rgba(17, 17, 17, 0.12);
  font-size: 1.4rem;
  line-height: 1;}

.modal-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;}


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

.modal-backdrop {
  position: absolute;
  inset: 0;}

.modal-card {
  position: relative;
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  /* 内容超过屏幕高度时卡片内部滚动，否则底部的"保存/取消"按钮会被挤出屏幕够不着
     (小屏/高 DPI/缩放的机器上尤其明显) */
  overflow-y: auto;
  padding: 24px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: box-shadow 0.18s ease;}

.modal-shell.visible .modal-card {
  box-shadow: 0 28px 56px rgba(17, 17, 17, 0.18);
}

.modal-card-sm {
  width: min(520px, 100%);
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-header {
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
}

.modal-actions {
  margin-top: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* 表单类 modal(发/收件箱等)的操作按钮吸底：卡片滚动时"保存/取消"始终可见，
   不会因内容过高被挤出屏幕。用负外边距抵消卡片 24px 内边距，让底栏铺满宽度。 */
.grid-form .modal-actions {
  position: sticky;
  bottom: -24px;
  margin: 8px -24px -24px;
  padding: 14px 24px;
  background: rgba(244, 249, 255, 0.96);
  border-top: 1px solid rgba(115, 160, 214, 0.16);
  backdrop-filter: blur(6px);
}

.delete-message {
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}

.variant-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
}

.variant-top,
.reply-head,
.reply-meta,
.metric-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.reply-meta {
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 0.94rem;
}

.variant-section {
  display: grid;
  gap: 6px;
}

.variant-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.metric-stack {
  display: grid;
  gap: 12px;
}

.metric-row {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(14, 122, 99, 0.08);
}

.stat-grid-detail {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .mailbox-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .sidebar {
    gap: 18px;
  }

  .page {
    padding: 20px;
  }

  .grid-form,
  .stat-grid,
  .stat-grid-detail,
  .mailbox-summary-grid {
    grid-template-columns: 1fr;
  }

  .section-header,
  .modal-header,
  .modal-actions {
    align-items: start;
  }

  .mailbox-action-row {
    justify-content: start;
  }

  .modal-shell {
    padding: 14px;
  }

  .modal-card {
    padding: 18px;
    max-height: calc(100vh - 28px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

body {
  position: relative;}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 82%);}


.shell,
.page,
.sidebar {
  position: relative;
  z-index: 1;
}

.shell {
  gap: 0;}


.sidebar {
  min-height: 100vh;}


.nav a {
  border: 1px solid transparent;
  backdrop-filter: blur(4px);}


.page-login {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  padding: 38px 28px;
}

.hero-card,
.panel,
.stat-card,
.list-card {
  border-color: rgba(17, 17, 17, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82));
  box-shadow:
    0 18px 44px rgba(17, 17, 17, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.hero-card,
.panel {
  border-radius: 28px;
  overflow: hidden;
}

.panel {
  position: relative;
}

.panel::before,
.hero-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  pointer-events: none;}

.section-header {
  gap: 20px;
}

.section-header h1 {
  font-size: clamp(1.68rem, 2.35vw, 2.3rem);
  line-height: 1.12;
}

.section-header h2,
.panel h2 {
  font-size: 1.36rem;
  line-height: 1.18;
}


.muted,
.tip-box span,
.empty,
.empty-cell {
  color: #535353;
}

.stat-card {
  border-radius: 24px;
  padding: 22px 20px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover,
.list-card:hover,
.panel:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 48px rgba(17, 17, 17, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.stat-card strong {
  font-size: clamp(1.75rem, 2vw, 2.2rem);
  line-height: 1;
}

.list-card {
  border-radius: 20px;
  border: 1px solid rgba(17, 17, 17, 0.06);
}

input,
textarea,
select {
  padding: 13px 15px;}

input:focus,
textarea:focus,
select:focus {
  outline: none;}

button,
.ghost-btn,
.secondary-btn,
.danger-btn,
.danger-ghost {
  min-height: 46px;
  border-radius: 16px;
}


.tip-box {
  border: 1px solid rgba(14, 122, 99, 0.1);
  background:
    linear-gradient(180deg, rgba(14, 122, 99, 0.11), rgba(14, 122, 99, 0.06));
}

.table-wrap {
  border-radius: 22px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}


.mailbox-hero {
  padding: 28px;
  border-radius: 34px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background:
    radial-gradient(circle at right top, rgba(14, 122, 99, 0.16), transparent 18rem),
    radial-gradient(circle at left bottom, rgba(196, 107, 19, 0.14), transparent 16rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(253, 249, 242, 0.9));
  box-shadow:
    0 24px 58px rgba(17, 17, 17, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  overflow: hidden;}


.mailbox-hero-copy {
  max-width: 840px;
}

.mailbox-hero-copy h1 {
  margin: 0;
  font-size: clamp(1.86rem, 2.45vw, 2.5rem);
  line-height: 1.08;
}

.mailbox-hero-copy p {
  margin: 8px 0 0;
}


.mailbox-hero-stat span {
  display: block;
  margin-bottom: 10px;}

.mailbox-hero-stat strong {
  display: block;
  word-break: break-word;}

.mailbox-section {
  margin-bottom: 24px;
}

.mailbox-panel {
  padding: 24px;
}

.mailbox-support-badges,
.mailbox-provider-badges,
.mailbox-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mailbox-provider-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  background: rgba(255, 255, 255, 0.92);
  color: #2a2a2a;
  font-size: 0.88rem;
  font-weight: 600;
}

.mailbox-card-grid {
  display: grid;
  gap: 18px;}

.mailbox-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(17, 17, 17, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 236, 0.9));
  box-shadow:
    0 18px 40px rgba(17, 17, 17, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.mailbox-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;}

.mailbox-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.mailbox-card-title {
  display: grid;
  gap: 5px;
}

.mailbox-card-title h3 {
  margin: 0;
  font-size: 1.18rem;
}

.mailbox-owner-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.05);
  color: var(--muted);
  font-size: 0.86rem;
}

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

.mailbox-meta-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(17, 17, 17, 0.05);
}

.mailbox-meta-item.full {
  grid-column: 1 / -1;
}

.mailbox-meta-label {
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.mailbox-meta-value {
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.mailbox-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.mailbox-card-actions form {
  margin: 0;
}

.mailbox-empty {
  padding: 36px 24px;
  border-radius: 24px;
  border: 1px dashed rgba(17, 17, 17, 0.12);
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
  color: var(--muted);
}

.mailbox-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;}


.mailbox-row-highlight {
  outline: 2px solid rgba(37, 99, 235, 0.42);
  outline-offset: -2px;
  background: rgba(37, 99, 235, 0.08);
}

.mailbox-list-table tbody tr.mailbox-row-highlight td {
  background: rgba(37, 99, 235, 0.08);
}

.mailbox-list-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.mailbox-list-table {
  min-width: 1120px;
}

.mailbox-list-table th,
.mailbox-list-table td {
  padding: 12px 10px;
  vertical-align: middle;
}

.mailbox-list-table tbody tr:hover td {
  background: rgba(14, 122, 99, 0.04);
}

.mailbox-list-table strong {
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

.mailbox-list-actions {
  min-width: 250px;
}

.mailbox-list-actions,
.mailbox-list-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mailbox-list-actions form {
  margin: 0;
}

.mailbox-group-filter select {
  min-width: 168px;
}

.mailbox-note {
  margin-bottom: 18px;
}

.stats-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding: 28px;
  border-radius: 34px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background:
    radial-gradient(circle at right top, rgba(14, 122, 99, 0.18), transparent 18rem),
    radial-gradient(circle at left bottom, rgba(196, 107, 19, 0.12), transparent 14rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(249, 243, 234, 0.9));
  box-shadow:
    0 24px 58px rgba(17, 17, 17, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.stats-hero-copy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 3vw, 3rem);
  line-height: 1.03;
}

.stats-hero-copy p {
  margin: 8px 0 0;
  max-width: 840px;
}

.stats-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.stats-hero-actions {
  display: flex;
  justify-content: flex-end;
}

.stats-filter-panel,
.stats-panel {
  margin-bottom: 24px;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stats-kpi-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 26px;
  border: 1px solid rgba(17, 17, 17, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 242, 234, 0.9));
  box-shadow:
    0 16px 36px rgba(17, 17, 17, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.stats-kpi-card span {
  color: var(--muted);
}

.stats-kpi-card strong {
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
  line-height: 1;
}

.stats-kpi-card-lg {
  grid-column: span 2;
  min-height: 178px;
}

.stats-kpi-card.accent {
  background:
    radial-gradient(circle at right top, rgba(14, 122, 99, 0.14), transparent 12rem),
    linear-gradient(180deg, rgba(248, 255, 252, 0.96), rgba(236, 248, 244, 0.92));
}

.stats-kpi-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.93rem;
}

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

.stats-category-stack,
.stats-ranking-list {
  display: grid;
  gap: 14px;
}

.stats-category-row {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(17, 17, 17, 0.05);
  background: rgba(255, 255, 255, 0.74);}

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

.stats-bar {
  width: 100%;}

.stats-bar-fill {
  height: 100%;
  border-radius: inherit;}

.stats-ranking-item {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(17, 17, 17, 0.05);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 244, 237, 0.88));
}

.stats-ranking-main,
.stats-ranking-metrics,
.stats-ranking-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-ranking-title {
  display: grid;
  gap: 4px;
}

.stats-ranking-metrics > div {
  min-width: 88px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(17, 17, 17, 0.05);
}

.stats-ranking-metrics span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.stats-ranking-metrics strong {
  font-size: 1.15rem;
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 22px;
  margin-bottom: 24px;
  padding: 30px;
  border-radius: 34px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background:
    radial-gradient(circle at right top, rgba(14, 122, 99, 0.16), transparent 16rem),
    radial-gradient(circle at left bottom, rgba(196, 107, 19, 0.12), transparent 14rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(249, 243, 235, 0.9));
  box-shadow:
    0 24px 58px rgba(17, 17, 17, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.workspace-hero-copy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 3vw, 3rem);
  line-height: 1.04;
}

.workspace-hero-copy p {
  margin: 8px 0 0;
  max-width: 860px;
}

.workspace-hero-actions,
.workspace-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-hero-actions {
  margin-top: 16px;
}

.workspace-side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.workspace-side-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.workspace-side-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.workspace-side-card strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.38;
}

.workspace-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 18px;
  margin-bottom: 24px;
}

.workspace-stack {
  display: grid;
  gap: 18px;
}

.support-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 243, 236, 0.9));
  box-shadow:
    0 18px 36px rgba(17, 17, 17, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.support-card h3,
.support-card h2 {
  margin: 0;
}

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

.support-list-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(14, 122, 99, 0.06);
  border: 1px solid rgba(14, 122, 99, 0.08);
}

.support-list-item strong {
  display: block;
  margin-bottom: 6px;
}

.panel-lg {
  padding: 30px;
}

.table-panel {
  margin-bottom: 24px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 22px;
  margin-bottom: 24px;
  padding: 32px;
  border-radius: 36px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background:
    radial-gradient(circle at right top, rgba(14, 122, 99, 0.2), transparent 16rem),
    radial-gradient(circle at left bottom, rgba(196, 107, 19, 0.14), transparent 14rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 241, 232, 0.9));
  box-shadow:
    0 24px 58px rgba(17, 17, 17, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.dashboard-hero-main {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 18px;
  max-width: 900px;
}

.dashboard-hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 4vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.dashboard-hero p {
  margin: 10px 0 0;
  max-width: 760px;
  font-size: 1.16rem;
  line-height: 1.72;
}

.dashboard-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
}

.dashboard-hero-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.dashboard-flow-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(115, 160, 214, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: #557290;
  font-weight: 700;
}

.dashboard-flow-step.active {
  color: #1f4f9b;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(227, 241, 255, 0.9));
  box-shadow: 0 10px 20px rgba(48, 102, 179, 0.1);
}

.dashboard-flow-line {
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(96, 150, 219, 0.16), rgba(96, 150, 219, 0.42));
}

.dashboard-side {
  display: grid;
  gap: 16px;
  align-content: center;
}

.dashboard-side-card {
  position: relative;
  padding: 20px;
  border-radius: 28px;
  min-height: 148px;
  overflow: hidden;
}

.dashboard-side-card::before {
  content: "";
  position: absolute;
  inset: auto -2rem -3rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(119, 198, 255, 0.2), transparent 66%);
  pointer-events: none;
}

.dashboard-side-card-primary {
  background:
    radial-gradient(circle at right top, rgba(93, 179, 255, 0.24), transparent 10rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(231, 244, 255, 0.84));
}

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

.dashboard-side-card strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1.18;
}

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

.dashboard-metric-card {
  display: grid;
  gap: 12px;
  min-height: 176px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(17, 17, 17, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 243, 236, 0.9));
  box-shadow:
    0 18px 38px rgba(17, 17, 17, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.dashboard-metric-card.featured {
  background:
    radial-gradient(circle at right top, rgba(14, 122, 99, 0.16), transparent 12rem),
    linear-gradient(180deg, rgba(249, 255, 252, 0.96), rgba(236, 248, 244, 0.92));
}

.dashboard-metric-card span {
  color: var(--muted);
}

.dashboard-metric-card strong {
  font-size: clamp(2rem, 2.4vw, 2.6rem);
  line-height: 1;
}

.dashboard-metric-meta {
  margin-top: auto;
  color: var(--muted);
  font-size: 0.94rem;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  gap: 24px;
  width: min(1320px, 100%);
  align-items: stretch;
}

.login-layout-compact {
  width: min(460px, 100%);
  grid-template-columns: 1fr;
}

.login-showcase,
.login-form-card {
  position: relative;
  padding: 32px;
  border-radius: 34px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(249, 243, 235, 0.92));
  box-shadow:
    0 24px 56px rgba(17, 17, 17, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.login-showcase {
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(14, 122, 99, 0.18), transparent 16rem),
    radial-gradient(circle at bottom left, rgba(196, 107, 19, 0.12), transparent 14rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(248, 241, 232, 0.92));
}

.login-showcase h1 {
  margin: 0;
  font-size: clamp(2.3rem, 3.2vw, 3.5rem);
  line-height: 1.02;
}

.login-showcase p {
  margin: 10px 0 0;
  max-width: 760px;
}

.login-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 20px;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.login-feature-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(17, 17, 17, 0.06);
}

.login-feature-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.login-form-card {
  display: grid;
  gap: 18px;
  align-self: center;
  width: 100%;
  justify-self: end;}

.login-form-card-center {
  max-width: 460px;
  justify-self: center;
}

.login-form-card h2 {
  margin: 0;}

.login-form-card .grid-form {
  gap: 18px;
}

.login-form-card button {
  width: 100%;
}

.login-credentials {
  display: grid;
  gap: 12px;
}

.login-credentials-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(14, 122, 99, 0.06);
  border: 1px solid rgba(14, 122, 99, 0.1);
}

.login-credentials-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

@media (max-width: 1260px) {
  .mailbox-hero {
    grid-template-columns: 1fr;
  }

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

  .stats-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-hero,
  .workspace-main-grid,
  .dashboard-hero,
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-form-card {
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 900px) {
  .page {
    padding: 22px 18px 28px;
  }

  .mailbox-hero,
  .mailbox-meta-grid,
  .mailbox-hero-stats {
    grid-template-columns: 1fr;
  }

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

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

  .stats-kpi-grid,
  .stats-kpi-card-lg {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .dashboard-metric-grid,
  .workspace-side-grid,
  .login-feature-grid {
    grid-template-columns: 1fr;
  }
}

/* Blue refresh */


body::before {
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(79, 127, 182, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 127, 182, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
}

body::after {
  background:
    radial-gradient(circle at 86% 80%, rgba(87, 164, 255, 0.18), transparent 18rem),
    radial-gradient(circle at 12% 76%, rgba(126, 223, 255, 0.16), transparent 18rem);
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.08);}


.brand-title,
.section-header h1,
.section-header h2,
.panel h2,
.mailbox-card-title h3,
.dashboard-hero h1,
.workspace-hero-copy h1,
.stats-hero-copy h1 {
  color: #102440;
}


.nav a:hover {
  border-color: rgba(129, 183, 255, 0.18);}

.nav a.active {
  border-color: rgba(124, 190, 255, 0.24);}


.hero-card,
.panel,
.stat-card,
.list-card,
.support-card,
.dashboard-metric-card,
.stats-kpi-card,
.mailbox-card,
.mailbox-hero-stat,
.workspace-side-card,
.dashboard-side-card,
.stats-category-row,
.stats-ranking-item,
.mailbox-meta-item,
.login-form-card,
.modal-card,
.loading-card {
  border-color: rgba(115, 160, 214, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 249, 255, 0.78));
  box-shadow:
    0 24px 56px rgba(45, 93, 160, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(16px);
}

.panel::before,
.hero-card::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(117, 185, 255, 0.22), transparent 72%);
}

.mailbox-hero,
.stats-hero,
.workspace-hero,
.dashboard-hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(120, 169, 226, 0.2);
  background:
    radial-gradient(circle at top right, rgba(91, 170, 255, 0.24), transparent 18rem),
    radial-gradient(circle at left bottom, rgba(125, 231, 255, 0.18), transparent 16rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(237, 246, 255, 0.82));
  box-shadow:
    0 28px 64px rgba(42, 92, 158, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.mailbox-hero::after,
.stats-hero::after,
.workspace-hero::after,
.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -6rem;
  bottom: -7rem;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(113, 196, 255, 0.24), transparent 68%);
  pointer-events: none;
}

.dashboard-side-card,
.workspace-side-card,
.mailbox-hero-stat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(242, 248, 255, 0.74));
}

.mailbox-card::before {
  background: linear-gradient(180deg, #58a6ff, #4a80ff);
}

.eyebrow {
  color: #3c78d6;
  letter-spacing: 0.14em;
}

.muted,
.tip-box span,
.empty,
.empty-cell,
.stats-kpi-card span,
.dashboard-side-card span,
.workspace-side-card span,
.mailbox-meta-label,
.mailbox-hero-stat span {
  color: var(--muted);
}

input,
textarea,
select {
  border-color: rgba(112, 160, 214, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 4px 14px rgba(85, 136, 204, 0.04);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(47, 115, 224, 0.34);
  box-shadow:
    0 0 0 4px rgba(79, 148, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

button {
  background:
    linear-gradient(135deg, #69b5ff 0%, #3d82eb 58%, #2c67d2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 16px 30px rgba(47, 115, 224, 0.22);
}

.ghost-btn,
.secondary-btn {
  color: #153255;
  border-color: rgba(112, 160, 214, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 24px rgba(61, 110, 177, 0.08);
}


.pill {
  color: #2f73e0;
  border: 1px solid rgba(90, 145, 226, 0.18);
  background: rgba(77, 141, 235, 0.1);
}

.soft-badge {
  color: #557290;
  border: 1px solid rgba(115, 160, 214, 0.14);
  background: rgba(96, 150, 219, 0.08);
}

.tip-box,
.metric-row,
.support-list-item {
  border-color: rgba(94, 150, 230, 0.12);
  background:
    linear-gradient(180deg, rgba(75, 141, 235, 0.1), rgba(75, 141, 235, 0.05));
}

.notice-info,
.notice-success {
  background: rgba(62, 132, 232, 0.1);
  border-color: rgba(62, 132, 232, 0.16);
  color: #2f73e0;
}

.notice-error {
  background: rgba(207, 77, 104, 0.1);
  border-color: rgba(207, 77, 104, 0.16);
  color: var(--danger);
}

.table-wrap,
.mailbox-table-wrap {
  border-color: rgba(115, 160, 214, 0.14);
  background: rgba(255, 255, 255, 0.74);
}

th,
td {
  border-bottom-color: rgba(115, 160, 214, 0.12);
}

tbody tr:hover td {
  background: rgba(79, 148, 255, 0.06);
}

.progress-bar,
.stats-bar {
  background: rgba(80, 141, 216, 0.12);
}

.progress-bar-fill,
.stats-bar-fill {
  background: linear-gradient(90deg, #69b5ff, #2f73e0 58%, #5bc3ff);
}

.dashboard-metric-card.featured,
.stats-kpi-card.accent {
  background:
    radial-gradient(circle at right top, rgba(102, 185, 255, 0.18), transparent 12rem),
    linear-gradient(180deg, rgba(248, 253, 255, 0.96), rgba(233, 245, 255, 0.9));
}

.dashboard-metric-card,
.stats-kpi-card,
.support-card,
.mailbox-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dashboard-metric-card:hover,
.stats-kpi-card:hover,
.support-card:hover,
.mailbox-card:hover,
.dashboard-side-card:hover,
.workspace-side-card:hover,
.stats-ranking-item:hover {
  transform: translateY(-4px);
  box-shadow:
    0 28px 60px rgba(45, 93, 160, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.loading-overlay {
  background: rgba(19, 40, 76, 0.34);
}


.login-form-card {
  max-width: 480px;
  border-radius: 32px;
}

.login-form-card h2 {
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.dashboard-actions,
.workspace-hero-actions,
.mailbox-hero-actions {
  gap: 14px;
}

@media (max-width: 900px) {
  .page {
    padding: 20px 16px 28px;
  }
}

/* Dashboard admin layout */
.dashboard-shell {
  display: grid;}


.dashboard-topbar .muted {
  margin-top: 12px;
  max-width: 880px;
  font-size: 1.04rem;
  line-height: 1.75;
}


.dashboard-kpi-card,
.dashboard-activity-panel,
.dashboard-performance-panel,
.dashboard-panel {
  position: relative;}


.dashboard-kpi-card::before,
.dashboard-activity-panel::before,
.dashboard-performance-panel::before,
.dashboard-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(117, 185, 255, 0.28), transparent 76%);
  pointer-events: none;
}

.dashboard-kpi-card::after {
  content: "";
  position: absolute;
  top: -2rem;
  right: -2rem;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 198, 255, 0.2), transparent 68%);
  pointer-events: none;
}


.dashboard-panel-header {
  margin-bottom: 16px;
}

.dashboard-panel-header .pill {
  max-width: min(100%, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-admin-page {
  gap: 18px;
}

.stats-kpi-strip-wide {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stats-admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-metric-grid {
  gap: 12px;
  margin-bottom: 16px;}

.stats-metric-box,
.stats-quota-card,
.stats-inline-row {
  border: 1px solid rgba(115, 160, 214, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 249, 255, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.stats-metric-box {
  border-radius: 18px;}

.stats-metric-box span,
.stats-quota-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats-metric-box strong {
  color: #102440;
  font-size: 1.7rem;
  line-height: 1;
}

.stats-performance {
  margin-top: 12px;
}

.stats-compact-panel {
  min-height: 260px;
}

.stats-category-stack.compact {
  gap: 8px;
}

.stats-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
}

.stats-inline-row span {
  min-width: 0;
  overflow: hidden;
  color: #314a66;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-inline-row strong {
  color: #102440;
  font-size: 1rem;
}

.stats-table-wrap {
  max-height: 620px;
  overflow: auto;
}

.stats-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4f8fd;
}

.stats-detail-table td,
.stats-detail-table th {
  white-space: nowrap;
}

.stats-quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.stats-quota-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
}

.stats-quota-card > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stats-quota-progress {
  display: grid;
  gap: 8px;
}

.stats-quota-progress small {
  color: var(--muted);
}

.stats-admin-v2 {
  gap: 14px;
}

.stats-command-panel {
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
  box-shadow: 0 10px 22px rgba(31, 41, 55, 0.05);
}

.stats-command-meta {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 9px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  background: #ffffff;
}

.selected-outbox-item[hidden],
#selected-outbox-empty[hidden] {
  display: none !important;
}

.stats-command-meta strong,
.stats-command-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-command-meta strong {
  color: #111827;
  font-size: 0.9rem;
  font-weight: 950;
}

.stats-command-meta span {
  color: #687383;
  font-size: 0.76rem;
  font-weight: 800;
}

.stats-command-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.stats-filter-panel,
.stats-performance-card,
.stats-reply-card,
.stats-dimension-board {
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 41, 55, 0.055);
}

.stats-filter-panel {
  padding: 14px;
}

.stats-filter-form {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(160px, 0.6fr) minmax(160px, 0.6fr) auto;
  align-items: end;
  gap: 12px;
}

.stats-command-form {
  grid-template-columns: minmax(160px, 0.8fr) minmax(140px, 0.58fr) minmax(140px, 0.58fr) auto;
}

.mailbox-contact-filter-form {
  grid-template-columns: minmax(150px, 0.7fr) minmax(132px, 0.52fr) minmax(132px, 0.52fr) minmax(220px, 1fr) auto;
}

.stats-filter-form label {
  display: grid;
  gap: 6px;
}

.stats-filter-form label span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 850;
}

.stats-filter-actions {
  display: flex;
  gap: 8px;
}

.stats-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 16px;
}

.stats-performance-card,
.stats-reply-card,
.stats-dimension-board {
  padding: 18px;
}

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

.stats-performance-metrics > div,
.stats-kpi-tile {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 0.3rem;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.stats-performance-metrics span,
.stats-kpi-tile span,
.stats-kpi-tile small,
.stats-dimension-head span,
.stats-dimension-row span {
  overflow: hidden;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-performance-metrics strong,
.stats-kpi-tile strong {
  color: #111827;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  font-weight: 950;
  line-height: 1;
}

.stats-rate-grid {
  display: grid;
  gap: 10px;
}

.stats-rate-row {
  display: grid;
  gap: 7px;
}

.stats-rate-row > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.stats-rate-row strong,
.stats-rate-row span {
  color: #1f2937;
  font-size: 0.88rem;
  font-weight: 900;
}

.stats-rate-row i,
.stats-dimension-row i {
  display: block;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.stats-rate-row i::before,
.stats-dimension-row i::before {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tone, #0891b2), color-mix(in srgb, var(--tone, #0891b2) 54%, #ffffff));
  content: "";
}

.stats-category-row.slim {
  padding: 11px;
  border-radius: 0.3rem;
}

.stats-dimension-board {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.stats-dimension-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.stats-dimension-card {
  --tone: #0891b2;
  display: grid;
  align-content: start;
  gap: 11px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;}

.stats-dimension-card:hover {
  border-color: color-mix(in srgb, var(--tone) 30%, #d8e1ec);
  box-shadow: 0 13px 24px rgba(31, 41, 55, 0.075);
  transform: translateY(-1px);
}

.stats-dimension-card.tone-campaigns,
.stats-dimension-card.tone-projects {
  --tone: #f19828;
  --tone-soft: rgba(241, 152, 40, 0.13);
}

.stats-dimension-card.tone-recipients,
.stats-dimension-card.tone-imports,
.stats-dimension-card.tone-contacts {
  --tone: #16a34a;
  --tone-soft: rgba(22, 163, 74, 0.11);
}

.stats-dimension-card.tone-templates,
.stats-dimension-card.tone-variants,
.stats-dimension-card.tone-users {
  --tone: #7c3aed;
  --tone-soft: rgba(124, 58, 237, 0.1);
}

.stats-dimension-card.tone-messages,
.stats-dimension-card.tone-events,
.stats-dimension-card.tone-replies,
.stats-dimension-card.tone-mailboxes {
  --tone: #0891b2;
  --tone-soft: rgba(8, 145, 178, 0.12);
}

.stats-dimension-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stats-dimension-head strong {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 950;}

.stats-dimension-list {
  display: grid;
  gap: 9px;
}

.stats-dimension-row {
  display: grid;}

.stats-dimension-row > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}


.stats-dimension-empty {
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 0.3rem;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.stats-kpi-grid-modern {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.mailbox-send-kpi-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.stats-kpi-tile {
  min-height: 116px;
}

.stats-kpi-tile.accent {
  background:
    radial-gradient(circle at 100% 0, rgba(8, 145, 178, 0.16), transparent 8rem),
    linear-gradient(180deg, #ffffff, #eef9fb);
}

@media (max-width: 1520px) {
  .stats-dimension-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats-kpi-grid-modern {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mailbox-send-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1320px) {
  .stats-dimension-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .stats-command-panel,
  .stats-top-grid,
  .stats-filter-form,
  .stats-command-form {
    grid-template-columns: 1fr;
  }

  .stats-command-actions,
  .stats-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stats-performance-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .stats-dimension-grid,
  .stats-kpi-grid-modern,
  .mailbox-send-kpi-grid,
  .stats-performance-metrics {
    grid-template-columns: 1fr;
  }
}


.dashboard-chart-grid,
.dashboard-chart-highlight,
.dashboard-chart-wave,
.dashboard-chart-svg,
.dashboard-chart-legend,
.dashboard-chart-labels {
  position: absolute;
}


.dashboard-chart-highlight {
  top: 12%;
  right: 10%;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(119, 198, 255, 0.24), transparent 66%);
  filter: blur(2px);
}

.dashboard-chart-legend {
  z-index: 2;
  display: flex;
  flex-wrap: wrap;}

.dashboard-legend-item {
  display: inline-flex;
  align-items: center;}

.dashboard-legend-swatch {
  border-radius: 50%;
  flex: 0 0 auto;}


.dashboard-chart-svg {
  z-index: 1;
  overflow: visible;}


.dashboard-chart-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;}


.dashboard-chart-wave {
  left: 18px;
  right: 18px;
  bottom: 38px;
  border-radius: 24px 24px 0 0;
  transform-origin: center bottom;
  animation: dashboardWaveFloat 11s ease-in-out infinite;
}

.dashboard-chart-wave.wave-a {
  height: 72%;
  opacity: 0.92;
  background: linear-gradient(180deg, rgba(75, 180, 255, 0.52), rgba(75, 180, 255, 0.18));
  clip-path: polygon(0 72%, 8% 56%, 18% 68%, 30% 46%, 43% 62%, 55% 30%, 68% 48%, 80% 24%, 90% 54%, 100% 38%, 100% 100%, 0 100%);
}

.dashboard-chart-wave.wave-b {
  height: 58%;
  opacity: 0.78;
  background: linear-gradient(180deg, rgba(52, 115, 224, 0.44), rgba(52, 115, 224, 0.12));
  clip-path: polygon(0 54%, 12% 74%, 24% 42%, 38% 60%, 50% 34%, 62% 68%, 74% 48%, 86% 74%, 100% 56%, 100% 100%, 0 100%);
  animation-duration: 9.5s;
}

.dashboard-chart-wave.wave-c {
  height: 46%;
  opacity: 0.68;
  background: linear-gradient(180deg, rgba(88, 225, 255, 0.3), rgba(88, 225, 255, 0.08));
  clip-path: polygon(0 68%, 14% 58%, 28% 72%, 40% 48%, 56% 60%, 68% 34%, 82% 56%, 100% 28%, 100% 100%, 0 100%);
  animation-duration: 13s;
}

.dashboard-chart-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;}

.dashboard-mini-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;}

.dashboard-mini-stat,
.dashboard-performance-item,
.dashboard-performance-note,
.dashboard-feed-item,
.dashboard-quick-card {
  border: 1px solid rgba(115, 160, 214, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 249, 255, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.dashboard-mini-stat {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 16px 18px;
  border-radius: 20px;
}

.dashboard-mini-stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-mini-stat strong {
  color: #123056;
  font-size: 1.02rem;
  line-height: 1.5;
}


.dashboard-performance-list,
.dashboard-performance-foot,
.dashboard-feed {
  display: grid;
  gap: 12px;
}

.dashboard-performance-item,
.dashboard-performance-note {
  border-radius: 20px;}


.dashboard-feed-item {
  justify-content: space-between;
  border-radius: 20px;}


.dashboard-feed-item.plain {
  cursor: default;
}


.dashboard-feed-side {
  flex: 0 0 auto;
  align-items: flex-start;}

.dashboard-panel-actions {
  display: grid;
  gap: 16px;
}


.dashboard-quick-card {
  border-radius: 22px;}


.dashboard-quick-card strong {
  line-height: 1.58;}

.dashboard-process-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.dashboard-process-step {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(115, 160, 214, 0.14);
  background: rgba(255, 255, 255, 0.74);
  color: #5d7c9e;
  font-size: 0.92rem;
  font-weight: 700;
}

.dashboard-process-step.active {
  color: #1d55af;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(226, 240, 255, 0.92));
  box-shadow: 0 12px 24px rgba(47, 115, 224, 0.1);
}

@keyframes dashboardWaveFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 1520px) {
  .dashboard-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .dashboard-analytics-grid,
  .dashboard-workbench-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-topbar-actions {
    justify-content: flex-start;
  }

  .dashboard-kpi-strip,
  .dashboard-mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-chart-canvas {
    min-height: 300px;
  }
}

@media (max-width: 720px) {
  .dashboard-kpi-strip,
  .dashboard-mini-stats,
  .dashboard-quick-grid,
  .dashboard-chart-labels {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-legend {
    position: static;
    padding: 14px 14px 0;
  }

  .dashboard-chart-svg {
    inset: 76px 14px 48px;
    width: calc(100% - 28px);
    height: calc(100% - 124px);
  }

  .dashboard-topbar h1 {
    font-size: 2rem;
  }

  .dashboard-chart-canvas {
    min-height: 260px;
  }

  .dashboard-chart-labels {
    gap: 8px;
    text-align: left;
  }

  .dashboard-feed-item {
    flex-direction: column;
  }
}

/* Shared admin workspace */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.72fr);
  gap: 18px;
}

.dashboard-stack {
  display: grid;
  gap: 18px;
}

.dashboard-panel .grid-form,
.dashboard-panel .table-wrap,
.dashboard-panel .tip-box,
.dashboard-panel .mailbox-card-grid,
.dashboard-panel .mailbox-empty,
.dashboard-panel .reply-grid,
.dashboard-panel .variant-grid,
.dashboard-panel .progress-shell {
  margin-top: 8px;
}

.dashboard-panel .table-wrap {
  margin-top: 10px;
}

.dashboard-panel .action-row {
  align-items: center;
}

.dashboard-note-grid {
  display: grid;
  gap: 12px;
}

.dashboard-note-card {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(115, 160, 214, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 249, 255, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.dashboard-note-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-note-card strong {
  color: #123056;
  font-size: 1rem;
  line-height: 1.56;
}

.dashboard-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-panel .reply-grid {
  margin-top: 0;
}

.dashboard-panel .reply-card {
  border-radius: 22px;
}

.dashboard-panel .variant-card {
  border-radius: 22px;
  border-color: rgba(115, 160, 214, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 249, 255, 0.82));
  box-shadow:
    0 18px 36px rgba(45, 93, 160, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.dashboard-panel .tip-box.compact-box {
  margin-top: 0;
}

@media (max-width: 1200px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
}

/* Roomier layout after removing explanatory helper copy */


.dashboard-topbar h1,
.section-header h1 {
  font-size: clamp(2.15rem, 3vw, 3.05rem);
}


.dashboard-panel .grid-form,
.dashboard-panel .table-wrap,
.dashboard-panel .mailbox-card-grid,
.dashboard-panel .mailbox-empty,
.dashboard-panel .reply-grid,
.dashboard-panel .variant-grid,
.dashboard-panel .progress-shell {
  margin-top: 14px;
}


.grid-form label,
.checkbox-field {
  gap: 10px;
}

input,
textarea,
select {
  min-height: 50px;
}

textarea {
  min-height: 210px;
}

button,
.ghost-btn,
.secondary-btn {
  min-height: 48px;
}


.mailbox-card-grid,
.reply-grid,
.variant-grid,
.dashboard-feed,
.stats-ranking-list {
  gap: 20px;
}

.mailbox-card,
.reply-card,
.variant-card,
.dashboard-feed-item,
.stats-ranking-item {
  padding: 22px;
}

.mailbox-empty,
.empty-cell,
.empty {
  padding: 34px;
}

@media (max-width: 900px) {
  .page {
    padding: 24px 16px 32px;
  }

  .dashboard-panel,
  .dashboard-activity-panel,
  .dashboard-performance-panel,
  .panel {
    padding: 24px;
  }

  .dashboard-panel,
  .panel {
    min-height: 0;
  }
}

/* Full-width admin workspace */


.page {
  max-width: none;
  margin: 0;}

.dashboard-shell,
.mailbox-hero,
.panel,
.dashboard-panel {
  width: 100%;
}

.mailbox-hero {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.42fr);
  align-items: stretch;
}

.mailbox-hero-content {
  align-content: center;
}

.mailbox-hero-stats {
  align-content: stretch;
}


.mailbox-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
}

@media (min-width: 1500px) {
  .mailbox-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1840px) {
  .page {
    padding-right: 72px;
    padding-left: 72px;
  }
}

@media (max-width: 1260px) {
  .page {
    padding: 32px 28px 44px;
  }

  .mailbox-hero,
  .mailbox-card-grid {
    grid-template-columns: 1fr;
  }
}

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

  .page {
    padding: 24px 16px 32px;
  }
}

/* Dashboard refinement */


.dashboard-status-line {
  color: #64748b;
  font-size: 0.9rem;}


.dashboard-topbar-actions .ghost-btn,
.dashboard-topbar-actions .secondary-btn {
  min-width: 0;}


.dashboard-kpi-card,
.dashboard-activity-panel,
.dashboard-performance-panel,
.dashboard-panel {
  overflow: hidden;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: none;
}

.dashboard-kpi-card::before,
.dashboard-activity-panel::before,
.dashboard-performance-panel::before,
.dashboard-panel::before,
.dashboard-kpi-card::after {
  display: none;
}


.dashboard-kpi-card span {
  letter-spacing: 0;}

.dashboard-kpi-card strong {
  letter-spacing: 0;}


.dashboard-kpi-card.accent {
  background: #ffffff;
}

.tone-contacts {
  border-left-color: #2563eb;
}

.tone-campaigns {
  border-left-color: #0f766e;
}

.tone-sent {
  border-left-color: #16a34a;
}

.tone-replies {
  border-left-color: #7c3aed;
}

.tone-opened {
  border-left-color: #0891b2;
}

.tone-quota {
  border-left-color: #f59e0b;
}


.dashboard-panel,
.panel {
  min-height: 0;
}

.dashboard-panel-header,
.section-header.compact {
  margin-bottom: 14px;
}

.dashboard-panel-header h2 {
  letter-spacing: 0;}

.dashboard-panel-header .pill,
.dashboard-panel .pill {
  border-color: #dbe4ee;}


.dashboard-chart-grid {
  border-bottom: 1px solid #e2e8f0;
  border-left: 1px solid #e2e8f0;}

.dashboard-chart-highlight {
  display: none;
}

.dashboard-chart-scale {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;}


.dashboard-legend-item {
  border-color: #dbe4ee;}


.swatch-imports {
  background: #2563eb;
}

.swatch-sent {
  background: #16a34a;
}

.swatch-opened {
  background: #0891b2;
}

.swatch-replies {
  background: #7c3aed;
}

.dashboard-chart-svg {
  inset: 56px 18px 50px 46px;
  width: calc(100% - 64px);
  height: calc(100% - 106px);
}

.dashboard-chart-area {
  fill: rgba(22, 163, 74, 0.08);
}

.dashboard-chart-line {
  stroke-width: 2.6;
}

.line-imports {
  stroke: #2563eb;
}

.line-sent {
  stroke: #16a34a;
}

.line-opened {
  stroke: #0891b2;
}

.line-replies {
  stroke: #7c3aed;
}

.dashboard-chart-labels {
  right: 18px;
  bottom: 14px;
  left: 46px;
  gap: 0;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 700;
}


.dashboard-mini-stats {
  display: none;
}

.dashboard-performance-panel {
  align-content: start;}


.stats-bar-fill {
  background: linear-gradient(90deg, #60a5fa, #2563eb);
}

.stats-bar-fill.fill-replies {
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
}


.dashboard-performance-note strong {
  line-height: 1.1;}


.dashboard-feed-item.plain {
  background: #f8fafc;
}


@media (max-width: 1520px) {
  .dashboard-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .dashboard-analytics-grid,
  .dashboard-workbench-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-grid,
  .dashboard-series-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dashboard-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-topbar h1 {
    font-size: 1.55rem;
  }

  .dashboard-topbar-actions {
    justify-content: flex-start;
  }

  .dashboard-kpi-strip,
  .dashboard-series-summary,
  .dashboard-quick-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-canvas {
    min-height: 300px;
  }

  .dashboard-chart-legend {
    position: static;
    padding: 12px 12px 0 44px;
  }

  .dashboard-chart-svg {
    inset: 86px 16px 48px 42px;
    width: calc(100% - 58px);
    height: calc(100% - 134px);
  }

  .dashboard-chart-grid,
  .dashboard-chart-scale {
    top: 84px;
  }

  .dashboard-chart-labels {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    overflow: auto;
    text-align: center;
  }

  .dashboard-feed-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Dashboard trend bar chart */


.dashboard-chart-svg,
.dashboard-chart-labels {
  display: none;
}


.dashboard-bar {
  position: relative;
  display: block;
  min-height: 0;
  transition: height 0.2s ease, opacity 0.2s ease, transform 0.2s ease;}

.dashboard-bar:hover {
  opacity: 0.82;
  transform: translateY(-2px);
}

.dashboard-bar::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateX(50%) translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: nowrap;}

.dashboard-bar::before {
  content: "";
  position: absolute;
  right: 50%;
  bottom: calc(100% + 4px);
  width: 8px;
  height: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(50%) rotate(45deg);
  transition: opacity 0.16s ease;}

.dashboard-bar:hover::after,
.dashboard-bar:hover::before,
.dashboard-bar:focus::after,
.dashboard-bar:focus::before {
  opacity: 1;
}

.dashboard-bar:hover::after,
.dashboard-bar:focus::after {
  transform: translateX(50%) translateY(0);
}

.bar-imports {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.bar-sent {
  background: linear-gradient(180deg, #34d399, #16a34a);
}

.bar-opened {
  background: linear-gradient(180deg, #22d3ee, #0891b2);
}

.bar-replies {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

.dashboard-bar-label {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;}

@media (max-width: 980px) {
  .dashboard-chart-canvas {
    overflow-x: auto;
  }

  .dashboard-bar-chart {
    min-width: 680px;
  }
}

@media (max-width: 720px) {
  .dashboard-chart-canvas {
    padding-top: 78px;
  }

  .dashboard-chart-grid {
    top: 78px;
  }

  .dashboard-chart-scale {
    top: 78px;
  }

  .dashboard-chart-legend {
    padding: 12px 12px 0 46px;
  }
}

/* Login page reset */


.page.page-login {
  display: grid;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 32px 18px;
  place-items: center;
}

.login-layout.login-layout-compact {
  display: grid;
  min-height: 0;
  margin: 0 auto;
  place-items: stretch;}

.login-form-card.login-form-card-center {
  width: 100%;
  min-height: 0;
  margin: 0;}

.login-form-card.login-form-card-center h2 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;}

.login-form-card.login-form-card-center .grid-form {
  gap: 16px;}

.login-form-card.login-form-card-center button {
  width: 100%;
}

@media (max-width: 520px) {
  .login-form-card.login-form-card-center {
    padding: 24px;
  }
}

/* Reply workbench */
.reply-workbench {
  gap: 16px;
}

.reply-topbar {
  align-items: flex-start;
}

.reply-topbar-actions {
  align-items: end;
  min-width: min(100%, 620px);
}

.reply-inbox-form label {
  display: grid;
  gap: 6px;
  min-width: min(100vw - 48px, 360px);
}

.reply-inbox-form span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.reply-campaign-context {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(100%, 620px);
  padding: 9px 10px;
  border: 1px solid #cbdcf2;
  border-radius: 10px;
  background: #f7fbff;
  color: #475569;
  font-size: 0.82rem;
}

.reply-campaign-context strong {
  max-width: min(360px, 48vw);
  overflow: hidden;
  color: #0f3f74;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-kpi-row {
  display: grid;}

.reply-kpi {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);}

.reply-kpi span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.reply-kpi strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-list-panel .muted {
  margin: 4px 0 0;
}

.reply-thread-block {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #dbe4ee;
}

.reply-thread-timeline {
  display: grid;
  gap: 10px;
}

.reply-thread-entry {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #dbe4ee;
  border-left: 4px solid #94a3b8;
  border-radius: 10px;
  background: #fff;
}

.reply-thread-entry.is-outbound {
  border-left-color: #2563eb;
  background: #f7fbff;
}

.reply-thread-entry.is-inbound {
  border-left-color: #0f766e;
}

.reply-thread-entry.is-current {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.reply-thread-entry-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.reply-thread-direction,
.reply-thread-kind {
  padding: 2px 7px;
  border-radius: 99px;
  background: #e2e8f0;
  color: #334155;
}

.reply-thread-entry.is-outbound .reply-thread-direction {
  background: #dbeafe;
  color: #1d4ed8;
}

.reply-thread-entry.is-inbound .reply-thread-direction {
  background: #ccfbf1;
  color: #0f766e;
}

.reply-thread-entry-head time {
  margin-left: auto;
}

.reply-thread-subject {
  color: #0f172a;
  font-size: 0.88rem;
}

.reply-thread-address {
  overflow: hidden;
  color: #64748b;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-thread-body {
  max-height: 300px;
  overflow: auto;
  padding: 10px;
  border-radius: 7px;
  background: rgba(241, 245, 249, 0.72);
}

.reply-table-wrap {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.reply-table {
  min-width: 1320px;
}

.reply-table th,
.reply-table td {
  vertical-align: middle;
}

.reply-table th:last-child,
.reply-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 122px;
  background: #ffffff;
  box-shadow: -10px 0 16px -14px rgba(15, 23, 42, 0.5);
}

.reply-table th:last-child {
  z-index: 3;
}

.reply-table tbody tr:hover td:last-child {
  background: #fbfcff;
}

.reply-type-pill,
.reply-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.reply-type-pill.is-reply {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.reply-type-pill.is-bounce,
.reply-status-chip.is-danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.reply-type-pill.is-auto-reply {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.reply-status-chip.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.reply-status-chip.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.reply-status-chip.is-neutral {
  border-color: #dbe4ee;
  background: #f8fafc;
  color: #475569;
}

.reply-cell-main,
.reply-subject-cell {
  max-width: 320px;
  overflow: hidden;
  color: #172033;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-cell-sub {
  max-width: 360px;
  overflow: hidden;
  margin-top: 3px;
  color: #64748b;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-pager {
  justify-content: flex-end;
}

.reply-detail-modal {
  padding: 16px;
}

.reply-detail-card {
  width: min(1440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 18px;
  overflow: auto;}

.reply-detail-header {
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.reply-detail-header h2 {
  max-width: min(100%, 1120px);
  margin: 4px 0;
  color: #0f172a;
  font-size: 1.2rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.reply-status-chip.is-forwarded {
  border-color: #c4b5fd;
  background: #f5f3ff;
  color: #6d28d9;
}

.reply-detail-header .muted {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reply-detail-kind {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 800;
}

.reply-modal-toast {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #15803d;
  font-weight: 700;
}

.reply-modal-toast.is-error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.reply-modal-toast.is-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.reply-detail-loading,
.reply-info-empty {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
}

.reply-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.5fr);
  gap: 14px;
  align-items: start;
}

.reply-detail-main,
.reply-side-block {
  min-width: 0;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.reply-detail-main {
  display: grid;
  gap: 12px;
}

.reply-detail-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.reply-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reply-detail-section-head h3 {
  margin: 0;
  color: #172033;
  font-size: 0.96rem;
}

.reply-message-info,
.reply-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reply-info-list {
  grid-template-columns: 1fr;
}

.reply-message-info div,
.reply-info-list div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  background: #f8fafc;
}

.reply-message-info span,
.reply-info-list span {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 800;
}

.reply-message-info strong,
.reply-info-list strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-body-box {
  width: 100%;
  min-width: 0;
  min-height: 180px;
  max-height: none;
  overflow: visible;
  padding: 16px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  line-height: 1.68;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reply-plain-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reply-body-box > *,
.reply-body-box div,
.reply-body-box p,
.reply-body-box blockquote,
.reply-body-box pre,
.reply-body-box a,
.reply-body-box span,
.reply-body-box td,
.reply-body-box th {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.reply-body-box pre {
  overflow: visible;
  white-space: pre-wrap !important;
}

.reply-body-box img,
.reply-body-box video {
  max-width: 100% !important;
  height: auto !important;
}

.reply-body-box table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
}

.reply-ai-result {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.reply-ai-category {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.82rem;
  font-weight: 800;
}

.reply-ai-result p {
  margin: 0;
  color: #475569;
  line-height: 1.65;
}

.reply-draft-preview-wrap {
  display: grid;
  gap: 6px;
  margin: 10px 0 12px;
}

.reply-draft-label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.reply-draft-preview {
  min-height: 180px;
  max-height: 320px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  line-height: 1.68;
}

.reply-review-form {
  display: grid;
  gap: 10px;
}

.reply-review-form label {
  display: grid;
  gap: 6px;
}

.reply-review-form label span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.reply-review-form textarea {
  min-height: 360px;
  resize: vertical;
}

.reply-manual-hint {
  margin: 0 0 10px;
  line-height: 1.6;
}

.reply-manual-form textarea {
  min-height: 88px;
}

@media (max-width: 1100px) {
  .reply-kpi-row,
  .reply-detail-layout {
    grid-template-columns: 1fr;
  }

  .reply-topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .reply-detail-modal {
    padding: 8px;
  }

  .reply-detail-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px;
  }

  .reply-message-info {
    grid-template-columns: 1fr;
  }

  .reply-body-box {
    min-height: 160px;
    max-height: none;
  }
}

/* My-Task inspired admin skin */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e5e9f2;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #484c7f;
  --accent-strong: #3f4376;
  --accent-soft: #eef2ff;
  --success: #22c55e;
  --info: #0ea5e9;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 28px rgba(25, 30, 60, 0.07);
  --shadow-soft: 0 8px 18px rgba(25, 30, 60, 0.045);
  --radius: 10px;
  --radius-sm: 8px;
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  grid-template-columns: 260px minmax(0, 1fr);
  background: var(--bg);
}

.shell-login {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  align-self: start;
  gap: 22px;}

.brand {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);}


.brand-title {
  letter-spacing: 0;}

.brand-sub,
.user-meta {
  color: rgba(248, 250, 252, 0.66);
}


.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;}

.nav a::before {
  content: "";
  position: absolute;}

.nav a:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  transform: translateX(2px);
}

.nav a.active {
  background: #ffffff;
  color: #484c7f;
  box-shadow: 0 10px 22px rgba(27, 31, 74, 0.18);
}

.nav a.active::before {
  background: #484c7f;
  border-color: #484c7f;
  opacity: 1;
}


.user-name {
  color: #ffffff;
  font-weight: 800;
}

.sidebar .ghost-btn {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;}

.sidebar .ghost-btn:hover {
  border-color: rgba(255, 255, 255, 0.42);}

.page {
  width: 100%;}

.dashboard-shell,
.reply-workbench {
  display: grid;}


.dashboard-topbar h1 {
  letter-spacing: 0;}

.dashboard-status-line,
.dashboard-topbar .muted,
.section-header .muted,
.muted {
  color: var(--muted);
}

.dashboard-topbar-actions,
.action-row,
.modal-actions,
.template-action-row {
  gap: 8px;
}

.dashboard-panel,
.dashboard-activity-panel,
.dashboard-performance-panel,
.panel,
.stat-card,
.list-card,
.hero-card,
.mailbox-panel,
.stats-filter-panel,
.stats-panel,
.stats-compact-panel,
.reply-kpi,
.reply-detail-main,
.reply-side-block,
.reply-body-box,
.reply-draft-preview,
.template-editor-card,
.variant-template-card,
.variant-card,
.reply-card,
.mailbox-card,
.login-form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.dashboard-panel,
.dashboard-activity-panel,
.dashboard-performance-panel,
.panel,
.hero-card {
  padding: 20px;
}


.dashboard-panel::before,
.dashboard-activity-panel::before,
.dashboard-performance-panel::before,
.panel::before {
  display: none;
}

.dashboard-panel-header,
.section-header {
  align-items: center;
  margin-bottom: 16px;}

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

.dashboard-panel-header h2,
.section-header h1,
.section-header h2,
.panel h2,
.modal-header h2 {
  margin: 0;
  color: #1f2937;
  line-height: 1.3;
  letter-spacing: 0;}


.dashboard-kpi-card,
.stat-card {
  position: relative;
  overflow: hidden;}

.dashboard-kpi-card::after,
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: #484c7f;
}

.dashboard-kpi-card.tone-contacts::after,
.stat-card:nth-child(4n + 1)::after {
  background: #0ea5e9;
}

.dashboard-kpi-card.tone-campaigns::after,
.stat-card:nth-child(4n + 2)::after {
  background: #8b5cf6;
}

.dashboard-kpi-card.tone-sent::after,
.stat-card:nth-child(4n + 3)::after {
  background: #22c55e;
}

.dashboard-kpi-card.tone-replies::after,
.stat-card:nth-child(4n + 4)::after {
  background: #f59e0b;
}

.dashboard-kpi-card span,
.stat-card span,
.list-card span {
  color: #7b8294;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-kpi-card strong,
.stat-card strong {
  letter-spacing: 0;}

.dashboard-kpi-card small,
.stat-card small,
.list-card small {
  color: var(--muted);
}

.dashboard-analytics-grid,
.dashboard-workbench-grid,
.campaign-detail-layout,
.mailbox-detail-grid,
.stats-grid,
.panel-grid {
  gap: 16px;
}

.dashboard-feed-item,
.dashboard-series-row,
.dashboard-performance-item,
.list-card {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: #f9fafc;
}

.dashboard-feed-item:hover,
.list-card:hover {
  border-color: #cfd6e6;
  background: #ffffff;
}


.bar-sent,
.stats-bar-fill {
  background: #22c55e;
}

.bar-opened,
.stats-bar-fill.fill-opened {
  background: #0ea5e9;
}

.bar-replies,
.stats-bar-fill.fill-replies {
  background: #8b5cf6;
}

.stats-bar-fill.danger {
  background: #ef4444;
}

.stats-bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #edf2f7;
}

.pill,
.reply-type-pill,
.reply-status-chip,
.template-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #dbe3f1;
  border-radius: 999px;
  background: #f3f6fb;
  color: #536079;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.notice {
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.notice-info,
.tip-box,
.empty,
.mailbox-empty,
.reply-detail-loading,
.reply-info-empty {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1e40af;
}

.notice-success,
.reply-status-chip.is-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.notice-error,
.notice-danger,
.reply-type-pill.is-bounce,
.reply-status-chip.is-danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.notice-warning,
.reply-type-pill.is-auto-reply,
.reply-status-chip.is-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

button,
.ghost-btn,
.secondary-btn,
.danger-btn,
.danger-ghost,
.text-link,
.mini-btn,
.template-change-button,
.mode-option {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:not(.icon-btn):not(.mode-option):not(.danger-ghost),
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #484c7f;
  color: #ffffff;}

button:not(.icon-btn):not(.mode-option):not(.danger-ghost):hover,
.secondary-btn:hover {
  border-color: #3f4376;
  background: #3f4376;
  color: #ffffff;
  transform: translateY(-1px);
}

.ghost-btn,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #d8deeb;
  box-shadow: none;}

.ghost-btn:hover,
.text-link:hover {
  border-color: #bfc7da;
  transform: translateY(-1px);}

.danger-btn,
.danger-ghost {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
  box-shadow: none;
}

.danger-btn:hover,
.danger-ghost:hover {
  border-color: #fda4af;
  background: #ffe4e6;
  color: #9f1239;
}

.mini-btn {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.78rem;
}

.icon-btn {
  display: inline-grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #d8deeb;
  background: #ffffff;
  color: #64748b;
  box-shadow: none;}

.icon-btn:hover {
  border-color: #c7d2e4;
  background: #f8fafc;
  color: #111827;
}

.mode-switch,
.test-template-segment,
.send-template-source-panel .template-source-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);}

.mode-option {
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  box-shadow: none;
}

.mode-option:hover,
.mode-option.active {
  box-shadow: var(--shadow-soft);}

.grid-form {
  gap: 14px;
}

.grid-form label,
.single-form label,
.reply-review-form label {
  gap: 7px;
}

.grid-form span,
.single-form span,
.reply-review-form label span,
.reply-draft-label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

input,
select,
textarea {
  min-height: 40px;
  border: 1px solid #dbe2ef;
  background: #ffffff;
  color: #1f2937;
  box-shadow: none;}

textarea {
  line-height: 1.6;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #c6cede;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6970ad;
  outline: 3px solid rgba(72, 76, 127, 0.14);
}

input[type="file"] {
  padding: 8px;
  background: #f8fafc;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: #484c7f;
}

.table-wrap,
.mailbox-table-wrap,
.reply-table-wrap,
.stats-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  text-transform: none;
  white-space: nowrap;}

td {
  border-bottom: 1px solid #eef1f6;}

th,
td {
  vertical-align: middle;}

tbody tr {
  background: #ffffff;
}


tbody tr:last-child td {
  border-bottom: 0;
}

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

.modal-shell {
  padding: 22px;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}

.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.modal-header,
.modal-actions {
  border-color: var(--line);
}

.modal-header {
  padding-bottom: 14px;
}

.modal-actions {
  padding-top: 14px;
}

.loading-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.loading-spinner {
  border-color: #e5e7eb;
  border-top-color: #484c7f;
}

.send-template-source-panel,
.test-template-source-panel,
.template-editor-card,
.variant-template-card,
.reply-side-block {
  border-color: var(--line);
  background: #ffffff;
}

.send-template-source-panel .template-source-options label,
.test-template-segment label,
.choice-card,
.mailbox-choice-card {
  border: 1px solid #dbe2ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.send-template-source-panel .template-source-options label:hover,
.test-template-segment label:hover,
.choice-card:hover,
.mailbox-choice-card:hover {
  border-color: #bfc7da;
  background: #fbfcff;
}

.send-template-source-panel .template-source-options label:has(input:checked),
.test-template-segment label:has(input:checked),
.choice-card:has(input:checked),
.mailbox-choice-card:has(input:checked) {
  border-color: #6970ad;
  background: #eef2ff;
  color: #3730a3;
}

.mail-preview-panel,
.mail-preview-frame,
.rich-editor-surface,
.body-preview,
.variant-template-preview .body-preview {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.login-layout.login-layout-compact {
  width: min(480px, 100%);
}

.page.page-login {
  background: #f5f7fb;
}

.login-form-card.login-form-card-center {
  position: relative;
  overflow: hidden;
  max-width: 480px;
  padding: 34px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 22px 54px rgba(25, 30, 60, 0.12);}

.login-form-card.login-form-card-center::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: #484c7f;
  box-shadow: 0 12px 24px rgba(72, 76, 127, 0.2);
}

.login-form-card.login-form-card-center h2 {
  color: #1f2937;
  font-size: 1.45rem;
}

.login-form-card.login-form-card-center .grid-form {
  margin-top: 20px;
}

.login-form-card.login-form-card-center button {
  min-height: 44px;
}

.reply-table,
.mailbox-table-wrap table,
.project-preview-wrap table {
  min-width: 960px;
}

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

  .page {
    padding: 20px;
  }

  .dashboard-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: relative;
    height: auto;
    padding: 14px;
  }

  .brand {
    padding-bottom: 10px;
  }

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

  .nav a {
    min-height: 38px;
    padding: 9px 10px 9px 32px;
  }

  .nav a:hover {
    transform: none;
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .dashboard-topbar {
    align-items: flex-start;
    min-height: 0;
  }

  .dashboard-topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 14px;
  }

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

  .dashboard-topbar,
  .dashboard-panel,
  .dashboard-activity-panel,
  .dashboard-performance-panel,
  .panel,
  .hero-card {
    padding: 16px;
  }

  .dashboard-topbar h1 {
    font-size: 1.2rem;
  }

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

  .dashboard-kpi-card,
  .stat-card {
    min-height: 112px;
  }

  .dashboard-kpi-card strong,
  .stat-card strong {
    font-size: 1.45rem;
  }

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

  .modal-shell {
    padding: 10px;
  }

  .login-form-card.login-form-card-center {
    padding: 26px;
  }
}

/* My-Task layout correction */
:root {
  --body-color: #f9fbfd;
  --card-color: #ffffff;
  --primary-color: #484c7f;
  --secondary-color: #f19828;
  --chart-color1: #484c7f;
  --chart-color2: #f19828;
  --chart-color3: #f5558d;
  --chart-color4: #a7daff;
  --chart-color5: #9cbf3b;
  --chart-color6: #a0c1b8;
  --text-color: #212529;
  --border-color: #e9edf4;
  --bs-card-shadow: 0 2px 8px rgba(99, 99, 99, 0.08);
}

html,
body {
  background: var(--body-color);
  color: var(--text-color);
}

.shell:not(.shell-login) {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
  background: var(--body-color);
}

.sidebar {
  position: sticky;
  top: 25px;
  flex: 0 0 260px;
  width: 260px;
  height: calc(100vh - 50px);
  margin: 25px;
  padding: 24px;
  overflow-y: auto;
  border: 0;
  border-radius: 1.1rem;
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: none;
  scrollbar-width: none;}

.sidebar::-webkit-scrollbar {
  width: 0;
}

.brand {
  min-height: 60px;
  gap: 15px;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.brand-mark {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary-color);
  box-shadow: none;
  font-size: 1.25rem;
  font-weight: 900;
  overflow: hidden;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.brand-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.12;
}

.brand-sub {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.nav {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
}

.nav a {
  min-height: 44px;
  padding: 10px 0 10px 34px;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  box-shadow: none;
  font-size: 16px;
  font-weight: 700;
  opacity: 0.94;
}

.nav a::before {
  left: 0;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  opacity: 1;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
}

.nav a:hover,
.nav a.active {
  background: transparent;
  color: var(--secondary-color);
  transform: none;
}

.nav a:hover::before,
.nav a.active::before {
  background: rgba(241, 152, 40, 0.18);
}

.nav a.active::after {
  background: var(--secondary-color);
}

.sidebar-footer {
  gap: 5px;
  padding: 16px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;}

.sidebar .ghost-btn {
  justify-content: flex-start;
  width: fit-content;
  min-width: 0;
  min-height: 32px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.sidebar .ghost-btn:hover {
  background: transparent;
  color: var(--secondary-color);
  transform: none;
}

.page {
  flex: 1 1 auto;
  min-width: 0;
  padding: 22px 28px 28px 0;
}

.dashboard-shell,
.reply-workbench {
  gap: 18px;
}

.dashboard-topbar {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;}


.dashboard-panel,
.dashboard-activity-panel,
.dashboard-performance-panel,
.panel,
.stat-card,
.list-card,
.mailbox-panel,
.stats-filter-panel,
.stats-panel,
.stats-compact-panel,
.reply-kpi,
.reply-detail-main,
.reply-side-block,
.reply-body-box,
.reply-draft-preview,
.template-editor-card,
.variant-template-card,
.variant-card,
.reply-card,
.mailbox-card,
.modal-card,
.login-form-card {
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: var(--card-color);
  box-shadow: var(--bs-card-shadow);
}

.dashboard-panel,
.dashboard-activity-panel,
.dashboard-performance-panel,
.panel {
  padding: 0;
}

.dashboard-panel:hover,
.dashboard-activity-panel:hover,
.dashboard-performance-panel:hover,
.panel:hover,
.stat-card:hover,
.list-card:hover {
  box-shadow: var(--bs-card-shadow);
}

.dashboard-panel-header,
.section-header {
  min-height: 54px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 0;
  background: transparent;
}

.dashboard-panel-header h2,
.section-header h1,
.section-header h2,
.panel h2,
.modal-header h2 {
  font-size: 1rem;
  font-weight: 800;
}

.dashboard-panel > .grid-form,
.dashboard-panel > .table-wrap,
.dashboard-panel > .tip-box,
.dashboard-panel > .mailbox-card-grid,
.dashboard-panel > .mailbox-empty,
.dashboard-panel > .reply-grid,
.dashboard-panel > .variant-grid,
.dashboard-panel > .progress-shell,
.dashboard-panel > form,
.dashboard-panel > .mode-switch,
.dashboard-activity-panel > :not(.section-header):not(.dashboard-panel-header),
.dashboard-performance-panel > :not(.section-header):not(.dashboard-panel-header),
.panel > :not(.section-header) {
  margin: 0 16px 16px;
}


.dashboard-kpi-card,
.stat-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas:
    "icon value"
    "icon label"
    "icon meta";
  align-items: center;
  min-height: 96px;
  gap: 0 12px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: var(--card-color);
  box-shadow: var(--bs-card-shadow);
}

.dashboard-kpi-card::before,
.stat-card::before {
  content: "✉";
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(145deg, #67c2ff, #2f73e0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 22px rgba(47, 115, 224, 0.22);
}

.dashboard-kpi-card::after,
.stat-card::after {
  display: none;
}

.dashboard-kpi-card.tone-contacts::before,
.stat-card:nth-child(4n + 1)::before {
  content: "✉";
  background: linear-gradient(145deg, #75c9ff, #2f73e0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 22px rgba(47, 115, 224, 0.22);
}

.dashboard-kpi-card.tone-campaigns::before,
.stat-card:nth-child(4n + 2)::before {
  content: "◆";
  background: linear-gradient(145deg, #f3a7c8, #d94f8c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 22px rgba(217, 79, 140, 0.2);
}

.dashboard-kpi-card.tone-sent::before,
.stat-card:nth-child(4n + 3)::before {
  content: "✓";
  background: linear-gradient(145deg, #7de0a1, #22a65c);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 22px rgba(34, 166, 92, 0.2);
}

.dashboard-kpi-card.tone-replies::before,
.stat-card:nth-child(4n + 4)::before {
  content: "↩";
  background: linear-gradient(145deg, #ffe28c, #f59e0b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 12px 22px rgba(245, 158, 11, 0.2);
}

.dashboard-kpi-card.tone-opened::before {
  content: "◉";
  background: linear-gradient(145deg, #99e5ef, #0891b2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 22px rgba(8, 145, 178, 0.2);
}

.dashboard-kpi-card.tone-quota::before {
  content: "↗";
  background: linear-gradient(145deg, #ffaa8a, #f97316);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 22px rgba(249, 115, 22, 0.2);
}

.campaign-send-stat-grid .stat-card,
.campaign-summary-stat-grid .stat-card {
  border-color: rgba(83, 146, 220, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(242, 248, 255, 0.9));
  box-shadow:
    0 14px 32px rgba(43, 95, 166, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.campaign-send-stat-grid .stat-card::before,
.campaign-summary-stat-grid .stat-card::before {
  background: linear-gradient(145deg, #78c8ff, #2f73e0);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 12px 22px rgba(47, 115, 224, 0.2);
}

.campaign-send-stat-grid .stat-card span,
.campaign-summary-stat-grid .stat-card span,
.campaign-send-stat-grid .stat-card small,
.campaign-summary-stat-grid .stat-card small {
  color: #5f7894;
}

.campaign-send-stat-grid .stat-card strong,
.campaign-summary-stat-grid .stat-card strong {
  color: #132744;
}

.campaign-send-stat-grid .stat-mailboxes::before {
  content: "▦";
}

.campaign-send-stat-grid .stat-active-mailboxes::before {
  content: "↗";
}

.campaign-send-stat-grid .stat-paused-mailboxes::before {
  content: "Ⅱ";
}

.agent-capacity-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(83, 146, 220, 0.16);
}

.agent-capacity-panel .section-header {
  margin-bottom: 12px;
}

.agent-capacity-panel h3 {
  margin: 0 0 4px;
  color: #183356;
}

.agent-capacity-grid .stat-card {
  border-color: rgba(56, 189, 248, 0.18);
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(237, 247, 255, 0.92));
  box-shadow: 0 12px 28px rgba(43, 95, 166, 0.08);
}

.agent-capacity-grid .stat-card strong {
  color: #132744;
}

.campaign-summary-stat-grid .stat-target-contacts::before {
  content: "◎";
}

.campaign-summary-stat-grid .stat-sent-contacts::before {
  content: "✈";
}

.campaign-summary-stat-grid .stat-replied-contacts::before {
  content: "↩";
}

.dashboard-kpi-card span,
.stat-card span {
  grid-area: label;
  color: #6c757d;
  font-size: 0.82rem;
  font-weight: 600;
}

.dashboard-kpi-card strong,
.stat-card strong {
  grid-area: value;
  color: #212529;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}

.dashboard-kpi-card small,
.stat-card small {
  grid-area: meta;
  color: #6c757d;
  font-size: 0.75rem;
}

.table-wrap,
.mailbox-table-wrap,
.reply-table-wrap,
.stats-table-wrap {
  border-radius: 0.25rem;
  border-color: var(--border-color);
  box-shadow: none;
}

th {
  background: #ffffff;
  color: #6c757d;
  font-size: 0.78rem;
}

td {
  color: #212529;
}

th,
td {
  padding: 10px 12px;
}

button:not(.icon-btn):not(.mode-option):not(.danger-ghost),
.secondary-btn {
  border-radius: 0.25rem;
  border-color: var(--primary-color);
  background: var(--primary-color);
  box-shadow: none;
}

.ghost-btn,
.text-link {
  border-radius: 0.25rem;
  border-color: var(--primary-color);
  background: #ffffff;
  color: var(--primary-color);
}

.ghost-btn:hover,
.text-link:hover {
  background: var(--primary-color);
  color: #ffffff;
}

input,
select,
textarea {
  border-radius: 0.25rem;
}

.mode-switch,
.test-template-segment,
.send-template-source-panel .template-source-options {
  border-radius: 0.25rem;
  background: #ffffff;
}

.mode-option:hover,
.mode-option.active {
  border-color: var(--primary-color);
  color: #ffffff;
  background: var(--primary-color);
}

.notice,
.pill,
.reply-type-pill,
.reply-status-chip,
.template-status-pill {
  border-radius: 0.25rem;
}

.login-form-card.login-form-card-center {
  border-radius: 0.25rem;
}

@media (max-width: 1279px) {
  .shell:not(.shell-login) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: relative;
    top: 0;
    width: auto;
    height: auto;
    margin: 14px;
    padding: 18px;
    border-radius: 1rem;
  }

  .page {
    padding: 0 14px 18px;
  }
}

@media (max-width: 900px) {
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
  }

  .sidebar-footer {
    display: none;
  }
}

@media (max-width: 720px) {
  .dashboard-kpi-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .nav {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    min-width: 46px;
  }
}

/* Cross-page polish and motion */
:root {
  --surface-hover: #f8f9fc;
  --surface-soft: #f3f6fb;
  --focus-ring: rgba(72, 76, 127, 0.18);
  --human-motion: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes ui-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ui-pop {
  from {
    opacity: 0;
    transform: scale(0.985);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ui-slide-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes ui-progress {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 42px 0;
  }
}

.sidebar,
.dashboard-topbar,
.mailbox-hero,
.section-header,
.dashboard-panel,
.dashboard-activity-panel,
.dashboard-performance-panel,
.panel,
.dashboard-kpi-card,
.stat-card,
.modal-card,
.login-form-card {
  animation: ui-fade-up 0.38s var(--human-motion) both;
}

.sidebar {
  animation-name: ui-slide-in;
}

.dashboard-shell > :nth-child(1),
.reply-workbench > :nth-child(1) {
  animation-delay: 0.02s;
}

.dashboard-shell > :nth-child(2),
.reply-workbench > :nth-child(2) {
  animation-delay: 0.05s;
}

.dashboard-shell > :nth-child(3),
.reply-workbench > :nth-child(3) {
  animation-delay: 0.08s;
}

.dashboard-shell > :nth-child(4),
.reply-workbench > :nth-child(4) {
  animation-delay: 0.11s;
}

.dashboard-kpi-strip > :nth-child(1) {
  animation-delay: 0.04s;
}

.dashboard-kpi-strip > :nth-child(2) {
  animation-delay: 0.07s;
}

.dashboard-kpi-strip > :nth-child(3) {
  animation-delay: 0.1s;
}

.dashboard-kpi-strip > :nth-child(4) {
  animation-delay: 0.13s;
}

.dashboard-kpi-strip > :nth-child(5) {
  animation-delay: 0.16s;
}

.dashboard-kpi-strip > :nth-child(6) {
  animation-delay: 0.19s;
}

.dashboard-panel,
.dashboard-activity-panel,
.dashboard-performance-panel,
.panel,
.dashboard-kpi-card,
.stat-card,
.choice-card,
.mailbox-card,
.variant-card,
.reply-card,
.stats-metric-box,
.stats-category-row,
.stats-inline-row,
.running-import-item {
  transition:
    transform 0.18s var(--human-motion),
    box-shadow 0.18s var(--human-motion),
    border-color 0.18s var(--human-motion),
    background-color 0.18s var(--human-motion),
    color 0.18s var(--human-motion);
}

.dashboard-panel:hover,
.dashboard-activity-panel:hover,
.dashboard-performance-panel:hover,
.panel:hover,
.dashboard-kpi-card:hover,
.stat-card:hover,
.choice-card:hover,
.mailbox-card:hover,
.variant-card:hover,
.reply-card:hover,
.stats-metric-box:hover,
.stats-category-row:hover,
.stats-inline-row:hover,
.running-import-item:hover {
  border-color: #d7ddeb;
  box-shadow: 0 8px 22px rgba(30, 38, 70, 0.08);
  transform: translateY(-2px);
}

.mailbox-hero {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.mailbox-hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 8px 4px 14px;
}

.mailbox-hero-copy h1,
.section-header > div > h1 {
  margin: 0;
  color: #212529;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.25;
}

.mailbox-provider-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.mailbox-provider-badge,
.soft-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #e1e7f0;
  border-radius: 0.25rem;
  background: #f8f9fc;
  color: #5d6678;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.mailbox-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.mailbox-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mailbox-hero-stat {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: #ffffff;
  box-shadow: var(--bs-card-shadow);
}

.mailbox-hero-stat span {
  color: #6c757d;
  font-size: 0.82rem;
  font-weight: 700;
}

.mailbox-hero-stat strong {
  color: #212529;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}

.mailbox-section + .mailbox-section,
.panel + .panel,
.dashboard-panel + .dashboard-panel {
  margin-top: 18px;
}

.mailbox-list-meta,
.running-imports-card,
.sync-progress-head,
.progress-meta,
.dashboard-performance-head,
.stats-category-head,
.stats-inline-row,
.reply-detail-section-head,
.template-action-row,
.mailbox-list-actions,
.dashboard-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mailbox-list-meta {
  margin: 0 16px 12px;
  color: #6c757d;
  font-size: 0.86rem;
  font-weight: 700;
}

.mailbox-list-actions,
.template-action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.mailbox-list-actions form,
.template-action-row form {
  margin: 0;
}

.choice-grid,
.mailbox-card-grid,
.variant-grid,
.reply-grid,
.stats-metric-grid,
.stats-category-stack {
  gap: 12px;
}

.choice-card,
.mailbox-card,
.variant-card,
.reply-card,
.stats-metric-box,
.stats-category-row,
.stats-inline-row,
.running-import-item {
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: #ffffff;
  box-shadow: none;
}

.choice-card {
  padding: 14px;
}

.choice-card:has(input[type="radio"]:checked),
.choice-card:has(input[type="checkbox"]:checked),
.send-template-source-panel .template-source-options label:has(input:checked),
.test-template-segment label:has(input:checked),
.mailbox-choice-card:has(input:checked) {
  border-color: var(--primary-color);
  background: #f5f6ff;
  color: var(--primary-color);
  box-shadow: inset 0 0 0 1px rgba(72, 76, 127, 0.08);
}

.choice-card-title {
  color: #212529;
}

.choice-card-subtitle,
.choice-card-meta {
  color: #6c757d;
}

.grid-form {
  align-items: start;
}

.grid-form label,
.single-form label,
.reply-review-form label {
  min-width: 0;
}

.grid-form input,
.grid-form select,
.grid-form textarea,
.single-form input,
.single-form select,
.single-form textarea {
  transition:
    border-color 0.16s var(--human-motion),
    box-shadow 0.16s var(--human-motion),
    background-color 0.16s var(--human-motion);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px var(--focus-ring);
}

.native-fuzzy-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.select-combo {
  position: relative;
  width: 100%;
  min-width: 0;
}

.select-combo-input {
  min-height: 44px;
  padding: 10px 44px 10px 13px;
  border-radius: 8px;
  background: #ffffff;
  border-color: #cfd8e3;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.select-combo-input::placeholder {
  color: #8a96a8;
}

.select-combo.is-open .select-combo-input,
.select-combo-input:focus {
  border-color: #17866f;
  box-shadow: 0 0 0 3px rgba(20, 145, 114, 0.14);
}

.select-combo-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 34px;
  min-width: 0;
  height: calc(100% - 8px);
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
  font-size: 1.05rem;
  line-height: 1;
}

.select-combo-toggle:hover {
  transform: none;
  filter: none;
  background: #eef6f3;
  color: #0f766e;
}

.select-combo.is-open .select-combo-toggle {
  color: #0f766e;
  transform: rotate(180deg);
}

.select-combo-list {
  position: absolute;
  z-index: 1400;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: min(300px, 48vh);
  overflow: auto;
  display: grid;
  gap: 5px;
  padding: 6px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f6f8fb;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.select-combo-list[hidden] {
  display: none !important;
}

.select-combo-list::-webkit-scrollbar {
  width: 10px;
}

.select-combo-list::-webkit-scrollbar-thumb {
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #c7d2df;
}

.select-combo-option {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0;
  padding: 9px 36px 9px 13px !important;
  border: 1px solid #e3e8f0 !important;
  border-radius: 7px;
  background: #ffffff !important;
  color: #1f2937 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
  font-weight: 600;
  text-align: left !important;
  white-space: normal;
  line-height: 1.35;
}

.select-combo-option:hover,
.select-combo-option:focus {
  transform: none;
  filter: none;
  border-color: #cfd8e3 !important;
  background: #f9fbfd !important;
  color: #111827 !important;
  outline: none;
}

.select-combo-option.is-selected {
  transform: none;
  filter: none;
  border-color: #9bb8f5 !important;
  background: #f3f7ff !important;
  color: #17315e !important;
  font-weight: 800;
}

.select-combo-option.is-selected::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 5px;
  width: 3px;
  border-radius: 999px;
  background: #315fba;
}

.select-combo-option.is-selected::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #2454b8;
  font-size: 1.08rem;
  font-weight: 900;
}

.select-combo-empty {
  padding: 11px 10px;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
}

.campaign-reply-to-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin: 8px 0 0;
  padding: 7px 10px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #f7f9fc;
  color: #526174;
  font-size: 0.9rem;
  font-weight: 600;
}

.campaign-reply-to-summary strong {
  color: #17315e;
}

.campaign-reply-to-summary span {
  color: #8a96a8;
}

input[type="file"] {
  min-height: 42px;
}

.table-wrap,
.mailbox-table-wrap,
.reply-table-wrap,
.stats-table-wrap {
  max-width: 100%;
  background: #ffffff;
}

tbody tr {
  transition: background-color 0.14s var(--human-motion);
}

tbody tr td:first-child {
  border-left: 3px solid transparent;
}

tbody tr:hover {
  background: #fbfcff;
}

tbody tr:hover td:first-child {
  border-left-color: var(--secondary-color);
}

.empty-cell,
.empty,
.mailbox-empty,
.reply-detail-loading,
.reply-info-empty {
  padding: 18px;
  border: 1px dashed #dce3ee;
  border-radius: 0.25rem;
  background: #fbfcff;
  color: #6c757d;
}

.notice {
  border-color: #dbe3f1;
  background: #ffffff;
  color: #475569;
}

.notice-info {
  border-color: #d7e6ff;
  background: #f4f8ff;
  color: #244a88;
}

.notice-success {
  border-color: #cfead8;
  background: #f4fbf6;
  color: #1c7a3d;
}

.notice-error,
.notice-danger {
  border-color: #f4c7ce;
  background: #fff6f7;
  color: #b4233a;
}

.mini-progress,
.progress-bar,
.stats-bar {
  position: relative;
  overflow: hidden;
  background: #edf1f7;
}

.mini-progress span,
.progress-bar-fill,
.stats-bar-fill {
  background-color: var(--primary-color);
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.18) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.18) 75%,
    transparent 75%,
    transparent
  );
  background-size: 42px 42px;
  animation: ui-progress 1.1s linear infinite;
}

.stats-bar-fill.fill-replies,
.bar-replies {
  background-color: var(--chart-color3);
}

.stats-bar-fill.danger {
  background-color: #ef4444;
}

.import-progress-card {
  margin: 16px;
}

.column-select-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.column-select-grid label {
  margin: 0;
}

.import-column-modal-card {
  width: min(760px, calc(100vw - 32px));
}

.import-column-modal-card .column-select-grid {
  margin-top: 12px;
}

@media (max-width: 980px) {
  .column-select-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .column-select-grid {
    grid-template-columns: 1fr;
  }
}

.import-progress-steps span.active {
  border-color: var(--primary-color);
  background: #f5f6ff;
  color: var(--primary-color);
}

.running-imports-card {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: #ffffff;
  box-shadow: var(--bs-card-shadow);
}

.running-imports-list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.running-import-item {
  padding: 10px 12px;
}

.send-template-source-panel,
.test-template-source-panel {
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: #fbfcff;
}

.send-template-selection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 0.35rem;
  background: #ffffff;
}

.send-template-choice-list {
  display: grid;
  gap: 12px;
  max-height: min(58vh, 560px);
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

#send-template-picker-modal.visible .modal-card {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#send-template-picker-modal.visible .send-template-choice-list {
  min-height: 0;
}

.send-template-choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 0.35rem;
  background: #ffffff;
  cursor: pointer;
}

.send-template-choice-card:has(input:checked) {
  border-color: var(--primary-color);
  background: #f5f6ff;
  box-shadow: inset 0 0 0 1px rgba(72, 76, 127, 0.08);
}

.send-template-choice-card input {
  margin-top: 4px;
}

.variant-review-form .modal-actions button[type="submit"]:not([name]) {
  display: none;
}

.send-template-source-panel .template-source-options,
.test-template-segment {
  border: 0;
  background: transparent;
  padding: 0;
}

.send-template-source-panel .template-source-options label,
.test-template-segment label,
.mailbox-choice-card {
  min-height: 42px;
  border-radius: 0.25rem;
}

.campaign-template-toolbar {
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: #ffffff;
}

.template-change-button {
  min-height: 0;
  color: var(--primary-color);
}

.template-change-button:hover:not(:disabled) {
  color: var(--secondary-color);
}

.modal-shell.visible .modal-card {
  animation: ui-pop 0.2s var(--human-motion) both;
}

.modal-card {
  overflow: hidden;
}

.modal-header {
  min-height: 56px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-card > .grid-form,
.modal-card > form,
.modal-card > label,
.modal-card > p,
.modal-card > .table-wrap {
  margin: 16px;
}

.modal-actions {
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  background: #fbfcff;
}

.icon-btn {
  border-radius: 0.25rem;
}

.stats-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.stats-metric-box {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 14px;
}

.stats-metric-box span,
.stats-category-row span,
.stats-inline-row span {
  color: #6c757d;
  font-size: 0.82rem;
  font-weight: 700;
}

.stats-metric-box strong,
.stats-category-row strong,
.stats-inline-row strong {
  color: #212529;
  font-weight: 800;
}

.stats-category-stack {
  display: grid;
}

.stats-category-row,
.stats-inline-row {
  padding: 12px;
}

.stats-category-row {
  display: grid;
  gap: 10px;
}

.stats-compact-panel .stats-category-stack.compact {
  margin-top: 0;
}

.reply-kpi-row {
  gap: 12px;
}

.reply-kpi {
  padding: 14px 16px;
}

.reply-table-wrap,
.reply-detail-main,
.reply-side-block {
  box-shadow: var(--bs-card-shadow);
}

.reply-detail-card {
  border-radius: 0.25rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.reply-body-box,
.reply-draft-preview,
.mail-preview-frame,
.rich-editor,
.rich-editor-surface,
.body-preview,
.variant-template-preview .body-preview {
  border-radius: 0.25rem;
}

.mail-preview-frame {
  box-shadow: none;
}

.mailbox-owner-filter {
  align-items: center;
}

.mailbox-owner-filter select {
  min-width: 220px;
}

.danger-ghost,
.danger-btn {
  border-radius: 0.25rem;
}

button:active,
.ghost-btn:active,
.secondary-btn:active,
.danger-btn:active,
.danger-ghost:active,
.mode-option:active {
  transform: translateY(0) scale(0.99);
}

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

.app-message-stage,
.app-message-stage *,
.app-message-stage *::before,
.app-message-stage *::after {
  box-sizing: border-box;
}

.app-message-stage {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 300000;
  display: grid;
  width: min(92vw, 620px);
  pointer-events: none;
  transform: translateX(-50%);
}

.app-message-wrapper {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 6px 0;
  overflow: hidden;
  transition: height 0.28s ease, padding 0.28s ease;
}

.app-message {
  --message-color: #0d9488;
  --message-bg: #ecfeff;
  --message-border: #a5f3fc;
  --message-shadow: rgba(15, 118, 110, 0.16);
  display: grid;
  grid-template-columns: 18px minmax(180px, 1fr) 22px;
  align-items: center;
  gap: 11px;
  min-width: min(420px, 92vw);
  max-width: min(620px, 92vw);
  padding: 14px 18px;
  border: 1px solid var(--message-border);
  border-radius: 8px;
  color: var(--message-color);
  background: color-mix(in srgb, var(--message-bg) 90%, #ffffff);
  box-shadow: 0 16px 38px var(--message-shadow), 0 1px 2px rgba(15, 23, 42, 0.08);
  opacity: 0;
  pointer-events: auto;
  transform: translate3d(0, -16px, 0) scale(0.98);
  transition: opacity 0.2s ease, transform 0.24s ease, filter 0.2s ease;
  will-change: opacity, transform;
}

.app-message.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.app-message.is-leaving {
  opacity: 0;
  filter: blur(2px);
  transform: translate3d(0, -12px, 0) scale(0.985);
}

.app-message-info,
.app-message-loading {
  --message-color: #0f766e;
  --message-bg: #ecfeff;
  --message-border: #99f6e4;
  --message-shadow: rgba(15, 118, 110, 0.15);
}

.app-message-success {
  --message-color: #15803d;
  --message-bg: #f0fdf4;
  --message-border: #bbf7d0;
  --message-shadow: rgba(21, 128, 61, 0.14);
}

.app-message-warning {
  --message-color: #b45309;
  --message-bg: #fffbeb;
  --message-border: #fde68a;
  --message-shadow: rgba(180, 83, 9, 0.15);
}

.app-message-error {
  --message-color: #be123c;
  --message-bg: #fff1f2;
  --message-border: #fecdd3;
  --message-shadow: rgba(190, 18, 60, 0.14);
}

.app-message-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--message-color);
  color: #fff;
  flex: 0 0 auto;
}

.app-message-icon svg {
  display: block;
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.app-message-content {
  min-width: 0;
  color: var(--message-color);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: left;
  word-break: break-word;
}

.app-message-progress {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.app-message-progress svg {
  display: block;
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.app-message-progress-bg,
.app-message-progress-ring {
  fill: none;
  stroke-width: 2.4;
}

.app-message-progress-bg {
  stroke: color-mix(in srgb, var(--message-color) 18%, transparent);
}

.app-message-progress-ring {
  stroke: var(--message-color);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: app-message-countdown linear forwards;
}

.app-message-stage:hover .app-message-progress-ring {
  animation-play-state: paused;
}

.app-message-close {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--message-color);
  background: transparent;
  cursor: pointer;
}

.app-message-close:hover {
  background: color-mix(in srgb, var(--message-color) 12%, transparent);
}

.app-message-close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.app-message-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 999px;
  animation: app-message-spin 0.8s linear infinite;
}

@keyframes app-message-countdown {
  to {
    stroke-dashoffset: 100;
  }
}

@keyframes app-message-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .app-message-stage {
    top: 12px;
    width: calc(100vw - 24px);
  }

  .app-message {
    grid-template-columns: 18px minmax(0, 1fr) 22px;
    min-width: 0;
    width: 100%;
    padding: 13px 14px;
  }
}

@media (max-width: 1180px) {
  .mailbox-hero-content {
    grid-template-columns: 1fr;
  }

  .mailbox-provider-badges,
  .mailbox-hero-actions {
    justify-content: flex-start;
  }

  .mailbox-hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .mailbox-hero-stats,
  .stats-metric-grid {
    grid-template-columns: 1fr;
  }

  .mailbox-list-meta,
  .running-imports-card,
  .dashboard-performance-head,
  .stats-category-head,
  .stats-inline-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Modal stacking fix */
.shell:not(.shell-login) {
  isolation: isolate;
}

.sidebar {
  z-index: 10;
}

.page {
  position: relative;
  z-index: 20;
}

.modal-shell {
  z-index: 200000;
}

.modal-shell-nested {
  z-index: 200100;
}

.modal-backdrop {
  z-index: 0;
}

.modal-card {
  z-index: 1;
}

.app-update-modal {
  z-index: 200200;
}

.app-update-card {
  max-width: min(460px, calc(100vw - 32px));
}

.app-update-body {
  display: grid;
  gap: 12px;
}

.app-update-version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(30, 41, 59, 0.12);
  border-radius: 8px;
  background: #f8fafc;
}

.app-update-version-row span {
  color: var(--muted);
  font-weight: 700;
}

.app-update-version-row strong {
  color: #0f172a;
  font-size: 1.05rem;
}

.app-update-version-row.is-latest {
  border-color: rgba(38, 166, 154, 0.35);
  background: #ecfdf7;
}

.app-update-version-row.is-latest strong {
  color: #047857;
}

.app-update-notes {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
  line-height: 1.6;
}

.app-update-instruction {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef6ff;
  color: #175cd3;
  font-weight: 800;
  line-height: 1.6;
}

.app-update-actions {
  align-items: center;
}

.primary-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--secondary-color);
  background: var(--secondary-color);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.primary-link-btn:hover {
  filter: brightness(0.96);
  color: #ffffff;
}

body.modal-open .sidebar {
  pointer-events: none;
  z-index: 0;
}

/* Sidebar account footer */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar .nav {
  flex: 1 1 auto;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.sidebar-footer .user-name {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
}

.sidebar-footer .user-meta {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
  font-weight: 700;
}

.app-version-badge {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar-footer .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 800;
}

.sidebar-footer .ghost-btn:hover {
  border-color: var(--secondary-color);
  background: var(--secondary-color);
  color: #ffffff;
}

/* Sidebar icons and mini mode */
.sidebar {
  transition:
    width 0.22s var(--human-motion),
    flex-basis 0.22s var(--human-motion),
    padding 0.22s var(--human-motion),
    margin 0.22s var(--human-motion);
}

.sidebar .brand,
.sidebar .nav a,
.sidebar-footer .ghost-btn,
.sidebar-mini-btn {
  transition:
    background 0.18s var(--human-motion),
    color 0.18s var(--human-motion),
    transform 0.18s var(--human-motion),
    opacity 0.18s var(--human-motion);
}

.sidebar .nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin: 2px 0;
  padding: 7px 10px;
  border-radius: 0.25rem;
}

.sidebar .nav a::before,
.sidebar .nav a::after {
  display: none;
  content: none;
}

.sidebar .nav-text,
.sidebar-toggle-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.sidebar .nav-icon,
.sidebar-toggle-icon {
  display: block;
  box-sizing: border-box;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 7px;
  overflow: visible;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
}

.sidebar .nav-icon {
  flex: 0 0 34px;
}

.sidebar .nav-icon use,
.sidebar-toggle-icon use {
  pointer-events: none;
}

.sidebar .nav a:hover .nav-icon,
.sidebar .nav a.active .nav-icon,
.sidebar-footer .ghost-btn:hover .nav-icon,
.sidebar-mini-btn:hover .sidebar-toggle-icon {
  background: rgba(241, 152, 40, 0.2);
  color: var(--secondary-color);
}

.sidebar-toggle-expand {
  display: none;
}

body.sidebar-mini .sidebar-toggle-collapse {
  display: none;
}

body.sidebar-mini .sidebar-toggle-expand {
  display: block;
}

.sidebar-user {
  display: grid;
  gap: 4px;
}

.sidebar-footer .ghost-btn,
.sidebar-mini-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.sidebar-footer .ghost-btn:hover,
.sidebar-mini-btn:hover {
  border-color: rgba(241, 152, 40, 0.38);
  background: rgba(241, 152, 40, 0.12);
  color: var(--secondary-color);
  transform: none;
}

.sidebar-mini-btn {
  font: inherit;
}

body.sidebar-mini .sidebar {
  flex-basis: 96px;
  width: 96px;
  padding: 22px 14px;
  overflow: visible;
}

body.sidebar-mini .brand {
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}

body.sidebar-mini .brand-mark {
  width: 56px;
  min-width: 56px;
  height: 56px;
}

body.sidebar-mini .brand-title,
body.sidebar-mini .brand-sub,
body.sidebar-mini .sidebar-user,
body.sidebar-mini .sidebar .nav a .nav-text,
body.sidebar-mini .sidebar-footer .ghost-btn .nav-text,
body.sidebar-mini .sidebar-mini-btn .sidebar-toggle-text {
  display: none;
}

body.sidebar-mini .sidebar .nav {
  align-items: center;
  justify-items: center;
}

body.sidebar-mini .sidebar-footer {
  align-items: center;
  width: 100%;
  gap: 8px;
}

body.sidebar-mini .sidebar .nav a,
body.sidebar-mini .sidebar-footer .ghost-btn,
body.sidebar-mini .sidebar-mini-btn {
  justify-content: center;
  width: 56px;
  min-height: 46px;
  padding: 6px 0;
  gap: 0;
  border-radius: 0.9rem;
}

body.sidebar-mini .sidebar-footer .ghost-btn,
body.sidebar-mini .sidebar-mini-btn {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body.sidebar-mini .sidebar-footer .ghost-btn:hover,
body.sidebar-mini .sidebar-mini-btn:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body.sidebar-mini .sidebar .nav a .nav-icon,
body.sidebar-mini .sidebar-footer .ghost-btn .nav-icon,
body.sidebar-mini .sidebar-mini-btn .sidebar-toggle-icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
}

body.sidebar-mini .sidebar .nav a:hover .nav-text,
body.sidebar-mini .sidebar .nav a:focus-visible .nav-text {
  position: absolute;
  left: 68px;
  top: 50%;
  display: block;
  width: max-content;
  min-width: 112px;
  max-width: 180px;
  padding: 10px 13px;
  border-radius: 0.25rem;
  background: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(33, 37, 41, 0.18);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);}

@media (max-width: 1279px) {
  .sidebar-mini-btn {
    display: none;
  }

  body.sidebar-mini .sidebar {
    flex-basis: auto;
    width: auto;
    height: auto;
    margin: 14px;
    padding: 18px;
    overflow: visible;
  }

  body.sidebar-mini .brand {
    justify-content: flex-start;
    gap: 15px;
    margin-bottom: 22px;
  }

  body.sidebar-mini .brand-title,
  body.sidebar-mini .sidebar-user,
  body.sidebar-mini .sidebar .nav a .nav-text,
  body.sidebar-mini .sidebar-footer .ghost-btn .nav-text {
    display: block;
  }

  body.sidebar-mini .sidebar .nav a,
  body.sidebar-mini .sidebar-footer .ghost-btn {
    justify-content: flex-start;
    width: 100%;
    padding: 7px 10px;
    gap: 12px;
    border-radius: 0.25rem;
  }
}

/* Keep the sidebar collapse control from inheriting page-level button skins. */
.sidebar .sidebar-mini-btn,
.sidebar .sidebar-mini-btn.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  margin: 10px 0 0;
  padding: 6px 10px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.25rem;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: #ffffff;
}

.sidebar .sidebar-mini-btn:hover,
.sidebar .sidebar-mini-btn.icon-btn:hover {
  border-color: rgba(241, 152, 40, 0.38);
  background: rgba(241, 152, 40, 0.12);
  box-shadow: none;
  color: var(--secondary-color);
  transform: none;
}

body.sidebar-mini .sidebar .sidebar-mini-btn,
body.sidebar-mini .sidebar .sidebar-mini-btn.icon-btn {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  height: 46px;
  min-height: 46px;
  margin-inline: auto;
  padding: 0;
  border-color: transparent;
  border-radius: 0.9rem;
  background: transparent;
}

/* Mini sidebar tooltips must float above the page content. */
body.sidebar-mini .shell:not(.shell-login) .sidebar {
  z-index: 120;
}

body.sidebar-mini .sidebar .nav a,
body.sidebar-mini .sidebar-footer .ghost-btn,
body.sidebar-mini .sidebar-mini-btn {
  position: relative;
}

body.sidebar-mini .sidebar .nav a:hover .nav-text,
body.sidebar-mini .sidebar .nav a:focus-visible .nav-text {
  z-index: 300;
}

body.modal-open.sidebar-mini .shell:not(.shell-login) .sidebar {
  pointer-events: none;
  z-index: 0;
}

/* Dashboard workspace refresh */
.dashboard-shell {
  --dashboard-ink: #1f2937;
  --dashboard-muted: #687383;
  --dashboard-border: #e2e8f0;
  --dashboard-soft: #f6f8fb;
  --dashboard-card: #ffffff;
  --dashboard-primary: #484c7f;
  gap: 16px;
  color: var(--dashboard-ink);
}

.dashboard-shell *,
.dashboard-shell *::before,
.dashboard-shell *::after {
  letter-spacing: 0;
}

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

.dashboard-topbar h1 {
  margin: 0;
  color: var(--dashboard-ink);
  font-size: 1.56rem;
  font-weight: 850;
  line-height: 1.18;
}

.dashboard-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-status-line span {
  max-width: min(100%, 420px);
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.25rem;
  background: #ffffff;
  color: var(--dashboard-muted);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-topbar-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-topbar-actions .ghost-btn,
.dashboard-topbar-actions .secondary-btn {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.25rem;
  background: #ffffff;
  box-shadow: none;
  color: #374151;
  font-size: 0.86rem;
  font-weight: 800;
}

.dashboard-topbar-actions a[href="/campaigns"] {
  border-color: var(--dashboard-primary);
  background: var(--dashboard-primary);
  color: #ffffff;
}

.dashboard-topbar-actions .ghost-btn:hover,
.dashboard-topbar-actions .secondary-btn:hover {
  border-color: var(--dashboard-primary);
  background: var(--dashboard-primary);
  box-shadow: none;
  color: #ffffff;
  transform: translateY(-1px);
}

.dashboard-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 12px;
}

.dashboard-kpi-card {
  --tone: #64748b;
  --tone-soft: #f1f5f9;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 9px;
  min-height: 116px;
  margin: 0;
  padding: 15px 16px 14px;
  overflow: hidden;
  border: 1px solid var(--dashboard-border);
  border-left: 3px solid var(--tone);
  border-radius: 0.25rem;
  background: var(--dashboard-card);
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.045);
  backdrop-filter: none;
}

.dashboard-kpi-card::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tone);
  opacity: 0.82;
}

.dashboard-kpi-card::after {
  display: none;
}

.dashboard-kpi-card span {
  color: var(--dashboard-muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.dashboard-kpi-card strong {
  align-self: center;
  color: #111827;
  font-size: clamp(1.58rem, 1.9vw, 2.08rem);
  font-weight: 850;
  line-height: 1;
}

.dashboard-kpi-card small {
  color: #7b8493;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.25;
}

.dashboard-kpi-card:hover {
  border-color: #cfd8e6;
  border-left-color: var(--tone);
  box-shadow: 0 12px 26px rgba(31, 41, 55, 0.07);
  transform: translateY(-1px);
}

.tone-contacts {
  --tone: #484c7f;
  --tone-soft: #eef2ff;
  --tone-border: #c7d2fe;
}

.tone-campaigns {
  --tone: #0f766e;
  --tone-soft: #ecfdf5;
  --tone-border: #99f6e4;
}

.tone-sent {
  --tone: #16a34a;
  --tone-soft: #f0fdf4;
  --tone-border: #bbf7d0;
}

.tone-replies {
  --tone: #7c3aed;
  --tone-soft: #f5f0ff;
  --tone-border: #ddd6fe;
}

.tone-opened {
  --tone: #0891b2;
  --tone-soft: #ecfeff;
  --tone-border: #bae6fd;
}

.tone-quota {
  --tone: #f19828;
  --tone-soft: #fff7ed;
  --tone-border: #fed7aa;
}

.dashboard-analytics-grid {
  display: grid;
  gap: 14px;
  align-items: start;}

.dashboard-activity-panel,
.dashboard-performance-panel,
.dashboard-panel {
  position: relative;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.25rem;
  background: var(--dashboard-card);
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.045);
  backdrop-filter: none;
}

.dashboard-activity-panel::before,
.dashboard-performance-panel::before,
.dashboard-panel::before {
  display: none;
}

.dashboard-activity-panel {
  overflow: visible;
}

.dashboard-performance-panel {
  display: grid;
  gap: 14px;
}

.dashboard-panel + .dashboard-panel {
  margin-top: 0;
}

.dashboard-panel-header,
.section-header.compact.dashboard-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.dashboard-panel-header h2 {
  margin: 0;
  color: var(--dashboard-ink);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.25;
}

.dashboard-panel-header .pill,
.dashboard-panel .pill {
  min-height: 26px;
  max-width: min(100%, 360px);
  padding: 5px 9px;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.25rem;
  background: var(--dashboard-soft);
  color: #4b5563;
  font-size: 0.76rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-chart-canvas {
  position: relative;
  min-height: 302px;
  padding: 50px 16px 18px 48px;
  overflow: visible;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.25rem;
  background: linear-gradient(180deg, #ffffff, #f9fbfd);
}

.dashboard-chart-grid {
  inset: 50px 16px 40px 48px;
  border: 0;
  opacity: 1;
  background-image:
    linear-gradient(#edf1f6 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 232, 240, 0.72) 1px, transparent 1px);
  background-size: 100% 25%, calc(100% / 7) 100%;
}

.dashboard-chart-scale {
  top: 50px;
  bottom: 40px;
  left: 14px;
  color: #8a95a6;
  font-size: 0.72rem;
  font-weight: 800;
}

.dashboard-chart-legend {
  top: 12px;
  right: 14px;
  left: auto;
  gap: 6px;
}

.dashboard-legend-item {
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.25rem;
  background: #ffffff;
  color: #4b5563;
  box-shadow: none;
  font-size: 0.76rem;
  font-weight: 800;
}

.dashboard-legend-swatch {
  width: 8px;
  height: 8px;
}

.dashboard-bar-chart {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  height: 220px;
}

.dashboard-bar-day {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 9px;
  min-width: 0;
  height: 100%;
}

.dashboard-bar-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(5px, 1fr));
  align-items: end;
  gap: 4px;
  min-height: 0;
  padding: 0 5px;
}

.dashboard-bar {
  border-radius: 4px 4px 1px 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.dashboard-bar::after {
  z-index: 400;
  border: 0;
  border-radius: 0.25rem;
  background: #111827;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.2);
  font-size: 0.74rem;
}

.dashboard-bar::before {
  z-index: 399;
  background: #111827;
}

.dashboard-bar-label {
  color: #7b8493;
  font-size: 0.73rem;
  font-weight: 800;
}

.dashboard-series-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.dashboard-series-row {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid var(--dashboard-border);
  border-radius: 0.25rem;
  background: var(--dashboard-soft);
}

.dashboard-series-row span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--dashboard-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-series-row strong {
  color: #111827;
  font-size: 1.18rem;
  font-weight: 850;
  line-height: 1;
}

.dashboard-series-row small {
  color: #7b8493;
  font-size: 0.75rem;
  font-weight: 700;
}

.dashboard-performance-list,
.dashboard-feed {
  display: grid;
  gap: 9px;
}

.dashboard-performance-item,
.dashboard-performance-note,
.dashboard-feed-item,
.dashboard-quick-card {
  border: 1px solid var(--dashboard-border);
  border-radius: 0.25rem;
  background: var(--dashboard-soft);
  box-shadow: none;
}

.dashboard-performance-item,
.dashboard-performance-note {
  padding: 13px;
}

.dashboard-performance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.dashboard-performance-head strong {
  color: #374151;
  font-size: 0.86rem;
  font-weight: 850;
}

.dashboard-performance-head span {
  color: #111827;
  font-size: 0.94rem;
  font-weight: 850;
}

.dashboard-performance-panel .stats-bar {
  height: 8px;
  border-radius: 999px;
  background: #dfe6ef;
}

.dashboard-performance-panel .stats-bar-fill {
  border-radius: inherit;
  background: linear-gradient(90deg, #6ca6ff, #484c7f);
}

.dashboard-performance-panel .stats-bar-fill.fill-replies {
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
}

.dashboard-performance-panel .stats-bar-fill.danger {
  background: linear-gradient(90deg, #fb7185, #e11d48);
}

.dashboard-performance-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-performance-note span {
  color: var(--dashboard-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.dashboard-performance-note strong {
  color: #111827;
  font-size: 1.38rem;
  font-weight: 850;
}

.dashboard-workbench-grid {
  display: grid;
  gap: 14px;
  align-items: start;}

.dashboard-panel-main {
  grid-row: auto;
}

.dashboard-panel.dashboard-panel-actions {
  display: grid;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
}

.dashboard-workbench-grid > .dashboard-panel:last-child {
  grid-column: auto;
}

.dashboard-feed-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s var(--human-motion), background 0.16s var(--human-motion), transform 0.16s var(--human-motion);
}

.dashboard-feed-item:hover {
  border-color: #c7d2e0;
  background: #ffffff;
  box-shadow: none;
  transform: translateY(-1px);
}

.dashboard-feed-main {
  min-width: 0;
}

.dashboard-feed-main strong {
  display: block;
  max-width: 100%;
  margin-bottom: 4px;
  overflow: hidden;
  color: var(--dashboard-ink);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-feed-main .muted {
  color: var(--dashboard-muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.42;
}

.dashboard-feed-side {
  display: flex;
  justify-content: flex-end;
  min-width: max-content;
}

.dashboard-quick-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.dashboard-quick-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 13px;
  text-decoration: none;
  transition: border-color 0.16s var(--human-motion), background 0.16s var(--human-motion), transform 0.16s var(--human-motion);
}

.dashboard-quick-card:hover {
  border-color: var(--dashboard-primary);
  background: #ffffff;
  box-shadow: none;
  transform: translateY(-1px);
}

.dashboard-quick-card span {
  min-width: 0;
  overflow: hidden;
  color: #374151;
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-quick-card strong {
  color: var(--dashboard-primary);
  font-size: 0.8rem;
  font-weight: 850;
}

.dashboard-panel .empty,
.dashboard-panel .mailbox-empty {
  margin: 0;
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 0.25rem;
  background: var(--dashboard-soft);
  color: var(--dashboard-muted);
  font-weight: 750;
}

@media (max-width: 1540px) {
  .dashboard-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .dashboard-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-topbar-actions {
    justify-content: flex-start;
  }

  .dashboard-analytics-grid,
  .dashboard-workbench-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-panel-main,
  .dashboard-workbench-grid > .dashboard-panel:last-child {
    grid-column: auto;
    grid-row: auto;
  }

  .dashboard-series-summary,
  .dashboard-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    gap: 12px;
  }

  .dashboard-topbar h1 {
    font-size: 1.3rem;
  }

  .dashboard-kpi-strip,
  .dashboard-series-summary,
  .dashboard-quick-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-activity-panel,
  .dashboard-performance-panel,
  .dashboard-panel,
  .dashboard-kpi-card {
    padding: 14px;
  }

  .dashboard-chart-canvas {
    min-height: 300px;
    padding-top: 78px;
    overflow-x: auto;
  }

  .dashboard-chart-legend {
    position: static;
    padding: 0 0 12px;
  }

  .dashboard-chart-grid,
  .dashboard-chart-scale {
    top: 86px;
  }

  .dashboard-bar-chart {
    min-width: 660px;
  }

  .dashboard-feed-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .dashboard-feed-side {
    justify-content: flex-start;
    min-width: 0;
  }
}

/* Dashboard command layout */
.dashboard-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(320px, 0.62fr);
  gap: 14px;
  align-items: stretch;
}

.dashboard-overview-panel,
.dashboard-quota-panel {
  position: relative;
  min-height: 214px;
  overflow: hidden;
  border: 1px solid var(--dashboard-border, #e2e8f0);
  border-radius: 0.25rem;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(31, 41, 55, 0.055);
}

.dashboard-overview-panel {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 176px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(72, 76, 127, 0.035), transparent 48%),
    #ffffff;
}

.dashboard-overview-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}

.dashboard-overview-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.78);
  color: #687383;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.dashboard-overview-summary strong {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 950;
}

.dashboard-metric-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-content: stretch;
}

.dashboard-metric-cell {
  --tone: #64748b;
  --tone-soft: #f1f5f9;
  --tone-border: #cbd5e1;
  position: relative;
  display: grid;
  grid-template-areas:
    "icon label"
    "icon value"
    "icon meta";
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 5px 11px;
  min-height: 98px;
  padding: 14px 15px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff, #f9fbfd);
  box-shadow: 0 6px 14px rgba(31, 41, 55, 0.035);
}

.dashboard-metric-icon {
  grid-area: icon;
  position: relative;
  display: block;
  align-self: center;
  justify-self: start;
  width: 36px;
  height: 36px;
  border: 1px solid var(--tone-border);
  border-radius: 10px;
  background:
    linear-gradient(135deg, var(--tone-soft), #ffffff);
  color: var(--tone);
}

.dashboard-metric-icon::before,
.dashboard-metric-icon::after {
  position: absolute;
  box-sizing: border-box;
  content: "";
}

.metric-icon-contacts::before {
  top: 9px;
  left: 10px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 10px 2px 0 -3px currentColor;
}

.metric-icon-contacts::after {
  left: 8px;
  bottom: 8px;
  width: 20px;
  height: 10px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 14px 14px;
}

.metric-icon-campaigns::before {
  top: 8px;
  left: 10px;
  width: 16px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.metric-icon-campaigns::after {
  top: 14px;
  left: 14px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.metric-icon-replies::before {
  top: 9px;
  left: 8px;
  width: 20px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 7px;
}

.metric-icon-replies::after {
  left: 14px;
  bottom: 8px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.metric-icon-opened::before {
  top: 11px;
  left: 7px;
  width: 22px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.metric-icon-opened::after {
  top: 15px;
  left: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dashboard-metric-cell span {
  grid-area: label;
  min-width: 0;
  overflow: hidden;
  color: #687383;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric-cell strong {
  grid-area: value;
  align-self: end;
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: clamp(1.12rem, 1.18vw, 1.38rem);
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric-cell small {
  grid-area: meta;
  overflow: hidden;
  color: #7b8493;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-quota-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 18px;
}

.dashboard-quota-body {
  display: grid;
  grid-template-columns: minmax(184px, 0.84fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.dashboard-quota-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: min(150px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--dashboard-primary, #484c7f) var(--quota), #e5eaf1 0);
}

.dashboard-quota-ring::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  border: 1px solid #edf1f6;
}

.dashboard-quota-ring strong,
.dashboard-quota-ring span {
  position: relative;
  z-index: 1;
}

.dashboard-quota-ring strong {
  margin-top: 10px;
  color: #111827;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}

.dashboard-quota-ring span {
  margin-top: -26px;
  color: #687383;
  font-size: 0.74rem;
  font-weight: 850;
}

.dashboard-quota-gauge {
  position: relative;
  display: grid;
  place-items: center;
  width: min(184px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  isolation: isolate;
  filter: none;
}

.dashboard-quota-gauge::before,
.dashboard-quota-gauge::after {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  content: "";
}

.dashboard-quota-gauge::before {
  background:
    conic-gradient(from -90deg, #4f5d95 0 var(--gauge), #e8edf5 var(--gauge) 100%);
  -webkit-mask: radial-gradient(circle, transparent 0 62%, #000 63% 79%, transparent 80%);
  mask: radial-gradient(circle, transparent 0 62%, #000 63% 79%, transparent 80%);
  box-shadow: none;
}

.dashboard-quota-gauge::after {
  z-index: 1;
  inset: 18px;
  border: 1px solid #e3e9f2;
  background: #ffffff;
  box-shadow:
    0 14px 28px rgba(31, 41, 55, 0.08),
    inset 0 0 0 8px #f8fafc;
}

.dashboard-quota-gauge-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  place-items: center;
  width: 112px;
  height: 112px;
  gap: 8px;
  padding: 12px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #111827;
  text-align: center;
}

.dashboard-quota-gauge-center strong {
  display: block;
  max-width: 108px;
  overflow: hidden;
  color: #111827;
  font-size: clamp(1.2rem, 1.45vw, 1.68rem);
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  text-shadow: none;
  white-space: nowrap;
}

.dashboard-quota-gauge-center span {
  margin-top: 0;
  color: #687383;
  font-size: 0.74rem;
  font-weight: 850;
}

.dashboard-quota-list {
  display: grid;
  gap: 10px;
}

.dashboard-quota-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid #e3e8f0;
  border-left: 3px solid #d8def0;
  border-radius: 0.25rem;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.dashboard-quota-list span {
  color: #687383;
  font-size: 0.78rem;
  font-weight: 850;
}

.dashboard-quota-list strong {
  color: #111827;
  font-size: 0.98rem;
  font-weight: 900;
}

.dashboard-command-grid + .dashboard-analytics-grid {
  margin-top: 0;
}

.dashboard-analytics-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.dashboard-workbench-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
}

.dashboard-feed {
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.dashboard-feed::-webkit-scrollbar {
  width: 6px;
}

.dashboard-feed::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #cbd5e1;
}

@media (max-width: 1480px) {
  .dashboard-command-grid,
  .dashboard-overview-panel,
  .dashboard-analytics-grid,
  .dashboard-workbench-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metric-matrix {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard-metric-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 620px) {
  .dashboard-overview-panel,
  .dashboard-quota-panel {
    padding: 14px;
  }

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

  .dashboard-metric-cell {
    min-height: 112px;
  }
}

/* Dashboard dimension panels */
.dashboard-dimension-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-insight-panel {
  display: grid;
  gap: 14px;
  min-height: 248px;
  padding: 16px;
  border: 1px solid var(--dashboard-border, #e2e8f0);
  border-radius: 0.25rem;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.045);
}

.dashboard-insight-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-insight-head span,
.dashboard-insight-head small {
  color: #687383;
  font-size: 0.78rem;
  font-weight: 850;
}

.dashboard-insight-head h2 {
  margin: 5px 0 0;
  color: #111827;
  font-size: 1.58rem;
  font-weight: 900;
  line-height: 1;
}

.dashboard-mini-pairs,
.dashboard-funnel-grid {
  display: grid;
  gap: 8px;
}

.dashboard-mini-pairs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-funnel-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-mini-pairs > div,
.dashboard-funnel-grid > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  background: #f8fafc;
}

.dashboard-mini-pairs span,
.dashboard-funnel-grid span {
  overflow: hidden;
  color: #687383;
  font-size: 0.74rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-mini-pairs strong,
.dashboard-funnel-grid strong {
  color: #111827;
  font-size: 1rem;
  font-weight: 900;
}

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

.dashboard-breakdown-row {
  display: grid;
  gap: 6px;
}

.dashboard-breakdown-row > div,
.dashboard-audience-columns p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}

.dashboard-breakdown-row span,
.dashboard-audience-columns span {
  min-width: 0;
  overflow: hidden;
  color: #4b5563;
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-breakdown-row strong,
.dashboard-audience-columns strong {
  color: #111827;
  font-size: 0.82rem;
  font-weight: 900;
}

.dashboard-breakdown-row i {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf1;
}

.dashboard-breakdown-row i::before {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f19828, #484c7f);
  content: "";
}

.dashboard-breakdown-empty {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 0.25rem;
  background: #f8fafc;
  color: #687383;
  font-size: 0.8rem;
  font-weight: 800;
}

.dashboard-audience-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-audience-columns > div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem;
  background: #f8fafc;
}

.dashboard-audience-columns h3 {
  margin: 0 0 2px;
  color: #687383;
  font-size: 0.76rem;
  font-weight: 900;
}

.dashboard-performance-panel .stats-bar-fill.fill-delivery {
  background: linear-gradient(90deg, #67e8f9, #0891b2);
}

@media (max-width: 1520px) {
  .dashboard-dimension-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-dimension-grid,
  .dashboard-mini-pairs,
  .dashboard-funnel-grid,
  .dashboard-audience-columns {
    grid-template-columns: 1fr;
  }

  .dashboard-insight-panel {
    min-height: 0;
  }
}

/* Dashboard icon pie cards */
.dashboard-pie-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-pie-panel {
  --pie-color: #484c7f;
  --pie-soft: rgba(72, 76, 127, 0.1);
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 168px;
  padding: 18px;
  border: 1px solid #e1e7f0;
  border-radius: 0.25rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.045);
}

.dashboard-pie-panel:hover {
  border-color: color-mix(in srgb, var(--pie-color) 28%, #dbe4ee);
  box-shadow: 0 14px 28px rgba(31, 41, 55, 0.075);
  transform: translateY(-1px);
}

.pie-quality {
  --pie-color: #16a34a;
  --pie-soft: rgba(22, 163, 74, 0.11);
}

.pie-funnel {
  --pie-color: #f19828;
  --pie-soft: rgba(241, 152, 40, 0.13);
}

.pie-template {
  --pie-color: #7c3aed;
  --pie-soft: rgba(124, 58, 237, 0.11);
}

.pie-audience {
  --pie-color: #0891b2;
  --pie-soft: rgba(8, 145, 178, 0.12);
}

.dashboard-pie-chart {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 57%, transparent 58%),
    conic-gradient(var(--pie-color) 0 var(--value), #e7edf4 var(--value) 100%);
}

.dashboard-pie-chart::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 50%;
  content: "";
}

.dashboard-pie-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--pie-soft);
  color: var(--pie-color);
}

.dashboard-pie-icon::before,
.dashboard-pie-icon::after {
  position: absolute;
  box-sizing: border-box;
  content: "";
}

.pie-icon-quality::before {
  top: 13px;
  left: 12px;
  width: 24px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.pie-icon-quality::after {
  top: 20px;
  left: 12px;
  width: 24px;
  height: 13px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 0 0 12px 12px;
}

.pie-icon-funnel::before {
  top: 12px;
  left: 11px;
  width: 26px;
  height: 12px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  transform: perspective(20px) rotateX(-18deg);
}

.pie-icon-funnel::after {
  top: 23px;
  left: 18px;
  width: 12px;
  height: 15px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  border-radius: 0 0 4px 4px;
}

.pie-icon-template::before {
  top: 10px;
  left: 14px;
  width: 20px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.pie-icon-template::after {
  top: 18px;
  left: 18px;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 7px 0 currentColor, 0 14px 0 currentColor;
}

.pie-icon-audience::before {
  top: 12px;
  left: 13px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 13px 2px 0 -2px currentColor;
}

.pie-icon-audience::after {
  top: 27px;
  left: 10px;
  width: 28px;
  height: 12px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 16px 16px;
}

.dashboard-pie-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.dashboard-pie-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-pie-head span {
  color: #687383;
  font-size: 0.82rem;
  font-weight: 900;
}

.dashboard-pie-head strong {
  color: #111827;
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.dashboard-pie-content p {
  margin: 0;
  color: #4b5563;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.5;
}

.dashboard-pie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dashboard-pie-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 26px;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid #e1e7f0;
  border-radius: 0.25rem;
  background: #f8fafc;
  color: #687383;
  font-size: 0.75rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-pie-meta b {
  color: #111827;
  font-weight: 950;
}

@media (max-width: 1520px) {
  .dashboard-pie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-pie-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-pie-panel {
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 142px;
    padding: 14px;
  }

  .dashboard-pie-chart {
    width: 92px;
    height: 92px;
  }

  .dashboard-pie-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }
}

.rich-editor-toolbar button.rich-color-swatch,
.rich-editor-toolbar button.rich-color-swatch:hover,
.rich-editor-toolbar button.rich-color-swatch:focus-visible {
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 2px solid rgba(17, 17, 17, 0.2);
  border-radius: 50%;
  background: var(--swatch-color) !important;
  background-color: var(--swatch-color) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 1px 2px rgba(17, 17, 17, 0.16);
  color: transparent !important;
  font-size: 0;
  line-height: 0;
}

.rich-editor-toolbar button.rich-color-swatch:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 17, 17, 0.38);
}

.rich-editor-toolbar button.rich-color-swatch.is-active,
.rich-editor-toolbar button.rich-color-swatch:focus-visible {
  border-color: #102440;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    0 0 0 3px rgba(47, 115, 224, 0.16);
}

/* Campaign template change dialog: body is locked, so the card must scroll. */
#template-change-modal.visible .modal-card {
  display: flex;
  flex-direction: column;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

#template-change-modal.visible .modal-header,
#template-change-modal.visible .modal-actions {
  flex: 0 0 auto;
}

#template-change-modal.visible form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

#template-change-modal.visible form > label,
#template-change-modal.visible form > p {
  margin-left: 16px;
  margin-right: 16px;
}

#template-change-modal.visible form > label:first-child {
  margin-top: 16px;
}

#template-change-modal.visible form > p {
  max-height: calc(100vh - 230px);
  max-height: calc(100dvh - 230px);
  overflow: auto;
}

#template-change-modal.visible form > .modal-actions {
  margin-top: 16px;
}

/* Campaign AI template editor: keep the modal itself scrollable after global modal overrides. */
.variant-template-modal.visible {
  overflow: hidden;
}

.variant-template-modal.visible .variant-template-scale-wrap {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

.variant-template-modal.visible .variant-template-card {
  width: min(1560px, calc(100vw - 32px));}

.variant-template-modal.visible .variant-template-card > .modal-header {
  flex: 0 0 auto;
}

.variant-template-modal.visible .variant-template-preview {
  flex: 0 0 auto;
  max-height: 190px;
  overflow: auto;
}

.variant-template-modal.visible .variant-review-form {
  gap: 14px;
  margin: 0;}

.variant-template-modal.visible .variant-review-form > label {
  margin: 0;
}


.variant-template-modal.visible .variant-review-form .rich-editor,
.variant-template-modal.visible .variant-review-form .mail-preview-panel {
  min-height: 0;
}


.variant-template-modal.visible .variant-review-form .rich-editor-surface,
.variant-template-modal.visible .variant-review-form .mail-preview-frame {
  height: clamp(260px, calc(100dvh - 540px), 520px);
  min-height: 0;
  max-height: none;}

.variant-template-modal.visible .variant-review-form .mail-preview-frame {
  overflow: hidden;
}

.variant-template-modal.visible .variant-review-form .mail-preview-body {
  min-height: 0;
  overflow: auto;
}

.variant-template-modal.visible .variant-review-form .modal-actions {
  bottom: auto;
  z-index: 5;
  margin: 0 -28px -28px;
  padding: 14px 28px;
  border-top: 1px solid var(--border-color);
  background: #fbfcff;}

/* Mailbox test dialog: keep the header/actions visible and scroll only the result list. */
#mailbox-test-modal.visible {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 18px;
  overflow: hidden;
}

#mailbox-test-modal.visible .modal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, calc(100vw - 36px));
  height: min(760px, calc(100vh - 36px));
  height: min(760px, calc(100dvh - 36px));
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#mailbox-test-modal.visible .modal-header,
#mailbox-test-modal.visible .modal-actions {
  margin: 0;
  flex: 0 0 auto;
}

#mailbox-test-modal.visible .table-wrap {
  min-height: 0;
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

#mailbox-test-modal.visible table {
  min-width: 820px;
}

#mailbox-test-modal.visible thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcff;
}

@media (max-width: 720px) {
  #mailbox-test-modal.visible {
    padding: 10px;
  }

  #mailbox-test-modal.visible .modal-card {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .reply-to-bulk-row {
    grid-template-columns: 1fr;
  }
}

/* Keep the template editor inside the viewport without stacking modal scrollbars. */
.template-edit-modal.visible {
  overflow: hidden;
}

.template-edit-modal.visible .template-editor-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1480px, calc(100vw - 36px));
  height: calc(100vh - 36px);
  height: calc(100dvh - 36px);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.template-edit-modal.visible .template-editor-card > .modal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: #fbfcff;
}

.template-edit-modal.visible .template-editor-card > .modal-header .icon-btn {
  position: relative;
  z-index: 31;
  flex: 0 0 auto;
}

.template-edit-modal.visible .template-edit-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}

.template-edit-modal.visible .template-edit-scrollarea {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 14px 20px 18px;
  overflow: hidden;
}

.template-edit-modal.visible .template-edit-settings {
  display: grid;
  grid-template-columns:
    minmax(170px, 1fr)
    minmax(120px, 0.62fr)
    minmax(140px, 0.72fr)
    minmax(220px, 1.35fr)
    minmax(140px, 0.72fr);
  gap: 10px 12px;
  min-height: 0;
  padding: 10px 12px;
  overflow: visible;
  border: 1px solid rgba(99, 118, 157, 0.16);
  border-radius: 10px;
  background: rgba(247, 249, 252, 0.78);
}

.template-edit-modal.visible .template-edit-settings label {
  min-width: 0;
  gap: 6px;
}

.template-edit-modal.visible .template-edit-settings span {
  font-size: 12px;
}

.template-edit-modal.visible .template-edit-settings input,
.template-edit-modal.visible .template-edit-settings select {
  min-height: 38px;
}

.template-edit-modal.visible .template-edit-form .modal-actions {
  position: static;
  inset: auto;
  bottom: auto;
  flex: 0 0 auto;
  z-index: 5;
  margin: 0;
  padding: 12px 20px 14px;
  transform: none;
}

.template-edit-modal.visible .rich-editor,
.template-edit-modal.visible .mail-preview-panel {
  height: 100%;
  min-height: 0;
}

.template-edit-modal.visible .rich-editor-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  align-content: stretch;
}

.template-edit-modal.visible .rich-editor {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: none;
}

.template-edit-modal.visible .rich-review-layout {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  height: 100%;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}

.template-edit-modal.visible .mail-preview-frame {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.template-edit-modal.visible .mail-preview-frame {
  overflow: hidden;
}

.template-edit-modal.visible .rich-editor-surface {
  overflow: auto;
  height: auto;
  min-height: 0;
  max-height: none;
  scroll-padding-bottom: 24px;
}

.template-edit-modal.visible .mail-preview-body {
  min-height: 0;
  overflow: auto;
  scroll-padding-bottom: 24px;
}

.template-edit-modal.visible .rich-html-source {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 8;
  max-height: calc(100% - 20px);
  margin: 0;
  overflow: auto;
  background: #fff;
}

.template-edit-modal.visible .rich-html-source:not([open]) {
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.template-edit-modal.visible .rich-html-source:not([open]) summary {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.template-edit-modal.visible .rich-html-source[open] {
  left: 10px;
  padding: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.template-edit-modal.visible .rich-html-source textarea {
  min-height: 120px;
}

@media (max-width: 900px) {
  .template-edit-modal.visible .template-edit-settings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .template-edit-modal.visible .template-edit-scrollarea {
    display: block;
    overflow-y: auto;
  }

  .template-edit-modal.visible .rich-review-layout {
    grid-template-columns: 1fr;
    height: auto;
    margin-top: 14px;
    overflow: visible;
  }

  .template-edit-modal.visible .rich-editor,
  .template-edit-modal.visible .mail-preview-frame {
    height: clamp(360px, 52dvh, 560px);
  }
}

/* Dashboard channel, chart and visual polish */
.dashboard-shell {
  --dashboard-ink: #172033;
  --dashboard-muted: #6f7b90;
  --dashboard-border: #e4e9f2;
  --dashboard-surface: #ffffff;
  display: grid;
  gap: 20px;
  padding-bottom: 24px;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid #e2e7f0;
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% -35%, rgba(78, 91, 150, 0.16), transparent 38%),
    linear-gradient(135deg, #ffffff 0%, #f8f9fd 100%);
  box-shadow: 0 12px 34px rgba(26, 34, 66, 0.07);
}

.dashboard-title-block {
  display: grid;
  gap: 4px;
}

.dashboard-eyebrow {
  color: #646a9b;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.dashboard-topbar h1 {
  margin: 0;
  color: var(--dashboard-ink);
  font-size: clamp(1.55rem, 2.2vw, 2.05rem);
  line-height: 1.15;
}

.dashboard-subtitle,
.dashboard-panel-caption {
  margin: 4px 0 0;
  color: var(--dashboard-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.dashboard-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.dashboard-topbar-actions .ghost-btn,
.dashboard-topbar-actions .secondary-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-topbar-actions .ghost-btn:hover,
.dashboard-topbar-actions .secondary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 41, 79, 0.1);
}

.dashboard-kpi-strip-core {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-kpi-card {
  --kpi-color: #4f46e5;
  --kpi-soft: #eef2ff;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value"
    "icon meta";
  align-items: center;
  min-height: 118px;
  gap: 2px 14px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid #e2e7f0;
  border-radius: 16px;
  background:
    radial-gradient(circle at 96% 0%, var(--kpi-soft), transparent 46%),
    #fff;
  box-shadow: 0 10px 28px rgba(30, 40, 72, 0.065);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(30, 40, 72, 0.1);
}

.dashboard-kpi-card::before {
  content: "•";
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--kpi-soft);
  color: var(--kpi-color);
  font-size: 1.5rem;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-color) 16%, transparent);
}

.dashboard-kpi-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  width: 4px;
  background: var(--kpi-color);
}

.dashboard-kpi-card.tone-sent {
  --kpi-color: #15956f;
  --kpi-soft: #e9f8f2;
}

.dashboard-kpi-card.tone-sent::before {
  content: "↗";
}

.dashboard-kpi-card.tone-campaigns {
  --kpi-color: #6d5bd0;
  --kpi-soft: #f0edff;
}

.dashboard-kpi-card.tone-campaigns::before {
  content: "◆";
}

.dashboard-kpi-card.tone-replies {
  --kpi-color: #d98516;
  --kpi-soft: #fff5df;
}

.dashboard-kpi-card.tone-replies::before {
  content: "↩";
}

.dashboard-kpi-card.tone-opened {
  --kpi-color: #178ca6;
  --kpi-soft: #e7f7fa;
}

.dashboard-kpi-card.tone-opened::before {
  content: "◉";
}

.dashboard-kpi-card > span {
  grid-area: label;
  color: #667085;
  font-size: 0.76rem;
  font-weight: 850;
}

.dashboard-kpi-card > strong {
  grid-area: value;
  color: var(--dashboard-ink);
  font-size: clamp(1.55rem, 2vw, 1.92rem);
  font-weight: 950;
  line-height: 1.1;
}

.dashboard-kpi-card > small {
  grid-area: meta;
  color: #7c879b;
  font-size: 0.72rem;
  font-weight: 700;
}

.dashboard-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-channel-card {
  --channel-color: #0f766e;
  --channel-soft: #ecfdf5;
  position: relative;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #e1e7ef;
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, var(--channel-soft), transparent 48%),
    #fff;
  box-shadow: 0 10px 28px rgba(30, 40, 72, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-channel-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--channel-color), color-mix(in srgb, var(--channel-color) 35%, transparent));
}

.dashboard-channel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(30, 40, 72, 0.1);
}

.channel-ordinary {
  --channel-color: #356ee6;
  --channel-soft: #edf3ff;
}

.channel-smart_revenue {
  --channel-color: #13826f;
  --channel-soft: #eaf8f3;
}

.channel-smart_startup {
  --channel-color: #cb5b22;
  --channel-soft: #fff1e8;
}

.dashboard-channel-heading,
.dashboard-performance-channel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-channel-kicker {
  color: var(--channel-color);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.dashboard-channel-heading h2 {
  margin: 5px 0 0;
  color: var(--dashboard-ink);
  font-size: 1.03rem;
  font-weight: 900;
}

.dashboard-channel-total {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.dashboard-channel-total span {
  color: #8390a4;
  font-size: 0.66rem;
  font-weight: 800;
}

.dashboard-channel-total strong {
  color: var(--channel-color);
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
}

.dashboard-channel-grid-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-channel-grid-values > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid color-mix(in srgb, var(--channel-color) 10%, #e5eaf1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-channel-grid-values span,
.dashboard-performance-stats span {
  color: #798599;
  font-size: 0.69rem;
  font-weight: 800;
}

.dashboard-channel-grid-values b {
  color: var(--dashboard-ink);
  font-size: 1rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.dashboard-channel-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dashboard-channel-rates span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border: 1px solid #e6eaf0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #657085;
  font-size: 0.69rem;
  font-weight: 850;
}

.dashboard-channel-rates .rate-reply {
  border-color: color-mix(in srgb, var(--channel-color) 18%, #e6eaf0);
  color: var(--channel-color);
}

.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.78fr);
  gap: 18px;
  align-items: start;
}

.dashboard-activity-panel,
.dashboard-performance-panel {
  overflow: hidden;
  border: 1px solid #e1e7ef;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(30, 40, 72, 0.07);
}

.dashboard-panel-header,
.dashboard-activity-panel > .dashboard-panel-header,
.dashboard-performance-panel > .dashboard-panel-header {
  min-height: 70px;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid #edf0f5;
  background: linear-gradient(180deg, #fff, #fcfdff);
}

.dashboard-panel-header h2 {
  color: var(--dashboard-ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.dashboard-trend-controls {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.dashboard-segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid #e1e6ee;
  border-radius: 10px;
  background: #f4f6fa;
}

.dashboard-segmented a {
  min-height: 27px;
  padding: 5px 10px;
  border-radius: 7px;
  color: #6f7a8d;
  font-size: 0.7rem;
  font-weight: 850;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-segmented a:hover {
  background: #e9edf4;
  color: #333b51;
}

.dashboard-segmented a.is-active {
  background: #343957;
  color: #fff;
  box-shadow: 0 4px 10px rgba(52, 57, 87, 0.22);
}

.dashboard-activity-panel > .dashboard-line-chart {
  margin: 18px 20px 14px;
}

.dashboard-line-chart {
  position: relative;
  min-width: 0;
  padding: 58px 18px 16px 70px;
  border: 1px solid #e4e9f1;
  border-radius: 15px;
  background:
    radial-gradient(circle at 92% 4%, rgba(81, 92, 153, 0.08), transparent 35%),
    linear-gradient(180deg, #fbfcff, #f7f9fc);
}

.dashboard-line-plot {
  position: relative;
  height: 254px;
}

.dashboard-line-chart svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.dashboard-line-grid line {
  stroke: #e4e9f1;
  stroke-width: 0.42;
  vector-effect: non-scaling-stroke;
}

.dashboard-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 4px rgba(31, 43, 83, 0.12));
}

.dashboard-line-ordinary {
  stroke: #356ee6;
}

.dashboard-line-smart_revenue {
  stroke: #13826f;
}

.dashboard-line-smart_startup {
  stroke: #cb5b22;
}

.dashboard-line-scale {
  position: absolute;
  top: 58px;
  bottom: auto;
  left: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 254px;
  color: #8792a4;
  font-size: 0.66rem;
  font-weight: 800;
  text-align: right;
}

.dashboard-line-legend {
  position: absolute;
  top: 15px;
  right: 18px;
  left: 70px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.dashboard-line-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #e2e7ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #536075;
  font-size: 0.68rem;
  font-weight: 850;
  box-shadow: 0 4px 10px rgba(31, 41, 72, 0.04);
}

.swatch-ordinary {
  background: #356ee6;
}

.swatch-smart_revenue {
  background: #13826f;
}

.swatch-smart_startup {
  background: #cb5b22;
}

.dashboard-line-points {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dashboard-line-point {
  --point-color: #356ee6;
  position: absolute;
  left: var(--point-x);
  top: var(--point-y);
  z-index: 2;
  width: 12px;
  height: 12px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.dashboard-line-point i {
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--point-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--point-color) 35%, transparent), 0 4px 9px rgba(31, 41, 72, 0.2);
  transition: transform 0.16s ease;
}

.dashboard-line-point:hover i {
  transform: scale(1.35);
}

.dashboard-line-point::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: 20;
  width: max-content;
  max-width: 210px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #22283d;
  color: #fff;
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

.dashboard-line-point:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.point-ordinary {
  --point-color: #356ee6;
}

.point-smart_revenue {
  --point-color: #13826f;
}

.point-smart_startup {
  --point-color: #cb5b22;
}

.dashboard-line-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
  margin-top: 9px;
  color: #7b8799;
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
}

.dashboard-line-values-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid #e6eaf1;
}

.dashboard-line-values-heading strong {
  color: #30394f;
  font-size: 0.76rem;
  font-weight: 900;
}

.dashboard-line-values-heading span {
  color: #8490a3;
  font-size: 0.67rem;
  font-weight: 750;
}

.dashboard-line-values {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(56px, 1fr);
  gap: 4px;
  margin-top: 9px;
  padding: 1px 1px 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.dashboard-line-value-day {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.dashboard-line-value-day > strong {
  color: #3f485d;
  font-size: 0.69rem;
  font-weight: 900;
}

.dashboard-line-value-day > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
  color: #6b7588;
  font-size: 0.59rem;
}

.dashboard-line-value-day b {
  overflow: hidden;
  color: #283146;
  font-size: 0.61rem;
  font-weight: 900;
  text-overflow: ellipsis;
}

.dashboard-series-summary-lines {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-activity-panel > .dashboard-series-summary {
  margin: 0 20px 20px;
}

.dashboard-series-summary {
  gap: 9px;
}

.dashboard-series-row {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  background: #fbfcfe;
}

.dashboard-series-row strong {
  color: var(--dashboard-ink);
  font-size: 1rem;
  font-weight: 950;
}

.dashboard-performance-panel > .dashboard-performance-table {
  margin: 18px 20px 20px;
}

.dashboard-performance-table {
  display: grid;
  gap: 12px;
}

.dashboard-performance-channel {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--channel-color) 16%, #e2e7ef);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.85), transparent),
    var(--channel-soft);
}

.dashboard-performance-channel-title strong {
  color: var(--dashboard-ink);
  font-size: 0.83rem;
  font-weight: 900;
}

.dashboard-performance-channel-title span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #687487;
  font-size: 0.65rem;
  font-weight: 850;
}

.dashboard-performance-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.dashboard-performance-stats span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.68);
}

.dashboard-performance-stats b {
  color: var(--dashboard-ink);
  font-size: 0.9rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.dashboard-performance-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(208, 216, 229, 0.72);
}

.dashboard-performance-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--channel-color) 72%, white), var(--channel-color));
}

@media (max-width: 1180px) {
  .dashboard-kpi-strip-core {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (max-width: 760px) {
  .dashboard-topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .dashboard-topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .dashboard-topbar-actions .ghost-btn,
  .dashboard-topbar-actions .secondary-btn {
    width: 100%;
  }

  .dashboard-kpi-strip-core,
  .dashboard-series-summary-lines {
    grid-template-columns: 1fr;
  }

  .dashboard-channel-grid-values,
  .dashboard-performance-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .dashboard-trend-controls {
    justify-items: start;
  }

  .dashboard-activity-panel > .dashboard-line-chart,
  .dashboard-activity-panel > .dashboard-series-summary,
  .dashboard-performance-panel > .dashboard-performance-table {
    margin-right: 12px;
    margin-left: 12px;
  }

  .dashboard-line-chart {
    padding: 58px 12px 14px 54px;
  }

  .dashboard-line-legend {
    left: 54px;
  }

  .dashboard-line-scale {
    left: 9px;
  }

  .dashboard-line-plot,
  .dashboard-line-scale {
    height: 220px;
  }

  .dashboard-line-labels {
    font-size: 0.58rem;
  }
}
@media (max-width: 720px) {
  .template-edit-modal.visible {
    padding: 10px;
  }

  .template-edit-modal.visible .template-editor-card {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }

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

  .template-edit-modal.visible .rich-editor,
  .template-edit-modal.visible .mail-preview-frame {
    height: clamp(320px, 52dvh, 480px);
  }
}


.stats-org-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;}

.stats-org-hero h1 {
  margin: 10px 0 0;
  line-height: 1.2;}

.stats-rate-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;}

.stats-rate-pills span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid rgba(99, 118, 157, 0.14);
  font-size: 12px;}


.stats-org-kpis {
  display: grid;}

.stats-org-kpis article {
  min-height: 108px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(24, 39, 75, 0.08);
  background: #fff;
  box-shadow: 0 12px 30px rgba(31, 51, 95, 0.06);
}

.stats-org-kpis span,
.stats-org-kpis small {
  display: block;
  font-size: 12px;}

.stats-org-kpis strong {
  display: block;
  line-height: 1.05;}

.stats-org-grid {
  display: grid;}

.stats-org-panel {
  overflow: hidden;
}


.stats-org-table th,
.stats-org-table td {
  white-space: nowrap;
}

.stats-org-dimensions {
  display: grid;}

@media (max-width: 1280px) {
  .stats-org-toolbar,
  .stats-org-grid {
    grid-template-columns: 1fr;
  }

  .stats-org-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-org-dimensions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .stats-org-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-rate-pills {
    justify-content: flex-start;
  }

  .stats-org-kpis,
  .stats-org-dimensions {
    grid-template-columns: 1fr;
  }
}

button.is-send-locked,
button:disabled.is-send-locked,
input.is-send-locked,
select.is-send-locked,
textarea.is-send-locked {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.18);
}

button[data-allow-while-sending]:disabled:not(.is-send-locked) {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Outbox picker modal: single source of truth. */
#outbox-picker-modal.visible {
  position: fixed;
  inset: 0;
  z-index: 220000;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 24px;
  overflow: hidden;
  box-sizing: border-box;
}

#outbox-picker-modal.visible .modal-card-wide {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1180px, calc(100vw - 48px));
  max-width: min(1180px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 48px));
  height: min(760px, calc(100dvh - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  box-sizing: border-box;
}

#outbox-picker-modal.visible .modal-header {
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

#outbox-picker-modal.visible .mailbox-group-picker {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(260px, 1fr) minmax(0, auto);
  gap: 10px;
  align-items: end;
  min-height: 0;
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

#outbox-picker-modal.visible .outbox-picker-toolbar-actions {
  align-self: end;
}

#outbox-picker-modal.visible .mailbox-group-picker label {
  min-width: 0;
  margin: 0;
}

#outbox-picker-modal.visible .mailbox-group-picker select,
#outbox-picker-modal.visible .mailbox-group-picker input {
  width: 100%;
  min-height: 38px;
}

#outbox-picker-modal.visible .campaign-outbox-group-list {
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 12px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #f4f6fa;
}

#outbox-picker-modal.visible .campaign-outbox-group {
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #fff;
}

#outbox-picker-modal.visible .campaign-outbox-group + .campaign-outbox-group {
  margin-top: 12px;
}

#outbox-picker-modal.visible .campaign-outbox-group[hidden] {
  display: none;
}

#outbox-picker-modal.visible .campaign-outbox-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid #e8edf3;
  background: #fbfcfe;
}

#outbox-picker-modal.visible .campaign-outbox-group-header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

#outbox-picker-modal.visible .campaign-outbox-group-header strong {
  overflow: hidden;
  color: #26364a;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#outbox-picker-modal.visible .campaign-outbox-group-header span {
  color: #7a8799;
  font-size: 0.76rem;
  white-space: nowrap;
}

#outbox-picker-modal.visible .campaign-outbox-group .outbox-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  background: #fff;
}

#outbox-picker-modal.visible .outbox-choice-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 14px;
  min-height: 56px;
  margin: 0;
  padding: 8px 12px 8px 42px;
  border: 1px solid #e4e9f3;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

#outbox-picker-modal.visible .outbox-choice-card[hidden] {
  display: none;
}

#outbox-picker-modal.visible .outbox-choice-card:hover {
  border-color: #b9c7df;
  background: #fbfdff;
}

#outbox-picker-modal.visible .outbox-choice-card:has(input:checked) {
  border-color: #4085f5;
  background: #f4f8ff;
}

#outbox-picker-modal.visible .outbox-choice-indicator {
  top: 18px;
  left: 14px;
  width: 18px;
  height: 18px;
}

#outbox-picker-modal.visible .outbox-choice-indicator::after {
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
}

#outbox-picker-modal.visible .choice-card-title {
  grid-column: 1;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.2;
}

#outbox-picker-modal.visible .choice-card-title > span:first-child,
#outbox-picker-modal.visible .choice-card-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#outbox-picker-modal.visible .choice-card-subtitle {
  grid-column: 1;
  color: #536179;
  font-size: 0.78rem;
}

#outbox-picker-modal.visible .choice-card-meta {
  color: #6d7890;
  font-size: 0.72rem;
  line-height: 1.2;
}

#outbox-picker-modal.visible [data-outbox-quota-meta] {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  max-width: 180px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#outbox-picker-modal.visible .choice-card-meta:not([data-outbox-quota-meta]) {
  grid-column: 1 / -1;
  margin-top: 2px;
}

#outbox-picker-modal.visible .outbox-filter-empty {
  margin: 18px 0;
  text-align: center;
}

#outbox-picker-modal.visible .modal-actions {
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  z-index: 5;
}

#outbox-picker-modal.visible .outbox-picker-count {
  margin-right: auto;
  color: #536179;
  font-size: 0.86rem;
}

#outbox-picker-modal.visible .modal-actions button {
  min-height: 38px;
  white-space: nowrap;
}

@media (max-width: 760px), (max-height: 640px) {
  #outbox-picker-modal.visible {
    padding: 12px;
  }

  #outbox-picker-modal.visible .modal-card-wide {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  #outbox-picker-modal.visible .mailbox-group-picker {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 12px;
  }

  #outbox-picker-modal.visible .mailbox-group-picker button {
    width: 100%;
  }

  #outbox-picker-modal.visible .outbox-picker-toolbar-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #outbox-picker-modal.visible .campaign-outbox-group-list {
    padding: 8px;
  }

  #outbox-picker-modal.visible .campaign-outbox-group .outbox-choice-grid {
    grid-template-columns: 1fr;
    padding: 6px 8px;
  }

  #outbox-picker-modal.visible .outbox-choice-card {
    grid-template-columns: minmax(0, 1fr);
    min-height: 52px;
    padding: 8px 10px 8px 38px;
  }

  #outbox-picker-modal.visible [data-outbox-quota-meta] {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    max-width: 100%;
    text-align: left;
  }

  #outbox-picker-modal.visible .choice-card-meta:not([data-outbox-quota-meta]) {
    display: none;
  }

  #outbox-picker-modal.visible .modal-actions {
    padding: 8px 12px;
  }
}

@media (max-width: 520px) {
  #outbox-picker-modal.visible .mailbox-group-picker {
    grid-template-columns: 1fr;
  }

  #outbox-picker-modal.visible .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #outbox-picker-modal.visible .outbox-picker-count {
    grid-column: 1 / -1;
  }

  #outbox-picker-modal.visible .outbox-picker-toolbar-actions {
    grid-template-columns: 1fr;
  }
}
.phase-progress-bar {
  background: linear-gradient(180deg, #89999d, #667377) !important;
}

.phase-progress-bar .progress-bar-fill,
.phase-mini-progress span {
  background-color: #35dc58 !important;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 38%),
    linear-gradient(90deg, #fdd447 0%, #b7e442 42%, #35dc58 100%) !important;
  background-size: auto !important;
  animation: none !important;
}

.phase-mini-progress {
  background: linear-gradient(180deg, #89999d, #667377) !important;
}

.send-blower-filler {
  background-color: #f07813 !important;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 36%),
    linear-gradient(90deg, #ffb01f, #f07813) !important;
  background-size: auto !important;
  animation: none !important;
}

.campaign-company-list {
  display: grid !important;
  gap: 18px !important;
  margin: 0 16px 16px !important;
}

.campaign-filter-form {
  display: grid !important;
  grid-template-columns: minmax(180px, 0.85fr) minmax(220px, 1.1fr) minmax(240px, 1.3fr) auto !important;
  gap: 12px !important;
  align-items: end !important;
  margin: 0 16px 16px !important;
  padding: 14px !important;
  border: 1px solid rgba(83, 146, 220, 0.16) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.74) !important;
}

.campaign-filter-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.campaign-company-group {
  overflow: hidden !important;
  border: 1px solid rgba(83, 146, 220, 0.16) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow:
    0 14px 32px rgba(43, 95, 166, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78) !important;
}

.campaign-company-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(83, 146, 220, 0.14) !important;
  background:
    linear-gradient(90deg, rgba(120, 200, 255, 0.16), rgba(255, 255, 255, 0.72)) !important;
}

.campaign-company-group .table-wrap {
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.campaign-company-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  padding: 10px 16px 14px !important;
  border-top: 1px solid rgba(83, 146, 220, 0.12) !important;
  background: rgba(255, 255, 255, 0.64) !important;
}

.campaign-company-load-more {
  min-height: 36px !important;
  padding: 8px 12px !important;
  white-space: nowrap !important;
}

@media (max-width: 1100px) {
  .campaign-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 680px) {
  .campaign-filter-form {
    grid-template-columns: 1fr !important;
  }
}

.rich-editor-surface span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.variant-template-modal.visible .variant-template-card {
  display: flex !important;
  flex-direction: column !important;
  height: calc(100dvh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.variant-template-modal.visible .variant-review-form {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.variant-template-modal.visible .variant-review-form .modal-actions {
  position: static !important;
  inset: auto !important;
  flex: 0 0 auto !important;
  transform: none !important;
}

.variant-template-modal.visible .variant-review-form .rich-review-layout {
  min-height: 0 !important;
  align-items: stretch !important;
  overflow: hidden !important;
}

.variant-template-modal.visible .variant-review-form .rich-editor {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  min-height: 0 !important;
}

.variant-template-modal.visible .variant-review-form .rich-editor,
.variant-template-modal.visible .variant-review-form .mail-preview-frame {
  height: clamp(300px, calc(100dvh - 570px), 460px) !important;
  max-height: clamp(300px, calc(100dvh - 570px), 460px) !important;
}

.variant-template-modal.visible .variant-review-form .rich-editor-surface,
.variant-template-modal.visible .variant-review-form .mail-preview-frame {
  scroll-padding-bottom: 120px !important;
}

.variant-template-modal.visible .variant-review-form .rich-editor-surface {
  overflow: auto !important;
}

.variant-template-modal.visible .variant-review-form .mail-preview-frame {
  overflow: hidden !important;
}

.variant-template-modal.visible .variant-review-form .rich-editor-surface {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.variant-template-modal.visible .variant-review-form .rich-editor-surface {
  padding-bottom: 120px !important;
}

.variant-template-modal.visible .variant-review-form .mail-preview-body {
  min-height: 0 !important;
  overflow: auto !important;
  padding-bottom: 120px !important;
}

/* Final statistics page polish: role-aware sections, cleaner hierarchy, and compact tables. */
.stats-org-page {
  gap: 16px !important;
}

.stats-org-toolbar {
  grid-template-columns: minmax(210px, 0.72fr) minmax(420px, 1fr) auto !important;
  align-items: center !important;
  padding: 12px !important;
  border: 1px solid rgba(83, 146, 220, 0.16) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 255, 0.9)) !important;
  box-shadow: 0 14px 34px rgba(43, 95, 166, 0.08) !important;
}

.stats-org-toolbar .stats-command-meta {
  min-height: 46px !important;
  border-color: rgba(83, 146, 220, 0.14) !important;
  background: rgba(255, 255, 255, 0.78) !important;
}

.stats-org-toolbar .stats-command-form {
  grid-template-columns: minmax(128px, 0.9fr) minmax(132px, 0.72fr) minmax(132px, 0.72fr) auto !important;
  gap: 10px !important;
}

.stats-org-toolbar .stats-filter-form label span {
  color: #5d6f8a !important;
  font-size: 0.74rem !important;
  font-weight: 900 !important;
}

.stats-org-toolbar select,
.stats-org-toolbar input[type="date"] {
  min-height: 38px !important;
  border-color: rgba(83, 146, 220, 0.16) !important;
  border-radius: 8px !important;
  background-color: #fff !important;
}

.stats-org-hero {
  position: relative !important;
  align-items: center !important;
  min-height: 132px !important;
  padding: 22px 24px !important;
  overflow: hidden !important;
  border: 1px solid rgba(83, 146, 220, 0.16) !important;
  border-radius: 12px !important;
  background:
    radial-gradient(circle at 88% 6%, rgba(45, 140, 240, 0.14), transparent 18rem),
    linear-gradient(135deg, #ffffff 0%, #f4f8ff 55%, #eef7f2 100%) !important;
  box-shadow:
    0 18px 44px rgba(43, 95, 166, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
}

.stats-org-hero::before {
  position: absolute;
  right: -32px;
  top: -52px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(14, 122, 99, 0.08);
  content: "";
}

.stats-org-hero > * {
  position: relative;
  z-index: 1;
}

.stats-org-hero h1 {
  margin-top: 12px !important;
  color: #13223a !important;
  font-size: clamp(1.55rem, 2vw, 2.05rem) !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
}

.stats-role-self {
  min-height: 116px !important;
}

.stats-role-leader {
  background:
    radial-gradient(circle at 88% 6%, rgba(14, 122, 99, 0.13), transparent 18rem),
    linear-gradient(135deg, #ffffff 0%, #f4fbf8 58%, #eef6ff 100%) !important;
}

.stats-rate-pills {
  max-width: 660px !important;
  gap: 9px !important;
}

.stats-rate-pills span {
  min-height: 36px !important;
  padding: 8px 12px !important;
  border-color: rgba(83, 146, 220, 0.16) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: 0 8px 18px rgba(43, 95, 166, 0.06) !important;
  color: #61708a !important;
  font-weight: 850 !important;
}

.stats-rate-pills strong {
  color: #10243d !important;
  font-weight: 950 !important;
}

.stats-org-kpis {
  grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)) !important;
  gap: 12px !important;
}

.stats-org-kpi-card {
  position: relative !important;
  min-height: 112px !important;
  padding: 16px 16px 14px !important;
  overflow: hidden !important;
  border: 1px solid rgba(83, 146, 220, 0.15) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
  box-shadow: 0 12px 30px rgba(43, 95, 166, 0.07) !important;
}

.stats-org-kpi-card::before {
  display: block;
  width: 32px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #2d8cf0;
  content: "";
}

.stats-org-kpi-2::before,
.stats-org-kpi-3::before {
  background: #0e7a63;
}

.stats-org-kpi-4::before,
.stats-org-kpi-5::before {
  background: #8b5cf6;
}

.stats-org-kpi-6::before {
  background: #d65b5b;
}

.stats-org-kpi-7::before {
  background: #f59e0b;
}

.stats-org-kpis span,
.stats-org-kpis small {
  color: #61708a !important;
  font-weight: 850 !important;
}

.stats-org-kpis strong {
  margin: 7px 0 6px !important;
  color: #10243d !important;
  font-size: clamp(1.35rem, 2vw, 1.75rem) !important;
  font-weight: 950 !important;
}

.stats-org-grid {
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)) !important;
  gap: 14px !important;
}

.stats-org-grid.single {
  grid-template-columns: minmax(0, 1fr) !important;
}

.stats-org-panel {
  padding: 16px !important;
  border: 1px solid rgba(83, 146, 220, 0.16) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 14px 34px rgba(43, 95, 166, 0.08) !important;
}

.stats-org-panel .dashboard-panel-header {
  align-items: center !important;
  margin-bottom: 12px !important;
}

.stats-org-panel .dashboard-panel-header h2 {
  color: #13223a !important;
  font-size: 1rem !important;
  font-weight: 950 !important;
}

.stats-org-panel .dashboard-panel-header p {
  margin: 4px 0 0 !important;
  font-size: 0.78rem !important;
}

.stats-org-panel .stats-table-wrap {
  margin: 0 !important;
  overflow: auto !important;
  border: 1px solid rgba(83, 146, 220, 0.12) !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.stats-org-table {
  min-width: 1040px !important;
}

.stats-org-table th {
  position: sticky !important;
  top: 0 !important;
  z-index: 1 !important;
  background: #f5f8fc !important;
  color: #5d6f8a !important;
  font-size: 0.75rem !important;
  font-weight: 950 !important;
}

.stats-org-table td {
  color: #23324a !important;
  font-size: 0.8rem !important;
  font-weight: 750 !important;
}

.stats-org-table td:first-child strong {
  color: #122033 !important;
  font-weight: 950 !important;
}

.stats-company-tree {
  display: grid !important;
  gap: 10px !important;
}

.stats-company-detail {
  overflow: hidden !important;
  border: 1px solid rgba(83, 146, 220, 0.14) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

.stats-company-detail summary {
  display: grid !important;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2fr) !important;
  gap: 12px !important;
  align-items: center !important;
  padding: 13px 15px !important;
  cursor: pointer !important;
  list-style: none !important;
  user-select: none !important;
}

.stats-company-detail summary::-webkit-details-marker {
  display: none !important;
}

.stats-company-detail summary::before {
  content: "›" !important;
  width: 24px !important;
  height: 24px !important;
  display: inline-grid !important;
  place-items: center !important;
  position: absolute !important;
  margin-left: -2px !important;
  color: #2d8cf0 !important;
  font-size: 1.25rem !important;
  font-weight: 950 !important;
  transform: translateX(-2px) rotate(0deg) !important;
  transition: transform 0.18s ease !important;
}

.stats-company-detail[open] summary::before {
  transform: translateX(-2px) rotate(90deg) !important;
}

.stats-company-title {
  min-width: 0 !important;
  padding-left: 26px !important;
}

.stats-company-title strong {
  display: block !important;
  overflow: hidden !important;
  color: #122033 !important;
  font-size: 0.95rem !important;
  font-weight: 950 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.stats-company-title span {
  display: block !important;
  margin-top: 3px !important;
  color: #6b7a90 !important;
  font-size: 0.76rem !important;
  font-weight: 850 !important;
}

.stats-company-metrics {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(86px, 1fr)) !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.stats-company-metrics span {
  min-width: 0 !important;
  padding: 7px 9px !important;
  border-radius: 8px !important;
  background: #f5f8fc !important;
  color: #66758b !important;
  font-size: 0.74rem !important;
  font-weight: 850 !important;
  white-space: nowrap !important;
}

.stats-company-metrics b {
  margin-left: 5px !important;
  color: #13223a !important;
  font-size: 0.82rem !important;
  font-weight: 950 !important;
}

.stats-company-empty {
  padding: 18px !important;
}

.stats-person-list {
  display: grid !important;
  gap: 9px !important;
  padding: 0 12px 12px !important;
}

.stats-person-detail {
  overflow: hidden !important;
  border: 1px solid rgba(83, 146, 220, 0.12) !important;
  border-radius: 9px !important;
  background: #fbfdff !important;
}

.stats-person-detail summary {
  display: grid !important;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 2.3fr) !important;
  gap: 10px !important;
  align-items: center !important;
  padding: 11px 13px !important;
  cursor: pointer !important;
  list-style: none !important;
  user-select: none !important;
}

.stats-person-detail summary::-webkit-details-marker {
  display: none !important;
}

.stats-person-detail summary::before {
  content: "›" !important;
  width: 22px !important;
  height: 22px !important;
  display: inline-grid !important;
  place-items: center !important;
  position: absolute !important;
  color: #4b83d1 !important;
  font-size: 1.15rem !important;
  font-weight: 950 !important;
  transform: translateX(-1px) rotate(0deg) !important;
  transition: transform 0.18s ease !important;
}

.stats-person-detail[open] summary::before {
  transform: translateX(-1px) rotate(90deg) !important;
}

.stats-person-title {
  min-width: 0 !important;
  padding-left: 24px !important;
}

.stats-person-title strong {
  display: block !important;
  overflow: hidden !important;
  color: #15243a !important;
  font-size: 0.88rem !important;
  font-weight: 950 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.stats-person-title span {
  display: block !important;
  margin-top: 3px !important;
  color: #6d7c91 !important;
  font-size: 0.72rem !important;
  font-weight: 850 !important;
}

.stats-person-metrics {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(68px, 1fr)) !important;
  gap: 7px !important;
  min-width: 0 !important;
}

.stats-person-metrics span {
  min-width: 0 !important;
  padding: 6px 8px !important;
  border-radius: 7px !important;
  background: #f1f5fa !important;
  color: #64748b !important;
  font-size: 0.71rem !important;
  font-weight: 850 !important;
  white-space: nowrap !important;
}

.stats-person-metrics b {
  margin-left: 4px !important;
  color: #13223a !important;
  font-size: 0.78rem !important;
  font-weight: 950 !important;
}

.stats-person-campaign-wrap {
  margin: 0 10px 10px !important;
}

.stats-person-campaign-table {
  min-width: 1060px !important;
}

.stats-org-dimensions {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  gap: 12px !important;
}

.stats-dimension-card {
  min-height: 184px !important;
  min-width: 0 !important;
  overflow: hidden !important;
  padding: 15px !important;
  border: 1px solid rgba(83, 146, 220, 0.16) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96)) !important;
  box-shadow: 0 12px 28px rgba(43, 95, 166, 0.065) !important;
}

.stats-dimension-data_quality {
  --tone: #0e7a63 !important;
  --tone-soft: rgba(14, 122, 99, 0.11) !important;
}

.stats-dimension-send_status {
  --tone: #2d8cf0 !important;
  --tone-soft: rgba(45, 140, 240, 0.12) !important;
}

.stats-dimension-domain_send {
  --tone: #0f8b8d !important;
  --tone-soft: rgba(15, 139, 141, 0.12) !important;
}

.stats-dimension-domain {
  --tone: #8b5cf6 !important;
  --tone-soft: rgba(139, 92, 246, 0.11) !important;
}

.stats-dimension-journal {
  --tone: #0891b2 !important;
  --tone-soft: rgba(8, 145, 178, 0.12) !important;
}

.stats-dimension-reply_category {
  --tone: #f59e0b !important;
  --tone-soft: rgba(245, 158, 11, 0.13) !important;
}

.stats-dimension-head span {
  color: #50627d !important;
  font-size: 0.82rem !important;
  font-weight: 950 !important;
}

.stats-dimension-head strong {
  width: 32px !important;
  height: 32px !important;
  background: var(--tone-soft) !important;
  color: var(--tone) !important;
}

.stats-dimension-row {
  gap: 7px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.stats-dimension-row > div {
  align-items: center !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.stats-dimension-row span {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #52647e !important;
  font-size: 0.78rem !important;
  font-weight: 850 !important;
}

.stats-dimension-row strong {
  flex: 0 0 auto !important;
  color: #13223a !important;
  font-size: 0.82rem !important;
  font-weight: 950 !important;
}

.stats-dimension-row i {
  height: 6px !important;
  background: #eaf0f7 !important;
}

.stats-dimension-row i::before {
  background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 58%, #ffffff)) !important;
}

.stats-role-self + .stats-org-kpis {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

@media (max-width: 1280px) {
  .stats-org-toolbar {
    grid-template-columns: 1fr !important;
  }

  .stats-org-toolbar .stats-command-form {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .stats-command-actions {
    justify-content: flex-start !important;
  }
}

@media (max-width: 720px) {
  .stats-org-toolbar .stats-command-form {
    grid-template-columns: 1fr !important;
  }

  .stats-org-hero {
    min-height: 0 !important;
    align-items: flex-start !important;
  }

  .stats-rate-pills {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .stats-rate-pills span {
    flex: 1 1 150px !important;
    justify-content: space-between !important;
  }

  .stats-org-grid {
    grid-template-columns: 1fr !important;
  }

  .stats-company-detail summary {
    grid-template-columns: 1fr !important;
  }

  .stats-company-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .stats-person-detail summary {
    grid-template-columns: 1fr !important;
  }

  .stats-person-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .stats-org-table {
    min-width: 920px !important;
  }
}

/* Reply filters and source-separated AI classification statistics */
.reply-kpi-row {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.reply-filter-panel {
  padding: 14px 16px;
}

.reply-advanced-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(150px, 0.65fr)) auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}

.reply-advanced-filter > label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.reply-advanced-filter > label > span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.reply-advanced-filter input,
.reply-advanced-filter select,
.reply-advanced-filter .select-combo {
  width: 100%;
  min-width: 0;
}

.reply-advanced-filter .select-combo-list {
  position: absolute;
  inset: calc(100% + 6px) 0 auto 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  margin: 0;
  max-height: 240px;
  overflow-x: hidden;
  box-sizing: border-box;
}

.reply-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 22px;
}

.reply-conversation-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 0 0 14px !important;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.reply-conversation-filter > label {
  display: grid;
  flex: 0 1 220px;
  gap: 6px;
  min-width: 170px;
}

.reply-conversation-filter > label > span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.reply-conversation-filter select {
  width: 100%;
  min-width: 0;
}

.reply-conversation-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.reply-export-btn {
  white-space: nowrap;
}

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

.reply-filter-label {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.reply-filter-chip,
.reply-source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.reply-filter-chip:hover,
.reply-filter-chip.active {
  border-color: #0e7a63;
  background: #ecfdf5;
  color: #0f766e;
}

.reply-source-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reply-source-summary {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #f8fafc;
}

.reply-source-summary-head,
.reply-source-metrics,
.reply-category-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reply-source-summary-head strong {
  color: #0f172a;
  font-size: 1rem;
}

.reply-source-summary-head span,
.reply-source-metrics span {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.reply-source-metrics {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.reply-category-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.reply-category-chip {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.reply-category-chip b {
  overflow: hidden;
  color: #172033;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-category-chip em {
  color: #0e7a63;
  font-style: normal;
  font-weight: 900;
}

.reply-category-empty {
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 700;
}

@media (max-width: 920px) {
  .reply-kpi-row,
  .reply-source-summary-grid {
    grid-template-columns: 1fr;
  }
}

.author-auto-panel .notice {
  margin-bottom: 0;
}

@media (max-width: 1120px) {
  .reply-advanced-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reply-advanced-filter .select-combo-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 0;
  }
}

@media (max-width: 680px) {
  .reply-advanced-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-filter-actions {
    grid-column: auto;
  }

  .reply-conversation-filter > label,
  .reply-conversation-filter-actions,
  .reply-conversation-filter-actions > * {
    width: 100%;
  }
}

.author-hub-create [data-author-source-panel][hidden] {
  display: none !important;
}

.author-data-availability-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
}

.author-data-availability-row .notice {
  min-width: 0;
  margin: 0;
}

.author-data-realtime-btn {
  align-self: center;
  min-height: 42px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .author-data-availability-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .author-data-realtime-btn {
    width: 100%;
  }
}

.author-data-category-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.author-data-category-field[hidden] {
  display: none !important;
}

.author-data-category-field legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--text-color);
  font-weight: 600;
}

.author-data-category-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.author-hub-create .grid-form .author-data-category-option {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.author-hub-create .grid-form .author-data-category-option:has(input:checked) {
  border-color: #24917c;
  background: #f2faf7;
}

.author-hub-create .grid-form .author-data-category-option input {
  display: block;
  flex: 0 0 17px;
  width: 17px;
  min-width: 17px;
  height: 17px;
  min-height: 17px;
}

.author-hub-create .grid-form .author-data-category-option span {
  display: block;
  width: auto;
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .author-data-category-options {
    grid-template-columns: 1fr;
  }
}

/* Reply conversation workspace */
.reply-conversation-page {
  display: grid;
  gap: 18px;
  width: auto;
  max-width: 1540px;
  min-width: 0;
  margin: 0 auto;
  color: #172033;
}

.reply-conversation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 16px;
  border-bottom: 1px solid #dbe4ee;
}

.reply-conversation-back {
  display: inline-flex;
  margin-bottom: 10px;
  color: #365f8d;
  font-size: 0.82rem;
  font-weight: 700;
}

.reply-conversation-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.reply-conversation-title-row h1,
.reply-conversation-section-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.reply-conversation-title-row h1 {
  font-size: 1.55rem;
}

.reply-conversation-header p {
  margin: 7px 0 4px;
  font-size: 1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.reply-conversation-header .muted {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reply-conversation-toast {
  position: sticky;
  top: 10px;
  z-index: 20;
  padding: 10px 12px;
  border: 1px solid #b8d7c8;
  border-radius: 6px;
  background: #f0faf5;
  color: #176143;
  font-size: 0.84rem;
  font-weight: 700;
}

.reply-conversation-toast.is-info {
  border-color: #c3d7ee;
  background: #f4f8fd;
  color: #285786;
}

.reply-conversation-toast.is-error {
  border-color: #efc1c1;
  background: #fff6f6;
  color: #9b2c2c;
}

.reply-original-band {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid #dbe4ee;
  border-bottom: 1px solid #dbe4ee;
}

.reply-conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.reply-conversation-main,
.reply-conversation-thread,
.reply-conversation-side {
  min-width: 0;
}

.reply-conversation-thread,
.reply-conversation-side {
  display: grid;
  gap: 14px;
}

.reply-conversation-side {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.reply-conversation-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reply-conversation-section-head h2 {
  margin-top: 2px;
  font-size: 1rem;
}

.reply-section-eyebrow {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reply-conversation-timeline {
  display: grid;
  gap: 10px;
}

.reply-conversation-mail {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dbe4ee;
  border-left: 4px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
}

.reply-conversation-mail.is-inbound {
  border-left-color: #16846d;
}

.reply-conversation-mail.is-outbound,
.reply-conversation-mail.is-original {
  border-left-color: #2f6fb3;
}

.reply-conversation-mail.is-current {
  box-shadow: 0 0 0 2px rgba(22, 132, 109, 0.12);
}

.reply-conversation-mail > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 11px 13px;
  cursor: pointer;
  list-style: none;
}

.reply-conversation-mail > summary::-webkit-details-marker {
  display: none;
}

.reply-conversation-mail > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef3f8;
  color: #365f8d;
  font-size: 1rem;
  font-weight: 800;
}

.reply-conversation-mail[open] > summary::after {
  content: "−";
}

.reply-mail-direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 99px;
  background: #e8eef5;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.reply-mail-direction.is-inbound {
  background: #dcf5ee;
  color: #0e6958;
}

.reply-mail-direction.is-outbound {
  background: #e4eefb;
  color: #285f9a;
}

.reply-mail-summary-main {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.reply-mail-summary-main strong,
.reply-mail-summary-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-mail-summary-main strong {
  color: #172033;
  font-size: 0.86rem;
}

.reply-mail-summary-main small,
.reply-conversation-mail time,
.reply-mail-expand-label {
  color: #64748b;
  font-size: 0.72rem;
}

.reply-mail-expand-label {
  white-space: nowrap;
}

.reply-conversation-mail-body {
  width: 100%;
  min-width: 0;
  padding: 16px;
  border-top: 1px solid #e5ebf2;
  background: #fbfcfe;
  line-height: 1.7;
  overflow-x: auto;
  overflow-wrap: anywhere;
  word-break: normal;
}

.reply-conversation-mail-body > *,
.reply-conversation-mail-body div,
.reply-conversation-mail-body p,
.reply-conversation-mail-body blockquote,
.reply-conversation-mail-body pre,
.reply-conversation-mail-body span,
.reply-conversation-mail-body a,
.reply-conversation-mail-body td,
.reply-conversation-mail-body th {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.reply-conversation-mail-body img,
.reply-conversation-mail-body video {
  max-width: 100% !important;
  height: auto !important;
}

.reply-conversation-mail-body table {
  max-width: 100% !important;
  table-layout: auto;
}

.reply-conversation-mail-body pre {
  white-space: pre-wrap !important;
}

.reply-mail-attachments {
  display: grid;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid #e5ebf2;
  background: #fff;
}

.reply-mail-attachments > strong {
  color: #52657a;
  font-size: 0.78rem;
  font-weight: 650;
}

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

.reply-mail-attachments li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #e1e7ed;
  border-radius: 5px;
  background: #f8fafb;
}

.reply-mail-attachments li a,
.reply-mail-attachments li span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #155eef;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.reply-mail-attachments li small {
  flex: 0 0 auto;
  color: #697887;
  font-size: 0.72rem;
}

.reply-empty-mail-body {
  padding: 10px 12px;
  border: 1px solid #d6e0ea;
  border-radius: 6px;
  background: #f5f8fb;
  color: #52657a;
  font-size: 0.82rem;
}

.reply-conversation-panel {
  display: grid;
  gap: 13px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #fff;
}

.reply-profile-summary {
  margin: 0;
  color: #334155;
  font-size: 0.84rem;
  line-height: 1.65;
}

.reply-author-profile-panel {
  align-self: start;
}

.reply-profile-dimension-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #e5ebf2;
}

.reply-profile-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.reply-profile-subhead strong {
  color: #172033;
  font-size: 0.86rem;
}

.reply-profile-subhead span {
  color: #64748b;
  font-size: 0.7rem;
}

.reply-profile-dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.reply-profile-dimension {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #e1e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.reply-profile-dimension header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.reply-profile-dimension header > span {
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
}

.reply-profile-dimension header > strong {
  color: #285f9a;
  font-size: 1rem;
}

.reply-profile-dimension header small {
  margin-left: 2px;
  color: #94a3b8;
  font-size: 0.6rem;
}

.reply-profile-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #e3eaf2;
}

.reply-profile-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6fb3, #16846d);
}

.reply-profile-dimension p,
.reply-profile-warning {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.7rem;
  line-height: 1.5;
}

.reply-profile-dimension p {
  color: #64748b;
}

.reply-profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.reply-profile-warning {
  margin-top: 12px;
  padding: 9px 10px;
  border-left: 3px solid #d59a32;
  background: #fff9ed;
  color: #76531b;
}

.reply-profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.reply-profile-facts div,
.reply-composer-mailbox {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border-left: 3px solid #78a8d9;
  background: #f6f9fd;
}

.reply-profile-facts span,
.reply-profile-group > span,
.reply-composer-mailbox span {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
}

.reply-profile-facts strong,
.reply-composer-mailbox strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.8rem;
}

.reply-profile-group {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5ebf2;
}

.reply-profile-group strong,
.reply-profile-group p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.reply-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reply-profile-tags b {
  padding: 4px 7px;
  border-radius: 4px;
  background: #eef5f3;
  color: #1b695a;
  font-size: 0.7rem;
  font-weight: 700;
}

.reply-profile-works {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e5ebf2;
}

.reply-profile-work-list {
  display: grid;
  gap: 8px;
}

.reply-profile-work {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 6px;
  background: #fbfcfe;
}

.reply-profile-work > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  list-style-position: inside;
}

.reply-profile-work > summary strong,
.reply-profile-work > summary span,
.reply-profile-work-body,
.reply-profile-work-meta dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reply-profile-work > summary strong {
  color: #172033;
  font-size: 0.8rem;
  line-height: 1.5;
}

.reply-profile-work > summary span {
  color: #64748b;
  font-size: 0.7rem;
  text-align: right;
}

.reply-profile-work-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px solid #e7edf4;
}

.reply-profile-work-body > :first-child {
  margin-top: 10px;
}

.reply-profile-work-body p {
  margin: 0;
  color: #475569;
  font-size: 0.76rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.reply-profile-work-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  margin: 0;
}

.reply-profile-work-meta div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
}

.reply-profile-work-meta dt,
.reply-profile-work-meta dd {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.45;
}

.reply-profile-work-meta dt {
  color: #64748b;
  font-weight: 700;
}

.reply-profile-work-meta dd {
  color: #334155;
}

.reply-source-data {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e5ebf2;
}

.reply-source-data > summary {
  color: #365f8d;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.reply-source-data dl {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
}

.reply-source-data dl > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #eef2f6;
}

.reply-source-data dt,
.reply-source-data dd {
  margin: 0;
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.reply-source-data dt {
  color: #64748b;
}

.reply-profile-retry {
  margin-top: 12px;
  padding: 8px 14px;
  border: 1px solid #b8c9dc;
  border-radius: 6px;
  background: #f7fafe;
  color: #315f91;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.reply-profile-retry:hover {
  border-color: #7ea5cf;
  background: #eef5fc;
}

.reply-profile-retry:disabled {
  cursor: wait;
  opacity: 0.6;
}

.reply-conversation-form {
  display: grid;
  gap: 10px;
}

.reply-conversation-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.reply-conversation-form label > span {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
}

.reply-conversation-form textarea {
  min-height: 78px;
  resize: vertical;
}

.reply-composer-panel .reply-conversation-form textarea {
  min-height: 190px;
}

.reply-transfer-current {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border-left: 3px solid #8b6bb8;
  background: #f7f4fb;
}

.reply-transfer-current span,
.reply-transfer-current small {
  color: #6f6480;
  font-size: 0.7rem;
  font-weight: 700;
}

.reply-transfer-current strong {
  color: #3e3150;
  font-size: 0.84rem;
}

.reply-transfer-current p {
  margin: 6px 0 0;
  padding-top: 7px;
  border-top: 1px solid #e6deef;
  color: #665a75;
  font-size: 0.74rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.reply-transfer-panel .reply-conversation-form {
  padding-top: 2px;
}

.reply-conversation-empty {
  padding: 13px;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .reply-conversation-layout {
    grid-template-columns: 1fr;
  }

  .reply-conversation-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reply-author-profile-panel {
    grid-column: 1 / -1;
  }

  .reply-profile-dimensions,
  .reply-profile-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reply-profile-work > summary,
  .reply-profile-work-meta {
    grid-template-columns: 1fr;
  }

  .reply-profile-work > summary span {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .reply-conversation-page {
    gap: 14px;
  }

  .reply-conversation-side,
  .reply-profile-facts,
  .reply-profile-dimensions,
  .reply-profile-detail-grid {
    grid-template-columns: 1fr;
  }

  .reply-conversation-mail > summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .reply-conversation-mail time,
  .reply-mail-expand-label {
    grid-column: 2;
  }

  .reply-conversation-mail > summary::after {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .reply-conversation-mail time {
    display: none;
  }

  .reply-mail-direction {
    min-width: 58px;
  }

  .reply-conversation-panel {
    padding: 13px;
  }
}

/* Conversation detail: message history stays primary; actions share one compact workspace. */
.reply-conversation-layout {
  grid-template-columns: minmax(0, 1.28fr) minmax(380px, 0.72fr);
  gap: 20px;
}

.reply-conversation-thread {
  gap: 14px;
  padding: 16px;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #ffffff;
}

.reply-conversation-section-head p {
  margin: 4px 0 0;
  color: #718096;
  font-size: 0.76rem;
  line-height: 1.45;
}

.reply-conversation-side {
  display: block;
  position: sticky;
  top: 16px;
}

.reply-action-workspace {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(35, 54, 78, 0.08);
}

.reply-action-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid #e3e9f0;
  background: #f8fafc;
}

.reply-action-workspace-head h2 {
  margin: 0;
  color: #172033;
  font-size: 1rem;
  letter-spacing: 0;
}

.reply-action-workspace-head p {
  margin: 4px 0 0;
  color: #718096;
  font-size: 0.72rem;
  line-height: 1.45;
}

.reply-action-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  padding: 0 10px;
  border-bottom: 1px solid #e3e9f0;
  background: #ffffff;
}

.reply-action-tabs .reply-action-tab:not(.icon-btn):not(.mode-option):not(.danger-ghost) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.reply-action-tab::after {
  position: absolute;
  right: 7px;
  bottom: -1px;
  left: 7px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #2f6fb3;
  content: "";
  opacity: 0;
  transform: scaleX(0.45);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.reply-action-tabs .reply-action-tab:not(.icon-btn):not(.mode-option):not(.danger-ghost):hover {
  color: #294f79;
  background: #f7f9fc;
  box-shadow: none;
  transform: none;
}

.reply-action-tabs .reply-action-tab.is-active:not(.icon-btn):not(.mode-option):not(.danger-ghost) {
  color: #285f9a;
  background: transparent;
}

.reply-action-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.reply-action-tab:focus-visible {
  z-index: 1;
  outline: 2px solid #7ca9d7;
  outline-offset: -3px;
}

.reply-action-tab > span {
  padding: 2px 4px;
  border-radius: 3px;
  background: #f0eafb;
  color: #6b4d90;
  font-size: 0.58rem;
  line-height: 1.2;
}

.reply-action-panel {
  min-width: 0;
  padding: 16px;
}

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

.reply-conversation-form {
  gap: 13px;
}

.reply-conversation-form label {
  gap: 7px;
}

.reply-conversation-form label > span {
  color: #34465a;
  font-size: 0.74rem;
}

.reply-conversation-form input,
.reply-conversation-form select,
.reply-conversation-form textarea {
  width: 100%;
  min-width: 0;
  border-color: #cbd6e2;
  background: #ffffff;
}

.reply-conversation-form input:focus,
.reply-conversation-form select:focus,
.reply-conversation-form textarea:focus {
  border-color: #7ca9d7;
  box-shadow: 0 0 0 3px rgba(47, 111, 179, 0.1);
  outline: none;
}

.reply-composer-form textarea {
  min-height: 230px;
  line-height: 1.65;
}

.reply-action-panel .reply-transfer-current {
  margin-bottom: 14px;
}

.reply-transfer-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reply-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid #e3e9f0;
  background: #f8fafc;
}

.reply-form-footer small {
  color: #718096;
  font-size: 0.68rem;
  line-height: 1.4;
}

.reply-form-footer button {
  flex: 0 0 auto;
}

.reply-conversation-timeline {
  position: relative;
  gap: 12px;
  padding-left: 16px;
}

.reply-conversation-timeline::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 4px;
  width: 2px;
  border-radius: 2px;
  background: #dce5ee;
  content: "";
}

.reply-conversation-timeline .reply-conversation-mail {
  position: relative;
  border-left-width: 1px;
  box-shadow: 0 3px 10px rgba(37, 54, 76, 0.035);
}

.reply-conversation-timeline .reply-conversation-mail > summary {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.reply-conversation-timeline .reply-conversation-mail::before {
  position: absolute;
  top: 25px;
  left: -18px;
  z-index: 2;
  width: 8px;
  height: 8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #8092a7;
  box-shadow: 0 0 0 2px #dce5ee;
  content: "";
}

.reply-conversation-timeline .reply-conversation-mail.is-inbound::before {
  background: #16846d;
}

.reply-conversation-timeline .reply-conversation-mail.is-outbound::before {
  background: #2f6fb3;
}

.reply-conversation-mail.is-current {
  border-color: #9fcfc4;
  box-shadow: 0 0 0 2px rgba(22, 132, 109, 0.1);
}

@media (max-width: 1180px) {
  .reply-conversation-layout {
    grid-template-columns: 1fr;
  }

  .reply-conversation-side {
    position: static;
  }

  .reply-action-workspace {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .reply-conversation-thread,
  .reply-action-panel {
    padding: 12px;
  }

  .reply-action-workspace-head {
    align-items: flex-start;
    padding: 13px 12px 11px;
  }

  .reply-action-tabs {
    padding: 0 4px;
  }

  .reply-action-tab {
    min-height: 42px;
    font-size: 0.7rem;
  }

  .reply-action-tab > span {
    display: none;
  }

  .reply-transfer-fields {
    grid-template-columns: 1fr;
  }

  .reply-form-footer {
    align-items: stretch;
    flex-direction: column;
    margin: 2px -12px -12px;
    padding: 11px 12px;
  }

  .reply-form-footer button {
    width: 100%;
  }

  .reply-conversation-timeline {
    padding-left: 12px;
  }

  .reply-conversation-timeline::before {
    left: 2px;
  }

  .reply-conversation-timeline .reply-conversation-mail::before {
    left: -14px;
  }

  .reply-conversation-timeline .reply-conversation-mail > summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .reply-conversation-timeline .reply-mail-expand-label {
    display: none;
  }

  .reply-conversation-timeline .reply-conversation-mail > summary::after {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

.author-auto-checkbox {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  align-self: end;
  gap: 10px;
  width: auto;
  min-height: 40px;
  padding-bottom: 8px;
}

.author-auto-checkbox input {
  flex: 0 0 auto;
  width: auto;
  min-width: 18px;
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.author-auto-checkbox span {
  flex: 0 1 auto;
  white-space: nowrap;
}

.author-auto-column-picker {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(225, 167, 43, 0.28);
  border-radius: 8px;
  background: #fffaf0;
}

.author-auto-column-picker[hidden] {
  display: none !important;
}

.author-auto-history-head {
  margin-top: 22px;
}

.author-auto-history-table {
  margin-top: 10px;
}

.author-auto-history-table table {
  min-width: 980px;
}

.author-auto-history-table .cell-main {
  overflow: hidden;
  max-width: 320px;
  color: #172033;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-auto-history-table .cell-sub {
  overflow: hidden;
  max-width: 380px;
  margin-top: 3px;
  color: #64748b;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-automation-hub .author-job-metrics {
  margin-bottom: 0;
}

.author-hub-table {
  margin-top: 8px;
}

.author-hub-bulk-toolbar,
.author-hub-bulk-form,
.author-hub-select-all {
  display: flex;
  align-items: center;
}

.author-hub-bulk-toolbar {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.author-hub-bulk-form {
  flex-wrap: wrap;
  gap: 8px;
}

.author-hub-select-all {
  gap: 5px;
  color: #40536a;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.author-hub-table th.author-hub-select-column,
.author-hub-table td.author-hub-select-column {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  padding-right: 8px;
  padding-left: 8px;
  box-sizing: border-box;
  text-align: center;
}

.author-hub-select-column input,
.author-hub-select-all input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.author-hub-table table {
  min-width: 1180px;
}

.author-hub-table td:nth-child(2) {
  min-width: 300px;
}

.author-hub-table .cell-main {
  color: #172033;
  font-weight: 800;
}

.author-hub-table .cell-sub {
  margin-top: 4px;
  color: #64748b;
  font-size: 0.78rem;
}

.author-monitor-state {
  font-weight: 750;
}

.author-monitor-state.is-active {
  color: #13795b;
}

.author-job-status-stack {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.author-monitor-status {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.author-hub-message {
  overflow: hidden;
  max-width: 420px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-hub-progress {
  width: 120px;
  margin-top: 7px;
}

.author-hub-progress:not(.is-running) > span {
  background-image: none;
  animation: none;
}

.author-hub-table .mini-btn {
  white-space: nowrap;
}

.author-hub-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 172px;
}

.author-hub-row-actions .inline-form {
  display: flex;
  margin: 0;
}

.author-hub-row-actions .author-hub-progress-btn {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.author-hub-row-actions .author-hub-progress-btn:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
}

.author-hub-row-actions .author-hub-delete-btn {
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #b42318;
}

.author-hub-row-actions .author-hub-delete-btn:hover {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
}

.author-monitor-start-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
}

.author-monitor-start-form > div {
  display: grid;
  gap: 4px;
}

.author-monitor-start-form small {
  color: #64748b;
}

@media (max-width: 720px) {
  .author-monitor-start-form {
    align-items: stretch;
    flex-direction: column;
  }
}

.author-hub-pagination {
  justify-content: flex-end;
  width: 100%;
  margin-top: 16px;
}

.author-auto-outbox-picker {
  display: grid;
  gap: 10px;
}

.author-auto-outbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}

.author-auto-outbox-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(115, 160, 214, 0.2);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.author-auto-outbox-option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.5);
  background: #eef5ff;
}

.author-auto-outbox-option input {
  width: 18px;
  height: 18px;
}

.author-auto-outbox-option strong,
.author-auto-outbox-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-auto-outbox-option small {
  color: #64748b;
  font-size: 0.78rem;
}

.author-auto-outbox-option em {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.author-job-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.author-engagement-panel {
  display: grid;
  gap: 14px;
}

.author-engagement-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}

.author-engagement-metric {
  display: grid;
  grid-template-rows: auto minmax(34px, auto) auto;
  gap: 6px;
  min-width: 0;
  min-height: 112px;
  padding: 13px 14px;
  border: 1px solid #dce4ec;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2937;
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.author-engagement-metric:hover,
.author-engagement-metric:focus-visible,
.author-engagement-metric[data-engagement-filter].is-active {
  border-color: #6b8cae;
  box-shadow: 0 8px 18px rgba(30, 64, 95, 0.1);
  transform: translateY(-1px);
}

.author-engagement-metric span {
  color: #566678;
  font-size: 0.78rem;
  font-weight: 800;
}

.author-engagement-metric strong {
  align-self: center;
  color: #14283b;
  font-size: 1.45rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.author-engagement-metric small {
  color: #718096;
  font-size: 0.72rem;
  line-height: 1.35;
}

.compact-stat {
  min-height: auto;
  padding: 14px 16px;
}

.compact-stat strong {
  font-size: 1.45rem;
}

.author-action-panel {
  display: grid;
  gap: 16px;
}

.author-flow-form {
  display: grid;
  gap: 16px;
}

.author-mailbox-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.author-mailbox-selector-card {
  display: grid;
  gap: 8px;
  min-height: 138px;
  padding: 16px;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background: #f9fbfd;
  box-shadow: none;
}

.author-mailbox-selector-card > span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 850;
}

.author-mailbox-selector-card strong {
  min-height: 24px;
  color: #18324a;
  font-size: 1rem;
}

.author-mailbox-selector-card small {
  color: #64748b;
  line-height: 1.45;
}

.author-mailbox-selector-card .author-selected-mailbox-detail {
  margin-top: -3px;
  padding: 7px 9px;
  border: 1px solid #cfe0f2;
  border-radius: 6px;
  color: #285f8f;
  background: #eef6fd;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.author-mailbox-selector-card .author-selected-mailbox-detail[hidden] {
  display: none;
}

.author-mailbox-selector-card .author-selector-quota,
.author-outbox-option .author-mailbox-quota {
  color: #15803d;
  font-weight: 800;
}

.author-outbox-option .author-mailbox-quota {
  margin-top: 4px;
}

.author-mailbox-selector-card .author-selector-quota.is-exhausted,
.author-outbox-option .author-mailbox-quota.is-exhausted {
  color: #b42318;
}

.author-mailbox-selector-card button {
  align-self: end;
  justify-self: start;
}

.author-mailbox-modal-card {
  display: flex;
  flex-direction: column;
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

.author-mailbox-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding: 2px;
}

.author-mailbox-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 0;
}

.author-mailbox-search-field {
  flex: 1;
  min-width: 0;
}

.author-mailbox-search-field input {
  width: 100%;
  min-height: 40px;
  margin: 0;
}

.author-mailbox-search-count {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.author-mailbox-option[hidden],
.author-mailbox-search-empty[hidden] {
  display: none;
}

.author-mailbox-search-empty {
  margin: 0 16px 14px;
  padding: 24px 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  text-align: center;
}

.author-mailbox-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #e5eaf1;
  background: #f7f9fc;
  color: #536179;
  font-size: 0.86rem;
}

.author-mailbox-picker-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.author-mailbox-group-list {
  display: block;
  min-height: 0;
  padding: 14px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  background: #f4f6fa;
  scrollbar-gutter: stable;
}

.author-mailbox-group + .author-mailbox-group {
  margin-top: 14px;
}

.author-mailbox-group {
  overflow: hidden;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  background: #ffffff;
}

.author-mailbox-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid #e8edf3;
  background: #fbfcfe;
}

.author-mailbox-group-header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.author-mailbox-group-header strong {
  overflow: hidden;
  color: #26364a;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-mailbox-group-header span {
  color: #7a8799;
  font-size: 0.76rem;
  white-space: nowrap;
}

.author-mailbox-group .author-mailbox-modal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: none;
  padding: 10px;
  overflow: visible;
}

.author-mailbox-follow-option {
  padding: 12px 16px 0;
  background: #f4f6fa;
}

.author-mailbox-follow-option .author-mailbox-option {
  border-color: #cfd9e7;
}

.author-mailbox-selected-count {
  margin-right: auto;
  color: #536179;
  font-size: 0.86rem;
  font-weight: 700;
}

.author-mailbox-modal-card > .author-mailbox-modal-grid {
  margin: 14px 16px;
}

.author-mailbox-option {
  min-height: 66px;
}

.author-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 16px;
  align-items: start;
}

.author-outbox-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 300px;
  overflow: auto;
  padding: 4px;
}

.author-outbox-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(115, 160, 214, 0.2);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.author-outbox-option:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.5);
  background: #eef5ff;
}

.author-outbox-option input {
  width: 18px;
  height: 18px;
}

.author-outbox-option strong,
.author-outbox-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-outbox-option small {
  color: #64748b;
  font-size: 0.78rem;
}

.author-outbox-option em {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.author-flow-controls {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(115, 160, 214, 0.16);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.78);
}

.author-flow-checkbox {
  min-height: auto;
}

.author-flow-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: #f8fbff;
  line-height: 1.55;
}

.author-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.author-advanced-settings {
  border: 1px solid rgba(99, 128, 162, 0.16);
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}

.author-advanced-settings summary {
  cursor: pointer;
  padding: 11px 13px;
  color: #31475c;
  font-weight: 800;
}

.author-advanced-settings[open] summary {
  border-bottom: 1px solid rgba(99, 128, 162, 0.14);
}

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

.author-advanced-grid .author-flow-note {
  grid-column: 1 / -1;
}

.author-stage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(99, 128, 162, 0.16);
  background: #eef4f8;
  color: #31475c;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.author-stage-badge.is-success {
  border-color: rgba(34, 139, 92, 0.24);
  background: #e9f8f0;
  color: #176a45;
}

.author-stage-badge.is-warning {
  border-color: rgba(191, 132, 21, 0.26);
  background: #fff7e6;
  color: #8a5a0a;
}

.author-stage-badge.is-danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: #fef0f0;
  color: #a32020;
}

.author-stage-badge.is-info {
  border-color: rgba(47, 125, 209, 0.24);
  background: #edf6ff;
  color: #1f5e9f;
}

.author-stage-badge.is-neutral {
  background: #f1f5f9;
  color: #475569;
}

.author-item-list {
  display: grid;
  gap: 14px;
}

.author-item-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(115, 160, 214, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.author-item-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.author-item-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.author-item-head p {
  margin: 0;
}

.author-item-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.author-item-title {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.author-profile-summary,
.author-profile-source,
.author-item-abstract {
  margin: 0;
  line-height: 1.6;
}

.author-profile-summary {
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.72);
  color: #1e3a5f;
}

.author-profile-source {
  color: #475569;
  font-weight: 700;
}

.author-item-abstract {
  max-height: 150px;
  overflow: auto;
  padding: 10px 12px;
  border-left: 3px solid rgba(37, 99, 235, 0.38);
  background: rgba(248, 251, 255, 0.82);
  color: #334155;
}

.author-item-abstract strong {
  display: inline-block;
  margin-right: 8px;
  color: #1d4ed8;
}

.author-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.author-detail-grid details {
  border: 1px solid rgba(115, 160, 214, 0.18);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.78);
  overflow: hidden;
}

.author-detail-grid summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
}

.author-detail-block {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.author-detail-block p {
  margin: 0;
  line-height: 1.6;
}

.author-detail-block pre {
  max-height: 360px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(115, 160, 214, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: #21324a;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .author-job-metrics,
  .author-mailbox-selector-grid,
  .author-flow-grid,
  .author-detail-grid {
    grid-template-columns: 1fr;
  }

  .author-item-head {
    display: grid;
  }

  .author-item-statuses {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .author-engagement-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .author-engagement-metric {
    min-height: 104px;
    padding: 12px;
  }
}

/* Reply workbench: searchable pickers float above the page instead of
   increasing the form height and stretching the dropdown toggle. */
.reply-workbench,
.reply-workbench > *,
.reply-workbench .reply-filter-panel,
.reply-workbench .reply-category-panel,
.reply-workbench .reply-list-panel,
.reply-workbench .reply-table-wrap {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.reply-workbench .reply-topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
  justify-content: stretch;
  gap: 12px;
}

.reply-workbench .reply-topbar > div:first-child,
.reply-workbench .reply-topbar-actions,
.reply-workbench .reply-inbox-form {
  min-width: 0;
}

.reply-workbench .reply-topbar > div:first-child {
  width: 100%;
}

.reply-workbench .reply-topbar-actions {
  display: grid;
  grid-template-columns: minmax(0, 620px) max-content max-content;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
}

.reply-workbench .reply-inbox-form {
  width: 100%;
  max-width: none;
}

.reply-workbench .reply-inbox-form label {
  width: 100%;
  min-width: 0;
}

.reply-workbench .reply-inbox-form .select-combo-list {
  position: absolute;
  inset: calc(100% + 6px) 0 auto 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 100%;
  margin: 0;
  max-height: 260px;
  overflow-x: hidden;
  box-sizing: border-box;
}

.reply-workbench .select-combo {
  min-width: 0;
  max-width: 100%;
}

.reply-workbench .select-combo-toggle {
  height: 36px;
}

.reply-workbench .select-combo-option {
  display: block !important;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-workbench .reply-filter-panel {
  position: relative;
  z-index: 20;
  overflow: visible;
}

.reply-workbench .reply-advanced-filter .select-combo.is-open {
  z-index: 40;
}

.reply-workbench .reply-category-panel,
.reply-workbench .reply-list-panel {
  position: relative;
  z-index: 1;
}

.reply-workbench #reply-sync-form,
.reply-workbench #reply-sync-all-form {
  padding-top: 22px;
}

@media (max-width: 1180px) {
  .reply-workbench .reply-topbar-actions {
    grid-template-columns: minmax(0, 1fr) max-content max-content;
  }
}

@media (max-width: 900px) {
  .reply-workbench .reply-topbar-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-workbench .reply-inbox-form .select-combo-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-workbench #reply-sync-form,
  .reply-workbench #reply-sync-all-form {
    width: 100%;
    padding-top: 0;
  }

  .reply-workbench #reply-sync-form button,
  .reply-workbench #reply-sync-all-form button {
    width: 100%;
  }
}

/* Reply workbench refresh: one focused control band and conversation-first cards. */
.reply-workbench {
  gap: 16px;
  width: min(100%, 1640px);
  margin: 0 auto;
}

.reply-workbench .reply-topbar {
  display: block;
  padding: 2px 2px 0;
  border: 0;
}

.reply-workbench .reply-topbar h1 {
  margin: 0;
  color: #172033;
  font-size: 1.55rem;
  line-height: 1.2;
}

.reply-workbench .reply-topbar p {
  max-width: 780px;
  margin: 6px 0 0;
  line-height: 1.55;
}

.reply-workbench .reply-kpi-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.reply-workbench .reply-kpi {
  min-width: 0;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #dfe7ee;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(30, 45, 65, 0.035);
}

.reply-workbench .reply-kpi span {
  color: #718096;
  font-size: 0.72rem;
  font-weight: 700;
}

.reply-workbench .reply-kpi strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #1e3348;
  font-size: 1.28rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-workbench .reply-filter-panel {
  z-index: 20;
  padding: 0;
  overflow: visible;
  border: 1px solid #d9e3ec;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(30, 47, 68, 0.05);
}

.reply-filter-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid #e3eaf0;
  background: #f8fafc;
}

.reply-filter-panel-head h2 {
  margin: 2px 0 3px;
  color: #1e3348;
  font-size: 1rem;
  line-height: 1.25;
}

.reply-filter-panel-head p {
  margin: 0;
  color: #718096;
  font-size: 0.78rem;
  line-height: 1.45;
}

.reply-workbench .reply-advanced-filter {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  border: 0;
}

.reply-workbench .reply-advanced-filter > label,
.reply-workbench .reply-filter-field {
  gap: 6px;
}

.reply-workbench .reply-filter-field-wide {
  min-width: 0;
  grid-column: span 2;
}

.reply-workbench .reply-advanced-filter .select-combo-list {
  z-index: 40;
}

.reply-workbench .reply-filter-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  padding-top: 0;
}

.reply-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid #e7edf2;
  background: #fbfcfd;
}

.reply-workbench .reply-filter-row {
  min-width: 0;
}

.reply-workbench .reply-filter-chip,
.reply-workbench .reply-source-pill {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 0.74rem;
}

.reply-sync-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.reply-sync-actions form {
  margin: 0;
}

.reply-workbench #reply-sync-form,
.reply-workbench #reply-sync-all-form {
  padding-top: 0;
}

.reply-workbench .reply-category-panel {
  z-index: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e0e7ed;
  border-radius: 7px;
  background: #ffffff;
}

.reply-workbench .reply-category-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: #34495e;
  cursor: pointer;
  list-style: none;
}

.reply-workbench .reply-category-panel > summary::-webkit-details-marker {
  display: none;
}

.reply-workbench .reply-category-panel > summary strong,
.reply-workbench .reply-category-panel > summary small {
  display: block;
}

.reply-workbench .reply-category-panel > summary strong {
  font-size: 0.88rem;
}

.reply-workbench .reply-category-panel > summary small,
.reply-category-summary-action {
  margin-top: 2px;
  color: #718096;
  font-size: 0.72rem;
}

.reply-workbench .reply-category-panel[open] > summary {
  border-bottom: 1px solid #e3eaf0;
  background: #f8fafc;
}

.reply-workbench .reply-category-panel[open] .reply-category-summary-action {
  font-size: 0;
}

.reply-workbench .reply-category-panel[open] .reply-category-summary-action::after {
  content: "收起统计";
  font-size: 0.72rem;
}

.reply-workbench .reply-category-panel .reply-source-summary-grid {
  padding: 14px 16px 16px;
}

.reply-workbench .reply-list-panel {
  z-index: 1;
  padding: 18px;
  border: 1px solid #d9e3ec;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(30, 47, 68, 0.05);
}

.reply-workbench .reply-list-panel .dashboard-panel-header {
  align-items: flex-start;
  margin-bottom: 14px;
}

.reply-workbench .reply-list-panel h2 {
  color: #172f46;
  font-size: 1.12rem;
}

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

.reply-conversation-card {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dce5ed;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(26, 46, 66, 0.035);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.reply-conversation-card:hover {
  border-color: #adc4d8;
  box-shadow: 0 7px 20px rgba(26, 46, 66, 0.08);
}

.reply-conversation-card-main {
  display: grid;
  min-width: 0;
  gap: 11px;
  padding: 16px 18px;
}

.reply-conversation-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.reply-conversation-count {
  color: #718096;
  font-size: 0.72rem;
  font-weight: 700;
}

.reply-conversation-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.reply-conversation-card-heading > div {
  min-width: 0;
}

.reply-conversation-card-heading span,
.reply-conversation-paper > span {
  display: block;
  color: #7a8998;
  font-size: 0.68rem;
  font-weight: 800;
}

.reply-conversation-card-heading h3 {
  margin: 3px 0 2px;
  overflow: hidden;
  color: #1d3145;
  font-size: 1.04rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-conversation-card-heading a {
  display: inline-block;
  overflow: hidden;
  max-width: 100%;
  color: #456a8d;
  font-size: 0.78rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-conversation-card-heading time {
  flex: 0 0 auto;
  color: #738194;
  font-size: 0.72rem;
  white-space: nowrap;
}

.reply-conversation-card-message {
  min-width: 0;
  padding: 11px 12px;
  border-left: 3px solid #4f81ad;
  background: #f7fafc;
}

.reply-conversation-card-message strong {
  display: block;
  overflow: hidden;
  color: #243b53;
  font-size: 0.85rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-conversation-card-message p,
.reply-conversation-paper p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: #5d6f81;
  font-size: 0.78rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reply-conversation-paper {
  min-width: 0;
}

.reply-conversation-paper p {
  margin-top: 3px;
  color: #41596f;
}

.reply-conversation-card-context {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-left: 1px solid #dfe7ee;
  background: #f9fbfc;
}

.reply-conversation-card-context dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.reply-conversation-card-context dl > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.reply-conversation-card-context dt {
  color: #7a8998;
  font-size: 0.67rem;
  font-weight: 800;
}

.reply-conversation-card-context dd {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #354c61;
  font-size: 0.76rem;
  line-height: 1.38;
}

.reply-conversation-card-context dd small {
  color: #708094;
  font-size: 0.7rem;
}

.reply-conversation-card-context .is-unmatched {
  color: #a15c21;
}

.reply-conversation-primary-action {
  display: grid;
  gap: 3px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid #2d6ea5;
  border-radius: 5px;
  background: #2d6ea5;
  color: #ffffff;
  text-decoration: none;
}

.reply-conversation-primary-action:hover {
  border-color: #225a8a;
  background: #225a8a;
  color: #ffffff;
}

.reply-conversation-primary-action strong {
  font-size: 0.86rem;
}

.reply-conversation-primary-action span {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.7rem;
  line-height: 1.35;
}

/* Conversation page: actions are a real workspace, not a narrow sidebar. */
.reply-conversation-page .reply-author-profile-panel {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce5ed;
  border-radius: 7px;
  background: #ffffff;
}

.reply-conversation-page .reply-author-profile-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.reply-conversation-page .reply-author-profile-panel > summary::-webkit-details-marker {
  display: none;
}

.reply-author-profile-summary strong,
.reply-author-profile-summary small {
  display: block;
}

.reply-author-profile-summary strong {
  color: #243b53;
  font-size: 0.9rem;
}

.reply-author-profile-summary small {
  margin-top: 3px;
  color: #718096;
  font-size: 0.72rem;
}

.reply-conversation-page .reply-author-profile-panel[open] > summary {
  border-bottom: 1px solid #e3eaf0;
  background: #f8fafc;
}

.reply-author-profile-content {
  padding: 16px;
}

.reply-conversation-page .reply-conversation-layout {
  grid-template-columns: minmax(400px, 0.95fr) minmax(0, 1.25fr);
  grid-template-areas: "actions thread";
  gap: 20px;
}

.reply-conversation-page .reply-conversation-main {
  grid-area: thread;
}

.reply-conversation-page .reply-conversation-side {
  grid-area: actions;
  position: sticky;
  top: 16px;
  display: block;
}

.reply-conversation-page .reply-action-workspace {
  width: 100%;
}

.reply-conversation-page .reply-action-workspace-head {
  padding: 18px;
  background: #f5f9fc;
}

.reply-conversation-page .reply-action-workspace-head h2 {
  font-size: 1.1rem;
}

.reply-conversation-page .reply-action-workspace-head p {
  font-size: 0.76rem;
}

.reply-conversation-page .reply-action-panel {
  padding: 18px;
}

.reply-conversation-page .reply-composer-form textarea {
  min-height: 260px;
}

@media (max-width: 1180px) {
  .reply-workbench .reply-advanced-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reply-conversation-page .reply-conversation-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "actions"
      "thread";
  }

  .reply-conversation-page .reply-conversation-side {
    position: static;
  }
}

@media (max-width: 980px) {
  .reply-workbench .reply-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reply-conversation-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-conversation-card-context {
    border-top: 1px solid #dfe7ee;
    border-left: 0;
  }

  .reply-conversation-card-context dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .reply-workbench .reply-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reply-filter-panel-head,
  .reply-filter-footer,
  .reply-conversation-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .reply-workbench .reply-advanced-filter {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .reply-workbench .reply-filter-field-wide,
  .reply-workbench .reply-filter-actions {
    grid-column: auto;
  }

  .reply-workbench .reply-filter-actions,
  .reply-sync-actions,
  .reply-sync-actions form,
  .reply-workbench .reply-filter-actions > * {
    width: 100%;
  }

  .reply-filter-footer,
  .reply-workbench .reply-list-panel {
    padding: 14px;
  }

  .reply-conversation-card-main,
  .reply-conversation-card-context {
    padding: 14px;
  }

  .reply-conversation-card-heading time {
    order: -1;
  }

  .reply-conversation-card-heading h3,
  .reply-conversation-card-heading a,
  .reply-conversation-card-message strong {
    white-space: normal;
  }

  .reply-conversation-card-context dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-conversation-page .reply-conversation-layout {
    gap: 14px;
  }

  .reply-conversation-page .reply-action-workspace-head,
  .reply-conversation-page .reply-action-panel,
  .reply-author-profile-content {
    padding: 14px;
  }
}

/* Reply conversation refinement: handling stays primary, context stays grouped. */
.reply-conversation-page {
  gap: 14px;
  max-width: 1680px;
}

.reply-conversation-page .reply-conversation-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.75fr);
  align-items: end;
  gap: 28px;
  padding: 2px 0 18px;
  border-bottom: 1px solid #d7e1e9;
}

.reply-conversation-header-main {
  min-width: 0;
}

.reply-conversation-page .reply-conversation-back {
  margin-bottom: 12px;
  color: #36658e;
}

.reply-conversation-page .reply-conversation-title-row h1 {
  color: #172b3f;
  font-size: 1.65rem;
}

.reply-conversation-page .reply-conversation-subject {
  max-width: 860px;
  margin: 9px 0 0;
  color: #263b50;
  font-size: 0.96rem;
  line-height: 1.45;
}

.reply-conversation-header-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid #dce5ed;
  border-radius: 6px;
  background: #ffffff;
}

.reply-conversation-header-meta > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
}

.reply-conversation-header-meta > div + div {
  border-left: 1px solid #e4ebf1;
}

.reply-conversation-header-meta dt {
  color: #7b8998;
  font-size: 0.66rem;
  font-weight: 800;
}

.reply-conversation-header-meta dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #344a5f;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-case-workspace {
  display: grid;
  grid-template-columns: minmax(540px, 1.35fr) minmax(380px, 0.85fr);
  grid-template-areas: "actions context";
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.reply-case-context {
  display: grid;
  grid-area: context;
  grid-template-areas:
    "original"
    "thread"
    "profile";
  gap: 14px;
  min-width: 0;
}

.reply-case-context > .reply-original-band {
  grid-area: original;
}

.reply-case-context > .reply-author-profile-panel {
  grid-area: profile;
}

.reply-case-context > .reply-conversation-layout {
  display: contents;
}

.reply-case-context .reply-conversation-main {
  grid-area: thread;
}

.reply-case-workspace .reply-conversation-side {
  grid-area: actions;
  position: sticky;
  top: 14px;
  display: block;
  min-width: 0;
}

.reply-conversation-page .reply-original-band,
.reply-conversation-page .reply-conversation-thread,
.reply-conversation-page .reply-author-profile-panel,
.reply-conversation-page .reply-action-workspace {
  min-width: 0;
  border: 1px solid #d8e3ec;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(30, 49, 69, 0.045);
}

.reply-conversation-page .reply-original-band {
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #d8e3ec;
  border-bottom: 1px solid #d8e3ec;
}

.reply-conversation-page .reply-conversation-thread {
  gap: 12px;
  padding: 14px;
}

.reply-conversation-page .reply-conversation-section-head {
  align-items: flex-start;
}

.reply-conversation-page .reply-conversation-section-head h2 {
  margin-top: 2px;
  color: #22384d;
  font-size: 0.92rem;
}

.reply-conversation-page .reply-section-eyebrow {
  color: #60788f;
  font-size: 0.61rem;
  letter-spacing: 0;
}

.reply-conversation-page .reply-original-band .reply-conversation-mail,
.reply-conversation-page .reply-conversation-thread .reply-conversation-mail {
  border-radius: 5px;
  box-shadow: none;
}

.reply-conversation-page .reply-original-band .reply-conversation-mail > summary,
.reply-conversation-page .reply-conversation-thread .reply-conversation-mail > summary {
  min-height: 58px;
  padding: 10px 11px;
}

.reply-case-context .reply-conversation-mail > summary {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.reply-case-context .reply-mail-expand-label {
  display: none;
}

.reply-case-context .reply-conversation-mail time {
  grid-column: 2;
  grid-row: 2;
  margin-top: 2px;
  font-size: 0.66rem;
}

.reply-case-context .reply-conversation-mail > summary::after {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.reply-conversation-page .reply-author-profile-panel > summary {
  min-height: 58px;
  padding: 12px 14px;
}

.reply-conversation-page .reply-author-profile-summary strong {
  font-size: 0.84rem;
}

.reply-conversation-page .reply-author-profile-summary small {
  font-size: 0.68rem;
}

.reply-case-context .reply-author-profile-content,
.reply-case-context #reply-author-profile,
.reply-case-context .reply-profile-works,
.reply-case-context .reply-profile-work-list,
.reply-case-context .reply-profile-work {
  min-width: 0;
  max-width: 100%;
}

.reply-case-context .reply-profile-facts,
.reply-case-context .reply-profile-dimensions,
.reply-case-context .reply-profile-detail-grid,
.reply-case-context .reply-profile-work-meta {
  grid-template-columns: minmax(0, 1fr);
}

.reply-case-context .reply-profile-work > summary {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  list-style-position: outside;
}

.reply-case-context .reply-profile-work > summary strong,
.reply-case-context .reply-profile-work > summary span {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.reply-case-context .reply-profile-work > summary span {
  text-align: left;
}

.reply-case-context .reply-profile-work-body,
.reply-case-context .reply-profile-work-body p,
.reply-case-context .reply-profile-work-meta dd {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.reply-conversation-page .reply-action-workspace {
  overflow: hidden;
  border-color: #b9cddd;
  box-shadow: 0 10px 28px rgba(32, 61, 87, 0.09);
}

.reply-conversation-page .reply-action-workspace-head {
  align-items: center;
  padding: 17px 18px 15px;
  border-bottom-color: #dbe5ed;
  background: #f3f8fb;
}

.reply-conversation-page .reply-action-workspace-head h2 {
  margin-top: 3px;
  color: #18344d;
  font-size: 1.08rem;
}

.reply-conversation-page .reply-action-workspace-head p {
  margin-top: 5px;
  color: #5f7488;
  font-size: 0.72rem;
}

.reply-conversation-page .reply-action-tabs {
  padding: 0 14px;
  background: #fbfcfd;
}

.reply-conversation-page .reply-action-tabs .reply-action-tab:not(.icon-btn):not(.mode-option):not(.danger-ghost) {
  min-height: 48px;
  font-size: 0.79rem;
}

.reply-conversation-page .reply-action-panel {
  padding: 20px;
}

.reply-conversation-page .reply-composer-form textarea {
  min-height: 340px;
  resize: vertical;
}

.reply-conversation-page .reply-ai-draft-card,
.reply-conversation-page .reply-assignment-card {
  margin: 0 0 18px;
  padding: 15px;
  border: 1px solid #d7e3ec;
  border-radius: 8px;
  background: #f8fbfd;
}

.reply-ai-draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.reply-ai-draft-head > div {
  display: grid;
  gap: 4px;
}

.reply-ai-draft-head strong {
  color: #18344d;
  font-size: .92rem;
}

.reply-ai-draft-head small {
  color: #6c8192;
  line-height: 1.5;
}

.reply-ai-draft-head {
  flex-wrap: wrap;
}

.reply-ai-draft-head > .reply-ai-model-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
}

.reply-ai-model-picker {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  color: #536b7f;
  font-size: .78rem;
}

.reply-ai-model-picker select {
  width: 260px;
  max-width: 100%;
  min-height: 36px;
  margin: 0;
}

.reply-ai-draft-card .reply-conversation-form,
.reply-assignment-card .reply-conversation-form {
  gap: 12px;
}

.reply-ai-draft-card .reply-form-footer,
.reply-assignment-card .reply-form-footer {
  margin: 0;
  padding: 10px 0 0;
  border-top: 1px solid #e0e9ef;
}

.reply-ai-draft-card textarea {
  min-height: 210px;
  resize: vertical;
}

.reply-assignment-card .reply-transfer-current {
  margin: 0 0 13px;
  padding: 0 0 11px;
  border-bottom: 1px solid #e0e9ef;
}

.reply-conversation-page .reply-form-footer {
  margin: 4px -20px -20px;
  padding: 13px 20px;
}

.reply-conversation-page .reply-conversation-timeline {
  gap: 10px;
  padding-left: 12px;
}

.reply-conversation-page .reply-conversation-timeline .reply-conversation-mail::before {
  left: -14px;
}

@media (max-width: 1320px) {
  .reply-conversation-page .reply-conversation-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .reply-conversation-header-meta {
    max-width: 760px;
  }

  .reply-case-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "actions"
      "context";
  }

  .reply-case-workspace .reply-conversation-side {
    position: static;
  }
}

@media (max-width: 720px) {
  .reply-conversation-page .reply-conversation-header {
    padding-bottom: 14px;
  }

  .reply-conversation-page .reply-conversation-title-row h1 {
    width: 100%;
    font-size: 1.42rem;
  }

  .reply-conversation-header-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .reply-conversation-header-meta > div + div {
    border-top: 1px solid #e4ebf1;
    border-left: 0;
  }

  .reply-conversation-page .reply-action-panel,
  .reply-conversation-page .reply-action-workspace-head,
  .reply-conversation-page .reply-original-band,
  .reply-conversation-page .reply-conversation-thread {
    padding: 13px;
  }

  .reply-conversation-page .reply-composer-form textarea {
    min-height: 260px;
  }

  .reply-conversation-page .reply-form-footer {
    margin: 4px -13px -13px;
    padding: 12px 13px;
  }
}

/* Reply ticket workflow: a compact, persistent stepper shared by both
   business sources.  Keep each step stable so long labels do not reflow the
   action workspace while a ticket is being processed. */
.reply-workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid #d7e2eb;
  border-radius: 8px;
  background: #f7fafc;
}

.reply-workflow-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #526b80;
  text-align: left;
  cursor: pointer;
}

.reply-workflow-step:hover,
.reply-workflow-step:focus-visible {
  border-color: #b5ccdd;
  background: #ffffff;
  outline: none;
}

.reply-workflow-step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #bdcdd9;
  border-radius: 50%;
  background: #ffffff;
  color: #5e7488;
  font-size: .76rem;
  font-weight: 800;
}

.reply-workflow-step-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.reply-workflow-step-copy strong,
.reply-workflow-step-copy small {
  overflow-wrap: anywhere;
}

.reply-workflow-step-copy strong {
  color: #2c455b;
  font-size: .76rem;
  line-height: 1.2;
}

.reply-workflow-step-copy small {
  color: #718496;
  font-size: .64rem;
  line-height: 1.35;
}

.reply-workflow-step.is-active {
  border-color: #4f83a8;
  background: #eaf4fb;
  box-shadow: inset 3px 0 #2d6b98;
}

.reply-workflow-step.is-active .reply-workflow-step-number {
  border-color: #2d6b98;
  background: #2d6b98;
  color: #ffffff;
}

.reply-workflow-step.is-complete .reply-workflow-step-number {
  border-color: #78a88b;
  background: #edf8f0;
  color: #2e7148;
}

.reply-workflow-status {
  margin: -5px 2px 0;
  color: #637b8f;
  font-size: .73rem;
  line-height: 1.45;
}

.reply-workflow-status strong {
  color: #284b67;
}

.reply-global-reply-notice {
  position: fixed;
  z-index: 1200;
  top: 14px;
  right: 18px;
}

.reply-global-reply-notice-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #c8d7e2;
  border-radius: 6px;
  background: #ffffff;
  color: #28485f;
  box-shadow: 0 5px 16px rgba(36, 66, 88, .12);
  cursor: pointer;
}

.reply-global-reply-notice-toggle:hover,
.reply-global-reply-notice-toggle:focus-visible {
  border-color: #4d83a8;
  outline: none;
}

.reply-global-reply-notice-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #bd4d43;
  color: #ffffff;
  font-size: .68rem;
  font-weight: 800;
}

.reply-global-reply-notice-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 28px));
  max-height: 420px;
  overflow: auto;
  padding: 10px;
  border: 1px solid #cfdae4;
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(30, 52, 70, .18);
}

.reply-global-reply-notice-panel[hidden] {
  display: none;
}

.reply-global-reply-notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid #e1e9ef;
  color: #304d64;
  font-size: .78rem;
  font-weight: 800;
}

.reply-global-reply-notice-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
}

.reply-global-reply-notice-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e0e8ee;
  border-radius: 5px;
  color: #304d64;
  text-decoration: none;
}

.reply-global-reply-notice-item:hover,
.reply-global-reply-notice-item:focus-visible {
  border-color: #8bb0c8;
  background: #f5f9fc;
  outline: none;
}

.reply-global-reply-notice-item strong,
.reply-global-reply-notice-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reply-global-reply-notice-item strong { font-size: .75rem; }
.reply-global-reply-notice-item small { color: #748898; font-size: .66rem; }

.reply-page-unread-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #d7e2eb;
  border-radius: 7px;
  background: #ffffff;
}

.reply-page-unread-panel[hidden] { display: none; }

.reply-page-unread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reply-page-unread-head > div {
  display: grid;
  gap: 3px;
}

.reply-page-unread-head strong { color: #294861; font-size: .82rem; }
.reply-page-unread-head small { color: #718596; font-size: .68rem; }

.reply-page-unread-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.reply-page-unread-person {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid #d7e3eb;
  border-radius: 5px;
  background: #f7fafc;
  color: #36566e;
  font-size: .72rem;
}

.reply-page-unread-person b {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 9px;
  background: #bd4d43;
  color: #ffffff;
  text-align: center;
  font-size: .65rem;
}

@media (max-width: 820px) {
  .reply-workflow-steps {
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .reply-workflow-step {
    flex: 0 0 180px;
  }

  .reply-global-reply-notice {
    top: 8px;
    right: 10px;
  }
}

/* 智能邀约独立统计 */
.invitation-stats-page {
  display: grid;
  gap: 18px;
  width: min(100%, 1680px);
  margin: 0 auto;
  color: #1c2d3f;
}

.invitation-stats-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 0;
  padding: 4px 2px 0;
  gap: 24px;
}

.invitation-stats-heading h1 {
  margin: 4px 0 5px;
  color: #17293b;
  font-size: 1.72rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.invitation-stats-heading p,
.invitation-stats-section-head p {
  margin: 0;
  color: #6f7d8c;
  font-size: 0.84rem;
}

.invitation-stats-eyebrow,
.invitation-stats-section-head span {
  color: #16806c;
  font-family: var(--font-montserrat);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.invitation-stats-heading-meta {
  display: grid;
  flex: 0 0 auto;
  gap: 3px;
  max-width: 420px;
  text-align: right;
}

.invitation-stats-heading-meta span {
  color: #83909d;
  font-size: 0.7rem;
}

.invitation-stats-heading-meta strong {
  color: #34495e;
  font-size: 0.86rem;
}

.invitation-stats-business-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  border-bottom: 1px solid #dfe6ec;
}

.invitation-stats-business-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  height: 42px;
  padding: 0 18px;
  border-bottom: 3px solid transparent;
  color: #657585;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.invitation-stats-business-tabs a:hover {
  color: #1f6f63;
  background: #f6faf9;
}

.invitation-stats-business-tabs a.is-active {
  border-bottom-color: #24917c;
  color: #176b5d;
  background: #f2f8f6;
}

.invitation-stats-filter-band {
  padding: 15px 16px;
  border-top: 1px solid #dfe6ec;
  border-bottom: 1px solid #dfe6ec;
  background: #f7f9fa;
}

.invitation-stats-filter-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.invitation-stats-filter-form label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.invitation-stats-filter-form label > span {
  color: #526272;
  font-size: 0.71rem;
  font-weight: 700;
}

.invitation-stats-filter-form select,
.invitation-stats-filter-form input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #ced8e1;
  border-radius: 5px;
  color: #24384b;
  background: #fff;
  font-size: 0.79rem;
}

.invitation-stats-filter-form select:focus,
.invitation-stats-filter-form input:focus {
  border-color: #24917c;
  outline: 2px solid rgba(36, 145, 124, 0.13);
}

.invitation-stats-filter-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
}

.invitation-stats-filter-actions button,
.invitation-stats-filter-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 5px;
  white-space: nowrap;
}

.invitation-stats-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.invitation-stat-kpi {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 105px;
  padding: 15px 16px 14px;
  overflow: hidden;
  border: 1px solid #e0e6eb;
  border-radius: 7px;
  background: #fff;
}

.invitation-stat-kpi::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: #91a0ad;
  content: "";
}

.invitation-stat-kpi.is-primary::before,
.invitation-stat-kpi.is-reply::before {
  background: #16806c;
}

.invitation-stat-kpi.is-send::before {
  background: #2878a8;
}

.invitation-stat-kpi.is-open::before,
.invitation-stat-kpi.is-cost::before {
  background: #c38a23;
}

.invitation-stat-kpi.is-failure::before {
  background: #c34f4f;
}

.invitation-stat-kpi span {
  color: #687887;
  font-size: 0.73rem;
  font-weight: 700;
}

.invitation-stat-kpi strong {
  margin-top: 4px;
  overflow: hidden;
  color: #182b3e;
  font-family: var(--font-montserrat);
  font-size: 1.42rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-stat-kpi small {
  margin-top: 6px;
  overflow: hidden;
  color: #87939e;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-stats-section {
  min-width: 0;
  border-top: 1px solid #dfe6ec;
  background: #fff;
}

.invitation-stats-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 0;
  padding: 16px 2px 12px;
  gap: 18px;
}

.invitation-stats-section-head h2 {
  margin: 3px 0 0;
  color: #203448;
  font-size: 1rem;
  letter-spacing: 0;
}

.invitation-stats-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #e0e6eb;
  border-radius: 6px;
}

.invitation-stats-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #2d4052;
  font-size: 0.75rem;
}

.invitation-stats-table th {
  padding: 10px 11px;
  border-bottom: 1px solid #dfe6ec;
  color: #687887;
  background: #f5f7f9;
  font-size: 0.67rem;
  font-weight: 800;
  text-align: left;
}

.invitation-stats-table td {
  padding: 11px;
  border-bottom: 1px solid #edf0f3;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.invitation-stats-table tbody tr:last-child td {
  border-bottom: 0;
}

.invitation-stats-table tbody tr:hover {
  background: #fbfcfd;
}

.invitation-stats-table td > strong,
.invitation-stats-table td > small {
  display: block;
}

.invitation-stats-table td > strong {
  color: #24394d;
  font-size: 0.76rem;
}

.invitation-stats-table td > small {
  margin-top: 4px;
  color: #82909d;
  font-size: 0.66rem;
  line-height: 1.35;
}

.invitation-domain-table {
  min-width: 1240px;
}

.invitation-mailbox-table {
  min-width: 940px;
}

.invitation-mailbox-table th:nth-child(1) {
  width: 11%;
}

.invitation-mailbox-table th:nth-child(2) {
  width: 24%;
}

.invitation-mailbox-table th:nth-child(3) {
  width: 15%;
}

.invitation-mailbox-table th:nth-child(n+4) {
  width: 10%;
}

.invitation-domain-table th:first-child {
  width: 16%;
}

.invitation-batch-table th:nth-child(1) {
  width: 25%;
}

.invitation-batch-table th:nth-child(2) {
  width: 14%;
}

.invitation-batch-table th:nth-child(n+3) {
  width: 15.25%;
}

.invitation-batch-link {
  display: block;
  color: #176f83;
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.invitation-batch-link:hover {
  color: #12546e;
  text-decoration: underline;
}

.invitation-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-top: 7px;
  padding: 2px 7px;
  border: 1px solid #d9e1e7;
  border-radius: 999px;
  color: #607180;
  background: #f5f7f9;
  font-size: 0.64rem;
  font-weight: 800;
}

.invitation-status-sending,
.invitation-status-running,
.invitation-status-reply_processing {
  border-color: #a9d8cc;
  color: #116957;
  background: #edf8f5;
}

.invitation-status-paused,
.invitation-status-failed {
  border-color: #edc3bd;
  color: #98463b;
  background: #fdf3f1;
}

.invitation-stats-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  color: #748391;
  font-size: 0.74rem;
}

.invitation-stats-pagination a,
.invitation-stats-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 30px;
  border: 1px solid #dce3e9;
  border-radius: 5px;
  color: #356078;
  background: #fff;
  text-decoration: none;
}

.invitation-stats-pagination span {
  color: #abb4bc;
  background: #f7f8f9;
}

.invitation-trend-head,
.invitation-trend-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.15fr) repeat(8, minmax(72px, 1fr));
  align-items: center;
  gap: 8px;
}

.invitation-trend-head {
  padding: 9px 12px;
  border: 1px solid #e0e6eb;
  border-radius: 6px 6px 0 0;
  color: #71808e;
  background: #f5f7f9;
  font-size: 0.66rem;
  font-weight: 800;
}

.invitation-trend-list {
  border-right: 1px solid #e0e6eb;
  border-bottom: 1px solid #e0e6eb;
  border-left: 1px solid #e0e6eb;
  border-radius: 0 0 6px 6px;
}

.invitation-trend-row {
  min-height: 43px;
  padding: 8px 12px;
  border-bottom: 1px solid #edf0f3;
  color: #364b5f;
  font-size: 0.73rem;
}

.invitation-trend-row:last-child {
  border-bottom: 0;
}

.invitation-trend-row small {
  display: block;
  margin-top: 2px;
  color: #8a96a1;
  font-size: 0.62rem;
}

.invitation-stats-empty {
  padding: 28px 16px !important;
  color: #8a96a1 !important;
  text-align: center !important;
}

@media (max-width: 1320px) {
  .invitation-stats-filter-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .invitation-stats-filter-actions {
    justify-content: flex-end;
  }

  .invitation-stats-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .invitation-stats-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .invitation-stats-heading-meta {
    max-width: none;
    text-align: left;
  }

  .invitation-stats-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-stats-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-stats-table-wrap {
    overflow: visible;
    border: 0;
  }

  .invitation-stats-table,
  .invitation-stats-table tbody,
  .invitation-stats-table tr,
  .invitation-stats-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .invitation-stats-table thead {
    display: none;
  }

  .invitation-stats-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 9px;
    overflow: hidden;
    border: 1px solid #e0e6eb;
    border-radius: 6px;
    background: #fff;
  }

  .invitation-stats-table td {
    min-height: 64px;
    padding: 10px 11px;
    border-right: 1px solid #edf0f3;
    border-bottom: 1px solid #edf0f3;
  }

  .invitation-stats-table td::before {
    display: block;
    margin-bottom: 4px;
    color: #8996a2;
    content: attr(data-label);
    font-size: 0.62rem;
    font-weight: 800;
  }

  .invitation-batch-table td:first-child,
  .invitation-domain-table td:first-child,
  .invitation-stats-table td.invitation-stats-empty {
    grid-column: 1 / -1;
  }

  .invitation-trend-head {
    display: none;
  }

  .invitation-trend-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    border: 0;
  }

  .invitation-trend-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-height: 0;
    padding: 12px;
    border: 1px solid #e0e6eb;
    border-radius: 6px;
  }

  .invitation-trend-row > *::before {
    display: block;
    margin-bottom: 3px;
    color: #8a96a1;
    content: attr(data-label);
    font-size: 0.61rem;
    font-weight: 800;
  }
}

@media (max-width: 560px) {
  .invitation-stats-page {
    gap: 14px;
  }

  .invitation-stats-heading h1 {
    font-size: 1.45rem;
  }

  .invitation-stats-filter-form,
  .invitation-stats-kpis,
  .invitation-trend-list {
    grid-template-columns: 1fr;
  }

  .invitation-stats-filter-actions {
    justify-content: stretch;
  }

  .invitation-stats-filter-actions > * {
    flex: 1 1 0;
  }

  .invitation-stat-kpi {
    min-height: 92px;
  }

  .invitation-stats-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .invitation-stats-table tr,
  .invitation-trend-row {
    grid-template-columns: 1fr;
  }

  .invitation-stats-table td,
  .invitation-batch-table td:first-child,
  .invitation-domain-table td:first-child {
    grid-column: 1;
    border-right: 0;
  }

  .invitation-stats-pagination {
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .author-mailbox-modal-card {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .author-mailbox-picker-toolbar,
  .author-mailbox-group-header {
    align-items: stretch;
  }

  .author-mailbox-picker-toolbar {
    display: grid;
  }

  .author-mailbox-search-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .author-mailbox-picker-toolbar > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .author-mailbox-group .author-mailbox-modal-grid {
    grid-template-columns: 1fr;
  }
}

.author-automation-page {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.author-automation-page > *,
.author-action-panel,
.author-flow-form,
.author-workbench-panel {
  min-width: 0;
  max-width: 100%;
}

.author-automation-page .dashboard-topbar-actions,
.author-list-toolbar,
.author-list-toolbar .page-jump-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.author-automation-page .dashboard-topbar-actions,
.author-list-toolbar {
  justify-content: flex-end;
}

.author-list-toolbar {
  flex: 1 1 620px;
  min-width: 0;
}

.author-workbench-panel > .dashboard-panel-header {
  flex-wrap: wrap;
  align-items: flex-start;
}

.author-workbench-panel > .dashboard-panel-header > div:first-child {
  flex: 1 1 280px;
  min-width: 0;
}

.author-list-toolbar .page-jump-form {
  margin-left: 0;
}

.author-workbench-panel {
  overflow: hidden;
}

.author-workbench-panel > .author-items-table {
  width: calc(100% - 32px);
  min-width: 0;
  max-width: calc(100% - 32px);
  margin: 10px 16px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
}

.author-items-table table {
  width: 100%;
  min-width: 1420px;
  table-layout: fixed;
}

.author-items-table th:nth-child(1) { width: 150px; }
.author-items-table th:nth-child(2) { width: 190px; }
.author-items-table th:nth-child(3) { width: 235px; }
.author-items-table th:nth-child(4) { width: 175px; }
.author-items-table th:nth-child(5) { width: 190px; }
.author-items-table th:nth-child(6) { width: 125px; }
.author-items-table th:nth-child(7) { width: 100px; }
.author-items-table th:nth-child(8) { width: 185px; }
.author-items-table th:nth-child(9) { width: 70px; }

.author-items-table th,
.author-items-table td {
  overflow: hidden;
}

.author-items-table td:nth-child(1),
.author-items-table td:nth-child(2),
.author-items-table td:nth-child(3),
.author-items-table td:nth-child(4),
.author-items-table td:nth-child(6),
.author-items-table td:nth-child(7),
.author-items-table td:nth-child(9) {
  white-space: nowrap;
}

.author-items-table th:last-child,
.author-items-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  text-align: center;
}

.author-items-table th:last-child {
  z-index: 3;
  background: #f8fafc;
}

.author-items-table tbody tr:hover td:last-child {
  background: #fbfcff;
}

.author-items-table td:last-child .mini-btn {
  min-width: 46px;
  white-space: nowrap;
}

.author-items-table .cell-main {
  overflow: hidden;
  max-width: 260px;
  color: #172033;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-items-table .cell-sub {
  overflow: hidden;
  max-width: 300px;
  margin-top: 3px;
  color: #64748b;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-items-table .author-title-cell {
  max-width: 360px;
}

.author-no-send-cell {
  display: -webkit-box;
  max-width: none;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.author-send-ok-cell {
  display: -webkit-box;
  max-width: none;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.author-detail-modal-card {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.author-detail-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 210000 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.author-detail-modal[hidden] {
  display: none !important;
}

.author-detail-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(2px);
}

.author-detail-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: #ffffff;
}

.author-detail-modal-card .modal-header {
  flex: 0 0 auto;
  align-items: flex-start;
  background: #ffffff;
}

.author-detail-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #243244;
  font-size: 1.25rem;
  font-weight: 900;
}

.author-detail-modal-card .author-detail-pane-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  padding: 16px;
  overflow: auto;
}

.author-detail-modal-card .author-detail-pane[hidden] {
  display: none !important;
}

.author-detail-modal-card .author-detail-pane.is-visible {
  display: grid;
}

.author-workbench {
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(420px, 1.35fr);
  gap: 16px;
  align-items: start;
}

.author-list-pane {
  display: grid;
  gap: 8px;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.author-list-row {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 12px;
  text-align: left;
  border: 1px solid rgba(99, 128, 162, 0.22);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.author-list-row:hover,
.author-list-row.is-active {
  border-color: rgba(25, 103, 210, 0.48);
  background: #f7fbff;
  box-shadow: 0 8px 20px rgba(15, 47, 88, 0.08);
}

.author-row-main,
.author-row-meta,
.author-row-score {
  min-width: 0;
}

.author-row-main {
  display: grid;
  gap: 3px;
}

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

.author-row-main small,
.author-row-score {
  color: var(--muted);
  font-size: 0.84rem;
}

.author-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.author-row-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef4f8;
  color: #365166;
  font-size: 0.78rem;
  font-weight: 700;
}

.author-detail-pane-wrap {
  min-width: 0;
}

.author-detail-pane {
  display: grid;
  gap: 14px;
}

.author-detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(99, 128, 162, 0.18);
}

.author-detail-title h3 {
  margin: 0 0 4px;
}

.author-detail-section {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(99, 128, 162, 0.18);
  border-radius: 8px;
  background: #fbfdff;
}

.author-detail-section h4 {
  margin: 0;
  font-size: 0.98rem;
}

.author-detail-section p {
  margin: 0;
  line-height: 1.65;
}

.author-no-send-notice {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
}

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

.author-no-send-head strong {
  color: #9a3412;
  font-size: 0.98rem;
}

.author-no-send-head span {
  color: #9a3412;
  font-size: 0.8rem;
  font-weight: 850;
}

.author-no-send-notice p {
  margin: 0;
  line-height: 1.65;
}

.author-no-send-notice ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.author-no-send-notice li {
  line-height: 1.55;
}

.author-profile-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.9fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(99, 128, 162, 0.18);
  border-radius: 8px;
  background: #f8fbfd;
}

.author-overview-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.author-overview-eyebrow {
  color: #25636f;
  font-size: 0.78rem;
  font-weight: 850;
}

.author-overview-copy h4 {
  margin: 0;
  color: #1f3652;
  font-size: 1.08rem;
}

.author-overview-copy p {
  margin: 0;
  color: #334155;
  line-height: 1.68;
}

.author-overview-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.author-overview-facts div {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid rgba(99, 128, 162, 0.15);
  border-radius: 8px;
  background: #ffffff;
}

.author-overview-facts span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
}

.author-overview-facts strong {
  min-width: 0;
  color: #21324a;
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.author-detail-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  gap: 14px;
  align-items: start;
}

.author-radar-section {
  align-content: start;
}

.author-detail-accordion {
  display: grid;
  gap: 10px;
}

.author-detail-accordion details.author-detail-section {
  padding: 0;
  overflow: hidden;
}

.author-detail-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  color: #1f3652;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.author-detail-accordion summary::-webkit-details-marker {
  display: none;
}

.author-detail-accordion summary::after {
  content: "+";
  display: grid;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(99, 128, 162, 0.26);
  border-radius: 999px;
  color: #2f6b82;
  font-size: 1rem;
  line-height: 1;
  place-items: center;
}

.author-detail-accordion details[open] summary {
  border-bottom: 1px solid rgba(99, 128, 162, 0.14);
  background: #f8fbfd;
}

.author-detail-accordion details[open] summary::after {
  content: "-";
}

.author-detail-fold-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.author-detail-fold-body p {
  margin: 0;
  line-height: 1.65;
}

.author-dimension-note-list {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

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

.author-send-reply-grid > .author-mail-preview,
.author-send-reply-grid > .author-reply-preview,
.author-send-reply-grid > p {
  grid-column: 1 / -1;
}

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

.author-dimension-row {
  display: grid;
  gap: 6px;
}

.author-dimension-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #31475c;
  font-size: 0.88rem;
  font-weight: 700;
}

.author-dimension-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf3;
}

.author-dimension-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f7dd1, #35a58b);
}

.author-radar-wrap {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.author-radar-svg {
  display: block;
  width: min(100%, 300px);
  min-width: 220px;
  aspect-ratio: 1;
}

.author-radar-grid {
  fill: none;
  stroke: rgba(99, 128, 162, 0.22);
  stroke-width: 1;
}

.author-radar-grid.outer {
  stroke: rgba(47, 125, 209, 0.38);
  stroke-width: 1.4;
}

.author-radar-axis {
  stroke: rgba(99, 128, 162, 0.16);
  stroke-width: 1;
}

.author-radar-area {
  fill: rgba(47, 125, 209, 0.2);
  stroke: #2f7dd1;
  stroke-width: 2.4;
  stroke-linejoin: round;
}

.author-radar-dot {
  fill: #ffffff;
  stroke: #2f7dd1;
  stroke-width: 2;
}

.author-radar-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.author-radar-legend div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(99, 128, 162, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.author-radar-legend span {
  color: #31475c;
  font-size: 0.86rem;
  font-weight: 760;
}

.author-radar-legend strong {
  color: #1f5e9f;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.author-score-tile {
  position: relative;
}

.author-score-tile span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.author-score-tile em {
  display: inline-grid;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #e8f1f8;
  color: #25636f;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  place-items: center;
}

.author-score-tile::after {
  content: attr(data-score-tip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 9px);
  z-index: 5;
  width: min(320px, 78vw);
  padding: 9px 10px;
  border-radius: 8px;
  background: #1f2f46;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.author-score-tile:hover::after,
.author-score-tile:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.author-score-explain {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(99, 128, 162, 0.18);
  border-radius: 8px;
  background: #ffffff;
}

.author-score-explain summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  color: #1f3652;
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.author-score-explain summary::-webkit-details-marker {
  display: none;
}

.author-score-explain summary::after {
  content: "-";
  display: grid;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(99, 128, 162, 0.24);
  border-radius: 999px;
  color: #2f6b82;
  line-height: 1;
  place-items: center;
}

.author-score-explain:not([open]) summary::after {
  content: "+";
}

.author-score-explain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 13px 13px;
}

.author-score-reason {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(99, 128, 162, 0.14);
  border-radius: 8px;
  background: #f8fbfd;
}

.author-score-reason header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.author-score-reason header strong {
  color: #1f3652;
  font-size: 0.92rem;
}

.author-score-reason header span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #1f5e9f;
  font-size: 0.78rem;
  font-weight: 850;
}

.author-score-reason p {
  margin: 0;
  color: #40566b;
  font-size: 0.84rem;
  line-height: 1.58;
}

.author-score-reason .author-score-basis {
  color: #24364c;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.62;
}

.author-score-reason .author-score-standard {
  padding-top: 7px;
  border-top: 1px solid rgba(99, 128, 162, 0.12);
  color: #687b8f;
  font-size: 0.78rem;
  line-height: 1.52;
}

.author-score-reason b {
  color: #21324a;
}

.author-score-footnote {
  margin: 0 13px 13px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.5;
}

.author-core-metrics {
  display: grid;
  gap: 9px;
  align-content: start;
  grid-auto-rows: auto;
}

.author-core-metrics div {
  display: grid;
  grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  align-content: center;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid rgba(99, 128, 162, 0.15);
  border-radius: 8px;
  background: #ffffff;
}

.author-core-metrics span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.author-core-metrics strong {
  min-width: 0;
  color: #21324a;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-align: right;
}

.author-side-summary {
  display: grid;
  gap: 9px;
}

.author-side-card {
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid rgba(99, 128, 162, 0.15);
  border-radius: 8px;
  background: #ffffff;
}

.author-side-card-accent {
  border-color: rgba(47, 125, 209, 0.2);
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.author-side-card span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 850;
}

.author-side-card strong {
  min-width: 0;
  color: #1f3652;
  font-size: 0.94rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.author-side-card p {
  margin: 0;
  color: #40566b;
  font-size: 0.82rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.author-abstract {
  max-height: 180px;
  overflow: auto;
  padding: 10px 12px;
  border-left: 3px solid #2f7dd1;
  background: #f4f9fd;
}

.author-openalex-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.author-openalex-metrics div {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid rgba(99, 128, 162, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.author-openalex-metrics span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 750;
}

.author-openalex-metrics strong {
  color: #21324a;
  font-size: 0.94rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.author-openalex-warning {
  padding: 10px 12px;
  border: 1px solid rgba(191, 132, 21, 0.24);
  border-radius: 8px;
  background: #fff8e8;
  color: #83540d;
  line-height: 1.55;
}

.author-chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.author-chip-line span {
  padding: 5px 8px;
  border: 1px solid rgba(99, 128, 162, 0.2);
  border-radius: 999px;
  background: #ffffff;
  color: #365166;
  font-size: 0.82rem;
  font-weight: 700;
}

.author-clean-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #495d70;
  line-height: 1.55;
}

.author-mail-preview,
.author-reply-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(99, 128, 162, 0.18);
  border-radius: 8px;
  background: #ffffff;
}

.author-mail-preview div,
.author-reply-preview div {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #283b4d;
  line-height: 1.62;
}

.author-detail-kv {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.author-detail-kv dt {
  color: var(--muted);
  font-weight: 700;
}

.author-detail-kv dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.author-sub-list {
  display: grid;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(99, 128, 162, 0.14);
}

.author-sub-list p {
  color: var(--muted);
  font-size: 0.88rem;
}

.author-journal-fit-list,
.author-work-list {
  display: grid;
  gap: 10px;
}

.author-journal-fit-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.author-journal-fit-card,
.author-work-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(99, 128, 162, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.author-journal-fit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: start;
}

.author-journal-fit-card div,
.author-work-card header {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.author-journal-fit-card strong,
.author-work-card strong {
  color: #1f3652;
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.author-journal-fit-card span,
.author-work-card span,
.author-journal-fit-card small {
  color: #68798d;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

.author-journal-fit-card em {
  padding: 4px 7px;
  border-radius: 999px;
  color: #155e75;
  background: #ecfeff;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.author-journal-fit-card small {
  grid-column: 1 / -1;
}

.author-work-card {
  display: grid;
  gap: 9px;
}

.author-work-meta {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 5px 9px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(99, 128, 162, 0.12);
  border-radius: 8px;
  background: #f9fbfd;
}

.author-work-meta dt {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.author-work-meta dd {
  min-width: 0;
  margin: 0;
  color: #32465a;
  font-size: 0.8rem;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.author-work-card p {
  max-height: 132px;
  overflow: auto;
  padding: 9px 10px;
  border-left: 3px solid rgba(47, 125, 209, 0.42);
  background: #f7fbff;
}

.danger-soft {
  background: rgba(220, 38, 38, 0.08);
  color: #a32020;
}

@media (max-width: 1100px) {
  .author-workbench {
    grid-template-columns: 1fr;
  }

  .author-list-pane {
    max-height: 380px;
  }

  .author-profile-overview,
  .author-detail-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .author-dimension-grid,
  .author-radar-wrap,
  .author-advanced-grid,
  .author-openalex-metrics,
  .author-overview-facts,
  .author-score-explain-grid,
  .author-send-reply-grid,
  .author-journal-fit-list,
  .author-work-meta,
  .author-detail-kv {
    grid-template-columns: 1fr;
  }

  .author-radar-svg {
    justify-self: center;
  }

  .author-detail-title {
    display: grid;
  }

  .author-core-metrics div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .author-core-metrics strong {
    text-align: left;
  }
}



/* 统计工具栏：改弹性换行，避免窄屏/缩放时"应用/下载/导出"按钮溢出重叠变形 */
.stats-org-toolbar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 12px !important;
  grid-template-columns: none !important;
}
.stats-org-toolbar .stats-command-meta {
  flex: 1 1 210px;
  min-width: 0;
}
.stats-org-toolbar .stats-command-form,
.stats-filter-form.stats-command-form {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  gap: 10px !important;
  grid-template-columns: none !important;
  flex: 1 1 460px;
  min-width: 0;
}
.stats-org-toolbar .stats-command-form > label {
  flex: 0 1 auto;
  min-width: 0;
}
.stats-command-actions {
  flex: 0 0 auto;
}
.stats-filter-actions,
.stats-command-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
}

/* 批次列表整洁化：每格单行(状态不再竖排换行、行高统一)，
   长文本列(批次/模板/来源/邮箱/创建人)截断带省略号，鼠标悬停看全文；
   表格超出宽度时在 .table-wrap 里横向滚动，不再挤成一团。 */
.campaign-table td {
  white-space: nowrap;
}
.campaign-table td.cell-clip {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.campaign-table td.cell-name {
  max-width: 320px;
}

/* Sending monitor: dense rows with live progress that only animates while running. */
.campaign-monitor .dashboard-panel {
  overflow: hidden;
}

.campaign-monitor-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 16px 14px;
  border: 1px solid #dfe6ee;
  border-radius: 8px;
  background: #f8fafc;
}

.campaign-monitor-summary > span {
  display: flex;
  align-items: baseline;
  justify-content: center;
  min-width: 0;
  padding: 11px 14px;
  gap: 8px;
  border-right: 1px solid #e5eaf0;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
}

.campaign-monitor-summary > span:last-child {
  border-right: 0;
}

.campaign-monitor-summary b {
  color: #172033;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.campaign-monitor .table-wrap {
  border-radius: 8px;
}

.campaign-monitor .campaign-table {
  min-width: 1120px;
  table-layout: fixed;
}

.campaign-monitor .campaign-table th:nth-child(1) { width: 260px; }
.campaign-monitor .campaign-table th:nth-last-child(5) { width: 210px; }
.campaign-monitor .campaign-table th:nth-last-child(4) { width: 112px; }
.campaign-monitor .campaign-table th:nth-last-child(3) { width: 210px; }
.campaign-monitor .campaign-table th:nth-last-child(2) { width: 92px; }
.campaign-monitor .campaign-table th:nth-last-child(1) { width: 184px; }

.campaign-monitor .campaign-table td {
  height: 78px;
  padding-top: 10px;
  padding-bottom: 10px;
  vertical-align: middle;
}

.campaign-info-cell,
.campaign-mailbox-cell,
.campaign-time-cell {
  display: table-cell;
}

.campaign-info-cell > *,
.campaign-mailbox-cell > *,
.campaign-time-cell > * {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-name-link {
  margin-bottom: 5px;
  color: #1759a8;
  font-weight: 800;
  text-decoration: none;
}

.campaign-name-link:hover {
  color: #0f766e;
  text-decoration: underline;
}

.campaign-row-meta,
.campaign-mailbox-cell > span,
.campaign-time-cell > span {
  margin-top: 3px;
  color: #667085;
  font-size: 0.76rem;
  line-height: 1.25;
}

.campaign-row-meta b,
.campaign-mailbox-cell b,
.campaign-time-cell b {
  display: inline-block;
  min-width: 34px;
  margin-right: 6px;
  color: #475467;
  font-size: 0.7rem;
  font-weight: 800;
}

.campaign-status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px;
  gap: 6px;
  border: 1px solid #dce3eb;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.campaign-status-badge i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #98a2b3;
}

.campaign-status-badge.status-running,
.campaign-status-badge.status-preparing {
  border-color: #a7d8d2;
  background: #eefbf8;
  color: #0f766e;
}

.campaign-status-badge.status-running i,
.campaign-status-badge.status-preparing i {
  background: #0f9f8f;
}

.campaign-status-badge.status-paused,
.campaign-status-badge.status-pausing,
.campaign-status-badge.status-needs_resume {
  border-color: #f3d29a;
  background: #fff8e8;
  color: #9a5b0a;
}

.campaign-status-badge.status-paused i,
.campaign-status-badge.status-pausing i,
.campaign-status-badge.status-needs_resume i {
  background: #e49b21;
}

.campaign-status-badge.status-completed {
  border-color: #b9ddc8;
  background: #f0faf4;
  color: #187443;
}

.campaign-status-badge.status-completed i {
  background: #22a65a;
}

.campaign-status-badge.status-failed {
  border-color: #efb8b8;
  background: #fff3f3;
  color: #b42318;
}

.campaign-status-badge.status-failed i {
  background: #d92d20;
}

.campaign-status-badge.status-running i {
  animation: campaign-status-pulse 1.2s ease-in-out infinite;
}

.campaign-progress {
  display: grid;
  min-width: 170px;
  gap: 7px;
}

.campaign-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.campaign-progress-head strong {
  color: #172033;
  font-size: 0.9rem;
}

.campaign-progress-head span {
  overflow: hidden;
  color: #667085;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 5px;
  background: #e7ecf2;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.08);
}

.campaign-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background-color: #278a80;
  background-image: linear-gradient(90deg, #278a80, #36a36c);
  transition: width 0.45s ease;
}

.campaign-progress.is-running .campaign-progress-track > span {
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.28) 0 8px, transparent 8px 17px),
    linear-gradient(90deg, #217f87, #25a36b);
  background-size: 32px 100%, 100% 100%;
  animation: campaign-progress-flow 0.9s linear infinite;
}

.campaign-reply-cell {
  font-variant-numeric: tabular-nums;
}

.campaign-reply-cell strong,
.campaign-reply-cell span {
  display: block;
}

.campaign-reply-cell strong {
  color: #344054;
  font-size: 0.82rem;
}

.campaign-reply-cell span {
  margin-top: 4px;
  color: #667085;
  font-size: 0.72rem;
}

.campaign-refresh-badge {
  min-width: 190px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

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

.campaign-refresh-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid #d6dee8;
  background: #ffffff;
  color: #35628f;
}

.campaign-refresh-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.campaign-refresh-button.is-refreshing svg {
  animation: campaign-refresh-spin 0.8s linear infinite;
}

.send-progress-panel.is-actively-sending .send-blower-filler {
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.28) 0 10px, transparent 10px 21px),
    linear-gradient(90deg, #ffb01f, #f07813) !important;
  background-size: 38px 100%, 100% 100% !important;
  animation: campaign-progress-flow 0.95s linear infinite !important;
}

@keyframes campaign-progress-flow {
  from { background-position: 0 0, 0 0; }
  to { background-position: 32px 0, 0 0; }
}

@keyframes campaign-status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 159, 143, 0.15); }
  50% { box-shadow: 0 0 0 4px rgba(15, 159, 143, 0.12); }
}

@keyframes campaign-refresh-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .campaign-monitor-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .campaign-monitor-summary > span:nth-child(2) {
    border-right: 0;
  }

  .campaign-monitor-summary > span:nth-child(-n + 2) {
    border-bottom: 1px solid #e5eaf0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .campaign-progress.is-running .campaign-progress-track > span,
  .campaign-status-badge.status-running i,
  .send-progress-panel.is-actively-sending .send-blower-filler,
  .send-progress-panel.is-actively-sending .send-blower-marker,
  .campaign-refresh-button.is-refreshing svg {
    animation: none !important;
  }
}

/* 批次发件箱运行状态：保留完整的剔除错误与复测结果，不让长 SMTP/Gmail 错误撑破表格。 */
#outbox-status-body [data-outbox-runtime-reason] {
  min-width: 280px;
  max-width: 560px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

/* Compact sidebar accordion hierarchy. */
.sidebar .nav {
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
  scrollbar-width: thin;
}

.sidebar .nav > .nav-primary-link,
.nav-group-summary {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  margin: 1px 0;
  padding: 5px 8px;
  gap: 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.sidebar .nav > .nav-primary-link {
  min-height: 42px;
  margin-bottom: 4px;
}

.sidebar .nav > .nav-primary-link:hover,
.sidebar .nav > .nav-primary-link.active,
.nav-group-summary:hover,
.nav-group-active > .nav-group-summary {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  transform: none;
}

.sidebar .nav > .nav-primary-link.active {
  color: var(--secondary-color);
}

.sidebar .nav > .nav-primary-link .nav-icon,
.nav-group-icon {
  display: block;
  box-sizing: border-box;
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar .nav > .nav-primary-link:hover .nav-icon,
.sidebar .nav > .nav-primary-link.active .nav-icon,
.nav-group-summary:hover .nav-group-icon,
.nav-group-active > .nav-group-summary .nav-group-icon {
  background: rgba(241, 152, 40, 0.16);
  color: var(--secondary-color);
}

.nav-group {
  display: block;
  margin: 2px 0;
}

.nav-group-summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.nav-group-summary::-webkit-details-marker {
  display: none;
}

.nav-group-summary:focus-visible {
  outline: 2px solid rgba(241, 152, 40, 0.72);
  outline-offset: -2px;
}

.nav-group-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-group-chevron {
  display: block;
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin-left: auto;
  color: rgba(255, 255, 255, 0.46);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s var(--human-motion), color 0.18s var(--human-motion);
}

.nav-group[open] .nav-group-chevron {
  color: rgba(255, 255, 255, 0.78);
  transform: rotate(180deg);
}

.nav-group-links {
  position: relative;
  display: grid;
  gap: 1px;
  padding: 2px 0 4px 18px;
}

.nav-group-links::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 6px;
  left: 15px;
  width: 1px;
  background: rgba(255, 255, 255, 0.13);
}

.sidebar .nav .nav-group-links a {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 36px;
  margin: 0;
  padding: 4px 7px 4px 10px;
  gap: 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 1;
}

.sidebar .nav .nav-group-links a:hover,
.sidebar .nav .nav-group-links a.active {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  transform: none;
}

.sidebar .nav .nav-group-links a.active {
  background: rgba(241, 152, 40, 0.12);
  color: var(--secondary-color);
}

.sidebar .nav .nav-group-links a.active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -4px;
  display: block;
  width: 2px;
  border-radius: 2px;
  background: var(--secondary-color);
}

.sidebar .nav .nav-group-links .nav-icon {
  width: 27px;
  min-width: 27px;
  height: 27px;
  padding: 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 27px;
}

.sidebar .nav .nav-group-links a:hover .nav-icon,
.sidebar .nav .nav-group-links a.active .nav-icon {
  background: rgba(241, 152, 40, 0.14);
  color: var(--secondary-color);
}

@media (min-width: 1280px) {
  .sidebar {
    overflow: hidden;
  }

  .sidebar-footer {
    flex: 0 0 auto;
  }

  body.sidebar-mini .sidebar {
    overflow: visible;
  }

  body.sidebar-mini .sidebar .nav {
    overflow: visible;
    padding-right: 0;
  }
}

body.sidebar-mini .nav-group {
  width: 56px;
}

body.sidebar-mini .nav-group-title,
body.sidebar-mini .nav-group-chevron {
  display: none;
}

body.sidebar-mini .sidebar .nav > .nav-primary-link,
body.sidebar-mini .nav-group-summary {
  justify-content: center;
  width: 56px;
  min-height: 44px;
  padding: 5px 0;
  gap: 0;
}

body.sidebar-mini .nav-group-links {
  padding: 2px 0 4px;
}

body.sidebar-mini .nav-group-links::before {
  display: none;
}

body.sidebar-mini .sidebar .nav .nav-group-links a {
  justify-content: center;
  width: 56px;
  min-height: 40px;
  padding: 4px 0;
  gap: 0;
}

body.sidebar-mini .sidebar .nav .nav-group-links a.active::before {
  left: 1px;
}

@media (max-width: 1279px) {
  .sidebar .nav,
  body.sidebar-mini .sidebar .nav {
    grid-template-columns: 1fr;
    overflow: visible;
    padding-right: 0;
  }

  body.sidebar-mini .nav-group {
    width: auto;
  }

  body.sidebar-mini .nav-group-title,
  body.sidebar-mini .nav-group-chevron {
    display: block;
  }

  body.sidebar-mini .sidebar .nav > .nav-primary-link,
  body.sidebar-mini .nav-group-summary {
    justify-content: flex-start;
    width: 100%;
    padding: 5px 8px;
    gap: 10px;
  }

  .nav-group-links,
  body.sidebar-mini .nav-group-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px 10px;
    padding: 2px 0 4px 18px;
  }

  body.sidebar-mini .nav-group-links::before {
    display: block;
  }

  body.sidebar-mini .sidebar .nav .nav-group-links a {
    justify-content: flex-start;
    width: 100%;
    padding: 4px 7px 4px 10px;
    gap: 9px;
  }
}

@media (max-width: 560px) {
  .sidebar,
  body.sidebar-mini .sidebar {
    flex-basis: auto;
    min-height: 0;
    height: auto;
    gap: 10px;
    margin: 8px;
    padding: 10px;
    border-radius: 8px;
  }

  .sidebar .brand,
  body.sidebar-mini .brand {
    min-height: 38px;
    gap: 10px;
    margin: 0 0 2px;
    padding: 0 2px 8px;
  }

  .sidebar .brand-mark,
  body.sidebar-mini .brand-mark {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }

  .sidebar .brand-title,
  body.sidebar-mini .brand-title {
    display: block;
    font-size: 0.92rem;
  }

  .sidebar .brand-sub {
    display: none;
  }

  .sidebar .nav,
  body.sidebar-mini .sidebar .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 6px;
  }

  .sidebar .nav > .nav-primary-link,
  body.sidebar-mini .sidebar .nav > .nav-primary-link,
  .nav-group-summary,
  body.sidebar-mini .nav-group-summary {
    min-height: 36px;
    padding: 3px 5px;
    gap: 7px;
    font-size: 0.78rem;
  }

  .sidebar .nav > .nav-primary-link .nav-icon,
  .nav-group-icon {
    width: 26px;
    min-width: 26px;
    height: 26px;
    padding: 5px;
  }

  .nav-group-links,
  body.sidebar-mini .nav-group-links {
    grid-template-columns: 1fr;
    padding: 1px 0 3px 8px;
  }

  .nav-group-links::before,
  body.sidebar-mini .nav-group-links::before {
    left: 6px;
  }

  .sidebar .nav .nav-group-links a,
  body.sidebar-mini .sidebar .nav .nav-group-links a {
    min-height: 31px;
    padding: 3px 5px 3px 8px;
    gap: 6px;
    font-size: 0.74rem;
  }

  .sidebar .nav .nav-group-links .nav-icon {
    width: 24px;
    min-width: 24px;
    height: 24px;
    padding: 4px;
    flex-basis: 24px;
  }
}

/* Personal report final simplification: one domain table, then two closed detail rows. */
.stats-person-report-compact {
  gap: 8px;
  padding: 9px;
  background: #f5f8fb;
}

.stats-person-domain-table-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dde6f0;
  border-radius: 9px;
  background: #fff;
}

.stats-person-domain-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 11px 13px;
  border-bottom: 1px solid #e7edf4;
  background: #fbfcfe;
}

.stats-person-domain-table-head > div {
  min-width: 0;
}

.stats-person-domain-table-head strong,
.stats-person-domain-table-head span {
  display: block;
}

.stats-person-domain-table-head strong {
  color: #28445f;
  font-size: 0.8rem;
  font-weight: 950;
}

.stats-person-domain-table-head span {
  margin-top: 2px;
  color: #8492a4;
  font-size: 0.64rem;
  font-weight: 750;
}

.stats-person-domain-table-head p {
  flex: 0 0 auto;
  margin: 0;
  color: #6f8094;
  font-size: 0.66rem;
  font-weight: 850;
  white-space: nowrap;
}

.stats-person-domain-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.stats-person-domain-table-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.65fr) repeat(6, minmax(72px, 0.62fr));
  align-items: center;
  min-width: 760px;
  border-bottom: 1px solid #edf1f6;
}

.stats-person-domain-table-row:last-child {
  border-bottom: 0;
}

.stats-person-domain-table-row > * {
  min-width: 0;
  padding: 9px 11px;
  color: #4e6279;
  font-size: 0.69rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stats-person-domain-table-row > :first-child {
  overflow: hidden;
  color: #2a435d;
  font-weight: 900;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-person-domain-table-row:not(.stats-person-domain-table-labels):hover {
  background: #f8fbfd;
}

.stats-person-domain-table-labels {
  background: #f3f6fa;
}

.stats-person-domain-table-labels > * {
  color: #7b899a;
  font-size: 0.62rem;
  font-weight: 900;
}

.stats-person-domain-table-empty {
  padding: 24px 12px;
  color: #8190a3;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
}

@media (max-width: 720px) {
  .stats-person-domain-table-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .stats-person-domain-table-head p {
    white-space: normal;
  }
}

/* Mailbox editor: keep save/cancel visible on short or zoomed screens. */
#outbox-modal .mailbox-editor-modal-card,
#inbox-modal .mailbox-editor-modal-card {
  display: flex;
  flex-direction: column;
  width: min(860px, 100%);
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px);
  padding: 0;
  overflow: hidden;
}

.mailbox-editor-modal-card > .modal-header {
  flex: 0 0 auto;
}

.mailbox-editor-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  margin: 0 !important;
  overflow: hidden;
}

.mailbox-editor-fields {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c7d2e3 transparent;
  scrollbar-width: thin;
}

.mailbox-editor-form > .modal-actions {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 16px;
  background: #fbfcff;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 900px) {
  #outbox-modal .mailbox-editor-modal-card,
  #inbox-modal .mailbox-editor-modal-card {
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
  }

  .mailbox-editor-fields {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .mailbox-editor-form > .modal-actions {
    align-items: center;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .mailbox-editor-form > .modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mailbox-editor-form > .modal-actions button {
    width: 100%;
  }
}

.mailbox-select-cell {
  width: 42px;
  min-width: 42px;
  padding-right: 4px !important;
  padding-left: 4px !important;
  text-align: center;
}

.mailbox-select-cell input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  vertical-align: middle;
  accent-color: var(--secondary-color);
  cursor: pointer;
}

.mailbox-bulk-selection {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 700;
}
/* Global sent-message search */
.send-search-page {
  gap: 18px;
}

.send-search-topbar {
  align-items: center;
}

.send-search-command-card {
  padding: 20px 22px;
  border: 1px solid #dce7f5;
  background:
    radial-gradient(circle at 92% 12%, rgba(63, 116, 255, .12), transparent 32%),
    #fff;
}

.send-search-form {
  display: grid;
  gap: 9px;
}

.send-search-form > label {
  font-size: 13px;
  font-weight: 700;
  color: #31415d;
}

.send-search-form > small {
  color: #7a879c;
}

.send-search-input-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
}

.send-search-input-row input {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid #cad8eb;
  background: #f9fbff;
  font-size: 15px;
}

.send-search-input-row input:focus {
  outline: 0;
  border-color: #4a78e8;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(74, 120, 232, .12);
}

.send-search-input-row button,
.send-search-input-row .secondary-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.send-search-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.send-search-kpi-grid article {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid #dfe8f5;
  border-radius: 15px;
  background: linear-gradient(145deg, #fff, #f8fbff);
  box-shadow: 0 8px 24px rgba(38, 61, 99, .06);
}

.send-search-kpi-grid span,
.send-search-kpi-grid small {
  display: block;
  color: #738199;
  font-size: 12px;
}

.send-search-kpi-grid strong {
  display: block;
  margin: 6px 0 3px;
  color: #17386d;
  font-size: 28px;
  line-height: 1;
}

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

.send-search-summary-panel {
  min-width: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.send-search-compact-table-wrap {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid #e8eef7;
}

.send-search-compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.send-search-compact-table th,
.send-search-compact-table td {
  padding: 11px 13px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #edf1f7;
}

.send-search-compact-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #60708a;
  background: #f7f9fd;
  font-size: 12px;
}

.send-search-count-badge {
  display: inline-flex;
  min-width: 30px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  color: #2456c6;
  background: #eaf1ff;
  font-weight: 800;
}

.send-search-results-panel {
  padding-bottom: 18px;
}

.send-search-result-list {
  display: grid;
  gap: 12px;
  padding: 0 18px;
}

.send-search-result-card {
  padding: 17px 18px;
  border: 1px solid #dfe7f2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(32, 53, 86, .045);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.send-search-result-card:hover {
  transform: translateY(-1px);
  border-color: #b9cdf0;
  box-shadow: 0 10px 28px rgba(32, 67, 125, .09);
}

.send-search-result-head,
.send-search-result-status,
.send-search-result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.send-search-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.send-search-identity strong {
  color: #1e3456;
  font-size: 17px;
}

.send-search-identity span,
.send-search-result-status time {
  color: #6f7e94;
  font-size: 13px;
}

.send-search-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 15px 0 12px;
}

.send-search-meta-grid > div {
  min-width: 0;
  padding: 10px 11px;
  border-radius: 10px;
  background: #f7f9fd;
}

.send-search-meta-grid dt {
  margin-bottom: 4px;
  color: #8090a7;
  font-size: 11px;
}

.send-search-meta-grid dd {
  margin: 0;
  color: #30435f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.send-search-meta-grid dd small {
  display: block;
  margin-top: 2px;
  color: #8090a7;
}

.send-search-meta-grid a {
  color: #3268d2;
  text-decoration: none;
}

.send-search-subject-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.send-search-subject-line span {
  color: #8190a6;
  font-size: 12px;
}

.send-search-subject-line strong {
  color: #223a5f;
  font-size: 14px;
}

.send-search-preview {
  margin: 9px 0 12px;
  color: #69778c;
  font-size: 13px;
  line-height: 1.65;
}

.send-search-result-actions {
  padding-top: 11px;
  border-top: 1px dashed #e4eaf3;
}

.send-search-no-detail {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 9px;
  color: #9a6814;
  background: #fff5dc;
  font-size: 12px;
}

.send-search-empty-state {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: #6e7d93;
}

.send-search-empty-state strong {
  color: #263d60;
  font-size: 18px;
}

.send-search-empty-state p {
  max-width: 660px;
  margin: 0;
}

.send-search-welcome-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  border-radius: 18px;
  color: #386cd3;
  background: #eaf1ff;
  font-size: 34px;
}

.send-search-detail-card {
  width: min(980px, calc(100vw - 36px));
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
}

.send-search-detail-body {
  display: grid;
  gap: 14px;
  padding: 18px 22px;
  overflow: auto;
}

.send-search-detail-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.send-search-detail-meta > div,
.send-search-detail-body > section {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: #f7f9fd;
}

.send-search-detail-meta span,
.send-search-detail-body > section > span {
  color: #7c8ba1;
  font-size: 11px;
}

.send-search-detail-meta strong {
  color: #2b405f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

#send-search-detail-content {
  min-height: 260px;
  max-height: 52vh;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid #dfe6f0;
  border-radius: 10px;
  color: #25374f;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .send-search-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .send-search-meta-grid,
  .send-search-detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .send-search-input-row {
    grid-template-columns: 1fr;
  }

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

  .send-search-result-head,
  .send-search-result-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .send-search-result-status {
    width: 100%;
  }

  .send-search-meta-grid,
  .send-search-detail-meta {
    grid-template-columns: 1fr;
  }
}

/* Business statistics v3: expandable personal reports and reply-mail ledger. */
.stats-org-page,
.stats-org-panel,
.stats-company-tree,
.stats-company-detail,
.stats-person-list,
.stats-person-detail,
.stats-person-report {
  min-width: 0;
  max-width: 100%;
}

.stats-org-page {
  overflow-x: clip;
}

.stats-person-list-self {
  padding: 0 !important;
}

.stats-person-report {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-top: 1px solid #dfe8f3;
  background:
    radial-gradient(circle at 100% 0, rgba(45, 140, 240, 0.075), transparent 300px),
    linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
}

.stats-person-report-placeholder {
  min-height: 58px;
  border-top: 1px solid #dfe8f3;
  background: #f8fbff;
}

.stats-person-report-loading {
  padding: 18px 20px;
  color: #6e7f92;
  font-size: 0.9rem;
  text-align: center;
}

.stats-person-report-loading.is-error {
  color: #b64747;
}

.stats-person-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid rgba(42, 94, 170, 0.13);
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% -20%, rgba(49, 143, 238, 0.2), transparent 260px),
    linear-gradient(135deg, #112941 0%, #174a66 56%, #136c68 100%);
  box-shadow: 0 14px 30px rgba(20, 61, 94, 0.14);
}

.stats-person-report-head > div:first-child {
  min-width: 0;
}

.stats-report-eyebrow {
  color: #86c9ef;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.stats-person-report-head h3 {
  margin: 5px 0 4px;
  overflow: hidden;
  color: #fff;
  font-size: clamp(1.08rem, 1.7vw, 1.42rem);
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-person-report-head p {
  margin: 0;
  color: rgba(225, 240, 249, 0.78);
  font-size: 0.75rem;
  font-weight: 700;
}

.stats-report-source-pills {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 520px;
}

.stats-report-source-pills span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 31px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(231, 244, 251, 0.82);
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.stats-report-source-pills b {
  color: #fff;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.stats-person-report-kpis {
  display: grid;
  grid-template-columns: repeat(8, minmax(112px, 1fr));
  gap: 9px;
}

.stats-person-report-kpis article {
  position: relative;
  min-width: 0;
  min-height: 104px;
  padding: 14px 13px 12px;
  overflow: hidden;
  border: 1px solid #dfe8f3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(39, 78, 125, 0.055);
}

.stats-person-report-kpis article::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 12px 0 0 12px;
  background: #a8b8ca;
  content: "";
}

.stats-person-report-kpis article.is-primary::before { background: #2d8cf0; }
.stats-person-report-kpis article.is-success::before { background: #0e8a6c; }
.stats-person-report-kpis article.is-reply::before { background: #7857d8; }
.stats-person-report-kpis article.is-danger::before { background: #d95f64; }

.stats-person-report-kpis span,
.stats-person-report-kpis small {
  display: block;
  overflow: hidden;
  color: #718096;
  font-size: 0.68rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-person-report-kpis strong {
  display: block;
  margin: 7px 0 6px;
  color: #18304c;
  font-size: 1.48rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stats-person-report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 12px;
}

.stats-report-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid #dfe8f3;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 9px 24px rgba(39, 78, 125, 0.055);
}

.stats-report-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 13px;
}

.stats-report-section-title > div {
  min-width: 0;
}

.stats-report-section-title span,
.stats-report-section-title strong {
  display: block;
}

.stats-report-section-title span {
  color: #8492a6;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-report-section-title strong {
  margin-top: 3px;
  color: #18304c;
  font-size: 0.96rem;
  font-weight: 950;
}

.stats-report-section-title small {
  color: #8190a5;
  font-size: 0.7rem;
  font-weight: 750;
}

.stats-report-progress-list {
  display: grid;
  gap: 12px;
}

.stats-report-progress-list > div {
  display: grid;
  gap: 6px;
}

.stats-report-progress-list header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #62748b;
  font-size: 0.73rem;
  font-weight: 800;
}

.stats-report-progress-list header b {
  color: #233c59;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.stats-report-progress-list i {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf0f7;
}

.stats-report-progress-list em {
  display: block;
  width: min(var(--stats-progress), 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2d8cf0, #46b7c0);
}

.stats-report-progress-list .is-reply em {
  min-width: 2px;
  background: linear-gradient(90deg, #7857d8, #a480ed);
}

.stats-reply-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stats-reply-health-grid > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e5ecf5;
  border-radius: 9px;
  background: #f7f9fc;
}

.stats-reply-health-grid span,
.stats-reply-health-grid strong {
  display: block;
}

.stats-reply-health-grid span {
  overflow: hidden;
  color: #75859a;
  font-size: 0.67rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-reply-health-grid strong {
  margin-top: 5px;
  color: #213b58;
  font-size: 1.08rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.stats-report-campaigns .stats-person-campaign-wrap {
  max-width: 100%;
  margin: 0 !important;
  overflow: auto !important;
}

.stats-report-campaigns .stats-person-campaign-table {
  min-width: 1120px !important;
}

.stats-table-badge {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  color: #22648e;
  background: #e9f4fc;
  font-size: 0.68rem;
  font-weight: 900;
}

.stats-table-status {
  color: #25624f;
  background: #e9f6f0;
}

.stats-person-replies {
  background:
    radial-gradient(circle at 100% 0, rgba(120, 87, 216, 0.08), transparent 260px),
    rgba(255, 255, 255, 0.97);
}

.stats-reply-feed-state {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #65768d;
  background: #f1f5fa;
  font-size: 0.72rem;
  font-weight: 800;
}

.stats-reply-feed-state.is-error {
  color: #a33b47;
  background: #fff0f1;
}

.stats-reply-feed-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.stats-reply-record {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #dfe8f3;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(39, 78, 125, 0.045);
}

.stats-reply-record-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stats-reply-record-top time {
  color: #77889f;
  font-size: 0.69rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.stats-reply-record-top > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.stats-reply-category,
.stats-reply-source {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  color: #674bb6;
  background: #f0ebff;
  font-size: 0.63rem;
  font-weight: 900;
}

.stats-reply-source {
  color: #24705f;
  background: #e8f6f1;
}

.stats-reply-record h4 {
  margin: 1px 0 0;
  overflow: hidden;
  color: #1d3855;
  font-size: 0.88rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-reply-route,
.stats-reply-preview {
  margin: 0;
  overflow: hidden;
  color: #6c7e94;
  font-size: 0.7rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-reply-batch {
  overflow: hidden;
  padding: 7px 9px;
  border-radius: 7px;
  color: #365779;
  background: #f1f5fa;
  font-size: 0.69rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-reply-preview {
  display: -webkit-box;
  min-height: 2.65em;
  overflow: hidden;
  line-height: 1.42;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.stats-reply-open {
  justify-self: start;
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.68rem;
}

.stats-reply-more {
  margin-top: 11px;
}

.stats-reply-more[hidden] {
  display: none !important;
}

.stats-reply-detail-modal {
  z-index: 1400;
}

.stats-reply-detail-card {
  width: min(1180px, calc(100vw - 36px));
  max-width: 1180px;
  max-height: min(88vh, 900px);
  overflow: auto !important;
  border: 1px solid rgba(58, 103, 155, 0.18);
  border-radius: 16px;
  background: #f5f8fc;
  box-shadow: 0 30px 80px rgba(16, 42, 71, 0.28);
}

.stats-reply-detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  align-items: flex-start;
  border-bottom: 1px solid #dfe8f3;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.stats-reply-detail-head .stats-report-eyebrow {
  color: #4879a5;
}

.stats-reply-detail-head h2 {
  max-width: 920px;
  margin: 5px 0;
  overflow-wrap: anywhere;
}

.stats-reply-detail-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.32fr) minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
}

.stats-reply-detail-facts {
  display: grid;
  align-content: start;
  gap: 8px;
}

.stats-reply-detail-facts > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e0e8f1;
  border-radius: 10px;
  background: #fff;
}

.stats-reply-detail-facts span,
.stats-reply-detail-facts strong {
  display: block;
}

.stats-reply-detail-facts span {
  margin-bottom: 4px;
  color: #8796a9;
  font-size: 0.66rem;
  font-weight: 850;
}

.stats-reply-detail-facts strong {
  color: #29435f;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.stats-reply-detail-content {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dfe8f3;
  border-radius: 12px;
  background: #fff;
}

.stats-reply-detail-content pre {
  min-height: 360px;
  margin: 0;
  padding: 17px;
  overflow: visible;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  color: #263d57;
  background: #fbfcfe;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1480px) {
  .stats-person-report-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .stats-person-report-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-report-source-pills {
    justify-content: flex-start;
    max-width: none;
  }

  .stats-person-report-grid,
  .stats-reply-detail-layout {
    grid-template-columns: 1fr;
  }

  .stats-reply-feed-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .stats-person-report {
    padding: 9px;
  }

  .stats-person-report-head,
  .stats-report-card {
    padding: 12px;
  }

  .stats-person-report-kpis,
  .stats-reply-health-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-person-report-kpis article {
    min-height: 94px;
  }

  .stats-report-section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-reply-detail-card {
    width: calc(100vw - 14px);
    max-height: 94vh;
  }

  .stats-reply-detail-layout {
    padding: 9px;
  }

  .stats-reply-detail-content pre {
    min-height: 260px;
    padding: 12px;
  }
}

/* Compact personal statistics: domain-first overview, details on demand. */
.stats-person-report-compact {
  gap: 10px;
  padding: 11px;
}

.stats-person-report-compact .stats-person-report-head {
  min-height: 0;
  padding: 14px 16px;
  border-radius: 11px;
  box-shadow: 0 10px 22px rgba(20, 61, 94, 0.11);
}

.stats-person-report-compact .stats-person-report-head h3 {
  margin-top: 3px;
  font-size: 1.12rem;
}

.stats-person-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 10px;
  min-width: 0;
}

.stats-person-report-compact .stats-report-card {
  padding: 13px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(39, 78, 125, 0.045);
}

.stats-person-report-compact .stats-report-section-title {
  margin-bottom: 10px;
}

.stats-person-domain-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.stats-person-domain-row {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e3eaf3;
  border-radius: 8px;
  background: #f9fbfd;
}

.stats-person-domain-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.stats-person-domain-main > div {
  min-width: 0;
}

.stats-person-domain-main strong,
.stats-person-domain-main span {
  display: block;
}

.stats-person-domain-main strong {
  overflow: hidden;
  color: #223d59;
  font-size: 0.76rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-person-domain-main span {
  margin-top: 2px;
  color: #8492a5;
  font-size: 0.62rem;
  font-weight: 800;
}

.stats-person-domain-main > b {
  flex: 0 0 auto;
  color: #1e4f79;
  font-size: 1rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.stats-person-domain-main > b small {
  color: #8796a8;
  font-size: 0.58rem;
}

.stats-person-domain-row > i {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.stats-person-domain-row > i em {
  display: block;
  width: min(var(--stats-progress), 100%);
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2d8cf0, #39a99d);
}

.stats-person-domain-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.stats-person-domain-metrics span {
  min-width: 0;
  overflow: hidden;
  color: #8694a6;
  font-size: 0.59rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-person-domain-metrics b {
  margin-left: 2px;
  color: #38536f;
  font-size: 0.64rem;
  font-weight: 950;
}

.stats-person-domain-empty {
  grid-column: 1 / -1;
  padding: 24px 12px;
  border: 1px dashed #dce5ef;
  border-radius: 8px;
  color: #8291a4;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.stats-report-progress-compact {
  gap: 10px;
}

.stats-person-compact-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #edf1f6;
}

.stats-person-compact-facts > span {
  display: grid;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 7px;
  color: #7c8c9f;
  background: #f5f8fb;
  font-size: 0.62rem;
  font-weight: 800;
}

.stats-person-compact-facts b {
  margin: 3px 0 1px;
  color: #243f5b;
  font-size: 0.93rem;
  font-weight: 950;
}

.stats-person-compact-facts small {
  overflow: hidden;
  color: #8b98a9;
  font-size: 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-report-disclosure {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dfe7f1;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.96);
}

.stats-company-detail .stats-report-disclosure > summary,
.stats-person-detail .stats-report-disclosure > summary {
  position: relative !important;
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  min-height: 54px !important;
  padding: 9px 13px 9px 43px !important;
  cursor: pointer !important;
  list-style: none !important;
  background: #fff !important;
  user-select: none !important;
}

.stats-report-disclosure > summary::-webkit-details-marker {
  display: none;
}

.stats-company-detail .stats-report-disclosure > summary::before,
.stats-person-detail .stats-report-disclosure > summary::before {
  position: absolute !important;
  left: 13px !important;
  top: 50% !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 21px !important;
  height: 21px !important;
  margin: 0 !important;
  border-radius: 6px !important;
  color: #3477b8 !important;
  background: #eaf3fb !important;
  content: "+" !important;
  font-size: 0.9rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  transform: translateY(-50%) !important;
}

.stats-company-detail .stats-report-disclosure[open] > summary::before,
.stats-person-detail .stats-report-disclosure[open] > summary::before {
  content: "−" !important;
  transform: translateY(-50%) !important;
}

.stats-report-disclosure > summary > div {
  min-width: 0;
}

.stats-report-disclosure > summary strong,
.stats-report-disclosure > summary span {
  display: block;
}

.stats-report-disclosure > summary strong {
  color: #28445f;
  font-size: 0.78rem;
  font-weight: 950;
}

.stats-report-disclosure > summary span {
  margin-top: 2px;
  overflow: hidden;
  color: #8492a4;
  font-size: 0.65rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-report-disclosure > summary > b {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #4e6680;
  background: #f0f4f8;
  font-size: 0.67rem;
  font-weight: 900;
  white-space: nowrap;
}

.stats-report-disclosure[open] > summary {
  border-bottom: 1px solid #e5ebf3;
  background: #f9fbfd !important;
}

.stats-disclosure-body {
  min-width: 0;
  padding: 11px;
}

.stats-disclosure-body .stats-person-campaign-wrap {
  margin: 0 !important;
}

.stats-person-replies.stats-disclosure-body {
  padding: 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .stats-person-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .stats-person-domain-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .stats-person-domain-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-company-detail .stats-report-disclosure > summary,
  .stats-person-detail .stats-report-disclosure > summary {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
}
/* Intelligent author follow-up workspace */
.author-followup-page { display: grid; gap: 18px; min-width: 0; }
.author-followup-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 126px; padding: 24px 26px; border: 1px solid #dce6ec; border-left: 4px solid #16837c; border-radius: 8px; color: #203448; background: #fff; box-shadow: 0 8px 24px rgba(30, 55, 76, .07); }
.author-followup-heading { display: flex; align-items: center; min-width: 0; gap: 16px; }
.author-followup-heading-icon { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; border: 1px solid #cde4e1; border-radius: 8px; color: #14776f; background: #edf8f6; }
.author-followup-heading-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.author-followup-context { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; color: #5d7283; font-size: 11px; font-weight: 800; }
.author-followup-context i { width: 3px; height: 3px; border-radius: 50%; background: #8da0ad; }
.author-followup-hero h1 { margin: 0; color: #1f3448; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.02em; }
.author-followup-hero p { max-width: 660px; margin: 7px 0 0; color: #6c7e8d; font-size: 13px; }
.author-followup-command { display: flex; flex: 0 0 auto; align-items: center; gap: 18px; padding-left: 22px; border-left: 1px solid #e2e9ee; }
.author-followup-mode { display: flex; align-items: center; gap: 9px; min-width: 128px; }
.author-followup-mode > span { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #1a9b78; box-shadow: 0 0 0 4px #e4f5ef; }
.author-followup-mode.is-off > span { background: #9aa8b3; box-shadow: 0 0 0 4px #eef1f3; }
.author-followup-mode small, .author-followup-mode strong { display: block; }
.author-followup-mode small { margin-bottom: 3px; color: #8a99a6; font-size: 10px; }
.author-followup-mode strong { color: #3d5264; font-size: 12px; white-space: nowrap; }
.author-followup-run { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 154px; min-height: 42px; padding: 0 15px; border: 1px solid #14776f; border-radius: 7px; color: #fff; background: #14776f; font-weight: 800; box-shadow: none; }
.author-followup-run svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.author-followup-run em { display: inline-grid; min-width: 23px; height: 23px; padding: 0 6px; place-items: center; border-radius: 5px; color: #0d5b55; background: #d6f1ed; font-size: 11px; font-style: normal; }
.author-followup-run:hover:not(:disabled) { border-color: #0f655f; background: #0f655f; }
.author-followup-run:disabled { border-color: #d6dfe5; color: #91a0ac; background: #edf1f4; box-shadow: none; cursor: not-allowed; opacity: 1; }
.author-followup-rules { display: grid; grid-template-columns: minmax(160px,1fr) auto minmax(190px,1.15fr) auto minmax(210px,1.2fr) auto minmax(150px,.85fr); align-items: stretch; gap: 10px; }
.author-followup-rules article { display: flex; align-items: flex-start; gap: 12px; padding: 17px; border: 1px solid #dbe5ee; border-radius: 16px; background: #fff; box-shadow: 0 8px 22px rgba(31, 55, 78, .06); }
.author-followup-rules article > span { display: grid; flex: 0 0 37px; height: 37px; place-items: center; border-radius: 11px; color: #126b75; background: #e5f8f5; font-size: 12px; font-weight: 900; }
.author-followup-rules article strong, .author-followup-rules article small { display: block; }
.author-followup-rules article small { margin-top: 6px; color: #64748b; line-height: 1.45; }
.author-followup-rules > i { align-self: center; color: #718096; font-size: 12px; font-style: normal; font-weight: 800; text-align: center; white-space: nowrap; }
.author-followup-rules .is-stop { border-color: #f0d5d2; background: #fff9f8; }
.author-followup-rules .is-stop > span { color: #a33f37; background: #fde8e5; }
.author-followup-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.author-followup-kpis article { min-width: 0; padding: 18px; border: 1px solid #dfe7ef; border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(35, 55, 78, .05); }
.author-followup-kpis span, .author-followup-kpis small { display: block; color: #68778b; }
.author-followup-kpis strong { display: block; margin: 7px 0 5px; color: #192b42; font-size: 28px; }
.author-followup-kpis small { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.author-followup-kpis .is-due { border-color: #a9dcd3; background: linear-gradient(145deg, #fff, #effbf8); }
.author-followup-kpis .is-due strong { color: #08736c; }
.author-followup-kpis .is-open strong { color: #316bb0; }
.author-followup-kpis .is-complete strong { color: #6c54a3; }
.author-followup-kpis .is-replied strong { color: #a04d45; }
.author-followup-progress, .author-followup-domain-summary { min-width: 0; overflow: hidden; padding: 18px 20px; border: 1px solid #dfe7ef; border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(35, 55, 78, .05); }
.author-followup-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.author-followup-progress-head span { color: #17746f; font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.author-followup-progress-head h2 { margin: 3px 0 0; color: #20364d; font-size: 18px; }
.author-followup-progress-head small { color: #718093; font-size: 12px; }
.author-followup-progress-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.author-followup-progress-item { min-width: 0; padding: 13px 14px; border: 1px solid #e2eaf0; border-radius: 10px; background: #f9fbfc; }
.author-followup-progress-label { display: flex; justify-content: space-between; gap: 8px; color: #314b61; font-size: 12px; }
.author-followup-progress-label span { color: #68788a; white-space: nowrap; }
.author-followup-progress-label b { color: #126b75; }
.author-followup-progress-track { height: 8px; margin: 12px 0 7px; overflow: hidden; border-radius: 99px; background: #e4edf0; }
.author-followup-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4aa79b, #1f7a75); transition: width .35s ease; }
.author-followup-progress-item small { color: #768697; font-size: 11px; }
.author-followup-progress-empty { padding: 10px 0; color: #8795a3; font-size: 12px; }
.author-followup-domain-summary { padding-bottom: 10px; }
.author-followup-domain-list { display: grid; gap: 0; }
.author-followup-domain-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(5, minmax(70px, .7fr)); gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #edf1f4; color: #647486; font-size: 12px; }
.author-followup-domain-row strong { overflow: hidden; color: #2f4b61; text-overflow: ellipsis; white-space: nowrap; }
.author-followup-domain-row span { white-space: nowrap; }
.author-followup-template { min-width: 0; overflow: hidden; border: 1px solid #dfe7ef; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px rgba(28, 49, 71, .06); }
.author-followup-template-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid #e7edf3; background: #f8fafc; }
.author-followup-template-head span { color: #17746f; font-size: 12px; font-weight: 850; }
.author-followup-template-head h2 { margin: 3px 0 0; color: #20364d; font-size: 18px; letter-spacing: 0; }
.author-followup-template-head p { margin: 6px 0 0; color: #6c7b8d; font-size: 13px; }
.author-followup-template-head form { flex: 0 0 auto; }
.author-followup-template-form { display: grid; gap: 14px; padding: 20px; }
.author-followup-template-form label > span { display: block; margin-bottom: 7px; color: #465b70; font-size: 12px; font-weight: 800; }
.author-followup-template-form input, .author-followup-template-form textarea { width: 100%; }
.author-followup-template-form textarea { min-height: 210px; resize: vertical; line-height: 1.65; }
.author-followup-template-variable-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: -5px; }
.author-followup-template-variable-head strong { color: #40576b; font-size: 12px; }
.author-followup-template-variable-head span { color: #8997a4; font-size: 11px; }
.author-followup-template-tokens { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 8px; }
.author-followup-template-tokens button { display: grid; min-width: 0; min-height: 54px; padding: 8px 10px; border: 1px solid #d5e1e8; border-radius: 7px; color: #314b61; background: #f8fafb; text-align: left; box-shadow: none; }
.author-followup-template-tokens button span { overflow: hidden; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.author-followup-template-tokens button code { margin-top: 4px; overflow: hidden; color: #718493; font-family: Consolas, monospace; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.author-followup-template-tokens button:hover { border-color: #78aaa5; color: #126a65; background: #eff8f6; transform: none; }
.author-followup-template-tokens button:hover code { color: #477c77; }
.author-followup-template-variable-note { margin: -3px 0 0; padding: 9px 11px; border-left: 3px solid #86bcb6; color: #687c8d; background: #f3f8f7; font-size: 11px; line-height: 1.55; }
.author-followup-template-variable-note strong { color: #3d635f; }
.author-followup-template-actions { display: flex; justify-content: flex-end; }
.author-followup-panel { min-width: 0; overflow: hidden; border: 1px solid #dfe7ef; border-radius: 20px; background: #fff; box-shadow: 0 12px 32px rgba(28, 49, 71, .07); }
.author-followup-filters { display: grid; grid-template-columns: repeat(3, minmax(140px, .75fr)) minmax(240px, 1.5fr) auto; align-items: end; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #e8eef4; background: #f8fafc; }
.author-followup-filters label > span { display: block; margin-bottom: 6px; color: #536477; font-size: 12px; font-weight: 700; }
.author-followup-filters select, .author-followup-filters input { width: 100%; min-height: 40px; }
.author-followup-filters > div { display: flex; gap: 8px; }
.author-followup-table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
.author-followup-table { width: 100%; min-width: 1120px; border-collapse: collapse; }
.author-followup-table th { padding: 13px 15px; color: #5d6d7f; background: #f6f8fb; font-size: 12px; letter-spacing: .03em; text-align: left; }
.author-followup-table td { padding: 15px; border-top: 1px solid #edf1f5; color: #24364b; vertical-align: top; }
.author-followup-table td strong, .author-followup-table td small, .author-followup-table td em { display: block; }
.author-followup-table td small { max-width: 240px; margin-top: 5px; overflow: hidden; color: #758396; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.author-followup-table td em { margin-top: 5px; color: #4b6c83; font-size: 11px; font-style: normal; }
.author-followup-table td a { color: #176d8b; font-weight: 750; text-decoration: none; }
.followup-flag { display: inline-flex; margin: 0 5px 5px 0; padding: 4px 8px; border-radius: 999px; color: #69798b; background: #edf1f5; font-size: 11px; font-weight: 750; }
.followup-flag.is-yes { color: #176995; background: #e4f3fb; }
.followup-flag.is-reply { color: #8f443c; background: #fbeae7; }
.followup-state { display: inline-flex; max-width: 180px; padding: 6px 9px; border-radius: 8px; color: #56677b; background: #eef2f6; font-size: 12px; font-weight: 800; }
.followup-state.is-due_second, .followup-state.is-due_third { color: #08736c; background: #ddf6ef; }
.followup-state.is-waiting_open { color: #9b6514; background: #fff2d8; }
.followup-state.is-completed { color: #5c4790; background: #eee9fa; }
.followup-state.is-replied { color: #984940; background: #fae8e5; }
.author-followup-empty { padding: 48px !important; color: #7a8797 !important; text-align: center; }
.author-followup-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 17px; border-top: 1px solid #e8eef4; }
.author-followup-pagination .disabled { opacity: .45; pointer-events: none; }
@media (max-width: 1280px) {
  .author-followup-rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .author-followup-rules > i { display: none; }
  .author-followup-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .author-followup-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .author-followup-filters > div { align-self: end; }
  .author-followup-template-tokens { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}
@media (max-width: 1040px) {
  .author-followup-hero { align-items: stretch; flex-direction: column; }
  .author-followup-command { justify-content: space-between; padding: 16px 0 0; border-top: 1px solid #e2e9ee; border-left: 0; }
}
@media (max-width: 720px) {
  .author-followup-hero { padding: 20px; }
  .author-followup-heading { align-items: flex-start; }
  .author-followup-heading-icon { flex-basis: 40px; width: 40px; height: 40px; }
  .author-followup-command { align-items: stretch; flex-direction: column; gap: 12px; }
  .author-followup-run { width: 100%; }
  .author-followup-rules, .author-followup-kpis, .author-followup-filters { grid-template-columns: 1fr; }
  .author-followup-kpis article { padding: 15px; }
  .author-followup-template-head { align-items: stretch; flex-direction: column; }
  .author-followup-template-head form, .author-followup-template-head button { width: 100%; }
  .author-followup-template-variable-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .author-followup-template-tokens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .author-followup-progress-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .author-followup-domain-row { grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .author-followup-domain-row strong { grid-column: 1 / -1; }
}

/* Shared page return navigation */
.app-page-backbar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  margin: 0 0 14px;
}

.app-page-back-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 0;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #d5e0e8;
  border-radius: 9px;
  color: #385166;
  background: #fff;
  box-shadow: 0 4px 12px rgba(31, 52, 72, .06);
  font-size: 13px;
  font-weight: 800;
}

.app-page-back-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.app-page-back-button:hover {
  border-color: #9ebdb9;
  color: #126c65;
  background: #f5fbfa;
  box-shadow: 0 6px 16px rgba(24, 99, 92, .09);
  transform: translateY(-1px);
}

.app-page-back-button:focus-visible {
  outline: 3px solid rgba(20, 129, 119, .18);
  outline-offset: 2px;
}

.app-page-back-hint {
  overflow: hidden;
  min-width: 0;
  color: #84929f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .app-page-backbar {
    margin-bottom: 11px;
  }

  .app-page-back-hint {
    display: none;
  }
}

/* Keep the invitation drill-down layer after legacy invitation table rules. */
.invitation-stats-filter-band {
  padding: 12px 14px;
  border: 1px solid #dfe6ec;
  border-radius: 6px;
  background: #f8fafb;
}

.invitation-stats-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.invitation-stat-kpi {
  min-height: 92px;
  padding: 13px 14px 12px;
}

.invitation-stats-section {
  border-top: 0;
}

.invitation-stats-section-head {
  padding: 18px 2px 10px;
  border-bottom: 1px solid #dfe6ec;
}

@media (max-width: 1320px) {
  .invitation-stats-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .invitation-stats-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Continuous-loop workspace refinements. */
.loop-list {
  gap: 16px;
}

.loop-run-card {
  border-color: #d5dfe6;
  box-shadow: 0 5px 18px rgba(27, 55, 75, .045);
}

.loop-run-card:hover {
  border-color: #a8c4bb;
  box-shadow: 0 8px 24px rgba(27, 75, 62, .08);
}

.loop-create-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 2px;
  padding: 10px;
  border: 1px solid #dce7e3;
  border-radius: 7px;
  background: #f5faf8;
}

.loop-create-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 10px;
  border-left: 2px solid #77a99a;
}

.loop-create-summary span {
  color: #6d7f8b;
  font-size: 11px;
}

.loop-create-summary strong {
  overflow: hidden;
  color: #1c4c40;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loop-create-collapsible {
  margin-top: 10px;
  border-top: 1px solid #e0e7eb;
}

.loop-create-collapsible > summary,
.loop-collapsed-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  cursor: pointer;
  color: #34495b;
  font-weight: 700;
  list-style: none;
}

.loop-create-collapsible > summary::-webkit-details-marker,
.loop-collapsed-section-summary::-webkit-details-marker {
  display: none;
}

.loop-create-collapsible > summary::before,
.loop-collapsed-section-summary::before {
  content: "+";
  display: inline-grid;
  flex: 0 0 20px;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #b8cbc4;
  border-radius: 50%;
  color: #176b57;
  font-size: 15px;
  line-height: 1;
}

.loop-create-collapsible[open] > summary::before,
.loop-collapsed-section[open] > .loop-collapsed-section-summary::before {
  content: "−";
}

.loop-create-collapsible > summary small,
.loop-collapsed-section-summary > div {
  min-width: 0;
}

.loop-create-collapsible > summary small {
  margin-left: auto;
  color: #6d7f8b;
  font-size: 11px;
  font-weight: 500;
}

.loop-worker-runtime-detail {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.loop-worker-runtime-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.loop-worker-runtime-summary::-webkit-details-marker {
  display: none;
}

.loop-worker-runtime-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.loop-worker-runtime-summary::before {
  content: "";
  order: 2;
  width: 7px;
  height: 7px;
  border-right: 1px solid #517267;
  border-bottom: 1px solid #517267;
  transform: rotate(45deg) translateY(-2px);
}

.loop-worker-runtime-summary > .soft-badge {
  order: 3;
}

.loop-worker-runtime-detail[open] .loop-worker-runtime-summary::before {
  transform: rotate(225deg) translateY(-1px);
}

.loop-worker-runtime-detail .loop-worker-runtime-grid {
  margin: 0 16px 16px;
}

.loop-collapsed-section-summary > div {
  display: grid;
  gap: 3px;
}

.loop-collapsed-section-summary > div span {
  color: #6d7f8b;
  font-size: 12px;
  font-weight: 500;
}

.loop-collapsed-section-body {
  padding: 0 16px 16px;
}

.loop-round-pagination {
  justify-content: space-between;
}

.loop-round-pagination button:disabled {
  cursor: default;
  opacity: .45;
}

@media (max-width: 760px) {
  .loop-create-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loop-worker-runtime-summary {
    align-items: flex-start;
  }
}

/* Reply inbox: compact ticket rows and a single-stage processing form. */
.reply-ticket-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #dce5e8;
  border-radius: 6px;
}

.reply-ticket-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.reply-ticket-table th {
  padding: 11px 12px;
  background: #f4f7f7;
  color: #5e7175;
  font-size: .72rem;
  text-align: left;
}

.reply-ticket-table th:nth-child(1) { width: 100px; }
.reply-ticket-table th:nth-child(2) { width: 150px; }
.reply-ticket-table th:nth-child(3) { width: 22%; }
.reply-ticket-table th:nth-child(4) { width: 145px; }
.reply-ticket-table th:nth-child(5) { width: 125px; }
.reply-ticket-table th:nth-child(6) { width: 19%; }
.reply-ticket-table th:nth-child(7) { width: 100px; }
.reply-ticket-table th:nth-child(8) { width: 76px; }

.reply-ticket-table td {
  min-width: 0;
  padding: 12px;
  border-top: 1px solid #e8edef;
  color: #24383c;
  font-size: .78rem;
  line-height: 1.4;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.reply-ticket-row:hover td { background: #f8fbfa; }
.reply-ticket-table td strong,
.reply-ticket-table td small { display: block; }
.reply-ticket-table td small {
  margin-top: 4px;
  color: #718084;
  font-size: .69rem;
  line-height: 1.4;
}
.reply-ticket-table td small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-ticket-table .reply-ticket-subject a {
  display: block;
  overflow: hidden;
  color: #176b67;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-ticket-table .reply-ticket-subject a:hover,
.reply-ticket-open:hover { text-decoration: underline; }
.reply-ticket-table .reply-type-pill { display: inline-flex; }
.reply-ticket-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #176b67;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.reply-conversation-page {
  max-width: 1120px;
  gap: 18px;
}
.reply-conversation-page [hidden] { display: none !important; }
.reply-conversation-page .reply-conversation-header {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 15px;
}
.reply-conversation-header-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: none;
}
.reply-conversation-page .reply-case-workspace {
  display: block;
  padding: 0;
  border: 1px solid #dce5e4;
  border-radius: 6px;
  background: #fff;
}
.reply-conversation-page .reply-case-context,
.reply-conversation-page .reply-conversation-layout,
.reply-conversation-page .reply-conversation-main,
.reply-conversation-page .reply-conversation-side {
  display: contents;
}
.reply-conversation-page .reply-original-band,
.reply-conversation-page .reply-conversation-thread,
.reply-conversation-page .reply-author-profile-panel,
.reply-conversation-page .reply-action-workspace {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.reply-conversation-page .reply-original-band,
.reply-conversation-page .reply-conversation-thread,
.reply-conversation-page .reply-author-profile-content,
.reply-conversation-page .reply-action-panel { padding: 22px 26px; }
.reply-conversation-page .reply-conversation-thread { border-top: 1px solid #e8eeee; }
.reply-conversation-page .reply-author-profile-panel > summary { display: none; }
.reply-conversation-page .reply-action-workspace { overflow: visible; }
.reply-conversation-page .reply-action-workspace-head {
  padding: 20px 26px;
  border-bottom: 1px solid #e6eceb;
  background: #f7faf9;
}
.reply-conversation-page .reply-action-workspace-head h2 { color: #244b49; }
.reply-conversation-page .reply-ai-draft-card,
.reply-conversation-page .reply-assignment-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
.reply-conversation-page .reply-form-footer {
  margin: 12px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid #e2e9e7;
}
.reply-workflow-steps {
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.reply-conversation-page button.reply-workflow-step:not(.icon-btn):not(.mode-option):not(.danger-ghost) {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  min-height: 48px;
  border: 0;
  border-bottom: 2px solid #dce6e3;
  border-radius: 0;
  background: transparent;
  color: #455d5a;
  box-shadow: none;
  text-align: left;
  transform: none;
}
.reply-conversation-page button.reply-workflow-step:not(.icon-btn):not(.mode-option):not(.danger-ghost):hover {
  border-bottom-color: #91b5ad;
  background: #f5faf8;
  color: #244b49;
  transform: none;
}
.reply-conversation-page button.reply-workflow-step.is-active:not(.icon-btn):not(.mode-option):not(.danger-ghost) {
  border: 0;
  border-bottom: 2px solid #16746b;
  background: #f0f8f5;
  color: #244b49;
  box-shadow: none;
}
.reply-workflow-step.is-active .reply-workflow-step-number {
  border-color: #16746b;
  background: #16746b;
}
.reply-workflow-step:disabled { cursor: not-allowed; opacity: .48; }
.reply-workflow-step-copy small { display: none; }
.reply-workflow-status { margin: 0; color: #586e6a; }
.reply-workflow-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 0;
}
.reply-workflow-footer > span {
  margin-right: auto;
  color: #6d7d7b;
  font-size: .76rem;
}
.reply-workflow-footer button:disabled { opacity: .5; cursor: not-allowed; }
.reply-handling-choice { padding: 22px 26px 0; }
.reply-handling-choice > strong { color: #244b49; font-size: .86rem; }
.reply-choice-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.reply-choice-options label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 70px;
  padding: 12px;
  border: 1px solid #d9e4e1;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}
.reply-choice-options label:has(input:checked) { border-color: #168078; background: #f0f8f5; }
.reply-choice-options input { flex: 0 0 auto; margin-top: 3px; accent-color: #16746b; }
.reply-choice-options span { color: #24383c; font-size: .79rem; font-weight: 800; }
.reply-choice-options small { display: block; margin-top: 4px; color: #6d7d7b; font-size: .68rem; font-weight: 400; }
.reply-compose-mode { display: inline-flex; gap: 3px; margin-bottom: 18px; padding: 3px; background: #eef3f1; border-radius: 5px; }
.reply-conversation-page .reply-compose-mode button:not(.icon-btn):not(.mode-option):not(.danger-ghost) { border: 0; border-radius: 4px; padding: 7px 12px; background: transparent; color: #566c68; box-shadow: none; transform: none; }
.reply-conversation-page .reply-compose-mode button.is-active:not(.icon-btn):not(.mode-option):not(.danger-ghost) { background: #fff; color: #176b67; box-shadow: 0 1px 4px #1b504722; }
.reply-completed-summary { padding: 30px 26px; }
.reply-completed-summary p { color: #526661; }

@media (max-width: 760px) {
  .reply-conversation-page button.reply-workflow-step:not(.icon-btn):not(.mode-option):not(.danger-ghost) { grid-template-columns: 24px minmax(0, 1fr); padding: 6px 3px; gap: 4px; }
  .reply-workflow-step-number { width: 24px; height: 24px; }
  .reply-workflow-step-copy strong { font-size: .65rem; }
  .reply-conversation-header-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reply-conversation-header-meta > div:nth-child(3) { border-top: 1px solid #e4ebf1; border-left: 0; }
  .reply-conversation-header-meta > div:nth-child(4) { border-top: 1px solid #e4ebf1; }
  .reply-choice-options { grid-template-columns: minmax(0, 1fr); }
  .reply-conversation-page .reply-original-band,
  .reply-conversation-page .reply-conversation-thread,
  .reply-conversation-page .reply-author-profile-content,
  .reply-conversation-page .reply-action-panel,
  .reply-conversation-page .reply-handling-choice,
  .reply-conversation-page .reply-action-workspace-head { padding: 16px; }
  .reply-workflow-footer { flex-wrap: wrap; }
  .reply-workflow-footer > span { order: -1; flex-basis: 100%; }
}

@media (max-width: 1200px) {
  .reply-ticket-table { min-width: 900px; }
  .reply-ticket-table th:nth-child(1) { width: 90px; }
  .reply-ticket-table th:nth-child(2) { width: 130px; }
  .reply-ticket-table th:nth-child(4) { width: 130px; }
  .reply-ticket-table th:nth-child(5) { width: 115px; }
  .reply-ticket-table th:nth-child(8) { width: 65px; }
  .reply-ticket-table th:nth-child(7),
  .reply-ticket-table td:nth-child(7) { display: none; }
}

@media (max-width: 700px) {
  .reply-ticket-table-wrap { overflow: visible; border: 0; }
  .reply-ticket-table,
  .reply-ticket-table tbody,
  .reply-ticket-table tr,
  .reply-ticket-table td { display: block; width: 100%; min-width: 0; }
  .reply-ticket-table thead { display: none; }
  .reply-ticket-table tr {
    margin-bottom: 10px;
    padding: 8px 0;
    border: 1px solid #dce5e8;
    border-radius: 5px;
  }
  .reply-ticket-table td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
    padding: 5px 12px;
    border: 0;
  }
  .reply-ticket-table td::before {
    content: attr(data-label);
    color: #72827e;
    font-size: .7rem;
    font-weight: 700;
  }
  .reply-ticket-table td > * { min-width: 0; }
  .reply-ticket-table td small { grid-column: 2; margin-top: -5px; }
  .reply-ticket-table .reply-ticket-subject a { white-space: normal; }
  .reply-ticket-table td:nth-child(7) { display: grid; }
}

/* Invitation daily summary UI: 2026-10-10 */
.invitation-section-note {
  display: block;
  margin-top: 5px;
  color: #8793a0;
  font-size: 0.7rem;
  font-weight: 500;
}

.invitation-daily-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 12px;
  overflow: hidden;
  border: 1px solid #e3e9ed;
  border-radius: 8px;
  background: #e8edf0;
}

.invitation-daily-summary > div {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 76px;
  padding: 12px 16px;
  gap: 7px;
  background: #fff;
}

.invitation-daily-summary span {
  color: #7b8996;
  font-size: 0.69rem;
  font-weight: 600;
}

.invitation-daily-summary b {
  overflow: hidden;
  color: #233a4e;
  font-family: var(--font-montserrat);
  font-size: 1.14rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-daily-summary i,
.invitation-drilldown-metrics i {
  color: #aab4bd;
  font-size: 0.75em;
  font-style: normal;
  font-weight: 500;
}

.invitation-daily-summary .is-follow-up,
.invitation-drilldown-metrics .is-follow-up b {
  color: #8b6b2c;
}

.invitation-daily-summary .is-positive {
  color: #23745f;
}

.invitation-daily-summary .is-negative {
  color: #a14f54;
}

.invitation-daily-list .invitation-drilldown:nth-child(even) > summary {
  background: #fbfcfd;
}

.invitation-daily-list .invitation-drilldown:nth-child(even) > summary:hover,
.invitation-daily-list .invitation-drilldown[open] > summary {
  background: #f4f8f8;
}

.invitation-drilldown-list {
  border-right: 1px solid #dfe6ec;
  border-bottom: 1px solid #dfe6ec;
  border-left: 1px solid #dfe6ec;
  background: #fff;
}

.invitation-drilldown {
  min-width: 0;
  border-bottom: 1px solid #e8edf1;
}

.invitation-drilldown:last-child {
  border-bottom: 0;
}

.invitation-drilldown > summary {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(700px, 5fr) 32px;
  align-items: center;
  min-height: 70px;
  padding: 10px 10px 10px 16px;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}

.invitation-drilldown > summary::-webkit-details-marker {
  display: none;
}

.invitation-drilldown > summary:hover {
  background: #f8fafb;
}

.invitation-drilldown[open] > summary {
  border-bottom: 1px solid #dfe6ec;
  background: #f5f8f9;
}

.invitation-drilldown-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.invitation-drilldown-title > strong,
.invitation-drilldown-title > a {
  overflow: hidden;
  color: #20384d;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-drilldown-title > small {
  overflow: hidden;
  color: #7d8995;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-drilldown-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(72px, 1fr));
  align-items: stretch;
  min-width: 0;
}

.invitation-drilldown-metrics > span {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 1px 10px;
  border-left: 1px solid #e5eaee;
}

.invitation-drilldown-metrics small,
.invitation-drilldown-metrics b,
.invitation-drilldown-metrics em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-drilldown-metrics small {
  color: #7c8995;
  font-size: 0.62rem;
  font-weight: 700;
}

.invitation-drilldown-metrics b {
  margin-top: 3px;
  color: #253d52;
  font-family: var(--font-montserrat);
  font-size: 0.79rem;
}

.invitation-drilldown-metrics em {
  margin-top: 1px;
  color: #8a96a1;
  font-size: 0.58rem;
  font-style: normal;
}

.invitation-drilldown-metrics .is-reply b {
  color: #15715f;
}

.invitation-drilldown-metrics .is-failure b {
  color: #b84f53;
}

.invitation-expand-icon {
  width: 18px;
  height: 18px;
  padding: 6px;
  box-sizing: content-box;
  color: #71818f;
  transition: transform 160ms ease;
}

.invitation-drilldown[open] .invitation-expand-icon {
  transform: rotate(180deg);
}

.invitation-drilldown-body {
  padding: 0 16px 14px;
  background: #f8fafb;
}

.invitation-mailbox-detail-head,
.invitation-mailbox-detail-row {
  display: grid;
  grid-template-columns: minmax(220px, 2.2fr) repeat(6, minmax(72px, 0.72fr));
  align-items: center;
  min-width: 980px;
  gap: 0;
}

.invitation-mailbox-detail-head.has-domain,
.invitation-mailbox-detail-row.has-domain {
  grid-template-columns: minmax(220px, 2.2fr) repeat(7, minmax(72px, 0.72fr));
  min-width: 1060px;
}

.invitation-mailbox-detail-head {
  min-height: 34px;
  color: #748290;
  font-size: 0.62rem;
  font-weight: 800;
}

.invitation-mailbox-detail-head > *,
.invitation-mailbox-detail-row > * {
  min-width: 0;
  padding: 7px 10px;
}

.invitation-mailbox-detail-list {
  overflow-x: auto;
  border: 1px solid #dce4ea;
  border-radius: 5px;
  background: #fff;
}

.invitation-mailbox-detail-row {
  min-height: 45px;
  border-bottom: 1px solid #edf1f4;
  color: #46596a;
  font-size: 0.7rem;
}

.invitation-mailbox-detail-row:last-child {
  border-bottom: 0;
}

.invitation-mailbox-detail-row:hover {
  background: #fbfcfd;
}

.invitation-mailbox-detail-row.is-unmatched {
  border-left: 3px solid #d39a32;
  background: #fffaf0;
}

.invitation-mailbox-identity {
  display: grid;
  gap: 2px;
}

.invitation-mailbox-identity strong {
  overflow-wrap: anywhere;
  color: #263f54;
  font-size: 0.72rem;
}

.invitation-mailbox-identity small {
  color: #85919c;
  font-size: 0.61rem;
}

.invitation-mailbox-detail-row b {
  color: #405466;
  font-family: var(--font-montserrat);
  font-size: 0.72rem;
}

.invitation-mailbox-detail-row b.is-positive {
  color: #15715f;
}

.invitation-mailbox-detail-row b.is-negative {
  color: #b84f53;
}

.invitation-batch-link {
  display: block;
}

@media (max-width: 1320px) {
  .invitation-stats-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .invitation-drilldown > summary {
    grid-template-columns: minmax(180px, 1fr) minmax(580px, 4fr) 28px;
    gap: 9px;
  }

  .invitation-drilldown-metrics > span {
    padding-right: 7px;
    padding-left: 7px;
  }
}

@media (max-width: 980px) {
  .invitation-daily-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .invitation-drilldown > summary {
    grid-template-columns: minmax(0, 1fr) 28px;
    padding: 12px;
  }

  .invitation-drilldown-title {
    grid-column: 1;
  }

  .invitation-expand-icon {
    grid-column: 2;
    grid-row: 1;
  }

  .invitation-drilldown-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .invitation-drilldown-metrics > span:nth-child(5) {
    border-left: 0;
  }

  .invitation-drilldown-body {
    padding: 0 12px 12px;
    overflow-x: auto;
  }
}

@media (max-width: 620px) {
  .invitation-daily-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-daily-summary > div {
    min-height: 68px;
    padding: 10px 12px;
  }

  .invitation-daily-summary > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .invitation-stats-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-stat-kpi {
    min-height: 86px;
  }

  .invitation-stats-facts,
  .invitation-reminder-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px 0;
  }

  .invitation-stats-facts span,
  .invitation-reminder-strip span,
  .invitation-stats-facts span:first-child,
  .invitation-reminder-strip span:first-child {
    padding: 6px 10px;
  }

  .invitation-reminder-daily-row {
    grid-template-columns: 1.35fr repeat(7, minmax(62px, 1fr));
  }

  .invitation-drilldown-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-drilldown-metrics > span:nth-child(odd) {
    border-left: 0;
  }

  .invitation-drilldown-metrics > span:nth-child(5) {
    border-left: 0;
  }

  .invitation-mailbox-detail-head {
    display: none;
  }

  .invitation-mailbox-detail-list {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .invitation-mailbox-detail-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #dce4ea;
    border-radius: 5px;
    background: #fff;
  }

  .invitation-mailbox-detail-row > *::before {
    display: block;
    margin-bottom: 2px;
    color: #8a96a1;
    content: attr(data-label);
    font-size: 0.58rem;
    font-weight: 700;
  }

  .invitation-mailbox-identity {
    grid-column: 1 / -1;
  }
}
.invitation-stats-pagination[hidden] {
  display: none;
}

/* Collapsible reply mailbox overview UI: 2026-10-10 */
.invitation-mailbox-overview-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}

.invitation-mailbox-overview-summary::-webkit-details-marker {
  display: none;
}

.invitation-mailbox-overview-summary .invitation-stats-section-head {
  flex: 1;
  min-width: 0;
}

.invitation-mailbox-overview-summary .invitation-expand-icon {
  flex: 0 0 auto;
}

.invitation-mailbox-overview[open] .invitation-mailbox-overview-summary .invitation-expand-icon {
  transform: rotate(180deg);
}

.invitation-mailbox-overview > .invitation-drilldown-body {
  padding-top: 12px;
}

/* Shared My-Task visual system: keep the product layout, align its surfaces and rhythm. */
:root {
  --bg: #f9fbfd;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --line: #e7ebf2;
  --border-color: #e7ebf2;
  --text: #252a36;
  --text-color: #252a36;
  --muted: #737b8b;
  --accent: #484c7f;
  --accent-strong: #3f4376;
  --accent-soft: #f0f1fa;
  --primary-color: #484c7f;
  --secondary-color: #f19828;
  --body-color: #f9fbfd;
  --card-color: #ffffff;
  --shadow: 0 8px 24px rgba(37, 42, 66, 0.065);
  --shadow-soft: 0 5px 16px rgba(37, 42, 66, 0.045);
  --bs-card-shadow: 0 5px 16px rgba(37, 42, 66, 0.045);
  --radius: 12px;
  --radius-sm: 8px;
}

html,
body {
  background: var(--body-color);
  color: var(--text-color);
}

body {
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

.shell:not(.shell-login) {
  background: var(--body-color);
}

.sidebar {
  border-radius: 1.1rem;
  background: var(--primary-color);
  box-shadow: 0 12px 30px rgba(43, 47, 91, 0.12);
}

.sidebar .nav > .nav-primary-link,
.nav-group-summary {
  min-height: 42px;
  border-radius: 8px;
}

.sidebar .nav > .nav-primary-link.active,
.nav-group-active > .nav-group-summary {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav .nav-group-links a {
  min-height: 38px;
  border-radius: 7px;
}

.sidebar .nav .nav-group-links a.active {
  background: rgba(241, 152, 40, 0.16);
  color: #ffffff;
}

.page {
  padding-top: 24px;
  padding-right: clamp(20px, 2.2vw, 36px);
}

.app-page-backbar {
  min-height: 34px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.app-page-back-button {
  min-height: 32px;
  border-radius: 8px;
  color: var(--accent);
}

.app-page-back-button:hover {
  background: var(--accent-soft);
}

.app-page-back-hint {
  color: #8a91a0;
}

.dashboard-shell,
.reply-workbench {
  gap: 20px;
}

.dashboard-topbar,
.mailbox-hero,
.invitation-stats-heading,
.reply-topbar {
  border-radius: var(--radius);
}

.dashboard-topbar h1,
.mailbox-hero-copy h1,
.invitation-stats-heading h1,
.reply-topbar h1 {
  color: #252a36;
  letter-spacing: -0.02em;
}

.dashboard-topbar-actions .ghost-btn,
.dashboard-topbar-actions .secondary-btn {
  min-height: 38px;
  border-radius: 8px;
}

.dashboard-panel,
.dashboard-activity-panel,
.dashboard-performance-panel,
.panel,
.stat-card,
.list-card,
.hero-card,
.mailbox-panel,
.stats-filter-panel,
.stats-panel,
.stats-compact-panel,
.reply-kpi,
.reply-detail-main,
.reply-side-block,
.reply-body-box,
.reply-draft-preview,
.template-editor-card,
.variant-template-card,
.variant-card,
.reply-card,
.mailbox-card,
.modal-card,
.login-form-card {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.dashboard-panel,
.dashboard-activity-panel,
.dashboard-performance-panel,
.panel {
  overflow: hidden;
}

.dashboard-panel-header,
.section-header,
.section-header.compact {
  min-height: 56px;
  padding: 16px 18px;
}

.dashboard-panel-header h2,
.section-header h1,
.section-header h2,
.panel h2,
.modal-header h2 {
  color: #303548;
}

.dashboard-kpi-card,
.stat-card {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.dashboard-kpi-card::before,
.stat-card::before {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  box-shadow: none;
  font-size: 21px;
}

.dashboard-kpi-card.tone-contacts::before,
.stat-card:nth-child(4n + 1)::before { background: #7182c5; }
.dashboard-kpi-card.tone-campaigns::before,
.stat-card:nth-child(4n + 2)::before { background: #8f83bd; }
.dashboard-kpi-card.tone-sent::before,
.stat-card:nth-child(4n + 3)::before { background: #67a88f; }
.dashboard-kpi-card.tone-replies::before,
.stat-card:nth-child(4n + 4)::before { background: #e0a24f; }
.dashboard-kpi-card.tone-opened::before { background: #5fa6b8; }

.table-wrap,
.table-panel,
.reply-ticket-table-wrap,
.mailbox-list-wrap {
  border-color: var(--line);
  border-radius: var(--radius-sm);
}

.table-wrap table thead th,
.table-panel table thead th,
.mailbox-list-table thead th,
.reply-ticket-table thead th {
  background: #f5f6fa;
  color: #606879;
  font-weight: 750;
}

.table-wrap table tbody tr:hover,
.table-panel table tbody tr:hover,
.mailbox-list-table tbody tr:hover {
  background: #fafbfe;
}

.secondary-btn,
.ghost-btn,
.danger-btn,
.danger-ghost,
.mini-btn,
.text-link,
.mode-option,
button:not(.icon-btn) {
  border-radius: 8px;
}

input,
select,
textarea {
  border-color: #dfe4ed;
  border-radius: 8px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #8589b5;
  box-shadow: 0 0 0 3px rgba(72, 76, 127, 0.12);
  outline: 0;
}

.pill,
.badge,
.status-badge,
.campaign-status-badge {
  border-radius: 999px;
}

@media (max-width: 1279px) {
  .page {
    padding: 22px 22px 28px;
  }
}

@media (max-width: 760px) {
  .page {
    padding: 16px 14px 24px;
  }

  .dashboard-shell,
  .reply-workbench {
    gap: 14px;
  }

  .dashboard-panel-header,
  .section-header,
  .section-header.compact {
    padding: 14px;
  }
}

/* Shared template-style page controls + fixed toast close sizing. */
.app-message-stage .app-message button.app-message-close {
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--message-color);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.app-message-stage .app-message button.app-message-close:hover,
.app-message-stage .app-message button.app-message-close:focus-visible {
  color: var(--message-color);
  background: color-mix(in srgb, var(--message-color) 12%, transparent);
  box-shadow: none;
  filter: none;
  outline: 2px solid color-mix(in srgb, var(--message-color) 24%, transparent);
  outline-offset: 1px;
  transform: none;
}

.app-message-stage .app-message button.app-message-close svg {
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.app-page-backbar {
  min-height: 46px;
  padding: 5px 8px;
  border: 1px solid #e1e4f0;
  border-radius: 11px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 3px 12px rgba(38, 42, 78, .045);
}

.app-page-back-button {
  min-height: 34px;
  padding: 6px 11px;
  border-color: #dfe1ef;
  border-radius: 8px;
  color: #484c7f;
  background: #f7f7fc;
  box-shadow: none;
  font-size: 12px;
}

.app-page-back-button:hover {
  border-color: #c7cae2;
  color: #383c70;
  background: #eeeff8;
  box-shadow: none;
}

.app-page-back-button:focus-visible {
  outline-color: rgba(72, 76, 127, .2);
}

.app-page-back-hint {
  color: #777d91;
  font-size: 11px;
}

.reply-global-reply-notice {
  top: 18px;
  right: 22px;
}

.reply-global-reply-notice-toggle {
  min-height: 36px;
  padding: 6px 10px;
  border-color: #e1e3ef;
  border-radius: 10px;
  color: #484c7f;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 16px rgba(48, 51, 91, .1);
  font-size: 12px;
  font-weight: 750;
}

.reply-global-reply-notice-toggle:hover,
.reply-global-reply-notice-toggle:focus-visible {
  border-color: #c4c7df;
  color: #373b70;
  background: #f8f8fd;
  outline: none;
  transform: translateY(-1px);
}

.reply-global-reply-notice-icon {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.reply-global-reply-notice-badge {
  min-width: 19px;
  height: 19px;
  border-radius: 7px;
  background: #484c7f;
  font-size: 10px;
}

.reply-global-reply-notice-panel {
  border-color: #e1e3ef;
  border-radius: 11px;
  box-shadow: 0 14px 34px rgba(39, 42, 78, .16);
}

@media (max-width: 760px) {
  .app-page-backbar {
    min-height: 42px;
    padding: 4px 6px;
    border-radius: 9px;
  }

  .reply-global-reply-notice {
    top: 10px;
    right: 12px;
  }
}

/* Reserve a dedicated top row so the fixed account controls never sit on page UI. */
.page {
  padding-top: 72px;
}

@media (max-width: 760px) {
  .page {
    padding-top: 64px;
  }
}

/* Screenshot-matched top-right notification + account identity menu. */
.app-global-controls {
  position: fixed;
  z-index: 1300;
  top: 12px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
}

.app-global-controls .reply-global-reply-notice {
  position: relative;
  inset: auto;
  z-index: auto;
}

.app-global-controls .reply-global-reply-notice-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #344158;
  background: transparent;
  box-shadow: none;
}

.app-global-controls .reply-global-reply-notice-toggle:hover,
.app-global-controls .reply-global-reply-notice-toggle:focus-visible {
  color: #484c7f;
  background: #f0f1f8;
  outline: none;
  transform: none;
}

.app-global-controls .reply-global-reply-notice-icon {
  width: 19px;
  height: 19px;
  fill: currentColor;
  stroke: none;
}

.app-global-controls .reply-global-reply-notice-badge {
  position: absolute;
  top: 1px;
  right: 0;
  display: inline-grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e4555d;
  color: #fff;
  font-size: 9px;
  line-height: 1;
}

.app-global-controls .reply-global-reply-notice-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: -4px;
}

.app-account-menu {
  position: relative;
  min-width: 0;
}

.app-account-menu > summary {
  list-style: none;
}

.app-account-menu > summary::-webkit-details-marker {
  display: none;
}

.app-account-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 3px 4px 3px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.app-account-trigger:hover,
.app-account-menu[open] > .app-account-trigger,
.app-account-trigger:focus-visible {
  border-color: #e4e7ef;
  background: #fff;
  box-shadow: 0 4px 14px rgba(37, 43, 68, .07);
  outline: none;
}

.app-account-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

.app-account-copy strong {
  overflow: hidden;
  max-width: 190px;
  color: #273246;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-account-copy small {
  color: #697386;
  font-size: 10px;
  line-height: 1.2;
}

.app-account-avatar {
  display: inline-grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 50%;
  outline: 1px solid #dfe3ec;
  color: #fff;
  background: linear-gradient(145deg, #777eaa, #484c7f);
  box-shadow: 0 2px 6px rgba(38, 42, 71, .12);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(32, 38, 64, .16);
}

.app-account-dropdown-user {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 9px 8px 12px;
  border-bottom: 1px solid #edf0f5;
}

.app-account-avatar-large {
  flex-basis: 42px;
  width: 42px;
  height: 42px;
}

.app-account-dropdown-user > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.app-account-dropdown-user strong,
.app-account-dropdown-user small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-account-dropdown-user strong {
  color: #273246;
  font-size: 12px;
}

.app-account-dropdown-user small {
  color: #778195;
  font-size: 10px;
}

.app-account-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-top: 5px;
  padding: 7px 9px;
  border-radius: 8px;
  color: #a63f49;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.app-account-logout:hover,
.app-account-logout:focus-visible {
  background: #fff3f3;
  outline: none;
}

.app-account-logout svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@media (max-width: 760px) {
  .app-global-controls {
    top: 8px;
    right: 10px;
    gap: 5px;
  }

  .app-account-trigger {
    min-height: 40px;
    gap: 7px;
    padding-left: 4px;
  }

  .app-account-avatar {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .app-account-copy strong {
    max-width: min(34vw, 150px);
    font-size: 11px;
  }

  .app-account-copy small {
    font-size: 9px;
  }
}


/* Compact page-back control: no full-width framed bar. */
.app-page-backbar { min-height: 0; justify-content: flex-end; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; margin: 0 0 8px; }
.app-page-back-button { min-height: 30px; padding: 5px 9px; border-color: transparent; border-radius: 7px; color: #484c7f; background: transparent; box-shadow: none; font-size: 12px; }
.app-page-back-button:hover { border-color: #c7cae2; color: #383c70; background: #f1f2f9; box-shadow: none; }
.app-page-back-button:focus-visible { outline-color: rgba(72, 76, 127, .2); }
.app-page-back-hint { display: none; }
@media (max-width: 640px) { .app-page-backbar { margin-bottom: 5px; } }


/* Place page-back control beside the notification bell. */
.app-global-controls .app-page-backbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; margin: 0; }
.app-global-controls .app-page-back-button { min-height: 34px; padding: 6px 9px; border: 1px solid #e1e3ef; border-radius: 9px; background: rgba(255,255,255,.88); color: #484c7f; font-size: 11px; white-space: nowrap; }
.app-global-controls .app-page-back-button:hover, .app-global-controls .app-page-back-button:focus-visible { border-color: #c4c7df; background: #f8f8fd; color: #373b70; outline: none; }
@media (max-width: 760px) { .app-global-controls .app-page-back-button { min-height: 32px; padding: 5px 7px; font-size: 10px; } }


/* Keep the page-back control compact inside the top-right account controls. */
.app-global-controls .app-page-backbar { width: auto !important; min-width: 0; max-width: none; margin: 0 !important; }

/* Codex UI deployment: login showcase and invitation daily statistics (2026-10-12). */
.invitation-stats-pagination[hidden] {
  display: none;
}


.invitation-mailbox-overview-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}

.invitation-mailbox-overview-summary::-webkit-details-marker {
  display: none;
}

.invitation-mailbox-overview-summary .invitation-stats-section-head {
  flex: 1;
  min-width: 0;
}

.invitation-mailbox-overview-summary .invitation-expand-icon {
  flex: 0 0 auto;
}

.invitation-mailbox-overview[open] .invitation-mailbox-overview-summary .invitation-expand-icon {
  transform: rotate(180deg);
}

.invitation-mailbox-overview > .invitation-drilldown-body {
  padding-top: 12px;
}

.invitation-week-section .invitation-stats-section-head {
  padding-top: 8px;
}

.invitation-section-note {
  display: block;
  margin-top: 5px;
  color: #8793a0;
  font-size: 0.7rem;
  font-weight: 500;
}

.invitation-daily-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 12px;
  overflow: hidden;
  border: 1px solid #e3e9ed;
  border-radius: 8px;
  background: #e8edf0;
}

.invitation-daily-summary > div {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 76px;
  padding: 12px 16px;
  gap: 7px;
  background: #fff;
}

.invitation-daily-summary > .is-total-sent {
  background: #f1f7f5;
}

.invitation-daily-summary span {
  color: #7b8996;
  font-size: 0.69rem;
  font-weight: 600;
}

.invitation-daily-summary b {
  overflow: hidden;
  color: #233a4e;
  font-family: var(--font-montserrat);
  font-size: 1.14rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-daily-summary i,
.invitation-drilldown-metrics i {
  color: #aab4bd;
  font-size: 0.75em;
  font-style: normal;
  font-weight: 500;
}

.invitation-daily-summary .is-follow-up,
.invitation-drilldown-metrics .is-follow-up b {
  color: #8b6b2c;
}

.invitation-daily-summary .is-positive {
  color: #23745f;
}

.invitation-daily-summary .is-negative {
  color: #a14f54;
}

.invitation-daily-summary .is-total-sent b,
.invitation-daily-list .invitation-daily-metrics > .is-total-sent b {
  color: #176b59;
}

/* Daily statistics use a consistent semantic palette: send, reminder,
   engagement, reply, and delivery failure remain distinguishable at a glance. */
.invitation-daily-summary > .is-total-sent,
.invitation-daily-list .invitation-daily-metrics > .is-total-sent { background: #edf7f3; }
.invitation-daily-summary > .is-first-send,
.invitation-daily-list .invitation-daily-metrics > .is-first-send { background: #eef5fc; }
.invitation-daily-summary > .is-follow-up,
.invitation-daily-list .invitation-daily-metrics > .is-follow-up { background: #fff7e8; }
.invitation-daily-summary > .is-open,
.invitation-daily-list .invitation-daily-metrics > .is-open { background: #f1f2fc; }
.invitation-daily-summary > .is-reminder-open,
.invitation-daily-list .invitation-daily-metrics > .is-reminder-open { background: #f5f0fc; }
.invitation-daily-summary > .is-positive,
.invitation-daily-list .invitation-daily-metrics > .is-reply { background: #edf7f1; }
.invitation-daily-summary > .is-failure,
.invitation-daily-list .invitation-daily-metrics > .is-failure { background: #fcf0f0; }
.invitation-daily-list .invitation-daily-metrics > .is-auto-reply { background: #eef7f8; }

.invitation-daily-summary > .is-total-sent b,
.invitation-daily-list .invitation-daily-metrics > .is-total-sent b { color: #176b59; }
.invitation-daily-summary > .is-first-send b,
.invitation-daily-list .invitation-daily-metrics > .is-first-send b { color: #2469a5; }
.invitation-daily-summary > .is-follow-up b,
.invitation-daily-list .invitation-daily-metrics > .is-follow-up b { color: #9a6411; }
.invitation-daily-summary > .is-open b,
.invitation-daily-list .invitation-daily-metrics > .is-open b { color: #4c55a1; }
.invitation-daily-summary > .is-reminder-open b,
.invitation-daily-list .invitation-daily-metrics > .is-reminder-open b { color: #7650a4; }
.invitation-daily-summary > .is-positive b,
.invitation-daily-list .invitation-daily-metrics > .is-reply b { color: #187451; }
.invitation-daily-summary > .is-failure b,
.invitation-daily-list .invitation-daily-metrics > .is-failure b { color: #ad4148; }
.invitation-daily-list .invitation-daily-metrics > .is-auto-reply b { color: #197184; }

.invitation-daily-list .invitation-daily-metrics > .is-total-sent,
.invitation-daily-list .invitation-daily-metrics > .is-first-send,
.invitation-daily-list .invitation-daily-metrics > .is-follow-up,
.invitation-daily-list .invitation-daily-metrics > .is-open,
.invitation-daily-list .invitation-daily-metrics > .is-reminder-open,
.invitation-daily-list .invitation-daily-metrics > .is-reply,
.invitation-daily-list .invitation-daily-metrics > .is-auto-reply,
.invitation-daily-list .invitation-daily-metrics > .is-failure {
  padding-left: 12px;
  border-radius: 5px;
  box-shadow: inset 3px 0 0 currentColor;
}

.invitation-daily-list .invitation-daily-metrics > .is-total-sent { color: #176b59; }
.invitation-daily-list .invitation-daily-metrics > .is-first-send { color: #2469a5; }
.invitation-daily-list .invitation-daily-metrics > .is-follow-up { color: #9a6411; }
.invitation-daily-list .invitation-daily-metrics > .is-open { color: #4c55a1; }
.invitation-daily-list .invitation-daily-metrics > .is-reminder-open { color: #7650a4; }
.invitation-daily-list .invitation-daily-metrics > .is-reply { color: #187451; }
.invitation-daily-list .invitation-daily-metrics > .is-auto-reply { color: #197184; }
.invitation-daily-list .invitation-daily-metrics > .is-failure { color: #ad4148; }

.invitation-daily-summary > .is-total-sent span,
.invitation-daily-summary > .is-first-send span,
.invitation-daily-summary > .is-follow-up span,
.invitation-daily-summary > .is-open span,
.invitation-daily-summary > .is-reminder-open span,
.invitation-daily-summary > .is-positive span,
.invitation-daily-summary > .is-failure span,
.invitation-daily-list .invitation-daily-metrics > .is-total-sent > small,
.invitation-daily-list .invitation-daily-metrics > .is-first-send > small,
.invitation-daily-list .invitation-daily-metrics > .is-follow-up > small,
.invitation-daily-list .invitation-daily-metrics > .is-open > small,
.invitation-daily-list .invitation-daily-metrics > .is-reminder-open > small,
.invitation-daily-list .invitation-daily-metrics > .is-reply > small,
.invitation-daily-list .invitation-daily-metrics > .is-auto-reply > small,
.invitation-daily-list .invitation-daily-metrics > .is-failure > small {
  color: inherit;
  opacity: 0.82;
}

.invitation-daily-list .invitation-drilldown:nth-child(even) > summary {
  background: #fbfcfd;
}

/* Keep daily metrics calm: neutral surfaces, thin separators, selective number color. */
.invitation-daily-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-color: #e3e9ed;
  background: #fff;
}

.invitation-daily-summary > div {
  min-height: 66px;
  padding: 10px 16px;
  border-right: 1px solid #edf0f2;
  border-bottom: 1px solid #edf0f2;
  background: #fff !important;
}

.invitation-daily-summary > div:nth-child(3n) { border-right: 0; }
.invitation-daily-summary > div:nth-last-child(-n + 3) { border-bottom: 0; }
.invitation-daily-summary span { color: #788692 !important; }
.invitation-daily-summary b { color: #263b4d; }
.invitation-daily-summary > .is-total-sent b { color: #176b59; }
.invitation-daily-summary > .is-follow-up b { color: #95651d; }
.invitation-daily-summary > .is-positive b { color: #28745d; }
.invitation-daily-summary > .is-negative b { color: #a14f54; }

.invitation-daily-list .invitation-daily-metrics > .is-total-sent,
.invitation-daily-list .invitation-daily-metrics > .is-first-send,
.invitation-daily-list .invitation-daily-metrics > .is-follow-up,
.invitation-daily-list .invitation-daily-metrics > .is-open,
.invitation-daily-list .invitation-daily-metrics > .is-reminder-open,
.invitation-daily-list .invitation-daily-metrics > .is-reply,
.invitation-daily-list .invitation-daily-metrics > .is-auto-reply,
.invitation-daily-list .invitation-daily-metrics > .is-failure {
  padding-left: 10px;
  border-radius: 0;
  box-shadow: none;
  background: transparent !important;
  color: inherit;
}

.invitation-daily-list .invitation-daily-metrics > .is-total-sent b { color: #176b59; }
.invitation-daily-list .invitation-daily-metrics > .is-first-send b,
.invitation-daily-list .invitation-daily-metrics > .is-open b,
.invitation-daily-list .invitation-daily-metrics > .is-reminder-open b,
.invitation-daily-list .invitation-daily-metrics > .is-auto-reply b { color: #263b4d; }
.invitation-daily-list .invitation-daily-metrics > .is-follow-up b { color: #95651d; }
.invitation-daily-list .invitation-daily-metrics > .is-reply b { color: #28745d; }
.invitation-daily-list .invitation-daily-metrics > .is-failure b { color: #a14f54; }

.invitation-daily-list .invitation-daily-metrics > .is-total-sent > small,
.invitation-daily-list .invitation-daily-metrics > .is-first-send > small,
.invitation-daily-list .invitation-daily-metrics > .is-follow-up > small,
.invitation-daily-list .invitation-daily-metrics > .is-open > small,
.invitation-daily-list .invitation-daily-metrics > .is-reminder-open > small,
.invitation-daily-list .invitation-daily-metrics > .is-reply > small,
.invitation-daily-list .invitation-daily-metrics > .is-auto-reply > small,
.invitation-daily-list .invitation-daily-metrics > .is-failure > small { color: #7c8995; opacity: 1; }

/* Daily activity is grouped by scope: overall, first outreach, and reminders. */
.invitation-daily-list .invitation-drilldown > summary {
  grid-template-columns: minmax(132px, 0.72fr) minmax(0, 3fr) 28px;
}

.invitation-daily-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  min-width: 0;
  border: 1px solid #e6ebef;
  border-radius: 7px;
  background: #fff;
}

.invitation-daily-group {
  min-width: 0;
  padding: 9px 12px 10px;
}

.invitation-daily-group + .invitation-daily-group {
  border-left: 1px solid #e6ebef;
}

.invitation-daily-group h3 {
  margin: 0 0 8px;
  color: #617383;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.025em;
}

.invitation-daily-group > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.invitation-daily-group > div > span:not(.invitation-reminder-counts) {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 3px;
}

.invitation-daily-group small {
  overflow: hidden;
  color: #84919b;
  font-size: 0.59rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-daily-group b {
  overflow: hidden;
  color: #263b4d;
  font-family: var(--font-montserrat);
  font-size: 0.8rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invitation-daily-group em {
  color: #52697a;
  font-size: 0.62rem;
  font-weight: 700;
  font-style: normal;
}

.invitation-daily-group .is-total-sent b { color: #176b59; }
.invitation-daily-group .is-reply b { color: #28745d; }
.invitation-daily-group .is-failure b { color: #a14f54; }

.invitation-daily-group .invitation-reminder-counts {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
}

.invitation-daily-group .invitation-reminder-count-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.invitation-daily-group .invitation-reminder-count-breakdown > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 4px 6px;
  border: 1px solid #e6ebef;
  border-radius: 5px;
  background: #fafbfc;
}

.invitation-daily-group .invitation-reminder-count-breakdown small { font-size: 0.53rem; }
.invitation-daily-group .invitation-reminder-count-breakdown b { font-size: 0.69rem; }

/* Lay each group's values out as consistent compact tiles instead of loose text. */
.invitation-daily-groups {
  align-items: start;
}

.invitation-daily-group {
  padding: 11px 12px 12px;
}

.invitation-daily-group h3 {
  display: flex;
  align-items: center;
  min-height: 24px;
  margin: 0 0 9px;
  padding: 0 0 7px;
  border-bottom: 1px solid #edf0f2;
  color: #41586b;
  font-size: 0.68rem;
}

.invitation-daily-group > div {
  align-content: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.invitation-daily-group > div > span:not(.invitation-reminder-counts) {
  min-height: 49px;
  padding: 7px 9px;
  gap: 4px;
  border: 1px solid #edf0f2;
  border-radius: 5px;
  background: #fafbfc;
}

.invitation-daily-group > div > .is-total-sent {
  border-color: #d9ebe4;
  background: #f4faf7;
}

.invitation-daily-group > div > .is-reply {
  border-color: #deeee6;
  background: #f5faf7;
}

.invitation-daily-group > div > .is-failure {
  border-color: #f0e1e2;
  background: #fdf8f8;
}

.invitation-daily-group > div > .is-total-sent b,
.invitation-daily-group > div > .is-reply b,
.invitation-daily-group > div > .is-failure b {
  color: inherit;
}

.invitation-daily-group > div > .is-total-sent b { color: #176b59; }
.invitation-daily-group > div > .is-reply b { color: #28745d; }
.invitation-daily-group > div > .is-failure b { color: #a14f54; }

.invitation-daily-group .invitation-reminder-counts {
  padding: 7px 9px;
  border: 1px solid #edf0f2;
  border-radius: 5px;
  background: #fafbfc;
}

.invitation-daily-list .invitation-drilldown:nth-child(even) > summary:hover,
.invitation-daily-list .invitation-drilldown[open] > summary {
  background: #f4f8f8;

}

/* Daily rows carry more independent metrics than batch/domain rows. Give
   them a compact two-line grid so large counts never compete for one strip. */
.invitation-daily-list .invitation-drilldown > summary {
  grid-template-columns: minmax(132px, 0.72fr) minmax(0, 3fr) 28px;
  align-items: start;
  gap: 10px;
}

.invitation-daily-list .invitation-daily-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  row-gap: 5px;
}

.invitation-daily-list .invitation-daily-metrics > span {
  min-height: 38px;
  padding: 2px 9px;
}

.invitation-daily-list .invitation-daily-metrics > span:nth-child(4n + 1) {
  border-left: 0;
}

.invitation-daily-list .invitation-drilldown-title {
  padding-top: 8px;
}

.invitation-daily-list .invitation-reminder-counts {
  grid-row: span 2;
  align-content: start;
  gap: 5px;
}

.invitation-daily-list .invitation-reminder-count-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.invitation-daily-list .invitation-reminder-count-breakdown > span {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 3px 6px;
  border: 1px solid #e6ebef;
  border-radius: 5px;
  background: #f8fafb;
}

.invitation-daily-list .invitation-reminder-count-breakdown small {
  font-size: 0.56rem;
}

.invitation-daily-list .invitation-reminder-count-breakdown b {
  margin-top: 2px;
  font-size: 0.72rem;
}

.invitation-daily-list .invitation-drilldown > summary > .invitation-expand-icon {
  margin-top: 7px;


  .invitation-daily-list .invitation-drilldown > summary {
    grid-template-columns: minmax(118px, 0.68fr) minmax(0, 3fr) 26px;
    gap: 7px;
  }
}

@media (max-width: 980px) {
  .invitation-daily-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }


  .invitation-daily-list .invitation-drilldown > summary {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .invitation-daily-groups {
    grid-column: 1 / -1;
  }

  .invitation-daily-list .invitation-daily-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .invitation-daily-list .invitation-daily-metrics > span:nth-child(4n + 1) {
    border-left: 0;
  }


  .invitation-daily-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-daily-summary > div {
    min-height: 68px;
    padding: 10px 12px;
  }

  .invitation-daily-summary > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }


  }

  .invitation-daily-list .invitation-daily-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invitation-daily-list .invitation-daily-metrics > span:nth-child(even) {
    border-left: 1px solid #e5eaee;
  }

  .invitation-daily-list .invitation-daily-metrics > span:nth-child(odd) {
    border-left: 0;

}

/* Login page: restrained 3D workflow cube based on the supplied animation. */
.login-layout.login-layout-cube {
  width: min(1080px, 100%);
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.login-cube-showcase {
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
  min-height: 590px;
  padding: 38px 34px 28px;
  overflow: hidden;
  border: 1px solid rgba(72, 76, 127, .12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 54%, rgba(157, 168, 235, .3), transparent 43%),
    linear-gradient(145deg, #fff 0%, #f6f7ff 55%, #eceefe 100%);
  box-shadow: 0 26px 70px rgba(48, 51, 91, .11), inset 0 1px #fff;
}

.login-cube-copy { position: relative; z-index: 1; }
.login-cube-eyebrow { color: #6c72a0; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.login-cube-copy h1 { margin: 14px 0 10px; color: #292d53; font-size: clamp(25px, 3vw, 34px); line-height: 1.34; letter-spacing: -.035em; }
.login-cube-copy p { margin: 0; color: #747b96; font-size: 13px; line-height: 1.7; }

.login-cube-stage {
  position: relative;
  display: grid;
  min-height: 310px;
  place-items: center;
  perspective: 900px;
  isolation: isolate;
}

.login-cube-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(112, 123, 211, .22);
  filter: blur(48px);
}

.login-cube {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 220px;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(-32deg);
  animation: login-cube-rotate 9s ease-in-out infinite;
  transition: transform .6s cubic-bezier(.2,.75,.25,1);
}

.login-cube-stage:hover .login-cube { animation-play-state: paused; transform: rotateX(-18deg) rotateY(-28deg) scale(.96); }
.login-cube-outer, .login-cube-inner { position: absolute; inset: 0; transform-style: preserve-3d; }
.login-cube-face { position: absolute; display: grid; align-content: center; justify-items: center; gap: 5px; box-sizing: border-box; width: 220px; height: 220px; border: 1px solid rgba(113, 123, 202, .55); background: linear-gradient(145deg, rgba(255,255,255,.68), rgba(181,190,246,.44)); color: #3e4477; box-shadow: inset 0 0 28px rgba(255,255,255,.36), 0 0 28px rgba(105,117,207,.12); backdrop-filter: blur(2px); backface-visibility: hidden; transition: transform .65s cubic-bezier(.2,.75,.25,1), background .3s ease; }
.login-cube-face span { color: #777fba; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.login-cube-face strong { font-size: 17px; font-weight: 750; }
.face-front { transform: translateZ(110px); }
.face-back { transform: rotateY(180deg) translateZ(110px); }
.face-left { transform: rotateY(-90deg) translateZ(110px); }
.face-right { transform: rotateY(90deg) translateZ(110px); }
.face-top { transform: rotateX(90deg) translateZ(110px); }
.face-bottom { transform: rotateX(-90deg) translateZ(110px); }
.login-cube-stage:hover .face-front { transform: translateZ(174px); }
.login-cube-stage:hover .face-back { transform: rotateY(180deg) translateZ(174px); }
.login-cube-stage:hover .face-left { transform: rotateY(-90deg) translateZ(174px); }
.login-cube-stage:hover .face-right { transform: rotateY(90deg) translateZ(174px); }
.login-cube-stage:hover .face-top { transform: rotateX(90deg) translateZ(174px); }
.login-cube-stage:hover .face-bottom { transform: rotateX(-90deg) translateZ(174px); }

.login-cube-core-face { position: absolute; display: grid; width: 88px; height: 88px; place-items: center; border: 1px solid rgba(255,255,255,.76); background: linear-gradient(145deg, #737bbd, #484c7f); color: #fff; box-shadow: 0 8px 26px rgba(53,58,117,.28); font-size: 23px; font-weight: 850; letter-spacing: -.06em; backface-visibility: hidden; }
.login-cube-inner { top: 66px; left: 66px; width: 88px; height: 88px; }
.login-cube-inner .face-front { transform: translateZ(44px); }
.login-cube-inner .face-back { transform: rotateY(180deg) translateZ(44px); }
.login-cube-inner .face-left { transform: rotateY(-90deg) translateZ(44px); }
.login-cube-inner .face-right { transform: rotateY(90deg) translateZ(44px); }
.login-cube-inner .face-top { transform: rotateX(90deg) translateZ(44px); }
.login-cube-inner .face-bottom { transform: rotateX(-90deg) translateZ(44px); }

.login-cube-orbit { position: absolute; z-index: -1; width: 290px; height: 108px; border: 1px solid rgba(117,126,200,.24); border-radius: 50%; transform: rotate(-23deg); }
.login-cube-orbit.orbit-two { width: 330px; height: 138px; border-color: rgba(117,126,200,.14); transform: rotate(31deg); }
.login-cube-caption { display: flex; align-items: center; gap: 9px; color: #747b96; font-size: 11px; font-weight: 650; }
.login-cube-caption span { width: 7px; height: 7px; border-radius: 50%; background: #717ac1; box-shadow: 0 0 0 4px rgba(113,122,193,.12); }

@keyframes login-cube-rotate {
  0%, 100% { transform: rotateX(-12deg) rotateY(-32deg); }
  50% { transform: rotateX(-17deg) rotateY(-20deg); }
}

.login-form-card.login-form-card-center { justify-self: stretch; max-width: 420px; }

@media (max-width: 760px) {
  .login-layout.login-layout-cube { width: min(480px, 100%); grid-template-columns: 1fr; gap: 18px; }
  .login-cube-showcase { min-height: 0; grid-template-rows: auto 240px auto; padding: 24px 22px 20px; border-radius: 22px; }
  .login-cube-copy h1 { font-size: 24px; }
  .login-cube-stage { min-height: 240px; transform: scale(.76); }
  .login-cube-caption { justify-content: center; }
  .login-form-card.login-form-card-center { max-width: none; padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-cube { animation: none; }
  .login-cube-face, .login-cube { transition-duration: .01ms; }
}

/* A single cohesive login showcase: mode-specific signal, shared workflow cube. */
.login-layout.login-layout-cube {
  width: min(1120px, 100%);
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: clamp(28px, 5vw, 68px);
}
.login-mode-revenue {
  --login-accent: #5864c8;
  --login-accent-bright: #8792ff;
  --login-ink: #242b56;
  --login-glow: rgba(100, 116, 230, .28);
}
.login-mode-startup {
  --login-accent: #087f87;
  --login-accent-bright: #39c7b2;
  --login-ink: #123e50;
  --login-glow: rgba(43, 188, 171, .28);
}
.login-cube-showcase {
  position: relative;
  min-height: 590px;
  grid-template-rows: auto minmax(320px, 1fr) auto;
  padding: 42px 38px 30px;
  border-color: color-mix(in srgb, var(--login-accent) 15%, white);
  background:
    radial-gradient(ellipse at 50% 53%, var(--login-glow), transparent 43%),
    radial-gradient(ellipse at 0% 100%, color-mix(in srgb, var(--login-accent) 9%, transparent), transparent 45%),
    linear-gradient(145deg, #fff 0%, #f8f9ff 50%, color-mix(in srgb, var(--login-accent) 8%, #f4f5ff) 100%);
  box-shadow: 0 30px 80px rgba(40, 48, 98, .13), inset 0 1px #fff;
}
.login-mode-startup .login-cube-showcase {
  background:
    radial-gradient(ellipse at 50% 53%, var(--login-glow), transparent 43%),
    radial-gradient(ellipse at 0% 100%, rgba(25, 168, 155, .09), transparent 45%),
    linear-gradient(145deg, #fff 0%, #f5fcfb 53%, #eaf8f7 100%);
}
.login-cube-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--login-accent) 14%, white);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--login-accent);
  font-size: 9px;
  letter-spacing: .14em;
  box-shadow: 0 5px 18px rgba(40, 48, 98, .05);
}
.login-cube-eyebrow i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}
.login-eyebrow-mark {
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 3px;
  transform: rotate(45deg);
  box-shadow: 0 0 12px color-mix(in srgb, var(--login-accent) 50%, transparent);
}
.login-cube-copy h1 {
  margin-top: 19px;
  color: var(--login-ink);
  font-size: clamp(27px, 3.1vw, 36px);
  line-height: 1.3;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.login-cube-copy p { max-width: 440px; font-size: 13px; }
.login-cube-stage { min-height: 330px; }
.login-cube-glow {
  width: 255px;
  height: 255px;
  background: var(--login-glow);
  filter: blur(58px);
}
.login-cube { width: 210px; height: 210px; }
.login-cube-face {
  width: 210px;
  height: 210px;
  gap: 8px;
  align-content: end;
  padding: 0 12px 30px;
  border-color: color-mix(in srgb, var(--login-accent) 40%, white);
  background: linear-gradient(145deg, rgba(255,255,255,.23), color-mix(in srgb, var(--login-accent) 4%, rgba(255,255,255,.12)));
  color: var(--login-ink);
  box-shadow: inset 0 0 24px rgba(255,255,255,.2), 0 0 25px color-mix(in srgb, var(--login-accent) 7%, transparent);
  backdrop-filter: none;
}
.login-cube-face span {
  color: var(--login-accent);
  font-size: 8px;
  letter-spacing: .15em;
  text-shadow: 0 0 14px color-mix(in srgb, var(--login-accent) 24%, transparent);
}
.login-cube-face strong {
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--login-accent) 17%, white);
  border-radius: 999px;
  background: rgba(255,255,255,.76);
  font-size: 15px;
  letter-spacing: .04em;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--login-accent) 12%, transparent);
}
.login-cube .face-front { transform: translateZ(105px); }
.login-cube .face-back { transform: rotateY(180deg) translateZ(105px); }
.login-cube .face-left { transform: rotateY(-90deg) translateZ(105px); }
.login-cube .face-right { transform: rotateY(90deg) translateZ(105px); }
.login-cube .face-top { transform: rotateX(90deg) translateZ(105px); }
.login-cube .face-bottom { transform: rotateX(-90deg) translateZ(105px); }
.login-cube-stage:hover .login-cube .face-front { transform: translateZ(105px); }
.login-cube-stage:hover .login-cube .face-back { transform: rotateY(180deg) translateZ(105px); }
.login-cube-stage:hover .login-cube .face-left { transform: rotateY(-90deg) translateZ(105px); }
.login-cube-stage:hover .login-cube .face-right { transform: rotateY(90deg) translateZ(105px); }
.login-cube-stage:hover .login-cube .face-top { transform: rotateX(90deg) translateZ(105px); }
.login-cube-stage:hover .login-cube .face-bottom { transform: rotateX(-90deg) translateZ(105px); }
.login-cube-emblem {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  transform: translate(-50%, -50%) translateZ(107px);
  transform-style: preserve-3d;
  pointer-events: none;
}
.login-cube-emblem-ring {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--login-accent) 28%, transparent);
  border-radius: 28px;
  background: linear-gradient(145deg, color-mix(in srgb, white 25%, transparent), color-mix(in srgb, var(--login-accent) 8%, transparent));
  box-shadow: inset 0 1px rgba(255,255,255,.65), 0 5px 14px color-mix(in srgb, var(--login-accent) 14%, transparent);
}
.login-cube-emblem-core {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 23px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--login-accent-bright) 88%, white), var(--login-accent));
  box-shadow: 0 5px 12px color-mix(in srgb, var(--login-accent) 25%, transparent), inset 0 1px rgba(255,255,255,.52);
  transform: translateZ(3px);
}
.login-cube-emblem-core svg {
  width: 47px;
  height: 47px;
  fill: none;
  stroke: white;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(12, 35, 67, .2));
}
.login-cube-emblem-label {
  position: absolute;
  bottom: -14px;
  color: var(--login-accent);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .2em;
  text-shadow: 0 1px 5px white;
}
.login-cube-orbit { border-color: color-mix(in srgb, var(--login-accent) 22%, transparent); }
.login-cube-orbit.orbit-two { border-color: color-mix(in srgb, var(--login-accent) 13%, transparent); }
.login-cube-orbit.orbit-three {
  position: absolute;
  z-index: -1;
  width: 245px;
  height: 245px;
  border: 1px dashed color-mix(in srgb, var(--login-accent) 15%, transparent);
  border-radius: 50%;
  animation: login-orbit-spin 36s linear infinite;
}
.login-cube-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: var(--login-ink);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  box-shadow: 0 12px 32px rgba(35, 48, 91, .1);
  backdrop-filter: blur(10px);
  animation: login-float 5s ease-in-out infinite;
}
.login-cube-float b { color: var(--login-accent); font-size: 12px; }
.login-cube-float-a { left: 5%; top: 23%; }
.login-cube-float-b { right: 3%; bottom: 19%; animation-delay: -2.5s; }
.login-cube-caption { gap: 10px; flex-wrap: wrap; color: var(--login-accent); }
.login-cube-caption > span { background: var(--login-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--login-accent) 13%, transparent), 0 0 16px var(--login-glow); }
.login-cube-caption strong { color: var(--login-ink); font-size: 11px; }
.login-cube-caption i { margin-left: auto; color: #8b91aa; font-size: 7px; font-style: normal; font-weight: 800; letter-spacing: .13em; }
.login-form-card.login-form-card-center {
  border: 1px solid rgba(108, 119, 172, .12);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(38, 47, 88, .13), 0 2px 7px rgba(38, 47, 88, .04);
}
@keyframes login-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes login-orbit-spin { from { transform: rotate(0deg) scaleX(.78); } to { transform: rotate(360deg) scaleX(.78); } }
@media (max-width: 760px) {
  .login-cube-showcase { grid-template-rows: auto 240px auto; padding: 25px 22px 20px; }
  .login-cube-stage { min-height: 240px; transform: none; }
  .login-cube { transform: scale(.78) rotateX(-22deg) rotateY(-32deg); }
  .login-cube-float { padding: 7px 9px; }
  .login-cube-float-a { left: 0; top: 12%; }
  .login-cube-float-b { right: 0; bottom: 10%; }
  .login-cube-caption i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .login-cube-orbit.orbit-three, .login-cube-float { animation: none; }
}

@media (max-width: 900px) {
  .login-layout.login-layout-cube {
    width: min(560px, 100%);
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .login-cube-showcase { min-height: 560px; }
  .login-form-card.login-form-card-center { width: 100%; max-width: none; }
}

/* Keep the illustration and form inside one shared login surface. */
.login-layout.login-layout-cube {
  position: relative;
  gap: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--login-accent) 15%, white);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 27% 55%, var(--login-glow), transparent 34%),
    linear-gradient(145deg, #fff 0%, #f8f9ff 53%, color-mix(in srgb, var(--login-accent) 7%, #f4f5ff) 100%);
  box-shadow: 0 30px 80px rgba(40, 48, 98, .13), inset 0 1px #fff;
}
.login-mode-startup.login-layout.login-layout-cube {
  background:
    radial-gradient(ellipse at 27% 55%, var(--login-glow), transparent 34%),
    linear-gradient(145deg, #fff 0%, #f5fcfb 53%, #eaf8f7 100%);
}
.login-layout.login-layout-cube .login-cube-showcase {
  min-height: 620px;
  border: 0;
  border-radius: 29px 0 0 29px;
  background: radial-gradient(ellipse at 53% 56%, color-mix(in srgb, var(--login-accent) 7%, transparent), transparent 48%);
  box-shadow: none;
}
.login-layout.login-layout-cube .login-cube-face {
  border-color: color-mix(in srgb, var(--login-accent) 25%, transparent);
  background: color-mix(in srgb, white 9%, transparent);
  box-shadow: inset 0 0 20px rgba(255,255,255,.12);
}
.login-layout.login-layout-cube .login-cube-face span,
.login-layout.login-layout-cube .login-cube-face strong { display: none; }
.login-layout.login-layout-cube .login-cube-face .login-cube-face-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--login-accent) 68%, white);
  background-image: radial-gradient(color-mix(in srgb, var(--login-accent) 11%, transparent) .8px, transparent 1px);
  background-position: center;
  background-size: 14px 14px;
  opacity: .82;
}
.login-layout.login-layout-cube .login-cube-face .login-cube-face-art::before {
  position: absolute;
  width: 88px;
  height: 88px;
  border: 1px solid color-mix(in srgb, var(--login-accent) 15%, transparent);
  border-radius: 26px;
  background: linear-gradient(145deg, color-mix(in srgb, white 17%, transparent), color-mix(in srgb, var(--login-accent) 4%, transparent));
  box-shadow: inset 0 1px rgba(255,255,255,.55), 0 8px 24px color-mix(in srgb, var(--login-accent) 5%, transparent);
  content: "";
}
.login-layout.login-layout-cube .login-cube-face-art svg {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(255,255,255,.8));
}
.login-layout.login-layout-cube .login-cube-face.face-top .login-cube-face-art::before,
.login-layout.login-layout-cube .login-cube-face.face-bottom .login-cube-face-art::before { width: 74px; height: 74px; border-radius: 50%; }
.login-layout.login-layout-cube .login-form-card.login-form-card-center {
  position: relative;
  align-self: center;
  justify-self: stretch;
  width: auto;
  max-width: none;
  margin: 28px 0;
  padding: clamp(30px, 5vw, 68px);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.login-layout.login-layout-cube .login-form-card.login-form-card-center::before { display: none; }
.login-layout.login-layout-cube .login-form-card.login-form-card-center::after {
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 0;
  width: 1px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--login-accent) 18%, transparent), transparent);
  content: "";
}
.login-layout.login-layout-cube .login-form-card h2 { color: var(--login-ink); }

@media (max-width: 900px) {
  .login-layout.login-layout-cube { border-radius: 26px; }
  .login-layout.login-layout-cube .login-cube-showcase {
    min-height: 560px;
    border-radius: 25px 25px 0 0;
  }
  .login-layout.login-layout-cube .login-form-card.login-form-card-center {
    margin: 0;
    padding: 30px 44px 42px;
  }
  .login-layout.login-layout-cube .login-form-card.login-form-card-center::after {
    top: 0;
    right: 9%;
    bottom: auto;
    left: 9%;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--login-accent) 18%, transparent), transparent);
  }
}
@media (max-width: 600px) {
  .login-layout.login-layout-cube { border-radius: 22px; }
  .login-layout.login-layout-cube .login-cube-showcase {
    min-height: 500px;
    grid-template-rows: auto 240px auto;
    padding: 28px 22px 22px;
    border-radius: 21px 21px 0 0;
  }
  .login-layout.login-layout-cube .login-form-card.login-form-card-center { padding: 28px 24px 34px; }
  .login-cube-emblem { width: 102px; height: 102px; }
  .login-cube-emblem-core { width: 68px; height: 68px; border-radius: 20px; }
  .login-cube-float { font-size: 8px; }
}

/* Keep the login experience usable in embedded / ultra-narrow browser panes. */
@media (max-width: 420px) {
  .page.page-login { padding: 18px 10px; }
  .login-layout.login-layout-cube {
    width: 100%;
    border-radius: 18px;
  }
  .login-layout.login-layout-cube .login-cube-showcase {
    min-height: 560px;
    grid-template-rows: auto minmax(320px, 1fr) auto;
    padding: 28px 22px 22px;
    border-radius: 17px 17px 0 0;
  }
  .login-cube-copy h1 { font-size: clamp(23px, 7vw, 30px); }
  .login-cube-copy p { font-size: 11px; }
  .login-cube-stage { min-height: 320px; overflow: hidden; }
  .login-cube { transform: scale(.9) rotateX(-22deg) rotateY(-32deg); }
  .login-cube-emblem { width: 102px; height: 102px; }
  .login-cube-emblem-ring { border-radius: 21px; }
  .login-cube-emblem-core { width: 68px; height: 68px; border-radius: 20px; }
  .login-cube-emblem-core svg { width: 42px; height: 42px; }
  .login-cube-float { display: flex; font-size: 8px; }
  .login-cube-float-a { left: 0; top: 18%; }
  .login-cube-float-b { right: 0; bottom: 14%; }
  .login-cube-caption { justify-content: flex-start; font-size: 10px; }
  .login-layout.login-layout-cube .login-form-card.login-form-card-center {
    padding: 22px 18px 26px;
  }
}

@media (max-width: 240px) {
  .page.page-login { padding: 12px 8px; }
  .login-layout.login-layout-cube .login-cube-showcase {
    min-height: 500px;
    grid-template-rows: auto minmax(260px, 1fr) auto;
    padding: 24px 16px 18px;
  }
  .login-cube-stage { min-height: 260px; }
  .login-cube { transform: scale(.72) rotateX(-22deg) rotateY(-32deg); }
  .login-cube-caption { font-size: 9px; }
  .login-layout.login-layout-cube .login-form-card.login-form-card-center {
    padding: 18px 14px 22px;
  }
}

