:root {
  --brand: #9d3836;
  --brand-strong: #7f2c2a;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --background: #f6f7f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #f0f2f5;
  --text: #242326;
  --text-muted: #68676d;
  --border: #dedfe3;
  --input: #d5d7dc;
  --shadow: 0 18px 50px rgba(33, 29, 31, 0.12);
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
}

:root[data-theme="dark"] {
  --background: #151416;
  --surface: #1d1c1f;
  --surface-raised: #252327;
  --surface-muted: #2b292d;
  --text: #f4f1f2;
  --text-muted: #aaa5ab;
  --border: #3a373c;
  --input: #4a464d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --success-soft: color-mix(in srgb, var(--success) 18%, transparent);
  --warning-soft: color-mix(in srgb, var(--warning) 18%, transparent);
  --danger-soft: color-mix(in srgb, var(--danger) 18%, transparent);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.2;
  font-weight: 650;
}

h2 {
  font-size: 1.15rem;
  font-weight: 650;
}

h3 {
  font-size: 1rem;
  font-weight: 650;
}

code {
  padding: 0.12rem 0.35rem;
  border-radius: 5px;
  color: var(--brand);
  background: var(--brand-soft);
}

.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

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

.muted,
small {
  color: var(--text-muted);
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.boot-state,
.loading-state,
.empty-state {
  display: grid;
  min-height: 140px;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
}

.app-shell {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell--collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 100vh;
  min-width: 0;
  flex-direction: column;
  gap: 22px;
  padding: 18px 12px;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.brand__logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.brand__copy {
  display: grid;
  min-width: 0;
}

.brand__copy strong,
.workspace strong {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__copy small,
.workspace small {
  display: block;
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__toggle {
  width: 26px;
  height: 26px;
  min-height: 26px;
  margin-left: auto;
  padding: 0;
  border-color: transparent;
  opacity: 0.55;
}

.sidebar__toggle:hover,
.sidebar__toggle:focus-visible {
  opacity: 1;
}

.sidebar__toggle .icon {
  width: 14px;
  height: 14px;
}

.sidebar__nav,
.sidebar__footer {
  display: grid;
  gap: 5px;
}

.sidebar__footer {
  margin-top: auto;
}

.nav-item {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item--active {
  color: var(--text);
  background: var(--brand-soft);
}

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

.nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--border);
}

.workspace__icon,
.session-identity__icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--brand);
  background: var(--brand-soft);
}

.workspace__icon--current {
  color: var(--success);
  background: var(--success-soft);
}

.workspace__icon--update {
  color: var(--warning);
  background: var(--warning-soft);
}

.workspace__icon--unknown {
  color: var(--text-muted);
  background: var(--surface-muted);
}

.app-shell--collapsed .sidebar {
  padding-inline: 10px;
}

.app-shell--collapsed .brand__copy,
.app-shell--collapsed .nav-item span,
.app-shell--collapsed .workspace__icon,
.app-shell--collapsed .workspace__copy {
  display: none;
}

.app-shell--collapsed .sidebar__toggle {
  margin-inline: auto;
}

.app-shell--collapsed .brand {
  justify-content: center;
}

.app-shell--collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

.app-shell--collapsed .workspace {
  grid-template-columns: 1fr;
  justify-items: center;
  padding-inline: 0;
}

.mobile-header {
  display: none;
}

.main {
  width: min(100%, 1440px);
  min-width: 0;
  margin-inline: auto;
  padding: 28px clamp(16px, 3vw, 40px) 52px;
}

.main--documentation {
  width: 100%;
  max-width: none;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.documentation-embed {
  width: 100%;
  height: 100%;
  background: var(--surface);
}

.documentation-embed__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

.page-header,
.section__heading,
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header {
  margin-bottom: 22px;
}

.page-header > div:first-child,
.section__heading > div:first-child {
  min-width: 0;
}

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

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-raised);
  cursor: pointer;
  font-weight: 550;
  text-decoration: none;
}

