:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --band: #f4f7fb;
  --soft: #f8fafc;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --danger: #b42318;
  --warning: #8a4b0f;
  --success: #1f7a4d;
  --success-bg: #eaf7ef;
  --success-line: #b8e2c8;
  --danger-bg: #fdecea;
  --danger-line: #f2b8b0;
  --pending: #667085;
  --pending-bg: #eef1f5;
  --pending-line: #d8dee8;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

[v-cloak] {
  display: none;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #ffffff;
}

.shell {
  min-height: 100vh;
}

/* SMS pilot: one gauge in the tool cluster; pinned menu and API behavior are unchanged. */
.header-tool-cluster.sms-tool-cluster {
  position: relative;
  overflow: visible;
}

.header-tool-cluster .sms-operating-state-icon {
  position: static;
  flex: 0 0 30px;
  order: 0;
  width: 30px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sms-operating-state-icon { --sms-state-color: #7a8795; }
.sms-operating-state-icon--open { --sms-state-color: #237a48; }
.sms-operating-state-icon--closed { --sms-state-color: #566575; }
.sms-operating-state-icon--restricted { --sms-state-color: #946200; }
.sms-operating-state-icon--unavailable { --sms-state-color: #b42318; }

.sms-operating-state-icon .header-status-item {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 4px;
  color: var(--sms-state-color);
  background: transparent;
  box-shadow: none;
}

.sms-operating-state-icon .header-status-copy,
.sms-operating-state-icon .header-state-caret {
  display: none;
}

.sms-operating-state-icon .header-status-icon {
  width: 18px;
  height: 18px;
}

.sms-operating-state-icon .header-state-button:hover,
.sms-operating-state-icon .header-status-item:focus-visible {
  background: #edf6f5;
}

.sms-operating-state-icon .header-status-item:focus-visible {
  outline: 2px solid var(--sms-state-color);
  outline-offset: 1px;
}

.sms-operating-state-icon .operating-state-spinner {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  margin: 0;
}

@media (max-width: 620px) {
  .sms-operating-state-icon .operating-state-menu {
    right: 0;
    left: auto;
    width: min(310px, calc(100vw - 32px));
  }
}

#eventBusSettingsMount .coredata-eventbus-settings.rabbit-overlay {
  top: var(--aicore-module-header-height, 74px);
  height: calc(100vh - var(--aicore-module-header-height, 74px));
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
}

#eventBusSettingsMount .coredata-eventbus-settings .rabbit-header {
  display: none;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--accent);
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

.help-dialog {
  width: min(680px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(23, 32, 51, 0.22);
}

.help-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.help-dialog--maximized {
  width: calc(100vw - 24px);
  max-width: none;
  height: calc(100vh - 24px);
  max-height: none;
}

.help-dialog--maximized .help-content {
  max-height: none;
}

.help-dialog::backdrop {
  background: rgba(23, 32, 51, 0.38);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.help-content {
  display: grid;
  gap: 0;
  max-height: min(72vh, 720px);
  overflow: auto;
  padding: 0 18px 18px;
  font-size: 14px;
  line-height: 1.45;
}

.help-content p {
  margin: 0;
}

.help-section {
  padding: 14px 0;
  border-bottom: 1px solid #e6ebf2;
}

.help-section:last-child {
  border-bottom: 0;
}

.help-section h3 {
  margin: 0 0 7px;
  font-size: 14px;
  color: var(--accent-strong);
}

.help-content code {
  font-size: 13px;
  color: #1f3a5f;
}

.help-grid {
  display: grid;
  grid-template-columns: minmax(110px, 0.55fr) minmax(0, 1fr);
  gap: 6px 12px;
  margin-top: 10px;
}

.help-example {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dce4ef;
  border-radius: 6px;
  background: #f8fafc;
}

.help-section--technical {
  border-top-color: #9eb7c7;
}

.help-technical-examples {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.help-technical-examples h4 {
  margin: 6px 0 0;
  color: var(--accent-strong);
  font-size: 13px;
}

.help-technical-examples pre {
  max-width: 100%;
  margin: 0;
  overflow: auto;
  border: 1px solid #dce4ef;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}

.help-technical-examples code {
  color: #1f3a5f;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
  background: #ffffff;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(260px, 20%) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px clamp(16px, 4vw, 44px) 22px;
}

.left-rail {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.right-workspace {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.access-panel {
  padding: 0;
  background: #ffffff;
}

.access-panel > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 700;
}

.access-panel > summary::-webkit-details-marker {
  display: none;
}

.access-panel > summary::before {
  content: "+";
  flex: 0 0 auto;
  width: 14px;
  color: var(--accent);
  font-weight: 700;
}

.access-panel[open] > summary::before {
  content: "-";
}

.connection-summary-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

button.customer-context-button:hover,
button.customer-context-button:focus-visible {
  border-color: var(--accent);
  background: #f4faf9;
}

button.customer-context-button--required:hover,
button.customer-context-button--required:focus-visible {
  color: #5c4200;
  border-color: #b88627;
  background: #fff7e6;
}

.account-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: #e1e7ef;
}

.account-permissions-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}

.permissions-dialog {
  width: min(760px, calc(100vw - 32px));
}

.permissions-content {
  gap: 0;
}

.permissions-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid #b9d9d1;
  border-radius: 6px;
  padding: 12px 14px;
  color: #135c4b;
  background: #f1faf7;
}

.permissions-summary p,
.permissions-security-note,
.permissions-section--informational > p,
.permissions-empty-state p {
  color: var(--muted);
}

.permissions-summary-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #ffffff;
  background: #23836b;
  font-weight: 800;
}

.permissions-section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.permissions-section-heading .eyebrow,
.permissions-section-heading h3 {
  margin: 0;
}

.permissions-client-badge {
  border: 1px solid #c9d5e3;
  border-radius: 4px;
  padding: 4px 7px;
  color: #354b68;
  background: #f7f9fc;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
}

.permissions-group {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.permissions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permissions-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid #b9d9d1;
  border-radius: 4px;
  padding: 4px 7px;
  overflow-wrap: anywhere;
  color: #176c57;
  background: #f1faf7;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.permissions-chip small {
  border-left: 1px solid currentColor;
  padding-left: 5px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.permissions-chip--role,
.permissions-chip--selected {
  border-color: #76b8aa;
  color: #0f5948;
  background: #e6f5f1;
}

.permissions-chip--neutral {
  border-color: #d6dee9;
  color: #42536b;
  background: #f7f9fc;
}

.permissions-detail-list {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr);
  gap: 7px 14px;
  margin: 10px 0 0;
}

.permissions-detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.permissions-detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
}

.permissions-client-row {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.permissions-empty {
  color: var(--danger);
}

.permissions-security-note {
  margin: 14px 0 0;
  border-left: 3px solid #9eb7c7;
  padding: 2px 0 2px 10px;
  font-size: 12px;
}

.permissions-empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  text-align: center;
}

@media (max-width: 620px) {
  .permissions-detail-list {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .permissions-detail-list dd {
    margin-bottom: 8px;
  }

  .permissions-section-heading {
    display: grid;
  }

  .permissions-client-badge {
    justify-self: start;
  }
}

.connection-summary-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7b8799;
}

.connection-summary-state--connected {
  color: #176c57;
}

.connection-summary-state--connected .connection-summary-dot {
  background: #23836b;
}

.connection-summary-state--disconnected {
  color: #8b5f00;
}

.connection-summary-state--disconnected .connection-summary-dot {
  background: #a86f00;
}

.connection-summary-state--unavailable {
  color: var(--danger);
}

.connection-summary-state--unavailable .connection-summary-dot {
  background: var(--danger);
}

.connection-panel-body {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
  background: var(--soft);
}

.help-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.help-resize-button {
  color: var(--accent-strong);
  background: #ffffff;
  border: 1px solid #cbd6e2;
}

.help-resize-button:hover,
.help-resize-button:focus-visible {
  background: #edf6f5;
}

.help-resize-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}

.help-resize-icon::before,
.help-resize-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  width: 12px;
  height: 10px;
  border: 1px solid currentColor;
}

.help-resize-icon::before {
  top: 3px;
  left: 2px;
}

.help-resize-icon::after {
  display: none;
}

.help-resize-icon--restore::before {
  top: 2px;
  left: 4px;
  width: 10px;
  height: 9px;
  background: #ffffff;
  z-index: 1;
}

.help-resize-icon--restore::after {
  display: block;
  top: 5px;
  left: 1px;
  width: 10px;
  height: 9px;
  background: #ffffff;
  z-index: 2;
}

.connection-host-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.connection-host-row a {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent-strong);
  text-align: right;
  text-decoration: none;
}

.connection-host-row a:hover,
.connection-host-row a:focus {
  text-decoration: underline;
}

.auth-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.role-badge {
  border: 1px solid #dce4ef;
  border-radius: 999px;
  padding: 3px 8px;
  color: #1f3a5f;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.dev-token-section {
  margin-bottom: 12px;
}

.fake-profile-notice {
  display: grid;
  gap: 4px;
  border: 1px solid #bdded8;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #f0fbf8;
  font-size: 13px;
  line-height: 1.4;
}

.fake-profile-notice strong {
  color: var(--accent);
}

.fake-profile-notice code {
  font-size: 12px;
}

.primary-panel {
  border-color: #bddbd7;
  box-shadow: 0 1px 0 rgba(15, 118, 110, 0.08);
}

.received-panel {
  background: #ffffff;
}

.activity-panel {
  min-height: 160px;
  min-width: 0;
}

.connection-context-list {
  display: grid;
  gap: 5px;
  margin: 0;
}

.connection-context-list > div {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.connection-context-list dt,
.connection-context-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.connection-context-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.connection-context-list dd {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.provider-panel {
  background: #ffffff;
}

.provider-panel > summary,
.details-section > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.provider-panel > summary::-webkit-details-marker,
.details-section > summary::-webkit-details-marker {
  display: none;
}

.provider-panel > summary::before,
.details-section > summary::before {
  content: "+";
  flex: 0 0 auto;
  width: 14px;
  color: var(--accent);
  font-weight: 700;
}

.provider-panel[open] > summary::before,
.details-section[open] > summary::before {
  content: "-";
}

.provider-panel > summary {
  justify-content: flex-start;
  font-size: 16px;
}

.details-section {
  margin-top: 6px;
}

.optional-send-fields {
  margin: 0 0 10px;
}

.details-body {
  margin-top: 10px;
}

.token-expiry {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.token-expiry.warning {
  color: var(--warning);
}

.token-expiry.error {
  color: var(--danger);
}

.profile-form {
  margin-top: 12px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.profile-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: start;
  margin-bottom: 10px;
}

.profile-picker-row label {
  margin-bottom: 0;
}

.compact-profile-picker {
  gap: 0;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

label {
  display: grid;
  gap: 5px;
  margin-bottom: 11px;
  font-size: 13px;
  font-weight: 700;
  color: #344054;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd6e1;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

#accessToken {
  height: 38px;
  min-height: 38px;
  overflow: auto;
  resize: vertical;
  white-space: nowrap;
}

.split,
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

button {
  min-height: 38px;
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  cursor: pointer;
}

button.secondary {
  color: var(--accent-strong);
  background: #ffffff;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

body.auth-needed .needs-auth {
  opacity: 0.74;
}

#sendStatus,
#profileStatus,
#serviceAccessStatus {
  font-size: 13px;
  color: var(--muted);
}

#sendStatus.error,
#profileStatus.error,
#serviceAccessStatus.error {
  color: var(--danger);
}

.message-mode-control {
  display: inline-flex;
  gap: 2px;
  margin: 0 0 12px;
  padding: 3px;
  border: 1px solid #cfd7e3;
  border-radius: 6px;
  background: #f4f7fb;
}

.message-mode-control button {
  min-height: 30px;
  padding: 5px 16px;
  border: 0;
  color: #48576a;
  background: transparent;
}

.message-mode-control button.active {
  color: #ffffff;
  background: var(--accent);
}

.template-send-grid,
.template-editor-grid,
.template-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.label-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.templates-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px clamp(16px, 4vw, 44px) 28px;
}

.templates-catalog {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.templates-catalog-header {
  margin-bottom: 3px;
}

.templates-catalog-actions,
.template-editor-actions,
.template-preview-heading,
.template-version-heading,
.template-version-row > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.templates-catalog-actions .icon-button {
  width: 34px;
  min-height: 34px;
  font-size: 17px;
}

.template-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border-color: #d7dee8;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
}

.template-list-item:hover,
.template-list-item.selected {
  border-color: var(--accent);
  background: #f1fbf9;
}

.template-list-item span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.template-list-item strong,
.template-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-list-item small,
.template-version-heading span,
.template-body-meta,
.templates-empty,
.templates-editor-empty {
  color: var(--muted);
  font-size: 12px;
}

.template-version-badge,
.template-active-badge {
  flex: 0 0 auto;
  border: 1px solid #b9dcd5;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--accent-strong);
  background: #eff9f7;
  font-size: 11px;
  font-weight: 700;
}

.template-editor {
  min-height: 510px;
  border-color: #bddbd7;
}

.template-body-meta {
  display: flex;
  justify-content: space-between;
  margin: -6px 0 12px;
}

.template-marker-panel {
  display: grid;
  grid-template-columns: minmax(170px, 0.4fr) minmax(0, 1fr);
  gap: 14px;
  margin: 2px 0 12px;
  padding: 11px 12px;
  border: 1px solid #d7e2e1;
  border-radius: 6px;
  background: #f7fbfa;
}

.template-marker-panel h3,
.template-preview-result h3,
.template-version-section h3 {
  margin: 0;
  font-size: 14px;
}

.template-marker-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.template-marker-list {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.template-marker-list code {
  border: 1px solid #d6dce5;
  border-radius: 4px;
  padding: 4px 6px;
  background: #ffffff;
  font-size: 11px;
}

.template-marker-list > span {
  color: var(--muted);
  font-size: 12px;
}

.template-preview-result {
  min-width: 0;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
}

.template-preview-heading,
.template-version-heading {
  justify-content: space-between;
}

.template-preview-result pre {
  min-height: 138px;
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.45 Arial, Helvetica, sans-serif;
}

.template-editor-actions {
  justify-content: flex-end;
  margin-top: 2px;
}

button.secondary-button {
  color: var(--accent-strong);
  background: #ffffff;
}

.template-version-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.template-version-list {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.template-version-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, auto) 110px;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e0e5ec;
  border-radius: 5px;
  font-size: 12px;
}

.template-version-row code {
  justify-self: end;
  color: var(--muted);
}

.templates-editor-empty {
  margin: 80px auto;
  text-align: center;
}

#profileStatus.warning {
  color: var(--warning);
  font-weight: 700;
}

.provider-customer-required {
  margin: 12px 0 2px;
  padding: 10px 11px;
  color: #5f4a13;
  font-size: 13px;
  line-height: 1.4;
  background: #fffaf0;
  border-left: 3px solid #b88627;
}

#serviceAccessStatus a {
  color: var(--accent-strong);
  text-decoration: none;
}

#serviceAccessStatus a:hover,
#serviceAccessStatus a:focus {
  text-decoration: underline;
}

