:root {
  color-scheme: light;
  --canvas: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-active: #cbd5e1;
  --focus: #0284c7;
  --healthy: #059669;
  --attention: #d97706;
  --critical: #dc2626;
  --topbar-height: 48px;
  --sidebar-width: 224px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-feature-settings: "tnum" 1, "cv05" 1;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid rgb(2 132 199 / 24%);
  outline-offset: 1px;
}

svg {
  width: 18px;
  height: 18px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  height: var(--topbar-height);
  grid-template-columns: var(--sidebar-width) minmax(260px, 1fr) 270px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.product-name {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  white-space: nowrap;
}

.product-logo-mark {
  position: relative;
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 22px;
  overflow: hidden;
}

.product-logo-mark img {
  position: absolute;
  top: 0;
  left: -3px;
  width: 42px;
  height: auto;
}

.product-name strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.product-name .product-divider {
  width: 1px;
  height: 17px;
  background: var(--border-active);
}

.product-name small {
  color: var(--text-secondary);
  font-size: 12px;
}

.search-shell {
  position: relative;
  display: flex;
  width: min(560px, calc(100% - 48px));
  align-items: center;
  justify-self: center;
}

.search-shell svg {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-shell input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--canvas);
  color: var(--text);
  font-size: 12px;
}

.search-shell input::placeholder {
  color: var(--text-muted);
}

.search-shell input:focus {
  border-color: var(--focus);
  background: var(--surface);
}

.operator-context {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-right: 16px;
}

.help-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1.5px solid var(--text-secondary);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.operator-divider {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--border);
}

.operator-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #172033;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.operator-copy strong,
.operator-copy small {
  display: block;
  overflow: hidden;
  max-width: 190px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-copy strong {
  font-size: 11px;
  font-weight: 500;
}

.operator-copy small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 10px;
}

.account-shell {
  position: relative;
}

.account-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.account-trigger:hover,
.account-trigger[aria-expanded='true'] {
  background: var(--canvas);
}

.account-menu {
  position: absolute;
  top: 38px;
  right: 0;
  z-index: 30;
  width: 280px;
  overflow: hidden;
  border: 1px solid var(--border-active);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 4px 6px -1px rgb(15 23 42 / 8%), 0 2px 4px -2px rgb(15 23 42 / 5%);
}

.account-menu-identity {
  padding: 15px;
}

.account-menu-identity strong,
.account-menu-identity span,
.account-menu-identity small {
  display: block;
}

.account-menu-identity strong {
  font-size: 12px;
  font-weight: 600;
}

.account-menu-identity span {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 11px;
}

.account-menu-identity small {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 10px;
}

.account-menu-role {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 15px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 10px;
}

.account-menu-role strong {
  padding: 2px 5px;
  border: 1px solid var(--border-active);
  border-radius: 3px;
  color: var(--text);
  font-size: 9px;
  font-weight: 600;
}

.account-menu > button {
  width: 100%;
  padding: 10px 15px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.account-menu > button:hover {
  background: var(--canvas);
  color: var(--text);
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--canvas);
}

.auth-card {
  width: min(100%, 380px);
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.auth-brand-logo {
  display: block;
  width: min(190px, 72%);
  height: auto;
  margin: 0 auto 20px;
}

.auth-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-card p {
  margin: 7px 0 24px;
  color: var(--text-secondary);
  font-size: 12px;
}

.auth-card .auth-status {
  margin: -12px 0 18px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--canvas);
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 15px;
}

.auth-card .auth-status-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.microsoft-sign-in {
  display: flex;
  width: 100%;
  height: 38px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--border-active);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.microsoft-sign-in:hover {
  border-color: var(--text-muted);
  background: var(--canvas);
}

.microsoft-sign-in:disabled {
  cursor: wait;
  opacity: 0.65;
}

.microsoft-mark {
  display: grid;
  width: 15px;
  height: 15px;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
}

.microsoft-mark i:nth-child(1) {
  background: #f35325;
}

.microsoft-mark i:nth-child(2) {
  background: #81bc06;
}