.btn:hover,
.btn:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: var(--brand-soft);
  outline: none;
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.tab:focus-visible,
.action-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 2px;
}

.btn--ghost {
  background: transparent;
}

.btn--icon {
  width: 38px;
  padding-inline: 0;
}

.btn--block {
  width: 100%;
}

.btn--danger {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  color: var(--danger);
  background: var(--danger-soft);
}

.health-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 11px 0;
  overflow-x: auto;
  border-block: 1px solid var(--border);
  white-space: nowrap;
}

.health-bar > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card,
.section,
.entity-card,
.action-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 17px;
}

.stat-card--button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.stat-card--button:hover,
.stat-card--button:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  transform: translateY(-1px);
}

.stat-card--active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.stat-card > span:first-child {
  color: var(--text-muted);
}

.stat-card > strong {
  font-size: 1.7rem;
  line-height: 1.15;
  font-weight: 650;
}

.stat-card .stat-card__status {
  font-size: 1rem;
}

.section {
  padding: clamp(14px, 2vw, 20px);
}

.section + .section {
  margin-top: 16px;
}

.section__heading {
  margin-bottom: 16px;
}

.section__heading p {
  margin-top: 3px;
}

.integration-card {
  margin-bottom: 16px;
}

.integration-identifiers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.integration-identifier {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.integration-identifier > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.integration-identifier span {
  color: var(--text-muted);
  font-size: .78rem;
}

.integration-identifier strong {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .88rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-identifier .btn {
  flex: 0 0 auto;
}

.integration-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: .84rem;
  line-height: 1.45;
}

.integration-note .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--brand);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px;
  gap: 10px;
  margin-bottom: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}

.search-field:focus-within {
  border-color: var(--brand);
  outline: 3px solid color-mix(in srgb, var(--brand) 20%, transparent);
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.field input,
.field select,
.field textarea,
.filters select {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--input);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-raised);
  resize: vertical;
}

.field--wide {
  grid-column: 1 / -1;
}

.field--compact {
  align-self: end;
}

.field--connection-peer {
  align-content: start;
}

.field-label {
  display: flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
}

.secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 36px;
  align-items: center;
  gap: 4px;
}

.secret-field > input {
  grid-column: 1;
}

.secret-field > .btn {
  min-height: 36px;
  padding: 7px;
}

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

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

