:root {
  --font: -apple-system, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Shared height for nav / inspector pane chrome (border-box). */
  --pane-chrome-height: 36px;

  /* Readable measure — inputs, textareas, and paragraphs (constitution). */
  --measure: 400px;

  /* Single-line EntityRow / InlineInput — padding + body line box. */
  --row-h: calc(1.5em + var(--space-2) * 2);

  /* EntityList / EntityRow horizontal gutter — global; do not override per view. */
  --list-pad-x: var(--space-3);

  --radius: 8px;
  --radius-sm: 6px;

  --bg: #17181c;
  --bg-elevated: #1f2025;
  --bg-inset: #14151a;
  --border: #2c2d33;
  --text: #e7e7ea;
  --text-muted: #9a9ba3;
  --accent: #6366f1;
  --accent-strong: #818cf8;
  --selection: rgba(59, 130, 246, 0.28);
  --danger: #ef4444;
  --success: #22c55e;
  --running: #2dd4bf;
  --warning: #eab308;

  /* Entity icons (brand / directory / membership roles). */
  --entity-brand: #3b82f6;
  --entity-admin: #ef4444;
  --entity-owner: #f97316;
  --entity-member: #22c55e;
  --entity-guest: #9a9ba3;
  --entity-submission: #60a5fa;
  --entity-product: #a78bfa;
  --entity-ingredient: #2dd4bf;
  --entity-result: #34d399;
}

* {
  box-sizing: border-box;
}

/* Every focusable control gets the same visible ring — buttons, inputs,
   and other keyboard-operable controls share one focus treatment instead
   of relying on inconsistent browser defaults. */
:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 1px;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  /* Single body size everywhere. Hierarchy comes from spacing, muted
     color, and weight — not new sizes. */
  font-size: 12px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
}

h3 {
  color: var(--text-muted);
  font-weight: 500;
}

p {
  margin: 0;
  max-width: min(100%, var(--measure));
}

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

/* Constitution measure — wrap form stacks / prose columns. */
.measure {
  width: 100%;
  max-width: var(--measure);
}

.hidden {
  display: none !important;
}

/* App shell */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.top-bar-start {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.header-nav-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-1) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}

.header-nav-item__label {
  min-width: 0;
}

.header-nav-item:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.header-nav-item.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--selection);
  font-weight: 500;
}

.top-bar-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.app-title {
  font-weight: 500;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.brand-mark-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 2px;
}