.microsoft-mark i:nth-child(3) {
  background: #05a6f0;
}

.microsoft-mark i:nth-child(4) {
  background: #ffba08;
}

.sidebar {
  position: fixed;
  inset: var(--topbar-height) auto 0 0;
  z-index: 10;
  width: var(--sidebar-width);
  padding: 12px 8px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar nav {
  display: grid;
  gap: 2px;
}

.nav-item {
  display: grid;
  min-height: 36px;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-left: 2px solid transparent;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  color: #64748b;
}

.nav-item:hover {
  background: var(--canvas);
  color: var(--text);
}

.nav-item.active {
  border-left-color: var(--text);
  background: var(--surface-muted);
  color: var(--text);
}

.nav-item.active svg {
  color: var(--text);
}

.nav-item small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 400;
}

.workspace {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 36px) 32px 38px;
}

.workspace > * {
  width: 100%;
  max-width: 1152px;
  margin-right: auto;
  margin-left: auto;
}

.page-heading {
  margin-bottom: 24px;
}

.page-heading h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 30px;
}

.page-heading p {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 18px;
}

.health-panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.overall-health {
  display: flex;
  min-height: 66px;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid #f1f5f9;
}

.overall-health strong {
  color: var(--text);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 42px;
}

.overall-health i,
.client-score i,
.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--tone);
}

.tone-healthy {
  --tone: var(--healthy);
}

.tone-attention {
  --tone: var(--attention);
}

.tone-critical {
  --tone: var(--critical);
}

.overall-health i {
  width: 10px;
  height: 10px;
  align-self: center;
}

.overall-health span {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overall-health em {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  padding-top: 23px;
}

.category-summary {
  min-width: 0;
}

.category-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-label span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.category-label small {
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.category-summary > strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 32px;
}

.category-summary p {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 16px;
}

.content-section {
  margin-top: 32px;
  scroll-margin-top: 70px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 11px;
}

.section-title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.section-title span {
  color: var(--text-muted);
  font-size: 11px;
}

.issue-table {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.issue-row {
  display: grid;
  min-height: 48px;
  grid-template-columns: 10px 78px minmax(160px, 1fr) minmax(260px, 1.8fr);
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  color: var(--text-secondary);
  font-size: 11px;
}

.issue-row + .issue-row {
  border-top: 1px solid #f1f5f9;
}

.issue-row:hover {
  background: var(--canvas);
}

.status-dot {
  width: 8px;
  height: 8px;
}

.issue-severity {
  color: var(--tone);
  font-weight: 500;
}

.issue-client {
  color: var(--text);
  font-weight: 600;
}

.issue-description {
  color: inherit;
  text-align: right;
  text-decoration: none;
}

.issue-detail {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  text-align: right;
}

.issue-description b {
  font-weight: 500;
}

a.issue-description:hover,
a.issue-description:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.client-card {
  display: flex;
  min-width: 0;
  min-height: 174px;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.client-card:hover {
  border-color: var(--border-active);
  background: #fdfefe;
}

.client-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.client-head > span:first-child {
  min-width: 0;
}

.client-head strong,
.client-head small {
  display: block;
}

.client-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-head small {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 400;
}

.client-score {
  display: flex;
  align-items: center;
  gap: 6px;
}

.client-score i {
  width: 8px;
  height: 8px;
}

.client-score strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
}

.client-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 20px;
  padding-bottom: 13px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
  font-size: 10.5px;
}

.client-counts span + span::before {
  margin: 0 5px;
  color: var(--text-muted);
  content: '·';
}

.destination-list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.destination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
}

.destination-row strong {
  color: var(--text);
  font-weight: 500;
}

.prototype-note {
  margin: 24px 0 0;
  color: var(--text-muted);
  font-size: 9px;
  text-align: center;
}

.settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.mock-mode-label {
  margin-top: 5px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.settings-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
}