.hint {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.hidden {
  display: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 10px;
}

.compact-actions button {
  flex: 1 1 120px;
}

.roles-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.role-row {
  border: 1px solid #e3e8ef;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}

.role-row strong {
  display: block;
  margin-bottom: 3px;
}

.role-row span {
  color: var(--muted);
}

.messages,
.received-messages {
  display: grid;
  min-width: 0;
  width: 100%;
  gap: 8px;
}

.message-row,
.inbound-row {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 4px;
  border: 1px solid #e3e8ef;
  border-radius: 6px;
  padding: 8px;
}

.message-row > *,
.inbound-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-row {
  cursor: pointer;
}

.message-row:hover,
.message-row:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.message-row.selected {
  border-color: var(--accent-strong);
  background: #f5fbfa;
}

.message-row strong,
.inbound-row strong {
  font-size: 14px;
}

.message-row code,
.inbound-row code {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.message-detail-panel {
  background: #ffffff;
}

.message-detail-content {
  display: grid;
  gap: 16px;
}

.message-detail-section {
  display: grid;
  gap: 10px;
}

.message-detail-section h3 {
  margin: 0;
  font-size: 14px;
  color: var(--accent-strong);
}

.message-body-full,
.json-block {
  margin: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid #dce4ef;
  border-radius: 6px;
  padding: 10px;
  background: #f8fafc;
  color: var(--ink);
  font: 13px/1.45 Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.28fr) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
  font-size: 13px;
}

.detail-grid dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.attempt-card {
  border: 1px solid #e3e8ef;
  border-radius: 6px;
  padding: 10px;
}

/* Message Trace page — full width, information-dense (see troubleshooting-diagnostics-ui.md) */

.tracepage {
  width: 100%;
  padding: 20px clamp(16px, 3vw, 40px) 64px;
}

.tracepage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.tracepage-back {
  background: transparent;
  border: none;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 14px;
  padding: 6px 0;
  cursor: pointer;
}

.tracepage-back:hover {
  text-decoration: underline;
}

.tracepage-lookup {
  display: flex;
  gap: 8px;
  flex: 0 1 420px;
  min-width: 260px;
}

.tracepage-lookup input {
  flex: 1;
}

.tracepage-status-text {
  font-size: 14px;
  color: var(--muted);
}

.tracepage-status-text--error {
  color: var(--danger);
}

.tracepage-header {
  margin-bottom: 20px;
}

.tracepage-header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.tracepage-header h1 {
  font-size: 22px;
  margin: 0 0 4px;
  text-wrap: balance;
}

.tracepage-message-id {
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tracepage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tracepage-pill--success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-line);
}

.tracepage-pill--danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-line);
}