.app-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.view-pane {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Column pages fill the center pane — no inset max-width cards. */
.workspace-center > .view-pane > * {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

/* 3-column workspace — polynome projects-layout clone */

.workspace-layout {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: row;
  min-width: 0;
  position: relative;
}

.workspace-layout::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: var(--pane-chrome-height);
  height: 1px;
  background: var(--border);
  z-index: 4;
  pointer-events: none;
}

.workspace-layout.is-compact::after {
  display: none;
}

.workspace-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.workspace-main > .split-shell {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.workspace-layout .split-primary > .split-shell {
  height: 100%;
  min-height: 0;
}

.workspace-left,
.workspace-center,
.workspace-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.workspace-left {
  border-right: 1px solid transparent;
}

.workspace-right {
  border-left: 1px solid transparent;
}

.pane-chrome {
  box-sizing: border-box;
  flex: 0 0 var(--pane-chrome-height);
  height: var(--pane-chrome-height);
  max-height: var(--pane-chrome-height);
  min-height: 0;
  margin: 0;
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.workspace-layout .pane-chrome {
  border-bottom-color: transparent;
  background: var(--bg);
}

.pane-chrome-label {
  color: var(--text-muted);
  font-weight: 500;
}

.pane-chrome-dismiss {
  margin-left: auto;
  flex-shrink: 0;
}

/* Entity header row hosted inside pane chrome (inspector title slot). */
.pane-chrome > .entity-row,
.pane-chrome > .entity-row__block {
  flex: 1;
  min-width: 0;
  height: 100%;
}

.pane-chrome > .entity-row__block {
  display: flex;
  align-items: center;
}

.pane-chrome .entity-row--header {
  min-height: 0;
  height: 100%;
  padding: 0;
}

/* Row already fills the chrome — don't let dismiss's auto margin collapse it. */
.pane-chrome:has(> .entity-row__block) > .pane-chrome-dismiss,
.pane-chrome:has(> .entity-row) > .pane-chrome-dismiss {
  margin-left: 0;
}

.layout-toggles {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.layout-toggle.active {
  border-color: var(--accent);
  color: var(--text);
}

.nav-rail,
.inspector-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.nav-rail-body,
.inspector-pane-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.inspector-pane-body {
  padding: var(--space-3);
}

.nav-rail-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: 100%;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-rail-item__label {
  flex: 1;
  min-width: 0;
}

.nav-rail-item__badge {
  flex-shrink: 0;
  margin-left: auto;
}

.nav-rail-item:hover {
  background: var(--bg-elevated);
}

.nav-rail-item.active {
  background: var(--selection);
  box-shadow: inset 3px 0 0 var(--accent-strong);
  color: var(--text);
  font-weight: 500;
}

.nav-rail-item--nested {
  padding-left: calc(var(--space-3) + var(--space-4));
  color: var(--text-muted);
}

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

/* Horizontal NavRail — same item chrome as vertical; only axis / sizing differ. */
.nav-rail--horizontal {
  height: auto;
  min-height: 0;
  flex-shrink: 0;
  margin-bottom: var(--space-3);
}

.nav-rail--horizontal .nav-rail-body {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  overflow: visible;
  gap: 0;
  padding: 0;
}

.nav-rail--horizontal .nav-rail-item {
  width: auto;
  flex: 0 0 auto;
}

.nav-rail--horizontal .nav-rail-item.active {
  /* Same accent bar as vertical — top edge instead of leading edge. */
  box-shadow: inset 0 3px 0 var(--accent-strong);
}

.nav-rail--horizontal .nav-rail-item__label {
  flex: 0 1 auto;
}

/* Status bar */

.status-bar {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 32px;
  padding: 0 var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.status-bar-track {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.status-bar.is-loading .status-bar-track {
  opacity: 1;
}

.status-bar-track-bar {
  height: 100%;
  width: 35%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-strong),
    transparent
  );
  animation: status-bar-slide 1.1s ease-in-out infinite;
}

@keyframes status-bar-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.status-bar-start,
.status-bar-center,
.status-bar-end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.status-bar-start {
  flex: 1;
  gap: var(--space-3);
}

/* Compact session chip — EntityRow in the status bar (left). */
.status-bar-session {
  flex-shrink: 1;
  min-width: 0;
  max-width: min(22rem, 42vw);
}

.status-bar-session .entity-row__shell {
  width: auto;
  max-width: 100%;
}

.status-bar-session .entity-row__shell > .entity-row {
  width: auto;
  max-width: 100%;
}

.status-bar-session-row.entity-row,
.status-bar-session .entity-row {
  width: auto;
  max-width: 100%;
  padding: 0 var(--space-1) 0 0;
  border-bottom: none;
  gap: var(--space-1);
  min-height: 0;
}

.status-bar-session .entity-row:hover,
.status-bar-session .entity-row.selected {
  background: transparent;
  box-shadow: none;
}

.status-bar-session .entity-row__text {
  flex: 1;
  min-width: 0;
}

.status-bar-session .user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
  line-height: 1.2;
}

.status-bar-session .entity-row__meta {
  flex-shrink: 0;
}

.status-bar-session .entity-row__menu-btn {
  width: 1.5rem;
  height: 1.5rem;
}

.status-bar-center {
  flex: 2;
  justify-content: center;
  overflow: hidden;
}

.status-bar-stats {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 24px;
}

.status-bar-end {
  flex: 1;
  margin-inline-start: 0;
  justify-content: flex-end;
  flex-shrink: 0;
}

.status-bar-path {
  flex-shrink: 1;
  min-width: 0;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 24px;
}

.status-bar-loading,
.status-bar-message-text {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 24px;
}

.status-bar-message {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}

.status-bar-message.is-success .status-bar-message-text,
.status-bar-message.is-error .status-bar-message-text {
  color: var(--text);
  font-weight: 500;
}

.status-bar-message.is-error .status-bar-message-text {
  color: var(--danger);
}

.status-bar-action {
  flex-shrink: 0;
  font: inherit;
  color: var(--accent-strong);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.status-bar-action:hover {
  text-decoration: underline;
}

.status-bar-dismiss {
  flex-shrink: 0;
  font: inherit;
  line-height: 1;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
}

.status-bar-dismiss:hover {
  color: var(--text);
}

.app-version {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  user-select: text;
  line-height: 24px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent-strong);
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.small {
  padding: var(--space-1) var(--space-2);
}

.btn.icon {
  padding: var(--space-1);
  width: 28px;
  height: 28px;
  justify-content: center;
}

.btn.icon-label {
  gap: var(--space-1);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
}

.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn.danger.armed {
  background: var(--danger);
  color: white;
}

.btn.cursor-open .cursor-icon {
  display: block;
}

/* Segmented control */

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.segment {
  padding: var(--space-1) var(--space-4);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.segment.active {
  background: var(--accent);
  color: white;
}

/* Form fields */

.search-input {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--text-muted);
  max-width: var(--measure);
}

.field input:not(.confirm-field__control),
.field textarea:not(.confirm-field__control) {
  width: 100%;
  max-width: var(--measure);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
}

.field-error {
  margin: 0;
  color: var(--danger);
}

.field-label {
  display: block;
  color: var(--text-muted);
}

/* Dropzone — system file picker (drag / browse) */

.dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  padding: var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-inset);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
  outline: none;
}

.dropzone:hover:not(.is-disabled),
.dropzone:focus-visible:not(.is-disabled) {
  border-color: var(--accent);
}

.dropzone.is-dragover {
  border-style: solid;
  border-color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-inset));
}

