.communication-mode .main-content > :not(#communication-screen) {
  display: none !important;
}

.comm-nav-button svg {
  flex: 0 0 auto;
}

#communication-screen {
  --comm-navy: #102338;
  --comm-blue: #075ea8;
  --comm-green: #6abd45;
  --comm-ink: #172235;
  --comm-muted: #64748b;
  --comm-line: #dce4ec;
  color: var(--comm-ink);
  display: grid;
  gap: 16px;
  padding-bottom: 44px;
}

.comm-toolbar,
.comm-panel,
.comm-stat,
.comm-email-preview,
.comm-campaign-card,
.comm-template-card,
.comm-system-retention {
  background: #fff;
  border: 1px solid var(--comm-line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(16, 35, 56, 0.07);
}

.comm-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 10px;
}

.comm-loading,
.comm-load-error {
  align-items: center;
  background: #fff;
  border: 1px solid var(--comm-line);
  border-radius: 14px;
  display: flex;
  gap: 13px;
  min-height: 92px;
  padding: 18px;
}

.comm-loading b,
.comm-load-error b {
  display: block;
  font-size: 15px;
  margin-bottom: 3px;
}

.comm-loading p,
.comm-load-error p {
  color: var(--comm-muted);
  font-size: 13px;
  margin: 0;
}

.comm-loading-spinner {
  animation: comm-spin 0.8s linear infinite;
  border: 3px solid #d9e6f2;
  border-radius: 50%;
  border-top-color: var(--comm-blue);
  flex: 0 0 auto;
  height: 30px;
  width: 30px;
}

.comm-load-error {
  background: #fff9ed;
  border-color: #efd59e;
  color: #8b5604;
}

.comm-load-error > div {
  flex: 1 1 auto;
}

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

.comm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.comm-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #526276;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 7px;
  min-height: 38px;
  padding: 9px 13px;
}

.comm-tab:hover,
.comm-tab.active {
  background: #eaf3fb;
  color: var(--comm-blue);
}

.comm-version {
  background: #eaf7e5;
  border-radius: 999px;
  color: #397b23;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
  white-space: nowrap;
}

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

.comm-stat {
  align-items: center;
  display: flex;
  gap: 12px;
  min-height: 78px;
  padding: 15px;
}

.comm-stat-icon {
  align-items: center;
  background: #eaf3fb;
  border-radius: 11px;
  color: var(--comm-blue);
  display: flex;
  height: 43px;
  justify-content: center;
  width: 43px;
}

.comm-stat.green .comm-stat-icon {
  background: #eaf7e5;
  color: #3c8f25;
}

.comm-stat.orange .comm-stat-icon {
  background: #fff3de;
  color: #b96605;
}

.comm-stat strong {
  display: block;
  font-size: 23px;
  line-height: 1;
  margin-bottom: 5px;
}

.comm-stat small {
  color: var(--comm-muted);
  font-size: 12px;
}

.comm-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
}

.comm-column {
  display: grid;
  gap: 16px;
}

.comm-panel {
  padding: 18px;
}

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

.comm-panel-heading h2,
.comm-panel-heading h3 {
  color: var(--comm-navy);
  font-size: 17px;
  margin: 0 0 4px;
}