.stack {
  display: grid;
  gap: 18px;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.switch-field {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.switch-field label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.switch-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

.switch-field strong {
  font-weight: 500;
}

.info-tooltip {
  position: relative;
  display: inline-grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 5px;
  place-items: center;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  cursor: help;
}

.info-tooltip .icon {
  width: 17px;
  height: 17px;
}

.info-tooltip::after {
  position: absolute;
  z-index: 90;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(280px, calc(100vw - 40px));
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  content: attr(data-tooltip);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: 120ms ease;
  visibility: hidden;
}

.info-tooltip:hover::after,
.info-tooltip:focus-visible::after,
.info-tooltip--open::after {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

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

.table-actions {
  text-align: right;
}

.destination {
  max-width: 520px;
  overflow-wrap: anywhere;
}

.queue-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(240px, 0.7fr);
}

.queue-name,
.queue-message__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.queue-inspector-controls {
  align-items: end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.queue-inspector-controls .field {
  min-width: 230px;
}

.page-back {
  margin-bottom: 14px;
}

.queue-name strong {
  overflow-wrap: anywhere;
}

.queue-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.queue-scope span {
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  padding: 2px 7px;
}

.queue-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.queue-state > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.queue-state--healthy {
  color: var(--success);
}

.queue-state--healthy > span {
  background: var(--success);
}

.queue-state--danger {
  color: var(--danger);
}

.queue-state--danger > span {
  background: var(--danger);
}

.row--selected {
  background: var(--brand-soft);
}

.queue-inspector {
  margin-top: 16px;
}

.queue-messages {
  display: grid;
  gap: 12px;
}

.queue-message {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.queue-message__header {
  margin-bottom: 10px;
}

.queue-message pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.redis-browser {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 1.6fr);
  gap: 16px;
  margin-top: 14px;
}

.redis-tree,
.redis-detail {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.redis-tree__toggle {
  min-width: 0;
  flex: 1;
  padding: 6px 4px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  text-align: left;
}

.redis-tree__row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.redis-tree__delete {
  flex: 0 0 auto;
  color: var(--danger);
  opacity: 0.68;
}

.redis-tree__count {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.redis-tree__delete:hover,
.redis-tree__delete:focus-visible {
  color: var(--danger);
  background: var(--danger-soft);
  opacity: 1;
}

.redis-tree__toggle:hover,
.redis-tree__toggle:focus-visible {
  background: var(--brand-soft);
}

.redis-tree__arrow {
  width: 12px;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 120ms ease;
}

.redis-tree__toggle[aria-expanded="true"] .redis-tree__arrow {
  transform: rotate(90deg);
}

.redis-tree__children {
  display: grid;
  gap: 3px;
  padding-left: 20px;
}

.redis-tree__loading {
  padding: 6px 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.field-help {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin: -2px 0 2px;
}

.redis-key {
  padding: 6px 8px;
  overflow-wrap: anywhere;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.redis-key:hover,
.redis-key:focus-visible,
.redis-key--active {
  color: var(--text);
  background: var(--brand-soft);
}

.redis-detail pre,
.redis-query-result {
  max-height: 460px;
  margin: 12px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.redis-query-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.4fr) minmax(240px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.session-identity {
  display: grid;
  grid-template-columns: 34px minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
}

.session-identity > span:last-child {
  display: grid;
}

.session-identity small {
  font-variant-numeric: tabular-nums;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  font-weight: 550;
}

.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status--online {
  color: var(--success);
}

.status--warning {
  color: var(--warning);
}

.status--danger {
  color: var(--danger);
}

.status--offline {
  color: var(--text-muted);
}

.auto-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.legacy-label {
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 600;
}

.legacy-migration {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
  background: var(--warning-soft);
}

.legacy-migration p {
  max-width: 720px;
  margin-top: 6px;
}

.session-header__title {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}

.session-header__title .muted {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding-bottom: 7px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.tab:hover,
.tab--active {
  color: var(--text);
  background: var(--brand-soft);
}

.tab--active {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  color: var(--brand);
}

.voip-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-muted);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
}

.voip-badge--success {
  color: var(--success);
  background: var(--success-soft);
}

.voip-badge--warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.voip-overview-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.voip-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px;
  border-bottom: 1px solid var(--border);
}

.voip-large-number {
  font-size: 2rem;
  color: var(--brand);
}

.voip-editor-form .wide,
.voip-editor-form > .form-actions {
  grid-column: 1 / -1;
}

.voip-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-top: 22px;
}

.voip-recording-actions {
  display: grid;
  min-width: 250px;
  gap: 8px;
}

.voip-audio {
  width: min(100%, 340px);
  height: 36px;
}

select[multiple] {
  min-height: 120px;
}

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

.action-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.action-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  background: var(--brand-soft);
}

.action-card > .icon {
  width: 21px;
  height: 21px;
  color: var(--brand);
}

.action-card span {
  display: grid;
  min-width: 0;
}

.action-card--danger > .icon,
.action-card--danger strong {
  color: var(--danger);
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
}

.entity-search {
  width: min(100%, 520px);
  margin-bottom: 16px;
}

.entity-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.entity-card__body {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.entity-card__body > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 7px;
  overflow: visible;
}

.entity-card__actions .btn {
  width: 32px;
  height: 32px;
}

.avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--brand);
  background: var(--brand-soft);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar .icon {
  width: 24px;
  height: 24px;
}

.avatar--group {
  border-radius: var(--radius);
}

.load-more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.inline-error,
.form-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: var(--danger-soft);
}

.form-error {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--surface-muted);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: color-mix(in srgb, #000 48%, transparent);
}

.modal {
  width: min(100%, 560px);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.modal--wide {
  width: min(100%, 880px);
}

.modal__header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.modal__body {
  padding: 18px;
}

.connection-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(240px, 1.2fr);
  gap: 22px;
  align-items: center;
}

.qr-box {
  display: grid;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  place-items: center;
  margin-inline: auto;
  overflow: hidden;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-placeholder,
.pairing-code {
  display: grid;
  place-items: center;
  gap: 9px;
  color: var(--text-muted);
  text-align: center;
}

.qr-placeholder .icon {
  width: 28px;
  height: 28px;
}

.pairing-code strong {
  color: var(--text);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 0.12em;
}

.details-list {
  display: grid;
  margin: 0;
}

.details-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.details-list dt {
  color: var(--text-muted);
}

.details-list dd {
  margin: 0;
  text-align: right;
}

.toast {
  position: fixed;
  z-index: 150;
  right: 18px;
  bottom: 18px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 15% 20%, var(--brand-soft), transparent 32%),
    var(--background);
}

.login-panel {
  display: grid;
  width: min(100%, 420px);
  gap: 24px;
  padding: clamp(22px, 5vw, 36px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  padding: 8px 14px 8px 8px;
  border-radius: var(--radius);
  color: #fff;
  background: #1d1c1f;
}

.login-brand__icon {
  width: 42px;
  height: 42px;
}

.login-brand strong {
  color: #fff;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (max-width: 900px) {
  .app-shell,
  .app-shell--collapsed {
    grid-template-columns: 1fr;
    padding-top: 62px;
  }

  .mobile-header {
    position: fixed;
    z-index: 40;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    height: 62px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .mobile-header .brand__logo {
    width: 34px;
    height: 34px;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    width: min(290px, calc(100vw - 48px));
    transform: translateX(-105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .app-shell--mobile-open .sidebar {
    transform: translateX(0);
  }

  .app-shell--collapsed .brand__logo,
  .app-shell--collapsed .brand__copy,
  .app-shell--collapsed .nav-item span,
  .app-shell--collapsed .workspace__icon,
  .app-shell--collapsed .workspace__copy {
    display: initial;
  }

  .app-shell--collapsed .brand__copy,
  .app-shell--collapsed .workspace__copy {
    display: grid;
  }

  .app-shell--collapsed .nav-item {
    justify-content: flex-start;
    padding-inline: 10px;
  }

  .app-shell--collapsed .workspace {
    grid-template-columns: 32px minmax(0, 1fr);
    justify-items: stretch;
    padding-inline: 8px;
  }

  .sidebar__toggle {
    display: none;
  }

  .main {
    padding: 22px 14px 42px;
  }

  .main--documentation {
    height: calc(100vh - 62px);
    padding: 0;
  }

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

@media (max-width: 640px) {
  .queue-filters {
    grid-template-columns: 1fr;
  }

  .queue-message__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .redis-browser,
  .redis-query-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-header,
  .section__heading,
  .legacy-migration {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header .actions,
  .section__heading .actions {
    justify-content: stretch;
  }

  .page-header .actions .btn:not(.btn--icon),
  .section__heading .actions .btn:not(.btn--icon) {
    flex: 1 1 150px;
  }

  .stats,
  .filters,
  .integration-identifiers,
  .form-grid,
  .form-grid--three,
  .switch-grid,
  .connection-layout {
    grid-template-columns: 1fr;
  }

  .field--wide {
    grid-column: auto;
  }

  .section {
    padding: 14px;
  }

  .session-table th:nth-child(3),
  .session-table td:nth-child(3) {
    display: none;
  }

  .row-actions .btn:not(.btn--icon) {
    min-width: 0;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal--wide {
    width: 100%;
    max-height: 94vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .form-actions .btn {
    flex: 1 1 160px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