.dropzone.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

.dropzone-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  pointer-events: none;
}

.dropzone-icon {
  display: inline-flex;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
}

.dropzone-preview {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 28rem;
}

.dropzone-label {
  color: var(--text);
  font-weight: 500;
}

.dropzone-hint {
  font-weight: 400;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge.running {
  border-color: var(--running);
  color: var(--running);
}

.badge.warn {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  color: var(--danger);
}

.badge.clean {
  border-color: var(--success);
  color: var(--success);
}

.badge.dirty {
  border-color: var(--warning);
  color: var(--warning);
}

/* Panels */

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pane-panel {
  height: 100%;
  min-height: 0;
  border-radius: 0;
  border: none;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}

.pane-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.panel-header-end {
  justify-content: flex-end;
}

.panel-actions {
  display: inline-flex;
  gap: var(--space-2);
}

/* Resizable shell splits (columns / rows) — pairs with ResizableSplit */

.split-shell {
  display: grid;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.split-shell-dragging {
  user-select: none;
  cursor: inherit;
}

.split-shell-dragging.split-shell-horizontal,
.split-shell-dragging .split-handle-col {
  cursor: col-resize;
}

.split-shell-dragging.split-shell-vertical,
.split-shell-dragging .split-handle-row {
  cursor: row-resize;
}

.split-primary,
.split-secondary {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.split-handle {
  background: var(--border);
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.split-handle::after {
  content: "";
  position: absolute;
  inset: -2px;
}

.split-handle-col {
  cursor: col-resize;
}

.split-handle-row {
  cursor: row-resize;
}

.split-handle:hover,
.split-shell-dragging .split-handle {
  background: var(--accent);
}

/* Status dot — pairs with the StatusDot component */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-stopped {
  background: var(--border);
}

.dot-pending {
  background: var(--warning);
}

.dot-running {
  background: var(--running);
}

.dot-blocked {
  background: var(--danger);
  opacity: 0.65;
}

.dot-crashed {
  background: var(--danger);
}

/* Empty state */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: var(--space-3);
  text-align: center;
  padding: var(--space-6);
}

.empty-state p {
  max-width: 360px;
  color: var(--text-muted);
}

/* Overlay scrollbars — never reserve gutter space. Styling
   `::-webkit-scrollbar` forces classic (layout-shifting) scrollbars in
   WebKit, so we leave them unstyled and rely on the platform overlay.
   Firefox gets a thin transparent track. */

* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  scrollbar-gutter: auto;
}

html.is-scrolling,
html.is-scrolling * {
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

/* Circular panel spinner (first-paint only; named work uses the strip) */

.spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.spinner-ring {
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong, var(--border));
  border-top-color: var(--accent-strong, var(--text-muted));
  border-radius: 50%;
  animation: spinner-rotate 0.7s linear infinite;
}

@keyframes spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.panel-spinner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--space-2) 0;
}

/* Floating notify hosts — growl (top), toast (bottom-left), snackbar (bottom-center). */