.tracepage-pill--pending {
  background: var(--pending-bg);
  color: var(--pending);
  border-color: var(--pending-line);
}

.tracepage-rootcause {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.5;
}

.tracepage-rootcause strong {
  color: var(--danger);
}

.tracepage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.tracepage-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tracepage-meta-item .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
}

.tracepage-meta-item .v {
  font-size: 13.5px;
}

.tracepage-layout {
  display: grid;
  gap: 20px;
  align-items: start;
}

@media (min-width: 900px) {
  .tracepage-layout {
    grid-template-columns: minmax(280px, 340px) 1fr;
  }
}

.tracepage-panel-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.tracepage-boundary .trace-boundary-group + .trace-boundary-group {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.tracepage-raw {
  margin-top: 20px;
}

.tracepage-raw summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-strong);
}

.tracepage-raw-body {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.trace-boundary-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.trace-hotlink {
  margin-left: 8px;
  font-weight: 700;
  color: var(--accent-strong);
}

.trace-timeline {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trace-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
}

.trace-step-dot {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--pending-line);
}

.trace-step-dot--success {
  background: var(--success-bg);
  border-color: var(--success);
}

.trace-step-dot--danger {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.trace-step-dot--pending {
  background: var(--pending-bg);
  border-color: var(--pending);
}

.trace-step-body p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
  max-width: 80ch;
}