.settings-index {
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.settings-index a {
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 10.5px;
  text-decoration: none;
}

.settings-index a + a {
  border-top: 1px solid #f1f5f9;
}

.settings-index a:hover {
  background: var(--canvas);
  color: var(--text);
}

.settings-index a.active {
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 600;
}

.settings-content {
  min-width: 0;
}

.settings-section {
  scroll-margin-top: calc(var(--topbar-height) + 18px);
  padding: 22px 0 28px;
  border-top: 1px solid var(--border);
}

.settings-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.settings-section > header {
  margin-bottom: 14px;
}

.settings-section > header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.settings-section > header p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 10.5px;
  line-height: 16px;
}

.settings-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  text-align: left;
}

.settings-table th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.settings-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-secondary);
  vertical-align: top;
}

.settings-table tbody tr:last-child td {
  border-bottom: 0;
}

.settings-table td > strong,
.settings-table td > small {
  display: block;
}

.settings-table td > strong {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.settings-table td > small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.setting-value {
  display: grid;
  gap: 4px;
}

.setting-value strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.setting-value small {
  color: var(--text-muted);
  font-size: 8px;
  white-space: nowrap;
}

.setting-value .source-device_override {
  color: #0369a1;
  font-weight: 600;
}

.boolean-state,
.scope-label,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.boolean-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.boolean-state.enabled i {
  background: var(--healthy);
}

.scope-label,
.status-pill {
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--canvas);
  color: var(--text-secondary);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.scope-excluded,
.status-not-configured,
.status-planned {
  color: var(--text-muted);
}

.override-list,
.recipient-list {
  display: grid;
  gap: 3px;
}

.override-list span::before {
  margin-right: 5px;
  color: #0369a1;
  content: '•';
}

.effective-summary {
  white-space: nowrap;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.table-action,
.secondary-action {
  border: 1px solid var(--border-active);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 9px;
  font-weight: 500;
}

.table-action {
  padding: 4px 7px;
}

.secondary-action {
  padding: 6px 9px;
}

.table-action:hover,
.secondary-action:hover {
  background: var(--canvas);
  color: var(--text);
}

.table-action.danger:hover {
  border-color: #fecaca;
  background: #fff7f7;
  color: var(--critical);
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -2px 0 10px;
  color: var(--text-muted);
  font-size: 9px;
}

.inventory-toolbar {
  margin-bottom: 10px;
}

.inventory-toolbar > span {
  color: var(--text-secondary);
}

.settings-help {
  margin: 9px 1px 0;
  color: var(--text-muted);
  font-size: 9px;
  line-height: 14px;
}

.boolean-state > span strong,
.boolean-state > span small {
  display: block;
}

.boolean-state > span strong {
  color: var(--text);
  font-size: 10px;
  font-weight: 500;
}

.boolean-state > span small,
.evidence-label {
  color: var(--text-muted);
  font-size: 8px;
}

.destination-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.primary-recipient-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.primary-recipient-row strong {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 500;
}

.additive-label {
  color: #0369a1;
  font-size: 9px;
  font-weight: 600;
}

.settings-definition-list {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.settings-definition-list > div,
.integration-row {
  display: grid;
  min-height: 46px;
  grid-template-columns: minmax(180px, 0.8fr) 1.2fr;
  align-items: center;
  gap: 20px;
  padding: 9px 13px;
}

.settings-definition-list > div + div,
.integration-row + .integration-row {
  border-top: 1px solid #f1f5f9;
}

.settings-definition-list dt {
  color: var(--text-secondary);
  font-size: 10px;
}

.settings-definition-list dd {
  display: flex;
  gap: 6px;
  margin: 0;
  color: var(--text);
  font-size: 10.5px;
  font-weight: 500;
}

.integration-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.integration-row {
  grid-template-columns: 1fr auto;
}

.integration-row strong,
.integration-row small {
  display: block;
}

.integration-row strong {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 600;
}

.integration-row small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9px;
}

.status-configured {
  border-color: #a7f3d0;
  background: #f0fdf4;
  color: #047857;
}

.settings-feedback {
  min-height: 16px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 9px;
  text-align: right;
}

.settings-form {
  display: grid;
  gap: 12px;
}

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

.settings-form label,
.assignment-editor > label {
  display: grid;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
}

.settings-form input,
.settings-form textarea,
.settings-form select {
  width: 100%;
  border: 1px solid var(--border-active);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 11px;
}

.settings-form input,
.settings-form select {
  min-height: 32px;
  padding: 6px 8px;
}

.settings-form textarea {
  min-height: 72px;
  padding: 8px;
  resize: vertical;
}

.settings-form input[readonly] {
  background: var(--canvas);
  color: var(--text-muted);
}

.compact-definition-list {
  margin-top: 2px;
}

.compact-definition-list code {
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
}

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

.mailer-test-row {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) 1fr;
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mailer-test-row label {
  display: grid;
  gap: 0.4rem;
}

.mailer-test-row p {
  margin: 0 0 0.65rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .mailer-test-row {
    grid-template-columns: 1fr;
  }
}

.primary-action {
  padding: 7px 11px;
  border: 1px solid #1d4ed8;
  border-radius: 4px;
  background: #1d4ed8;
  color: #fff;
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
}

.primary-action:hover {
  background: #1e40af;
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.recipient-editor {
  display: grid;
  gap: 7px;
}

.recipient-input-row {
  display: grid !important;
  grid-template-columns: minmax(0, 440px) auto;
  align-items: center;
}

.settings-editor {
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--canvas);
}

.settings-editor summary,
.row-editor summary {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
}

.group-editor-form {
  min-width: 280px;
  margin-top: 10px;
}

.row-editor {
  display: inline-block;
  margin-right: 6px;
}

.row-editor[open] {
  display: block;
  min-width: 300px;
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--canvas);
}

.assignment-editor {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--canvas);
}