.notify-growls,
.notify-toasts,
.notify-snackbar-host {
  pointer-events: none;
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0 var(--space-4);
}

.notify-growls {
  inset-inline: 0;
  top: var(--space-4);
  align-items: center;
}

.notify-toasts {
  left: var(--space-4);
  bottom: calc(28px + var(--space-4));
  align-items: flex-start;
  max-width: min(360px, calc(100vw - 2rem));
}

.notify-snackbar-host {
  inset-inline: 0;
  bottom: calc(28px + var(--space-4));
  align-items: center;
}

.notify-growl,
.notify-toast,
.notify-snackbar {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  max-width: 420px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: notify-enter 180ms ease-out;
}

.notify-toast {
  max-width: 360px;
}

.notify-snackbar {
  max-width: 480px;
}

@keyframes notify-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notify-growl,
  .notify-toast,
  .notify-snackbar {
    animation: none;
  }
}

.notify-growl.is-error,
.notify-toast.is-error,
.notify-snackbar.is-error {
  border-color: var(--danger);
}

.notify-growl.is-error .notify-message,
.notify-toast.is-error .notify-message {
  color: var(--danger);
  font-weight: 500;
}

.notify-toast.is-success .notify-message {
  color: var(--success);
}

.notify-message {
  flex: 1;
  min-width: 0;
}

.notify-action {
  flex-shrink: 0;
  margin: 0;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.notify-action:hover {
  border-color: var(--accent);
  color: var(--text);
}

.notify-dismiss {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

.notify-dismiss:hover {
  opacity: 1;
}

/* Auth (setup / sign-in) */

.auth-panel {
  width: min(360px, 90vw);
  text-align: left;
}

.auth-panel h1 {
  margin: 0 0 var(--space-1);
}

/* Settings — pane chrome clears the workspace rule; panels keep elevated shell. */

.settings-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.settings-view > .pane-chrome:first-child {
  position: sticky;
  top: 0;
  z-index: 2;
}

.settings-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-3) var(--list-pad-x) var(--space-5);
}

.settings-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
}

.settings-lede {
  margin: 0;
}

.settings-field--short {
  max-width: 8rem;
}

.settings-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Account view — pane chrome + elevated form surface (see recipes «Form surface»). */

.account-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  /* Keep overflow on the section body — auto here prevents flex children from
     filling the pane, so margin-top:auto on the delete row never engages. */
  overflow: hidden;
}

/* Profile / Invites / Requests — fill space under the Account chrome. */
.account-view > *:not(.pane-chrome) {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
}

/* Align with Filters / Inspector chrome; shared workspace rule sits under this. */
.account-view > .pane-chrome:first-child {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Profile / invites / requests — elevated panels (same form surface as Brand info). */
.account-profile,
.account-rail-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: var(--space-3) var(--list-pad-x) var(--space-5);
}

.account-profile > .panel:not(.account-profile-danger) {
  flex-shrink: 0;
}

.account-profile-danger {
  margin-top: auto;
  flex-shrink: 0;
}

.account-fields {
  padding: var(--space-3);
}

/* Tile grids already pad internally — keep the elevated shell flush. */
.account-rail-body > .panel.account-tiles-panel {
  padding: 0;
  overflow: hidden;
}

.account-email {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  font-weight: 500;
}

.account-email-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-email .badge {
  flex-shrink: 0;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Static entity rows (account / members) — see .entity-row--static */
.user-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

/* Only legacy stacks outside EntityList drop the last rule — inside a list,
   every row sits alone in `.entity-row__block`, so `:last-child` would erase
   all separators. */
.user-list > .user-row:last-child,
.user-list > .entity-row--static:last-child,
.user-list > .entity-row__block:last-child > .entity-row--static {
  border-bottom: none;
}

.user-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  overflow: hidden;
}

