/* Operational Clarity: Comms workspace, desktop only. */
@media (min-width: 901px) {
  body.fh-console-nav.fh-clarity #commsPage {
    --comm-canvas: #f4f7fa;
    --comm-surface: #fff;
    --comm-inset: #f7f9fb;
    --comm-line: #dce3eb;
    --comm-ink: #172633;
    --comm-muted: #536572;
    --comm-cyan: #087f9c;
    --comm-cyan-deep: #075f7c;
    --comm-cyan-soft: #eaf6f9;
    box-sizing: border-box;
    min-width: 0 !important;
    min-height: 0 !important;
    color: var(--comm-ink) !important;
    color-scheme: light;
    background: var(--comm-canvas) !important;
  }

  body.fh-console-nav.fh-clarity #commsPage,
  body.fh-console-nav.fh-clarity #commsPage * { box-sizing: border-box; }

  body.fh-console-nav.fh-clarity #commsPage .communication-grid {
    width: 100%; min-width: 0; min-height: 0; gap: 8px;
    grid-template-columns: minmax(218px, 0.82fr) minmax(390px, 1.55fr) minmax(218px, 0.82fr);
  }

  body.fh-console-nav.fh-clarity #commsPage .communication-panel {
    min-width: 0; min-height: 0; border: 1px solid var(--comm-line) !important;
    border-radius: 6px !important; background: var(--comm-surface) !important;
    color: var(--comm-ink) !important; box-shadow: 0 1px 2px #1726330a !important;
  }

  body.fh-console-nav.fh-clarity #commsPage :is(.comm-panel-head, .comm-thread-head) { border-color: var(--comm-line); }
  body.fh-console-nav.fh-clarity #commsPage .comm-panel-head { padding: 13px 14px 10px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-panel-head :is(h1, h2),
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-person h2 {
    margin: 0; color: var(--comm-ink) !important; font-size: 16px; line-height: 1.35;
  }
  body.fh-console-nav.fh-clarity #commsPage :is(.comm-panel-head p, .comm-thread-person p, .comm-contact-meta, .comm-contact-state, #communicationStatus) {
    color: var(--comm-muted) !important; font-size: 12px; line-height: 1.4;
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-panel-head p { margin: 4px 0 0; }

  body.fh-console-nav.fh-clarity #commsPage .comm-search-row { gap: 7px; padding: 0 12px 10px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-search-shell {
    min-width: 0; height: 38px; border: 1px solid #cbd5df; border-radius: 5px;
    background: #fff; color: var(--comm-muted);
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-search-shell:focus-within { border-color: var(--comm-cyan); box-shadow: 0 0 0 2px #087f9c1a; }
  body.fh-console-nav.fh-clarity #commsPage .comm-search-shell input { min-width: 0; min-height: 0 !important; height: 100%; background: transparent !important; color: var(--comm-ink); font-size: 12px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-search-shell input::placeholder { color: var(--comm-muted); opacity: 1; }

  body.fh-console-nav.fh-clarity #commsPage :is(.comm-icon-button, .comm-thread-actions button, .comm-template-button, .comm-context-body select) {
    border: 1px solid #cbd5df; border-radius: 5px; background: #fff; color: var(--comm-cyan-deep);
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-icon-button { width: 38px; height: 38px; min-width: 38px; }
  body.fh-console-nav.fh-clarity #commsPage :is(.comm-icon-button, .comm-thread-actions button, .comm-compose-tools button, .comm-contacts-footer button, .comm-context-body button):focus-visible {
    outline: 2px solid var(--comm-cyan); outline-offset: 2px;
  }

  body.fh-console-nav.fh-clarity #commsPage .comm-contact-list {
    min-width: 0; min-height: 0; gap: 6px; padding: 0 10px 8px; overflow: auto; overscroll-behavior: contain;
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-contact {
    min-width: 0; min-height: 68px; grid-template-columns: 36px minmax(0, 1fr); gap: 7px 9px;
    padding: 9px; border: 1px solid var(--comm-line); border-radius: 5px;
    background: #fff; color: var(--comm-ink); text-align: left;
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-contact:hover { border-color: #9dc7d1; background: #f8fcfd; }
  body.fh-console-nav.fh-clarity #commsPage .comm-contact.active,
  body.fh-console-nav.fh-clarity #commsPage .comm-contact.active:hover {
    border-color: #84bdcb !important; background: var(--comm-cyan-soft) !important; box-shadow: inset 3px 0 var(--comm-cyan) !important;
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-avatar {
    width: 36px; height: 36px; color: var(--comm-cyan-deep); background: var(--comm-cyan-soft); font-size: 12px;
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-avatar.violet { color: #6049a5; background: #f1edfb; }
  body.fh-console-nav.fh-clarity #commsPage .comm-avatar.amber { color: #795500; background: #fff6df; }
  body.fh-console-nav.fh-clarity #commsPage .comm-avatar.green { color: #27693b; background: #eaf6ed; }
  body.fh-console-nav.fh-clarity #commsPage .comm-contact-copy { min-width: 0; gap: 3px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-contact-title {
    min-width: 0; color: var(--comm-ink); font-size: 13px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere;
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-contact-meta { overflow-wrap: anywhere; white-space: normal; }
  body.fh-console-nav.fh-clarity #commsPage .comm-role-pill { color: var(--comm-cyan-deep); font-size: 11px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-role-pill.manager { color: #6049a5; }
  body.fh-console-nav.fh-clarity #commsPage .comm-role-pill.dispatcher { color: #795500; }
  body.fh-console-nav.fh-clarity #commsPage .comm-contact-state { font-size: 11px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-contact-state.online i,
  body.fh-console-nav.fh-clarity #commsPage .comm-contact-state.moving i,
  body.fh-console-nav.fh-clarity #commsPage .comm-contact-state.on-duty i,
  body.fh-console-nav.fh-clarity #commsPage .comm-contact-state.driving i { background: #278044; }
  body.fh-console-nav.fh-clarity #commsPage .comm-contacts-footer { flex-basis: 40px; border-color: var(--comm-line); }
  body.fh-console-nav.fh-clarity #commsPage .comm-contacts-footer button { color: var(--comm-cyan-deep); font-size: 12px; }

  body.fh-console-nav.fh-clarity #commsPage .comm-thread-head { min-width: 0; flex-basis: 70px; gap: 10px; padding: 10px 13px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-head .comm-avatar { width: 38px; height: 38px; flex-basis: 38px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-person { min-width: 0; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-person p { margin: 3px 0 0; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-person p.online i { background: #278044; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-actions { gap: 5px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-actions button { min-height: 34px; gap: 6px; padding: 0 9px; font-size: 12px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-actions button.icon-only { width: 36px; min-width: 36px; }

  body.fh-console-nav.fh-clarity #commsPage .comm-thread {
    min-width: 0; min-height: 0; gap: 9px; padding: 12px 14px;
    overflow: auto; overscroll-behavior: contain; background: var(--comm-inset);
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-empty { color: var(--comm-muted); font-size: 13px; line-height: 1.5; }
  body.fh-console-nav.fh-clarity #commsPage :is(.comm-day-divider, .comm-unread-divider) { color: var(--comm-muted); font-size: 12px; }
  body.fh-console-nav.fh-clarity #commsPage :is(.comm-day-divider::before, .comm-day-divider::after, .comm-unread-divider::before, .comm-unread-divider::after) { background: var(--comm-line); }
  body.fh-console-nav.fh-clarity #commsPage .comm-unread-divider { color: var(--comm-cyan-deep); font-weight: 700; }
  body.fh-console-nav.fh-clarity #commsPage .comm-bubble {
    max-width: min(520px, 82%); padding: 10px 12px 8px; border: 1px solid var(--comm-line);
    border-radius: 8px; background: #fff; color: var(--comm-ink);
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-bubble.mine { border-color: #a9d4df; background: #eaf6f9; }
  body.fh-console-nav.fh-clarity #commsPage .comm-bubble.issue { border-color: #e6c78d; background: #fff8e8; }
  body.fh-console-nav.fh-clarity #commsPage .comm-bubble.resolved { opacity: .78; }
  body.fh-console-nav.fh-clarity #commsPage .comm-bubble-body { color: var(--comm-ink); font-size: 13px; line-height: 1.5; }
  body.fh-console-nav.fh-clarity #commsPage .comm-bubble-head { color: var(--comm-muted); font-size: 11px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-read-action { color: var(--comm-muted); font-size: 12px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-bubble-resolve { border-color: #c69b47; background: #fff; color: #684a0d; font-size: 11px; }

  body.fh-console-nav.fh-clarity #commsPage .comm-template-scope {
    flex: 0 0 auto; display: grid; grid-template-columns: minmax(92px, auto) minmax(0, 1fr) auto;
    align-items: center; gap: 7px; margin: 0 13px; padding: 8px 0; border-top: 1px solid var(--comm-line);
    color: var(--comm-muted); font-size: 11px;
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-template-scope select,
  body.fh-console-nav.fh-clarity #commsPage .comm-context-body select {
    min-width: 0; min-height: 34px; padding: 0 8px; font-size: 12px;
  }
  body.fh-console-nav.fh-clarity #commsPage #communicationTemplateScopeStatus { grid-column: 1 / -1; font-size: 11px; }

  body.fh-console-nav.fh-clarity #commsPage .comm-compose {
    min-width: 0; min-height: 108px; grid-template-columns: minmax(0, 1fr) 96px; gap: 9px;
    margin: 0 13px 8px; padding-top: 9px; border-color: var(--comm-line);
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-compose-field { min-width: 0; border-color: #cbd5df; border-radius: 5px; background: #fff; }
  body.fh-console-nav.fh-clarity #commsPage .comm-compose-field textarea { min-height: 54px; color: var(--comm-ink); font: 13px/1.45 Inter, Arial, sans-serif; }
  body.fh-console-nav.fh-clarity #commsPage .comm-compose-field textarea::placeholder { color: var(--comm-muted); opacity: 1; }
  body.fh-console-nav.fh-clarity #commsPage .comm-compose-tools button { color: var(--comm-muted); }
  body.fh-console-nav.fh-clarity #commsPage .comm-compose-tools button:hover { background: var(--comm-cyan-soft); color: var(--comm-cyan-deep); }
  body.fh-console-nav.fh-clarity #commsPage .comm-compose-actions { min-width: 0; gap: 7px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-send-button {
    min-height: 40px; border: 1px solid var(--comm-cyan-deep) !important; border-radius: 5px; background: var(--comm-cyan-deep) !important;
    color: #fff !important; font-size: 13px;
  }
  body.fh-console-nav.fh-clarity #commsPage :is(.comm-template-button, .comm-template-manage-v144) { min-height: 34px; font-size: 12px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-template-manage-v144 { border: 1px solid #cbd5df !important; border-radius: 5px; background: #fff !important; color: var(--comm-cyan-deep) !important; }
  body.fh-console-nav.fh-clarity #commsPage .comm-template-menu,
  body.fh-console-nav.fh-clarity #commsPage .comm-more-menu {
    border: 1px solid var(--comm-line); border-radius: 6px; background: #fff; color: var(--comm-ink);
    box-shadow: 0 8px 24px #1726331f;
  }
  body.fh-console-nav.fh-clarity #commsPage :is(.comm-template-menu button, .comm-more-menu button) { color: var(--comm-ink); font-size: 12px; }
  body.fh-console-nav.fh-clarity #commsPage :is(.comm-template-menu button:hover, .comm-more-menu button:hover) { background: var(--comm-cyan-soft); }
  body.fh-console-nav.fh-clarity #commsPage #communicationStatus { flex: 0 0 auto; padding: 0 13px 8px; }

  body.fh-console-nav.fh-clarity #commsPage .comm-context-body { padding: 0 12px 10px; gap: 9px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-vehicle-select-shell {
    min-width: 0; min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 9px;
    border: 1px solid #cbd5df; border-radius: 5px; background: #fff; color: var(--comm-ink);
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-vehicle-select-shell select { flex: 1 1 auto; border: 0; }
  body.fh-console-nav.fh-clarity #commsPage .comm-context-list { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  body.fh-console-nav.fh-clarity #commsPage .comm-context-card { border: 1px solid var(--comm-line); border-radius: 5px; background: #fff; color: var(--comm-ink); }
  body.fh-console-nav.fh-clarity #commsPage .comm-context-person :is(b, span),
  body.fh-console-nav.fh-clarity #commsPage .comm-context-facts :is(div, b) { color: var(--comm-ink); font-size: 12px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-context-facts { border-color: var(--comm-line); }
  body.fh-console-nav.fh-clarity #commsPage .comm-quick-grid { gap: 6px; }
  body.fh-console-nav.fh-clarity #commsPage :is(.comm-quick-grid button, .comm-open-live) {
    min-width: 0; min-height: 36px; border: 1px solid #cbd5df; border-radius: 5px;
    background: #fff; color: var(--comm-cyan-deep); font-size: 12px;
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-open-live { flex: 0 0 auto; }
  body.fh-console-nav.fh-clarity #commsPage [hidden] { display: none !important; }

  /* These dialogs are portalled outside the Comms page. */
  body.fh-console-nav.fh-clarity .fh-data-modal-card:has(:is(#communicationFiltersForm,#communicationTemplateFormV144,.comm-template-manager-v144)) {
    background: #fff !important;
    color: #172633 !important;
    border-color: #dce3eb !important;
  }
  body.fh-console-nav.fh-clarity .fh-data-modal-card:has(:is(#communicationFiltersForm,#communicationTemplateFormV144,.comm-template-manager-v144)) .fh-data-modal-body {
    font-size: 13px !important;
    line-height: 1.5;
  }
  body.fh-console-nav.fh-clarity :is(#communicationFiltersForm,#communicationTemplateFormV144) label {
    color: #536572 !important;
    font-size: 12px !important;
    gap: 6px;
  }
  body.fh-console-nav.fh-clarity :is(#communicationFiltersForm,#communicationTemplateFormV144) :is(input,select,textarea) {
    box-sizing: border-box;
    min-height: 38px;
    padding: 9px 10px;
    border: 1px solid #cbd5df;
    border-radius: 5px;
    background: #fff !important;
    color: #172633 !important;
    font: 13px/1.5 Inter, Arial, sans-serif !important;
  }
  body.fh-console-nav.fh-clarity #communicationTemplateFormV144 textarea { min-height: 144px; resize: vertical; }
  body.fh-console-nav.fh-clarity .comm-template-manager-v144 :is(p,.console-empty,td) { font-size: 13px !important; color: #536572 !important; line-height: 1.5; }
  body.fh-console-nav.fh-clarity .comm-template-manager-v144 th { font-size: 12px !important; color: #536572 !important; background: #f7f9fb !important; }
  body.fh-console-nav.fh-clarity .comm-template-manager-v144 td { background: #fff !important; border-color: #dce3eb !important; }
  body.fh-console-nav.fh-clarity .comm-template-manager-v144 .comm-template-manager-table-wrap-v144 { overflow: auto; border: 1px solid #dce3eb; border-radius: 5px; }
  body.fh-console-nav.fh-clarity .fh-data-modal-card:has(:is(#communicationFiltersForm,#communicationTemplateFormV144,.comm-template-manager-v144)) :focus-visible { outline: 2px solid #087f9c; outline-offset: 2px; }
}

@media (min-width: 901px) and (max-width: 1200px) {
  body.fh-console-nav.fh-clarity #commsPage .communication-grid {
    grid-template-columns: minmax(196px, 0.76fr) minmax(360px, 1.48fr) minmax(196px, 0.76fr);
  }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-head { gap: 7px; padding-inline: 9px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-actions { gap: 3px; }
  body.fh-console-nav.fh-clarity #commsPage .comm-thread-actions button { padding-inline: 7px; }
}