.assignment-editor fieldset {
  margin: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.assignment-editor legend {
  padding: 0 4px;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 600;
}

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

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 400;
}

.checkbox-grid input {
  width: auto;
  min-height: auto;
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 64px;
  }

  .topbar {
    grid-template-columns: var(--sidebar-width) 1fr 190px;
  }

  .product-name {
    padding: 0 12px;
  }

  .product-name strong {
    font-size: 0;
  }

  .product-name strong::first-letter {
    font-size: 14px;
  }

  .product-name .product-divider,
  .product-name small,
  .nav-item span,
  .nav-item small,
  .operator-copy {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .settings-index {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .settings-index a {
    flex: 0 0 auto;
  }

  .settings-index a + a {
    border-top: 0;
    border-left: 1px solid #f1f5f9;
  }
}

@media (max-width: 680px) {
  :root {
    --sidebar-width: 0px;
    --topbar-height: 52px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .product-name {
    padding-left: 16px;
  }

  .product-name strong {
    font-size: 14px;
  }

  .product-name strong::first-letter {
    font-size: inherit;
  }

  .product-name .product-divider,
  .product-name small {
    display: block;
  }

  .search-shell,
  .help-icon,
  .operator-divider,
  .sidebar {
    display: none;
  }

  .operator-context {
    padding-right: 14px;
  }

  .workspace {
    width: 100%;
    margin-left: 0;
    padding: calc(var(--topbar-height) + 24px) 16px 30px;
  }

  .health-panel {
    padding: 19px;
  }

  .overall-health {
    flex-wrap: wrap;
  }

  .overall-health em {
    width: 100%;
    margin: -4px 0 0;
  }

  .category-grid,
  .client-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    gap: 20px;
  }

  .issue-row {
    grid-template-columns: 10px 70px 1fr;
    gap: 9px;
    padding: 12px 14px;
  }

  .issue-detail {
    grid-column: 2 / -1;
    justify-self: start;
    text-align: left;
  }

  .settings-heading {
    align-items: center;
  }

  .settings-layout {
    gap: 22px;
  }

  .settings-definition-list > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .client-card {
    transition: none;
  }
}

.client-condition-note {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.diagnostic-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  width: fit-content;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.client-diagnostic-badge {
  margin-top: 8px;
}