.user-email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email-secondary {
  font-size: 0.875em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Brands (admin) — full-bleed center column */

.brands-view {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.brands-view > .pane-chrome {
  justify-content: space-between;
}

.brand-create {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
  max-width: 28rem;
}

.brand-create-field {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.brand-create-field input {
  height: 28px;
}

.brands-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  box-sizing: border-box;
  min-height: var(--pane-chrome-height);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
}

.brand-search {
  flex: 1;
  min-width: 10rem;
  margin: 0;
}

.brand-search input {
  height: 28px;
}

.brand-row-badges,
.entity-row__meta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  flex-shrink: 0;
}

.entity-row__trailing {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.entity-row__shell {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.entity-row__shell > .entity-row {
  flex: 1;
  min-width: 0;
}

.entity-row__shell > .entity-row__trailing {
  padding-right: var(--list-pad-x);
}

.entity-row__meta + .entity-row__trailing {
  margin-left: 0;
}

.entity-row__menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  color: var(--text-muted, var(--muted-foreground, inherit));
  cursor: pointer;
}

.entity-row__menu-btn:hover {
  background: var(--bg-elevated, var(--secondary));
  color: var(--text, inherit);
}

.ui-context-menu {
  width: max-content;
  min-width: var(--ui-menu-min, 10.5rem);
  max-width: min(18rem, calc(100vw - 24px));
}

.ui-context-menu__check {
  display: inline-flex;
  width: 0.85em;
  flex-shrink: 0;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.ui-context-menu--submenu {
  min-width: var(--ui-menu-min, 10.5rem);
}

.brands-scroll {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Roster panes: list fills the column; body is the scrollport (sticky groups). */
.brands-scroll > .entity-list {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.brands-scroll .entity-list__body-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.brands-scroll .entity-list__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.brand-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-empty {
  margin: 0;
  padding: var(--space-3);
  color: var(--text-muted);
}

.brand-edit-field {
  flex: 1;
  min-width: 0;
}

/* Selectable roster rows (brands / users). Keep .brand-row for e2e. */
.entity-row,
.brand-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--row-h);
  margin: 0;
  padding: var(--space-2) var(--list-pad-x);
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.entity-row:hover,
.brand-row:hover {
  background: var(--bg-elevated);
}

.entity-row.selected,
.brand-row.selected {
  background: var(--selection);
  box-shadow: inset 3px 0 0 var(--accent-strong);
  color: var(--text);
}

.entity-row--static {
  cursor: default;
  padding: var(--space-2) 0;
  width: 100%;
  justify-content: flex-start;
}

.entity-row--static:hover {
  background: transparent;
}

/* Inspector entity header — no list rule, hug content */
.entity-row--header {
  border-bottom: none;
  padding: 0;
  width: 100%;
}

.entity-row--header .entity-row__text {
  flex: 1;
  min-width: 0;
}

.entity-row--header .hover-rename {
  min-width: 0;
  max-width: 100%;
}

/* Shared entity list shell */
.entity-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.entity-list__titlebar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--pane-chrome-height);
  padding: 0 var(--list-pad-x);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
  box-sizing: border-box;
}

.entity-list__titlebar .entity-list__title {
  flex: 1;
  min-width: 0;
}

.entity-list__titlebar-search {
  flex: 1;
  min-width: 0;
  max-width: var(--measure);
}

.entity-list__titlebar-create {
  flex: 1;
  min-width: 0;
  max-width: var(--measure);
}

.entity-list__titlebar-search .entity-list__search-shell {
  width: 100%;
  max-width: none;
  min-height: 28px;
  height: 28px;
  box-sizing: border-box;
}

.entity-list__titlebar-search .entity-list__search-input {
  height: 26px;
  padding-top: 0;
  padding-bottom: 0;
}

.entity-list__titlebar-create .entity-list-create {
  width: 100%;
}

.entity-list__titlebar-end {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  flex-shrink: 0;
}

.entity-list__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  /* Match EntityRow horizontal padding / gap so columns line up.
     Vertical padding alone — sort buttons must not add more, or labels
     overflow the box and paint over the borders above/below. */
  padding: var(--space-2) var(--list-pad-x);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg);
  box-sizing: border-box;
}

.entity-list__title {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.entity-list__icon-spacer {
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
}

.entity-list__sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0 var(--space-2);
  border: none;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
}

.entity-list__sort--label {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  padding-left: 0;
}

.entity-list__header-end {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  flex-shrink: 0;
}

.entity-list__sort:hover {
  background: var(--bg-elevated);
}