.trace-step-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.trace-step-head strong {
  font-size: 14.5px;
}

.trace-step-time {
  font-family: Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.trace-step--danger .trace-step-body p {
  color: var(--danger);
}

@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: minmax(300px, 28%) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .templates-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {

  .split,
  .field-grid,
  .detail-grid,
  .template-send-grid,
  .template-editor-grid,
  .template-preview-grid,
  .template-marker-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {

  .templates-workspace {
    padding-inline: 12px;
  }

  .template-version-row {
    grid-template-columns: 1fr;
  }

  .template-version-row code {
    justify-self: start;
  }
}

/* Flow & Gates: server-driven operational map */

.gates-page {
  min-height: calc(100vh - 86px);
  padding: 14px clamp(16px, 3vw, 32px) 40px;
  background: #f3f6f8;
}

.gates-state-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.gates-state-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.gates-state-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 800;
}

.gates-state-button::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.gates-state-button--open {
  border-color: #75b88e;
  color: #237a48;
  background: #eaf7ef;
}

.gates-state-button--restricted {
  border-color: #d6a64a;
  color: #805300;
  background: #fff4d6;
}

.gates-state-button--closed {
  border-color: #aab5c0;
  color: #4f5c69;
  background: #eef2f5;
}

.gates-state-button--unavailable {
  border-color: #e0a49f;
  color: var(--danger);
  background: #fff0ee;
}

.gates-state-button--unknown {
  border-color: #909eac;
  color: #566575;
  background: #ffffff;
}

.gates-live-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  border: 1px solid #adc6df;
  border-radius: 6px;
  color: #184b7f;
  background: #edf5ff;
}