.comm-panel-heading p,
.comm-panel p {
  color: var(--comm-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.comm-step {
  align-items: center;
  background: var(--comm-navy);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.comm-check-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.comm-choice {
  align-items: flex-start;
  background: #f7f9fc;
  border: 1px solid var(--comm-line);
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.comm-choice:has(input:checked) {
  background: #eff8eb;
  border-color: #8bcf6f;
}

.comm-choice input {
  accent-color: var(--comm-green);
  height: 17px;
  margin-top: 2px;
  width: 17px;
}

.comm-choice b {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.comm-choice small {
  color: var(--comm-muted);
  font-size: 12px;
}

.comm-filter-row,
.comm-field-grid {
  display: grid;
  gap: 11px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.comm-field {
  display: grid;
  gap: 5px;
}

.comm-field.full {
  grid-column: 1 / -1;
}

.comm-field span {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.comm-field input,
.comm-field select,
.comm-field textarea {
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 9px;
  color: var(--comm-ink);
  font: inherit;
  font-size: 14px;
  min-height: 41px;
  padding: 9px 11px;
  width: 100%;
}

.comm-field textarea {
  line-height: 1.5;
  min-height: 118px;
  resize: vertical;
}

.comm-field input:focus,
.comm-field select:focus,
.comm-field textarea:focus {
  border-color: var(--comm-blue);
  box-shadow: 0 0 0 3px rgba(7, 94, 168, 0.12);
  outline: none;
}

.comm-recipient-summary {
  background: #f6f9fc;
  border-radius: 11px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 13px;
  padding: 12px;
}

.comm-recipient-summary div {
  border-right: 1px solid var(--comm-line);
  padding: 0 10px;
}

.comm-recipient-summary div:last-child {
  border-right: 0;
}

.comm-recipient-summary b {
  display: block;
  font-size: 19px;
  margin-bottom: 3px;
}

.comm-recipient-summary small {
  color: var(--comm-muted);
  font-size: 11px;
}

.comm-send-note {
  align-items: center;
  background: #eaf7e5;
  border: 1px solid #c6e8b9;
  border-radius: 10px;
  color: #356c24;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
}

.comm-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 16px;
}

.comm-button {
  align-items: center;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
}

.comm-button.primary {
  background: var(--comm-green);
  color: #13290d;
}

.comm-button.primary:hover {
  background: #7bca58;
}

.comm-button.secondary {
  background: var(--comm-navy);
  color: #fff;
}

.comm-button.tertiary {
  background: #eaf0f6;
  color: var(--comm-navy);
}

.comm-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.comm-preview-shell {
  background: #e9eef4;
  border-radius: 14px;
  padding: 15px;
}

.comm-preview-meta {
  color: #5f6f82;
  display: grid;
  font-size: 11px;
  gap: 4px;
  margin-bottom: 10px;
}

.comm-email-preview {
  overflow: hidden;
}

.comm-email-head {
  align-items: center;
  background: var(--comm-navy);
  display: flex;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px 18px;
}

.comm-email-head img {
  background: #fff;
  border-radius: 7px;
  height: 48px;
  object-fit: contain;
  padding: 4px;
  width: 112px;
}

.comm-email-head span {
  color: #b8c7d8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comm-email-body {
  padding: 24px 22px 21px;
}

.comm-email-kicker {
  color: var(--comm-green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.comm-email-body h2 {
  color: var(--comm-navy);
  font-size: 23px;
  line-height: 1.2;
  margin: 7px 0 12px;
}

.comm-email-body p {
  color: #445269;
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 17px;
}

.comm-email-cta {
  background: var(--comm-green);
  border-radius: 8px;
  color: #14270e;
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  padding: 11px 16px;
  text-decoration: none;
}

.comm-email-footer {
  border-top: 1px solid #e6ebf0;
  color: #7b8797;
  font-size: 10px;
  line-height: 1.5;
  padding: 13px 22px;
}

.comm-protection {
  background: #fff8e8;
  border: 1px solid #efd59f;
  border-radius: 12px;
  padding: 14px;
}

.comm-protection h3 {
  align-items: center;
  color: #7a4a05;
  display: flex;
  font-size: 14px;
  gap: 7px;
  margin: 0 0 6px;
}

.comm-protection p {
  color: #795a29;
  font-size: 12px;
  margin-bottom: 10px;
}

.comm-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comm-chip {
  background: #fff;
  border: 1px solid #e6cb96;
  border-radius: 999px;
  color: #6e4c18;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
}

.comm-template-grid,
.comm-campaign-list {
  display: grid;
  gap: 12px;
}

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

.comm-template-card,
.comm-campaign-card {
  padding: 17px;
}

.comm-template-card h3,
.comm-campaign-card h3 {
  color: var(--comm-navy);
  font-size: 15px;
  margin: 0 0 6px;
}

.comm-template-card p,
.comm-campaign-card p {
  min-height: 38px;
}

.comm-card-bottom {
  align-items: center;
  border-top: 1px solid #edf1f5;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 13px;
  padding-top: 12px;
}

.comm-status {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
}

.comm-status.sent {
  background: #e8f6e3;
  color: #397b23;
}

.comm-status.scheduled {
  background: #e8f1fb;
  color: #075b9b;
}

.comm-campaign-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 13px;
}

.comm-campaign-metrics div {
  background: #f5f8fb;
  border-radius: 8px;
  padding: 9px;
}

.comm-campaign-metrics b {
  display: block;
  font-size: 16px;
}

.comm-campaign-metrics small {
  color: var(--comm-muted);
  font-size: 10px;
}

.comm-modal-backdrop {
  align-items: center;
  background: rgba(8, 22, 37, 0.66);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 5000;
}

.comm-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  max-height: min(760px, 92vh);
  max-width: 620px;
  overflow: auto;
  padding: 22px;
  width: 100%;
}

.comm-modal h2 {
  color: var(--comm-navy);
  font-size: 21px;
  margin: 0 0 7px;
}

.comm-review-list {
  border: 1px solid var(--comm-line);
  border-radius: 10px;
  margin-top: 14px;
  max-height: 205px;
  overflow: auto;
}

.comm-review-row {
  align-items: center;
  border-bottom: 1px solid #edf1f5;
  display: flex;
  font-size: 12px;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 11px;
}

.comm-review-row:last-child {
  border-bottom: 0;
}

.comm-review-row b {
  color: var(--comm-navy);
}

.comm-review-row span {
  color: var(--comm-muted);
}

.comm-modal-warning {
  background: #fff5df;
  border-radius: 9px;
  color: #77500f;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 13px;
  padding: 11px;
}

.comm-toast {
  background: var(--comm-navy);
  border-left: 5px solid var(--comm-green);
  border-radius: 9px;
  bottom: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  max-width: 370px;
  padding: 13px 16px;
  position: fixed;
  right: 24px;
  z-index: 6000;
}

.comm-empty {
  background: #fff;
  border: 1px dashed #c9d4e0;
  border-radius: 13px;
  color: var(--comm-muted);
  padding: 36px;
  text-align: center;
}

.comm-system-retention {
  margin-top: 16px;
  padding: 18px;
}

.comm-retention-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.comm-retention-grid div {
  background: #f5f8fb;
  border-radius: 9px;
  padding: 11px;
}

.comm-retention-grid b {
  color: var(--comm-navy);
  display: block;
  font-size: 16px;
}

.comm-retention-grid small {
  color: var(--comm-muted);
  font-size: 11px;
}

@media (max-width: 1050px) {
  .comm-stats {
    grid-template-columns: 1fr 1fr;
  }

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

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

@media (max-width: 700px) {
  #communication-screen {
    gap: 12px;
  }

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

  .comm-version {
    align-self: flex-end;
  }

  .comm-stats,
  .comm-template-grid,
  .comm-check-grid,
  .comm-filter-row,
  .comm-field-grid,
  .comm-retention-grid {
    grid-template-columns: 1fr;
  }

  .comm-recipient-summary,
  .comm-campaign-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .comm-recipient-summary div:nth-child(2) {
    border-right: 0;
  }

  .comm-email-head {
    padding: 12px;
  }

  .comm-email-head span {
    display: none;
  }

  .comm-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .comm-button {
    width: 100%;
  }
}