.entity-list__sort-ind {
  min-width: 0.75em;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.entity-list__search {
  flex-shrink: 0;
  padding: var(--space-2) var(--list-pad-x);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.entity-list__search-shell {
  container-type: inline-size;
  container-name: entity-list-search;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
  width: 100%;
  max-width: none;
  padding: 0 var(--space-2);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.entity-list__search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 28px;
  margin: 0;
  padding: var(--space-2) 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
}

.entity-list__search-input:focus {
  outline: none;
}

.entity-list__search-shell:focus-within {
  outline: 2px solid var(--accent-strong);
  outline-offset: 1px;
}

.entity-list__search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.entity-list__search-trail {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  max-width: 55%;
  min-width: 0;
}

.entity-list__search-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted, var(--muted-foreground, inherit));
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}

.entity-list__search-shell:hover .entity-list__search-add,
.entity-list__search-shell:focus-within .entity-list__search-add,
.entity-list__search-shell.is-add-open .entity-list__search-add {
  opacity: 1;
  pointer-events: auto;
}

.entity-list__search-add:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.entity-list__search-chips {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 1;
  min-width: 0;
  overflow-x: auto;
}

.entity-list__search-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0.1rem 0.35rem;
  border: none;
  /* Inner of field (`--radius-sm` / 6) — one step smaller. */
  border-radius: 4px;
  background: #5c5c5c;
  color: #000;
  font: inherit;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  line-height: 1.2;
  cursor: pointer;
}

.entity-list__search-chip:hover {
  filter: brightness(1.08);
}

.entity-list__search-chip-full {
  display: inline;
}

.entity-list__search-chip-short {
  display: none;
}

@container entity-list-search (max-width: 299px) {
  .entity-list__search-chip-full {
    display: none;
  }

  .entity-list__search-chip-short {
    display: inline;
  }
}

.entity-list__settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  color: var(--text-muted, var(--muted-foreground, inherit));
  cursor: pointer;
}

.entity-list__settings-btn:hover {
  background: var(--bg-elevated, var(--secondary));
  color: var(--text, inherit);
}

.entity-list__group {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  margin: 0;
  padding: var(--space-2) var(--list-pad-x);
  border: none;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  background: var(--bg-elevated);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.entity-list__group:hover {
  background: var(--bg-elevated);
  filter: brightness(1.06);
}

.entity-list__group-block > .entity-list__group:first-child,
.entity-list__body > .entity-list__group:first-child,
.entity-list__group:first-child {
  border-top: none;
}

.entity-list__group .ui-caps {
  color: var(--text);
}

.entity-list__group-chevron {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 120ms ease;
}

.entity-list__group-chevron.is-collapsed {
  transform: rotate(-90deg);
}

.entity-list__group-body.is-collapsed {
  display: none;
}

.entity-list__create {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--list-pad-x);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.entity-list__create-main {
  flex: 1;
  min-width: 0;
}

.entity-list__chrome-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  color: var(--text-muted);
  cursor: pointer;
}

.entity-list__chrome-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

.entity-list__chrome-toggle.is-active {
  color: var(--text);
  border-color: var(--accent-strong);
  background: var(--bg-elevated);
}

.entity-list__create-toggle svg {
  transition: transform 120ms ease;
}

.entity-list__create-toggle.is-active svg {
  transform: rotate(45deg);
}

.entity-list__search-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  color: var(--text-muted);
  cursor: pointer;
}

.entity-list__search-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}

.entity-list__search-toggle.is-active {
  color: var(--text);
  border-color: var(--accent-strong);
  background: var(--bg-elevated);
}

/* Empty roster: titlebar stays put; center empty copy + create below. */
.entity-list.is-empty {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.entity-list.is-empty .entity-list__body-wrap {
  display: none;
}

.entity-list.is-empty .entity-list__empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--space-6);
  box-sizing: border-box;
}

.entity-list.is-empty .entity-list__empty-copy {
  text-align: center;
}

.entity-list.is-empty .entity-list__empty-copy p {
  margin: 0;
  color: var(--text-muted);
}

.entity-list.is-empty .entity-list__create--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  gap: 0;
}

.entity-list.is-empty .entity-list__create--empty .entity-list__create-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 auto;
  width: 100%;
}

.entity-list-create {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
}

.entity-list-create__field {
  flex: 1;
  min-width: 0;
  margin: 0;
  /* Roster create line spans the column — don't inherit form `.field` measure. */
  max-width: none;
}

.entity-list-create__field input {
  height: 28px;
  width: 100%;
  max-width: none;
}

