.communications-dashboard {
  --comm-ink: #172438;
  --comm-muted: #566983;
  --comm-blue: #2057d6;
  --comm-line: #dfe6f0;
  --comm-panel: #fff;
  color: var(--comm-ink);
  min-width: 0;
}

.communications-dashboard [hidden] { display: none; }
.communications-dashboard a { text-decoration: none; }
.communications-dashboard a:hover { text-decoration: underline; }
.communications-dashboard :focus-visible { outline: 2px solid #2860e1; outline-offset: 3px; }
.comm-heading, .comm-toolbar, .comm-card-head, .comm-card-foot, .comm-breakdown-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.comm-heading { margin-bottom: 20px; }
.comm-heading h1 {
  margin: 8px 0 6px;
  font-size: clamp(24px, 2.05vw, 29px);
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: -.8px;
}
.comm-heading p { margin: 0; color: var(--comm-muted); font-size: 14px; }
.comm-breadcrumb, .comm-period, .comm-heading-actions, .comm-toolbar-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.comm-heading-actions { flex-wrap: wrap; max-width: 100%; }
.comm-breadcrumb, .comm-period { color: var(--comm-muted); font-size: 12px; }
.comm-breadcrumb a { color: inherit; }
.comm-breadcrumb .icon { width: 13px; height: 13px; }
.comm-period { white-space: nowrap; }
.comm-period .icon { width: 16px; height: 16px; }
.comm-report-scope { padding: 13px 16px; margin-bottom: 16px; border: 1px solid var(--comm-line); border-radius: 10px; background: #fff; }
.comm-scope-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.comm-scope-head strong { font-size: 13px; }
.comm-scope-head p { margin: 4px 0 8px; font-size: 12px; line-height: 1.5; color: var(--comm-muted); }
.comm-scope-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.comm-scope-filters > span { border-radius: 5px; padding: 4px 7px; background: #edf3fc; color: #405472; font-size: 12px; overflow-wrap: anywhere; }
.comm-report-scope .tg-report-coverage { margin: 9px 0 0; }
.comm-toolbar { margin-bottom: 16px; }
.comm-toolbar-main { flex-wrap: wrap; }
.comm-tool, .comm-employee-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--comm-line);
  color: #405472;
  font-size: 12px;
  white-space: nowrap;
}
.comm-tool:hover { background: #f7f9fd; color: var(--comm-blue); }
.comm-tool .icon, .comm-employee-picker .icon { width: 16px; height: 16px; flex: none; }
.comm-employee-picker select {
  min-height: 32px;
  max-width: min(220px, 55vw);
  border: 0;
  border-radius: 4px;
  padding: 0 5px 0 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
.comm-segments {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #eaf0f7;
  border-radius: 8px;
  white-space: nowrap;
}
.comm-segments button {
  min-height: 29px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--comm-muted);
  font-size: 12px;
}
.comm-segments button:hover { color: var(--comm-blue); }
.comm-segments button[aria-pressed='true'] {
  background: #fff;
  color: var(--comm-ink);
  border-color: #e1e8f4;
  box-shadow: 0 1px 3px #1a4a8a0c;
  font-weight: 720;
}

.comm-metrics, .comm-main-grid { display: grid; gap: 13px; margin-bottom: 16px; }
.comm-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.comm-main-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; }
.comm-card, .comm-metric {
  min-width: 0;
  border: 1px solid var(--comm-line);
  border-radius: 12px;
  background: var(--comm-panel);
  box-shadow: 0 2px 6px #21395806;
}
.comm-metric {
  min-height: 125px;
  padding: 15px 14px 12px;
  display: grid;
  align-content: start;
  gap: 9px;
  text-align: left;
}
.comm-metric-label { display: flex; align-items: center; gap: 8px; color: #405473; font-size: 12px; font-weight: 680; }
.comm-metric-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex: none; }
.comm-metric-icon .icon { width: 15px; height: 15px; }
.comm-metric-icon.blue { background: #e9efff; color: #245de5; }
.comm-metric-icon.green { background: #e4f5ef; color: #157a62; }
.comm-metric-icon.red { background: #fceced; color: #b72e40; }
.comm-metric strong { font-size: clamp(24px, 2.15vw, 31px); letter-spacing: -.8px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.comm-metric-note { color: var(--comm-muted); font-size: 11px; line-height: 1.3; }
.comm-metric-link { cursor: pointer; }
.comm-metric-link:hover, .comm-metric-link[aria-expanded="true"] {
  background: #f5f8ff;
  border-color: #c1d3fa;
}
.comm-metric-link:focus-visible { outline: 2px solid var(--comm-blue); outline-offset: 2px; }
.comm-metric-cta { display: flex; align-items: center; gap: 5px; color: var(--comm-blue); font-size: 12px; font-weight: 650; }
.comm-metric-cta .icon { width: 14px; height: 14px; }
.comm-metric-alert { background: #fff9f9; border-color: #f0d0d5; color: #ab2938; }
.comm-metric-alert:hover { background: #fff1f2; }

.comm-card-head { align-items: flex-start; padding: 16px 18px 12px; }
.comm-card-head h2, .comm-breakdown-heading h2 { margin: 0; font-size: 16px; line-height: 1.28; letter-spacing: -.2px; }
.comm-card-head p { margin: 5px 0 0; color: var(--comm-muted); font-size: 12px; line-height: 1.35; }
.comm-card-foot {
  margin-top: auto;
  border-top: 1px solid var(--comm-line);
  padding: 11px 18px;
  min-height: 41px;
  color: var(--comm-muted);
  font-size: 11px;
}
.comm-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--comm-blue);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.comm-link:hover { text-decoration: underline; }
.comm-link .icon { width: 15px; height: 15px; }
.comm-empty { margin: 0; padding: 20px 18px; color: var(--comm-muted); font-size: 13px; }
.comm-activity, .comm-queue { display: flex; flex-direction: column; min-height: 412px; }
.comm-chart-value { display: flex; align-items: baseline; gap: 8px; padding: 0 18px 2px; color: var(--comm-muted); font-size: 12px; }
.comm-chart-value strong { color: var(--comm-ink); font-size: 24px; font-variant-numeric: tabular-nums; }
.comm-chart { --comm-plot-height: 198px; display: flex; gap: 8px; margin: 8px 18px 0; min-width: 0; }
.comm-chart-axis {
  display: flex;
  flex: 0 0 25px;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: calc(var(--comm-plot-height) + 12px);
  margin-top: 8px;
  color: var(--comm-muted);
  font-size: 10px;
  line-height: 12px;
}
.comm-chart-scroll { flex: 1; min-width: 0; overflow-x: auto; }
.comm-chart-days {
  display: flex;
  gap: 7px;
  margin: 0;
  padding: 14px 4px 0;
  list-style: none;
  min-width: max-content;
  background: repeating-linear-gradient(to bottom, #e8edf5 0 1px, transparent 1px calc(var(--comm-plot-height) / 4)) top 14px left / 100% calc(var(--comm-plot-height) + 1px) no-repeat;
}
.comm-chart-days li { flex: 1 0 39px; min-width: 0; }
.comm-chart-day {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
  padding: 0 0 3px;
  border: 0;
  background: transparent;
  color: var(--comm-muted);
  font-size: 11px;
  white-space: nowrap;
}
.comm-chart-day:focus-visible { outline-offset: -2px; border-radius: 5px; }
.comm-plot-track { display: flex; align-items: flex-end; border-bottom: 1px solid var(--comm-line); height: var(--comm-plot-height); width: 100%; justify-content: center; }
.comm-plot-bar { display: block; position: relative; height: var(--comm-height); width: min(41px, 68%); border-radius: 5px 5px 3px 3px; background: #487be1; }
.comm-chart-day:hover .comm-plot-bar, .comm-chart-day[aria-pressed='true'] .comm-plot-bar { background: #2457ce; }
.comm-chart-day[aria-pressed='true'] time { color: var(--comm-blue); font-weight: 720; }
.comm-plot-bar > span { position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%); color: #415b81; font-size: 10px; font-weight: 700; }
.comm-chart-key { display: flex; align-items: center; gap: 6px; color: var(--comm-muted); margin: 10px 18px 19px; font-size: 11px; }
.comm-chart-key > span { width: 8px; height: 8px; background: #487be1; border-radius: 3px; }

.comm-count { display: inline-block; padding: 2px 6px; background: #fcecee; color: #ab2938; border-radius: 5px; font-size: 11px; vertical-align: 1px; }
.comm-queue ol { list-style: none; margin: 0 18px; padding: 0; }
.comm-queue li { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; padding: 11px 0; border-bottom: 1px solid #e9edf3; }
.comm-queue li:last-child { border-bottom: 0; }
.comm-queue-entry { display: flex; gap: 10px; min-width: 0; }
.comm-queue-entry > div { min-width: 0; }
.comm-queue-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: #cf8624; flex: none; }
.comm-queue li.urgent .comm-queue-dot { background: #d26472; }
.comm-queue-chat { color: var(--comm-ink); font-size: 13px; font-weight: 730; overflow-wrap: anywhere; }
.comm-queue-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 3px 0; color: var(--comm-muted); font-size: 12px; overflow-wrap: anywhere; }
.comm-queue li small { display: block; color: var(--comm-muted); font-size: 11px; }
.comm-queue-time { padding-top: 1px; color: #8b510a; text-align: right; white-space: nowrap; font-size: 12px; font-variant-numeric: tabular-nums; }
.comm-queue-time small { margin-top: 2px; }
.comm-queue li.urgent .comm-queue-time { color: #aa2d39; }

.comm-manager { margin: 0 0 16px; }
.comm-manager-scroll { position: relative; overflow-x: auto; }
.comm-manager table { width: 100%; min-width: 625px; border-collapse: collapse; text-align: left; }
.comm-manager thead { background: #f5f7fa; }
.comm-manager th, .comm-manager td { border-top: 1px solid #e7edf4; padding: 9px 13px; font-size: 13px; }
.comm-manager th:first-child { padding-left: 18px; width: 27%; }
.comm-manager th:last-child, .comm-manager td:last-child { width: 40px; }
.comm-manager th button, .comm-row-arrow { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; text-align: left; color: inherit; font-size: inherit; }
.comm-manager thead th { font-size: 11px; color: var(--comm-muted); white-space: nowrap; }
.comm-manager thead th[aria-sort] { color: var(--comm-blue); }
.comm-manager thead button span { color: #6d83a2; }
.comm-manager tbody tr:hover { background: #f7f9fd; }
.comm-manager tbody td { font-weight: 590; font-variant-numeric: tabular-nums; }
.comm-manager tbody th { font-weight: 650; }
.comm-row-arrow .icon { width: 14px; height: 14px; color: #526887; }
.comm-person-avatar { width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #e1ebfb; color: #29568c; font-size: 11px; }
.comm-person-avatar.tone-0 { background: #f0e7f8; color: #744691; }
.comm-person-avatar.tone-2 { background: #e2f0e9; color: #28694e; }
.comm-person-avatar.tone-3 { background: #dfedf0; color: #246779; }
.comm-person-avatar.tone-4 { background: #f9e9dc; color: #8a4c21; }
.comm-breakdown-heading { margin: 0 0 10px; }
.comm-breakdown-heading h2, .tg-attention-title, .comm-queue { scroll-margin-top: 85px; }
.communications-dashboard #tg-attention-title { scroll-margin-top: 90px; }
.comm-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 16px; color: var(--comm-muted); font-size: 11px; }
.comm-footer .tg-report-coverage { margin: 0; font-size: inherit; }
.comm-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1120px) {
  .comm-metric { min-height: 119px; padding: 12px 10px; }
  .comm-metric-label { font-size: 11px; }
  .comm-card-head, .comm-card-foot { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 995px) {
  .comm-metrics { grid-template-columns: repeat(auto-fit, minmax(133px, 1fr)); }
  .comm-main-grid { grid-template-columns: minmax(0, 1fr); }
  .comm-activity, .comm-queue { min-height: 0; }
}
@media (max-width: 640px) {
  .comm-scope-head { flex-wrap: wrap; gap: 4px; }
  .comm-heading, .comm-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .comm-heading { margin-bottom: 14px; }
  .comm-heading p { font-size: 13px; }
  .comm-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .comm-metric { min-height: 112px; }
  .comm-metric-alert { grid-column: 1 / -1; }
  .comm-card-head { flex-wrap: wrap; gap: 8px; }
  .comm-chart { --comm-plot-height: 160px; }
  .comm-chart-days { gap: 4px; }
  .comm-chart-days li { flex-basis: 33px; }
  .comm-segments button { padding: 0 9px; }
  .comm-queue li { gap: 7px; }
}