.gates-loading,
.gates-error {
  max-width: 1600px;
  margin: 0 auto;
}

.gates-error {
  color: var(--danger);
}

.gates-error p {
  color: var(--ink);
}

.gates-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1600px;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.gates-summary-item {
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.gates-summary-item:last-child {
  border-right: 0;
}

.gates-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.gates-summary-item strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.gates-flow-shell {
  position: relative;
  max-width: 1600px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.gates-flow-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafcfd;
}

.gates-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.gates-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gates-legend-mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.gates-last-updated {
  color: var(--muted);
  font-size: 12px;
}

.gates-flow-canvas {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(126px, 0.62fr) minmax(290px, 1.38fr) minmax(126px, 0.62fr) minmax(190px, 1fr);
  grid-template-rows: repeat(4, minmax(88px, auto));
  gap: 12px 10px;
  padding: 24px 22px 18px;
  background-image: linear-gradient(#edf1f4 1px, transparent 1px), linear-gradient(90deg, #edf1f4 1px, transparent 1px);
  background-size: 24px 24px;
}

.gates-input-node {
  grid-column: 1;
  grid-row: var(--desktop-row);
}

.gates-input-connector {
  grid-column: 2;
  grid-row: var(--desktop-row);
}

.gates-output-connector {
  grid-column: 4;
  grid-row: var(--desktop-row);
}

.gates-output-node {
  grid-column: 5;
  grid-row: var(--desktop-row);
}

.gates-flow-node {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #bdc9d6;
  border-left: 4px solid #6b7f93;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 5px rgba(26, 44, 67, 0.07);
}

.gates-flow-node--output {
  border-left-color: #245f9e;
}

.gates-flow-node--blocked {
  border-left-color: var(--danger);
  background: #fffafa;
}

.gates-node-type {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.gates-flow-node strong {
  margin-top: 3px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.gates-flow-node small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.gates-module-node {
  grid-column: 3;
  grid-row: 1 / span 4;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 22px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: #f7fffd;
  box-shadow: 0 8px 18px rgba(8, 123, 115, 0.10);
}

.gates-module-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.gates-module-title h3 {
  margin: 0;
  font-size: 22px;
}

.gates-module-title p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.gates-module-badge {
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.gates-pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 7px;
}

.gates-pipeline-stage {
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid #b8d6d2;
  border-radius: 5px;
  background: #ffffff;
  text-align: center;
}

.gates-pipeline-stage strong,
.gates-pipeline-stage small {
  display: block;
}

.gates-pipeline-stage strong {
  font-size: 13px;
}

.gates-pipeline-stage small {
  margin-top: 3px;
  color: var(--muted);
}

.gates-pipeline-arrow {
  width: 18px;
  height: 2px;
  background: var(--accent);
}

.gates-pipeline-arrow::after {
  content: "";
  display: block;
  float: right;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: rotate(45deg);
}

.gates-module-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.gates-module-stat {
  min-width: 0;
  padding: 9px;
  border-top: 1px solid #b8d6d2;
}

.gates-module-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.gates-module-stat strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.gates-connector {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}

.gates-connector::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: #91a0af;
}

.gates-connector--to-module::after,
.gates-connector--to-output::after {
  content: "";
  position: absolute;
  right: 1px;
  top: calc(50% - 4px);
  width: 7px;
  height: 7px;
  border-top: 2px solid #91a0af;
  border-right: 2px solid #91a0af;
  transform: rotate(45deg);
}

.gates-gate {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: min(100%, 122px);
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.gates-gate-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
}

.gates-tone--open {
  border-color: #75b88e;
  color: #237a48;
  background: #eaf7ef;
}

.gates-tone--restricted {
  border-color: #d6a64a;
  color: #805300;
  background: #fff4d6;
}

.gates-tone--closed {
  border-color: #aab5c0;
  color: #4f5c69;
  background: #eef2f5;
}

.gates-tone--unavailable {
  border-color: #e0a49f;
  color: var(--danger);
  background: #fff0ee;
}

.gates-tone--unknown {
  border-color: #909eac;
  color: #566575;
  background: #ffffff;
}

.gates-dependencies {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--line);
  background: #fafcfd;
}

.gates-dependencies h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.gates-dependency-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.gates-dependency {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
}

.gates-dependency-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gates-dependency strong,
.gates-dependency small {
  overflow-wrap: anywhere;
}

.gates-dependency small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.gates-status-text {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.gates-status-text--open {
  color: #237a48;
}

.gates-status-text--restricted {
  color: #805300;
}

.gates-status-text--closed {
  color: #4f5c69;
}

.gates-status-text--unavailable {
  color: var(--danger);
}

.gates-detail-drawer {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  color: var(--ink);
  background: #ffffff;
  box-shadow: -12px 0 30px rgba(21, 34, 56, 0.18);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.gates-detail-drawer.open {
  transform: translateX(0);
}

.gates-drawer-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.gates-drawer-header h2 {
  font-size: 19px;
}

.gates-close-button {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #ffffff;
  font-size: 18px;
}

.gates-drawer-content {
  padding: 20px;
}

.gates-drawer-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid;
  border-radius: 999px;
  font-weight: 800;
}

.gates-drawer-summary {
  margin: 16px 0 20px;
  color: #34445a;
  font-size: 15px;
  line-height: 1.5;
}

.gates-detail-list {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 11px 12px;
  margin: 0;
}

.gates-detail-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.gates-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.gates-drawer-action {
  width: 100%;
  min-height: 42px;
  margin-top: 22px;
  color: var(--accent-strong);
  background: #ffffff;
}

.gates-state-dialog {
  width: min(720px, calc(100% - 30px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(21, 34, 56, 0.28);
}

.gates-state-dialog::backdrop {
  background: rgba(21, 34, 56, 0.52);
}

.gates-dialog-header,
.gates-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.gates-dialog-header {
  border-bottom: 1px solid var(--line);
}

.gates-dialog-header h2 {
  font-size: 20px;
}

.gates-dialog-body {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding: 20px;
}

.gates-dialog-footer {
  border-top: 1px solid var(--line);
  background: #fafcfd;
}

.gates-state-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.gates-state-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #ffffff;
}

.gates-state-option.selected {
  border-color: var(--accent);
  background: #f1fbf9;
}

.gates-state-option input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--accent);
}

.gates-state-option strong,
.gates-state-option small {
  display: block;
}

.gates-state-option small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.gates-impact-preview {
  padding: 12px 14px;
  border-left: 4px solid #c88913;
  color: #644200;
  background: #fff4d6;
  line-height: 1.45;
}

.gates-dialog-note {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .gates-flow-canvas {
    grid-template-columns: minmax(165px, 1fr) minmax(105px, 0.55fr) minmax(250px, 1.25fr) minmax(105px, 0.55fr) minmax(165px, 1fr);
    padding-inline: 14px;
  }

  .gates-dependency-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gates-gate {
    font-size: 10px;
  }
}

@media (max-width: 820px) {
  .gates-flow-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .gates-state-control {
    justify-content: space-between;
  }

  .gates-summary-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gates-summary-item:nth-child(2) {
    border-right: 0;
  }

  .gates-summary-item:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .gates-flow-canvas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(96px, auto)) auto repeat(4, minmax(96px, auto));
    gap: 8px;
    background-image: none;
  }

  .gates-input-node {
    grid-column: 1;
    grid-row: var(--mobile-row);
  }

  .gates-input-connector {
    grid-column: 2;
    grid-row: var(--mobile-row);
  }

  .gates-module-node {
    grid-column: 1 / -1;
    grid-row: 5;
    margin: 12px 0;
  }

  .gates-output-connector {
    grid-column: 1;
    grid-row: var(--mobile-row);
  }

  .gates-output-node {
    grid-column: 2;
    grid-row: var(--mobile-row);
  }

  .gates-pipeline {
    grid-template-columns: 1fr;
  }

  .gates-pipeline-arrow {
    width: 2px;
    height: 18px;
    margin: 0 auto;
  }

  .gates-pipeline-arrow::after {
    float: none;
    margin: 10px 0 0 -3px;
    transform: rotate(135deg);
  }

  .gates-dependency-grid,
  .gates-state-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .gates-page {
    padding-inline: 14px;
  }

  .gates-summary-bar,
  .gates-module-stats {
    grid-template-columns: 1fr;
  }

  .gates-summary-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .gates-summary-item:last-child {
    border-bottom: 0;
  }

  .gates-module-title {
    flex-direction: column;
  }

  .gates-dialog-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .gates-dialog-footer button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gates-detail-drawer {
    transition: none;
  }
}