.entity-list-create__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.entity-list__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.entity-list__body-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.entity-list__jump {
  position: absolute;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  transform: translateX(-50%);
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  background: var(--bg-elevated, var(--bg));
  color: var(--text);
  font: inherit;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.entity-list__jump:hover {
  border-color: var(--accent);
  color: var(--text);
}

.entity-list__jump--top {
  top: var(--space-2);
}

.entity-list__jump--bottom {
  bottom: var(--space-2);
}

/* Match EntityList header inset for static rows (select rows already pad). */
.entity-list__body > .entity-row--static,
.entity-list__body > .entity-row__block > .entity-row--static {
  padding-left: var(--list-pad-x);
  padding-right: var(--list-pad-x);
}

.entity-list__body > .entity-row__shell > .entity-row--static,
.entity-list__body > .entity-row__block > .entity-row__shell > .entity-row--static {
  padding-left: var(--list-pad-x);
  padding-right: 0;
}

.entity-list__body.brand-list,
.brand-list.entity-list__body {
  gap: 0;
}

/* EntityCard — card layout; actions are always-visible buttons */

.entity-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-sizing: border-box;
}

.entity-card.is-selected {
  border-color: var(--accent);
  background: var(--selection);
}

.entity-card__hit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.entity-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.entity-card__title-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
}

.entity-card__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  overflow: hidden;
}

.entity-card__label {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card__secondary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
}

.entity-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.entity-card__actions > .btn:last-child {
  margin-left: auto;
}

/* EntityTiles — grid of EntityCards */

.entity-tiles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.entity-tiles__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--space-3);
  padding: var(--space-3);
  box-sizing: border-box;
}

.entity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
  color: var(--entity-guest);
  opacity: 0.95;
}

.entity-icon--brand {
  color: var(--entity-brand);
}

.entity-icon--admin {
  color: var(--entity-admin);
}

.entity-icon--owner {
  color: var(--entity-owner);
}

.entity-icon--member {
  color: var(--entity-member);
}

.entity-icon--guest {
  color: var(--entity-guest);
}

.entity-icon--submission {
  color: var(--entity-submission);
}

.entity-icon--product {
  color: var(--entity-product);
}

.entity-icon--ingredient {
  color: var(--entity-ingredient);
}

.entity-icon--result {
  color: var(--entity-result);
}

.user-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.users-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.brand-search-status {
  white-space: nowrap;
}

.hover-rename {
  min-width: 0;
  flex: 1;
}

.hover-rename-display {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.hover-rename-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hover-rename-hint {
  color: var(--text-muted);
  flex-shrink: 0;
}

.hover-rename-input {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  color: var(--text);
  font: inherit;
}

.brand-inspector .inspector-pane-body,
.brand-inspector-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.brand-inspector-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-inspector-actions {
  display: flex;
  justify-content: flex-end;
}

.brand-inspector-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--list-pad-x);
}

/* EntityList already applies list gutters — don't double-pad. */
.brand-inspector-section:has(.entity-list) {
  padding: 0;
}

.brand-inspector-section h3 {
  margin: 0;
}

.brand-invite-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.brand-invite-field {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.brand-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Legacy member chrome — layout lives on .entity-row--static */
.brand-member-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-width: 0;
}

.brand-member-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

a.app-title {
  text-decoration: none;
  color: inherit;
}

a.btn.active {
  font-weight: 600;
}

/* Kit layout helpers */
.side-rail {
  display: flex;
  width: fit-content;
  min-width: 144px;
  flex-shrink: 0;
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px;
}
.content-column {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px;
}
.content-column-centered {
  align-items: center;
  justify-content: center;
}
.content-column-inner {
  display: flex;
  width: 100%;
  max-width: 24rem;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}
.btn-icon-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--measure);
}

/* Confirm / InlineInput shell — same height as EntityRow. */
.confirm-field {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 2px;
  height: var(--row-h);
  min-height: var(--row-h);
  padding: 0 2px 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  /* One chrome ring only — never stack outline on the inner control. */
  outline: none;
  box-shadow: none;
}

.confirm-field.is-dirty {
  border-color: var(--text);
}

.confirm-field.is-invalid {
  border-color: var(--danger);
}

.confirm-field:focus-within {
  border-color: var(--accent-strong);
}

.confirm-field.is-multiline {
  height: auto;
  min-height: var(--row-h);
  align-items: flex-start;
  padding-top: 2px;
  padding-bottom: 2px;
}

.confirm-field__control,
.confirm-field input.confirm-field__control,
.confirm-field textarea.confirm-field__control {
  box-sizing: border-box;
  flex: 1 1 0;
  width: 0; /* share row with Accept/Cancel — ignore .field input { width:100% } */
  max-width: none;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text);
  font: inherit;
  outline: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.confirm-field__control:focus,
.confirm-field__control:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.confirm-field.is-multiline .confirm-field__control {
  min-height: calc(var(--row-h) - 4px);
  height: auto;
  resize: vertical;
  padding-top: 2px;
  padding-bottom: 2px;
}

.confirm-field__action {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
}

.confirm-field__action.is-hidden {
  display: none;
}

.confirm-field__action--cancel {
  background: var(--bg-inset);
  color: var(--text);
}

.confirm-field__action--accept {
  background: var(--text);
  color: var(--bg);
}

.confirm-field__action--invalid {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger);
  cursor: default;
}

.field-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.field-actions > :last-child {
  margin-left: auto;
}

/* Submissions admin queue + brand home */
.subs-admin {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.subs-admin > .pane-chrome {
  justify-content: space-between;
}
.subs-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.subs-scroll > .entity-list {
  flex: 1;
  min-height: 0;
  height: 100%;
}
.subs-scroll .entity-list__body-wrap {
  flex: 1;
  min-height: 0;
}
.subs-scroll .entity-list__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.subs-inspector-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.subs-inspector .inspector-pane-body {
  padding: 0;
  gap: 0;
}
.subs-inspector-pad {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
}
.subs-tools-row {
  margin-top: var(--space-1);
}
.subs-products {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
.subs-products-empty {
  padding: var(--space-2) var(--space-3);
}
.subs-products-list {
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.subs-products-list .entity-list__body {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.entity-row__block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.entity-row__block.is-details-open {
  isolation: isolate;
}
.entity-row__block.is-details-open > .entity-row,
.entity-row__block.is-details-open > .entity-row__shell {
  position: sticky;
  top: 0;
  z-index: 10;
  /* Opaque underlay so scrolling details never paint through the sticky row. */
  background-color: var(--bg);
}
.entity-row__block.is-details-open > .entity-row.selected,
.entity-row__block.is-details-open > .entity-row__shell > .entity-row.selected {
  /* --selection is translucent — layer over opaque --bg so details can't bleed through. */
  background-color: var(--bg);
  background-image: linear-gradient(var(--selection), var(--selection));
  box-shadow:
    inset 3px 0 0 var(--accent-strong),
    0 1px 0 var(--border);
}
.entity-row__block.is-details-open > .entity-row__shell {
  /* Shell hosts the button; keep opaque chrome for sticky. */
  background-color: var(--bg);
}
.entity-row__details {
  position: relative;
  z-index: 1;
  padding: 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
}
.entity-row__details-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: none;
  border-radius: 0;
}
.entity-row__details-list .entity-list__body {
  overflow: visible;
  max-height: none;
}
.brand-home {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}
/* Brand header fills pane-chrome height so the workspace rule does not cut text. */
.brand-home > .entity-row__block:has(> .entity-row--header) {
  box-sizing: border-box;
  flex: 0 0 var(--pane-chrome-height);
  height: var(--pane-chrome-height);
  max-height: var(--pane-chrome-height);
  display: flex;
  align-items: center;
  min-width: 0;
}
.brand-home > .entity-row__block > .entity-row--header,
.brand-home > .entity-row--header {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0 var(--list-pad-x);
  border-bottom: none;
  align-items: center;
}
.brand-home-body {
  flex: 1 1 0;
  min-height: 0;
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.owner-members {
  padding: 0;
  overflow: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.owner-members > .entity-list {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.brands-picker {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.brands-picker-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow: auto;
  padding: 0 1rem 1.5rem;
}
.brand-home-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0;
}
.brand-home-section > .entity-list {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.brand-home-section h2,
.brand-home-section h3 {
  font-size: 1em;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.brand-info {
  gap: var(--space-4);
  padding: var(--space-3) var(--list-pad-x);
  overflow: auto;
}

.brand-info-fields {
  padding: var(--space-3);
}
.form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}
.form-actions > :last-child {
  margin-left: auto;
}
/* Right-edge action cluster (e.g. Reject + Accept) — keeps siblings adjacent. */
.form-actions-end {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
