:root {
  --rail-width: 184px;
  --rail-collapsed-width: 56px;
  --app-bg: #09090b;
  --sidebar-bg: #0c0c0f;
  --sidebar-ink: #f4f4f5;
  --sidebar-muted: #a1a1aa;
  --sidebar-accent: #18181b;
  --sidebar-border: #27272a;
  --header-bg: rgba(9, 9, 11, 0.92);
  --header-border: #27272a;
  --control-bg: #09090b;
  --control-hover: #18181b;
  --control-border: #27272a;
  --control-ring: #3f3f46;
  --status-color: #a1a1aa;
  --panel-bg: #101014;
  --panel-section: #141418;
  --panel-field: #09090b;
  --panel-border: #27272a;
  --panel-text: #fafafa;
  --panel-muted: #a1a1aa;
  --accent-amber: #f4b942;
  --accent-blue: #60a5fa;
  --danger-red: #ef5f5f;
}

html {
  height: 100%;
  overflow: hidden;
}

body.has-app-rail {
  margin: 0;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background: var(--app-bg);
  color: #fafafa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.has-app-rail #root {
  height: 100vh;
  overflow: hidden;
}

body.has-app-rail * {
  box-sizing: border-box;
}

body.has-app-rail .page-shell,
body.has-app-rail .research-shell,
body.has-app-rail .admin-shell {
  margin-left: 0;
}

body.has-app-rail .app-rail.collapsed + .page-shell,
body.has-app-rail .app-rail.collapsed + .research-shell,
body.has-app-rail .app-rail.collapsed + .admin-shell {
  margin-left: 0;
}

body.has-app-rail,
body.has-app-rail .page-shell,
body.has-app-rail .research-shell,
body.has-app-rail .admin-shell {
  background: var(--app-bg);
}

body.has-app-rail .page-shell {
  height: 100vh;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  overflow: hidden;
  color: #fafafa;
}

body.has-app-rail .app-shell,
body.has-app-rail .builder-shell,
body.has-app-rail .overview-shell,
body.has-app-rail .admin-shell {
  grid-template-rows: 64px minmax(0, 1fr);
  background: var(--app-bg);
}

body.has-app-rail .workspace {
  height: 100%;
}

.app-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: var(--rail-width);
  display: grid;
  grid-template-rows: 57px minmax(0, 1fr);
  border-right: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  overflow: hidden;
  transition: width 160ms ease;
}

.app-rail.collapsed {
  width: var(--rail-collapsed-width);
}

.rail-brand {
  height: 57px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--sidebar-border);
  color: var(--sidebar-ink);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
}

.rail-mark,
.rail-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rail-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  background: #18181b;
}

.rail-mark img {
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 6px;
  object-fit: cover;
}

.rail-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-toggle {
  width: 28px;
  height: 28px;
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
}

.rail-toggle:hover {
  background: var(--sidebar-accent);
  color: #fafafa;
}

.rail-toggle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-links {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px 8px;
}

.rail-group-label {
  padding: 8px 10px 5px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}

.rail-link {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 8px;
  color: #d4d4d8;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.rail-link:hover {
  background: var(--sidebar-accent);
  color: var(--sidebar-ink);
}

.rail-link.active {
  border-color: var(--sidebar-border);
  background: var(--sidebar-accent);
  color: var(--sidebar-ink);
}

.rail-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 3px;
  height: 20px;
  border-radius: 999px;
  background: #fafafa;
}

.rail-icon {
  width: 18px;
  height: 18px;
  color: currentColor;
  opacity: 0.82;
}

.rail-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-rail.collapsed .rail-brand {
  justify-content: center;
  padding: 0;
}

.app-rail.collapsed .rail-title,
.app-rail.collapsed .rail-label,
.app-rail.collapsed .rail-group-label {
  display: none;
}

.app-rail.collapsed .rail-mark {
  display: none;
}

.app-rail.collapsed .rail-toggle {
  margin-left: 0;
}

.app-rail.collapsed .rail-links {
  padding: 10px 8px;
}

.app-rail.collapsed .rail-link {
  justify-content: center;
  padding: 0;
}

.user-chip {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  padding: 0 9px 0 5px;
  background: var(--control-bg);
  color: #fafafa;
  cursor: pointer;
}

.user-chip:hover {
  border-color: var(--control-ring);
  background: var(--control-hover);
}

.user-chip:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.user-chip:disabled:hover {
  border-color: var(--control-border);
  background: var(--control-bg);
}

.user-menu {
  position: relative;
  display: inline-flex;
}

.user-avatar {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fafafa;
  color: #09090b;
  font-size: 11px;
  font-weight: 700;
}

.google-avatar {
  background: #ffffff;
  color: #1a73e8;
}

.user-photo {
  padding: 0;
  object-fit: cover;
  background: #18181b;
}

.user-copy {
  display: grid;
  gap: 1px;
  text-align: left;
  line-height: 1;
}

.user-copy strong,
.user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.user-copy small {
  color: #a1a1aa;
  font-size: 10px;
  font-weight: 500;
}

.user-caret {
  color: #a1a1aa;
  font-size: 12px;
  line-height: 1;
}

.user-dropdown {
  position: fixed;
  z-index: 1000;
  width: 240px;
  max-height: min(360px, calc(100vh - 16px));
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #0c0c0f;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.03);
  color: #fafafa;
}

.user-dropdown-static {
  display: none;
}

.user-dropdown-static.is-open {
  display: block;
}

.user-dropdown-heading {
  display: grid;
  gap: 4px;
  padding: 7px 8px 9px;
  border-bottom: 1px solid var(--control-border);
  overflow: hidden;
}

.user-dropdown-heading strong,
.user-dropdown-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-heading strong {
  font-size: 12px;
  font-weight: 650;
}

.user-dropdown-heading span {
  color: #a1a1aa;
  font-size: 11px;
}

.user-dropdown-action {
  width: 100%;
  height: 32px;
  margin-top: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fafafa;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  padding: 0 8px;
}

.user-dropdown-action:hover {
  background: var(--control-hover);
}

.user-dropdown-action:disabled {
  color: #71717a;
  cursor: not-allowed;
}

.user-dropdown-action:disabled:hover {
  background: transparent;
}

.user-dropdown-language {
  width: 100%;
  height: auto;
  justify-content: space-between;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(244, 244, 245, 0.03);
}

.user-dropdown-language .language-select {
  min-width: 112px;
}

.auth-access-overlay {
  position: fixed;
  inset: 64px 0 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(8px);
}

.auth-access-panel {
  width: min(480px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  padding: 18px;
  background: #0c0c0f;
  color: #fafafa;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

.auth-access-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #fafafa;
  color: #09090b;
  font-size: 18px;
  font-weight: 800;
}

.auth-access-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.auth-access-copy h2 {
  margin: 0;
  color: #fafafa;
  font-size: 18px;
  line-height: 1.2;
}

.auth-access-copy p {
  margin: 0;
  color: #d4d4d8;
  font-size: 13px;
  line-height: 1.5;
}

.auth-access-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.has-app-rail .page-topbar,
body.has-app-rail .research-topbar,
body.has-app-rail .admin-topbar {
  min-height: 64px;
  height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.app-topnav {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.topnav-brand {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fafafa;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.topnav-brand img {
  width: 27px;
  height: 27px;
  border-radius: 7px;
}

.topnav-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.topnav-link {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 10px;
  color: #d4d4d8;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.topnav-link:hover {
  border-color: var(--control-border);
  background: var(--control-hover);
  color: #fafafa;
}

.topnav-link.active {
  border-color: var(--control-border);
  background: #18181b;
  color: #fafafa;
}

.topnav-icon,
.topnav-icon svg {
  width: 17px;
  height: 17px;
}

.topnav-icon svg {
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.page-layer {
  min-height: 0;
  height: calc(100vh - 64px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.page-header {
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--header-border);
  background: rgba(12, 12, 15, 0.72);
}

.page-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
  overflow: hidden;
}

.page-heading .brand-title {
  min-width: 0;
  margin: 0;
  color: #fafafa;
  font-size: 18px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.15;
}

.page-heading .brand-title,
.page-heading .subtle,
.page-breadcrumb,
.page-meta-chip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-breadcrumb span:last-child {
  color: #e4e4e7;
}

.page-header-meta {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}

.page-meta-chip {
  max-width: 320px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--control-bg);
  color: #d4d4d8;
  font-size: 12px;
  font-weight: 600;
}

.page-actions {
  min-width: 0;
  justify-content: flex-end;
  overflow: hidden;
}

.page-actions .status {
  min-width: 76px;
  max-width: 240px;
  flex: 0 1 auto;
  display: block;
  overflow: hidden;
  line-height: 30px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-actions .status:not(.valid):not(.invalid) {
  text-align: left;
}

body.has-app-rail .global-actions,
body.has-app-rail .toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-switcher {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.language-switcher > span {
  line-height: 1;
}

.language-select {
  width: auto;
  min-width: 96px;
  padding-right: 26px;
}

body.has-app-rail .button {
  position: relative;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--control-bg);
  color: #e4e4e7;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

body.has-app-rail .button:hover {
  border-color: var(--control-ring);
  background: var(--control-hover);
  color: #fafafa;
}

body.has-app-rail .button:focus-visible,
body.has-app-rail .reload-button:focus-visible,
body.has-app-rail .control:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.72);
  outline-offset: 2px;
}

body.has-app-rail .button.primary {
  border-color: #b88719;
  background: var(--accent-amber);
  color: #12100a;
  box-shadow: 0 0 0 1px rgba(244, 185, 66, 0.2);
}

body.has-app-rail .button.primary:hover {
  border-color: #f4b942;
  background: #ffd36f;
  color: #12100a;
}

body.has-app-rail .button.accent,
body.has-app-rail .button.button--accent {
  border-color: rgba(244, 185, 66, 0.76);
  background: rgba(244, 185, 66, 0.14);
  color: #ffe08a;
  box-shadow: inset 3px 0 0 var(--accent-amber), 0 0 0 1px rgba(244, 185, 66, 0.08);
}

body.has-app-rail .button.accent:hover,
body.has-app-rail .button.button--accent:hover {
  border-color: #f4b942;
  background: rgba(244, 185, 66, 0.22);
  color: #fff1b8;
  box-shadow: inset 3px 0 0 var(--accent-amber), 0 0 0 1px rgba(244, 185, 66, 0.28);
}

body.has-app-rail .button.danger {
  border-color: rgba(239, 95, 95, 0.56);
  background: rgba(239, 95, 95, 0.08);
  color: #ff9a9a;
}

body.has-app-rail .button.danger:hover {
  border-color: var(--danger-red);
  background: rgba(239, 95, 95, 0.15);
  color: #ffc0c0;
}

body.has-app-rail .button:disabled {
  border-color: rgba(113, 113, 122, 0.36);
  background:
    repeating-linear-gradient(135deg, rgba(161, 161, 170, 0.06) 0 6px, transparent 6px 12px),
    rgba(24, 24, 27, 0.34);
  color: #71717a;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

body.has-app-rail .button:disabled:hover {
  border-color: rgba(113, 113, 122, 0.36);
  background:
    repeating-linear-gradient(135deg, rgba(161, 161, 170, 0.06) 0 6px, transparent 6px 12px),
    rgba(24, 24, 27, 0.34);
  color: #71717a;
}

body.has-app-rail .page-topbar .button,
body.has-app-rail .page-topbar .control,
body.has-app-rail .page-topbar .segmented button,
body.has-app-rail .page-header .button,
body.has-app-rail .page-header .control,
body.has-app-rail .page-header .segmented button,
body.has-app-rail .research-topbar .button {
  height: 32px;
  border-color: var(--control-border);
  border-radius: 6px;
  background: var(--control-bg);
  color: #e4e4e7;
  font-size: 12px;
  font-weight: 500;
}

body.has-app-rail .page-topbar .button:hover,
body.has-app-rail .page-topbar .control:hover,
body.has-app-rail .page-topbar .segmented button:hover,
body.has-app-rail .page-header .button:hover,
body.has-app-rail .page-header .control:hover,
body.has-app-rail .page-header .segmented button:hover,
body.has-app-rail .research-topbar .button:hover {
  border-color: var(--control-ring);
  background: var(--control-hover);
  color: #fafafa;
}

body.has-app-rail .page-topbar .button.primary,
body.has-app-rail .page-header .button.primary,
body.has-app-rail .research-topbar .button.primary {
  border-color: #b88719;
  background: var(--accent-amber);
  color: #12100a;
}

body.has-app-rail .page-topbar .button.primary:hover,
body.has-app-rail .page-header .button.primary:hover,
body.has-app-rail .research-topbar .button.primary:hover {
  border-color: #f4b942;
  background: #ffd36f;
}

body.has-app-rail .page-topbar .button.accent,
body.has-app-rail .page-header .button.accent,
body.has-app-rail .research-topbar .button.accent,
body.has-app-rail .page-topbar .button.button--accent,
body.has-app-rail .page-header .button.button--accent,
body.has-app-rail .research-topbar .button.button--accent {
  border-color: rgba(244, 185, 66, 0.76);
  background: rgba(244, 185, 66, 0.14);
  color: #ffe08a;
  box-shadow: inset 3px 0 0 var(--accent-amber), 0 0 0 1px rgba(244, 185, 66, 0.08);
}

body.has-app-rail .page-topbar .button:disabled,
body.has-app-rail .page-header .button:disabled,
body.has-app-rail .research-topbar .button:disabled {
  border-color: rgba(113, 113, 122, 0.36);
  background:
    repeating-linear-gradient(135deg, rgba(161, 161, 170, 0.06) 0 6px, transparent 6px 12px),
    rgba(24, 24, 27, 0.34);
  color: #71717a;
}

body.has-app-rail .page-topbar .segmented button {
  min-width: 74px;
}

body.has-app-rail .page-topbar .segmented button.active,
body.has-app-rail .page-header .segmented button.active {
  border-color: var(--control-ring);
  background: var(--control-hover);
  color: #fafafa;
}

.page-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: hidden;
}

.page-workspace-two {
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
}

.page-workspace-one {
  grid-template-columns: minmax(0, 1fr);
}

.page-workspace-three {
  grid-template-columns: minmax(240px, 0.72fr) minmax(520px, 1.28fr) minmax(420px, 1fr);
}

.workspace-splitter {
  align-self: stretch;
  min-width: 8px;
  cursor: col-resize;
  position: relative;
  touch-action: none;
}

.workspace-splitter::after {
  content: "";
  position: absolute;
  inset: 8px 3px;
  border-radius: 999px;
  background: rgba(161, 161, 170, 0.18);
}

.workspace-splitter:hover::after,
.workspace-splitter:focus-visible::after {
  background: var(--control-ring);
}

.page-tabs-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.page-tabs {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #101014;
}

.page-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #a1a1aa;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.page-tabs button:hover,
.page-tabs button.active {
  border-color: var(--control-ring);
  background: var(--control-hover);
  color: #fafafa;
}

.page-tabs button small {
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.72;
}

.page-tab-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
}

.app-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #101014;
  color: #fafafa;
}

.app-panel-head {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--control-border);
  background: #101014;
}

.app-panel-head-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.app-panel-title-block {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.app-panel-title {
  margin: 0;
  overflow: hidden;
  color: #fafafa;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-panel-subtitle,
.app-panel-meta,
.subtle {
  overflow: hidden;
  color: #a1a1aa;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-panel-meta {
  flex: 0 0 auto;
}

.app-panel-body,
.app-panel-section {
  min-width: 0;
  min-height: 0;
  padding: 14px;
}

.app-panel-section {
  border-bottom: 1px solid var(--control-border);
}

.app-panel-scroll,
.app-table-scroll {
  contain: paint;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.app-matrix-surface {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--panel-text);
}

.app-matrix-head {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel-bg);
}

.app-matrix-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.matrix-wrap {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.flat-legend {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--panel-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.flat-legend-item {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.flat-legend-swatch {
  width: 18px;
  height: 9px;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: rgba(161, 161, 170, 0.28);
}

.app-form-grid {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--control-border);
  background: #141418;
}

.app-form-row {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.form-field > span {
  overflow: hidden;
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  padding: 0 10px;
  outline: none;
  background: #09090b;
  color: #fafafa;
  font: inherit;
  font-size: 12px;
}

.form-field textarea {
  min-height: 92px;
  padding: 9px 10px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--control-ring);
}

.table-check {
  width: 100%;
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.table-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.table-check-mark {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--control-border);
  border-radius: 4px;
  background: #09090b;
}

.table-check-mark::after {
  width: 11px;
  height: 7px;
  display: block;
  border-bottom: 2px solid transparent;
  border-left: 2px solid transparent;
  transform: rotate(-45deg) translateY(-1px);
  content: "";
}

.table-check input:checked + .table-check-mark {
  border-color: var(--control-ring);
  background: #0e7490;
}

.table-check input:checked + .table-check-mark::after {
  border-color: #ecfeff;
}

.table-check:focus-within .table-check-mark,
.table-number-input:focus {
  outline: none;
  border-color: var(--control-ring);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.12);
}

.table-number-input {
  width: 76px;
  max-width: 100%;
  height: 28px;
  padding: 0 7px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: #09090b;
  color: #fafafa;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.table-link {
  color: #67e8f9;
  font-weight: 700;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.metric-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--control-border);
  background: #141418;
}

.metric-grid.compact {
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.metric-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: #09090b;
}

.metric-label {
  overflow: hidden;
  color: #a1a1aa;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value {
  overflow: hidden;
  color: #fafafa;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-viz {
  min-width: 0;
  display: grid;
  gap: 4px;
  color: #d4d4d8;
  font-variant-numeric: tabular-nums;
}

.metric-viz-value {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-viz-track {
  position: relative;
  height: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #27272a;
}

.metric-viz-track span {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 2px;
  border-radius: 0;
  background: #71717a;
}

.metric-viz.success .metric-viz-track span {
  background: #22c55e;
}

.metric-viz.warning .metric-viz-track span {
  background: #f4b942;
}

.metric-viz.danger .metric-viz-track span {
  background: #ef4444;
}

.metric-viz.neutral .metric-viz-track span {
  background: #71717a;
}

.metric-card .metric-viz {
  width: 100%;
}

.metric-card .metric-viz-value {
  text-align: left;
}

.section-box {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #141418;
}

.page-shell .data-table table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.page-shell .data-table th,
.page-shell .data-table td {
  overflow: hidden;
  height: 36px;
  padding: 0 10px;
  border-bottom: 1px solid var(--control-border);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-shell .data-table th {
  color: #a1a1aa;
  font-size: 11px;
  font-weight: 700;
  background: #101014;
}

.page-shell .data-table td {
  color: #e4e4e7;
}

.page-shell .data-table-search {
  height: 32px;
  border-color: var(--control-border);
  border-radius: 6px;
  background: #09090b;
  color: #fafafa;
  font-size: 12px;
}

.reload-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--control-bg);
  color: #d4d4d8;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.reload-button:hover {
  border-color: var(--control-ring);
  background: var(--control-hover);
  color: #fafafa;
}

.reload-button:disabled {
  border-color: rgba(113, 113, 122, 0.36);
  background:
    repeating-linear-gradient(135deg, rgba(161, 161, 170, 0.06) 0 6px, transparent 6px 12px),
    rgba(24, 24, 27, 0.34);
  color: #71717a;
  cursor: not-allowed;
  opacity: 1;
}

.reload-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-pill {
  --status-color: #a1a1aa;
  position: relative;
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--control-bg);
  color: #d4d4d8;
  cursor: default;
}

.status-icon {
  position: relative;
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.status-icon::before {
  content: none;
}

.status-icon::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(161, 161, 170, 0.28);
  border-top-color: var(--status-color);
  border-radius: 999px;
  animation: statusSpin 0.8s linear infinite;
}

.status-tip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 140;
  min-width: 78px;
  padding: 7px 9px;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  background: #18181b;
  color: #fafafa;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
  text-align: center;
  white-space: nowrap;
}

.status-pill:hover .status-tip,
.status-pill:focus-visible .status-tip {
  opacity: 1;
  transform: translateY(0);
}

.status-pill.ready {
  --status-color: #22c55e;
  color: #bbf7d0;
}

.status-pill.ready .status-icon::after {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: var(--status-color);
  animation: none;
}

.status-pill.error {
  --status-color: #ef4444;
  color: #fecaca;
}

.status-pill.error .status-icon::after {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--status-color);
  font-size: 13px;
  font-weight: 800;
  animation: none;
}

.portfolio-list-overlay {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  position: relative;
  z-index: 20;
  min-height: 0;
  width: 58px;
  pointer-events: none;
  transition: width 160ms ease;
}

.portfolio-list-overlay:hover,
.portfolio-list-overlay:focus-within {
  width: 282px;
}

.portfolio-list-overlay .portfolio-list-panel {
  position: relative;
  width: 58px;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr);
  pointer-events: auto;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  transition: width 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.portfolio-list-overlay:hover .portfolio-list-panel,
.portfolio-list-overlay:focus-within .portfolio-list-panel {
  width: 282px;
}

.portfolio-list-panel::after {
  content: var(--portfolio-picker-label, "Portfolio Picker");
  position: absolute;
  top: 14px;
  left: 50%;
  display: block;
  width: max-content;
  height: max-content;
  padding: 0;
  color: var(--panel-text, #fafafa);
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: translateX(-50%);
  opacity: 1;
  pointer-events: none;
  transition: opacity 80ms ease;
}

.portfolio-list-overlay:hover .portfolio-list-panel::after,
.portfolio-list-overlay:focus-within .portfolio-list-panel::after {
  opacity: 0;
}

.portfolio-list-panel .app-panel-head {
  justify-content: space-between;
  padding: 0 14px;
}

.portfolio-list-panel .app-panel-head,
.portfolio-list-panel .app-panel-head-actions,
.portfolio-list-panel .portfolio-list-actions,
.portfolio-list-panel .app-panel-scroll {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 80ms ease, visibility 0s linear 80ms;
}

.portfolio-list-overlay:hover .portfolio-list-panel .app-panel-head,
.portfolio-list-overlay:focus-within .portfolio-list-panel .app-panel-head,
.portfolio-list-overlay:hover .portfolio-list-panel .app-panel-head-actions,
.portfolio-list-overlay:focus-within .portfolio-list-panel .app-panel-head-actions,
.portfolio-list-overlay:hover .portfolio-list-panel .portfolio-list-actions,
.portfolio-list-overlay:focus-within .portfolio-list-panel .portfolio-list-actions,
.portfolio-list-overlay:hover .portfolio-list-panel .app-panel-scroll,
.portfolio-list-overlay:focus-within .portfolio-list-panel .app-panel-scroll {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 120ms, 120ms;
}

.portfolio-list-actions {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.portfolio-list-actions .button {
  width: 100%;
}

.picker-search {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--control-border, #27272a);
  border-radius: 6px;
  background: var(--panel-field, #09090b);
  color: var(--panel-text, #e4e4e7);
  font: inherit;
  font-size: 12px;
}

.picker-search:focus {
  outline: 2px solid rgba(244, 185, 66, 0.28);
  outline-offset: 0;
  border-color: rgba(244, 185, 66, 0.68);
}

.ticker-picker,
.ticker-picker-field {
  position: relative;
  min-width: 0;
}

.ticker-picker-field {
  display: grid;
  gap: 6px;
}

.ticker-picker-field > span {
  color: var(--panel-muted);
  font-size: 11px;
  font-weight: 650;
}

.ticker-picker-trigger {
  width: 100%;
  min-width: 0;
  height: 34px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  padding: 4px 9px;
  background: var(--control-bg);
  color: #e4e4e7;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ticker-picker-trigger:hover,
.ticker-picker-trigger[aria-expanded="true"] {
  border-color: var(--accent-amber);
  background: var(--control-hover);
}

.ticker-picker-trigger:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.ticker-picker-trigger-meta {
  min-width: 0;
  overflow: hidden;
  color: #a1a1aa;
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-picker-trigger strong {
  min-width: max-content;
  color: #fafafa;
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.ticker-picker-trigger-caret {
  color: #fafafa;
  font-size: 13px;
  line-height: 1;
}

.ticker-picker-wrap {
  z-index: 950;
}

.ticker-picker-modal {
  width: min(520px, calc(100vw - 32px));
}

.portfolio-list {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.portfolio-list-meta {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.portfolio-list-meta > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--control-border, #27272a);
  border-radius: 6px;
  background: var(--panel-section, #141418);
  color: var(--panel-text, #e4e4e7);
  text-align: left;
  cursor: pointer;
}

.list-item:hover {
  border-color: var(--control-ring, #3f3f46);
  background: var(--control-hover, #18181b);
}

.list-item.active,
.list-item.active:hover {
  border-color: rgba(244, 185, 66, 0.72);
  background: rgba(244, 185, 66, 0.1);
  box-shadow: inset 3px 0 0 var(--accent-amber, #f4b942);
}

.list-item strong,
.list-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item span {
  color: var(--panel-muted, #a1a1aa);
}

.strategy-picker {
  --strategy-picker-width: 312px;
  --strategy-picker-collapsed-width: 64px;
  width: var(--strategy-picker-width);
  min-width: var(--strategy-picker-width);
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  border: 1px solid var(--control-border, var(--line, #27272a));
  border-radius: 8px;
  background: var(--panel-bg, #101014);
  overflow: hidden;
}

.strategy-picker.is-collapsed {
  width: var(--strategy-picker-collapsed-width);
  min-width: var(--strategy-picker-collapsed-width);
  grid-template-rows: auto minmax(0, 1fr);
}

.strategy-picker-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--control-border, var(--line, #27272a));
  background: var(--panel-bg, #101014);
}

.strategy-picker-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.strategy-picker-title h2 {
  margin: 0;
  color: var(--panel-text, #fafafa);
  font-size: 13px;
  font-weight: 760;
}

.strategy-picker-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--control-border, var(--line, #27272a));
  border-radius: 6px;
  background: var(--control-bg, #09090b);
  color: var(--panel-muted, #a1a1aa);
  cursor: pointer;
}

.strategy-picker-actions {
  display: flex;
  gap: 7px;
  padding: 8px;
  border-bottom: 1px solid var(--control-border, var(--line, #27272a));
}

.strategy-picker-actions .button {
  flex: 1;
}

.strategy-picker-filter {
  display: flex;
  gap: 5px;
  padding: 8px;
  border-bottom: 1px solid var(--control-border, var(--line, #27272a));
  overflow-x: auto;
}

.strategy-picker-filter button {
  height: 26px;
  border: 1px solid var(--control-border, var(--line, #27272a));
  border-radius: 6px;
  padding: 0 8px;
  background: var(--control-bg, #09090b);
  color: var(--panel-muted, #a1a1aa);
  font-size: 11px;
  font-weight: 720;
  cursor: pointer;
}

.strategy-picker-filter button.active {
  border-color: rgba(244, 185, 66, 0.42);
  background: rgba(244, 185, 66, 0.1);
  color: var(--panel-text, #fafafa);
}

.strategy-picker-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
}

.strategy-picker-row {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.strategy-picker-row:hover {
  border-color: var(--control-ring, #3f3f46);
  background: var(--control-hover, #18181b);
}

.strategy-picker-row.active {
  border-color: rgba(244, 185, 66, 0.72);
  background: rgba(244, 185, 66, 0.1);
  box-shadow: inset 3px 0 0 var(--accent-amber, #f4b942);
}

.strategy-picker-row.invalid {
  opacity: 0.58;
}

.strategy-picker-empty {
  border: 1px solid var(--control-border, rgba(255, 255, 255, 0.08));
  border-radius: 6px;
  background: var(--control-bg, rgba(255, 255, 255, 0.035));
  color: var(--panel-text-muted, #9ca3af);
  font-size: 12px;
  line-height: 1.3;
  padding: 14px 12px;
  text-align: center;
}

.strategy-picker-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.strategy-picker-name,
.strategy-picker-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-picker-name {
  color: var(--panel-text, #fafafa);
  font-size: 13px;
  font-weight: 760;
}

.strategy-picker-meta,
.strategy-picker-tags {
  color: var(--panel-muted, #a1a1aa);
  font-size: 11px;
}

.strategy-picker-tags {
  display: flex;
  gap: 5px;
  overflow: hidden;
  flex-wrap: nowrap;
}

.badge {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 6px;
  border: 1px solid var(--control-border, var(--line, #27272a));
  border-radius: 4px;
  background: var(--control-bg, #09090b);
  color: #d4d4d8;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-picker-tags .badge {
  max-width: calc(50% - 3px);
}

.strategy-picker-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.strategy-picker-metrics {
  min-width: 58px;
  display: grid;
  gap: 2px;
  text-align: right;
}

.strategy-picker-metrics strong {
  color: var(--panel-text, #fafafa);
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
}

.strategy-picker-metrics small {
  color: var(--panel-muted, #a1a1aa);
  font-size: 10px;
  font-weight: 700;
}

.bt-result-bars {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.bt-result-metric {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: #09090b;
}

.bt-bar-label {
  min-width: 0;
  overflow: hidden;
  color: #a1a1aa;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bt-result-metric .metric-viz-value {
  text-align: left;
  font-size: 11px;
}

.strategy-picker-initial {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line, #243142);
  border-radius: 7px;
  color: #f7fafc;
  font-size: 11px;
  font-weight: 820;
}

.strategy-picker.is-collapsed .strategy-picker-head {
  justify-content: center;
  flex-direction: column;
  padding: 8px;
}

.strategy-picker.is-collapsed .strategy-picker-row {
  min-height: 46px;
  display: flex;
  justify-content: center;
  padding: 5px;
}

.collapse-section {
  min-width: 0;
  display: grid;
  border-bottom: 1px solid var(--soft-line, #1a2432);
  background: transparent;
}

.collapse-section:last-child {
  border-bottom: 0;
}

.collapse-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink, #eef3f8);
  cursor: pointer;
  text-align: left;
}

.collapse-trigger:hover {
  background: rgba(255, 255, 255, 0.035);
}

.collapse-trigger:focus-visible {
  outline: 1px solid var(--control-ring, #3f3f46);
  outline-offset: -1px;
}

.collapse-eyebrow {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--soft-line, #1a2432);
  border-radius: 4px;
  color: var(--muted, #8a98aa);
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.collapse-title {
  min-width: 0;
  overflow: hidden;
  color: #f7fafc;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collapse-badge {
  min-width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--soft-line, #1a2432);
  border-radius: 4px;
  padding: 0 6px;
  color: var(--muted, #8a98aa);
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

.collapse-chevron {
  width: 16px;
  height: 16px;
  position: relative;
  color: var(--muted, #8a98aa);
}

.collapse-chevron::before {
  content: "";
  position: absolute;
  inset: 4px 5px 5px 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.collapse-section.closed .collapse-chevron::before {
  transform: rotate(-45deg);
}

.collapse-body {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.data-table {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.data-table-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.data-table-search {
  width: min(220px, 100%);
  height: 28px;
  margin-left: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: #09090b;
  color: var(--text, #e5edf7);
  padding: 0 9px;
  font-size: 11px;
}

.data-table-count {
  color: var(--muted, #8ea0b5);
  font-size: 12px;
  white-space: nowrap;
}

.data-table-page-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.data-table-page-size,
.data-table-page-button {
  height: 28px;
  border: 1px solid var(--control-border, rgba(148, 163, 184, 0.24));
  border-radius: 6px;
  background: #09090b;
  color: var(--text, #e5edf7);
  font: inherit;
  font-size: 11px;
}

.data-table-page-size {
  max-width: 96px;
}

.data-table-page-button {
  padding: 0 9px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.data-table-page-button:disabled {
  border-color: rgba(113, 113, 122, 0.36);
  background:
    repeating-linear-gradient(135deg, rgba(161, 161, 170, 0.06) 0 6px, transparent 6px 12px),
    rgba(24, 24, 27, 0.34);
  color: #71717a;
  cursor: not-allowed;
  opacity: 1;
}

.data-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.data-table-filter-row th {
  overflow: visible !important;
  position: relative;
  z-index: 80;
  height: 34px;
  padding-top: 4px;
  padding-bottom: 6px;
  background: #101014;
}

.data-table-column-filter {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--control-border, rgba(148, 163, 184, 0.24));
  border-radius: 5px;
  background: #09090b;
  color: var(--text, #e5edf7);
  font-size: 11px;
  font: inherit;
}

.data-table-column-filter:focus {
  outline: none;
  border-color: var(--control-ring, #22d3ee);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.12);
}

.data-table-multiselect {
  position: relative;
  min-width: 0;
}

.data-table-multiselect-button {
  width: 100%;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  overflow: hidden;
  padding: 0 7px;
  border: 1px solid var(--control-border, rgba(148, 163, 184, 0.24));
  border-radius: 5px;
  background: #09090b;
  color: var(--muted, #8ea0b5);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.data-table-multiselect-button::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}

.data-table-multiselect-button.has-value {
  border-color: rgba(244, 185, 66, 0.48);
  color: #f4b942;
}

.data-table-multiselect[data-open="true"] .data-table-multiselect-button {
  border-color: var(--control-ring, #22d3ee);
}

.data-table-multiselect-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 4px);
  left: 0;
  min-width: 190px;
  width: 100%;
  max-height: 260px;
  display: grid;
  gap: 3px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--control-border, rgba(148, 163, 184, 0.24));
  border-radius: 6px;
  background: #0d0d11;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
}

.data-table-filter-clear,
.data-table-multiselect-option {
  min-height: 24px;
  border-radius: 4px;
  color: #d4d4d8;
  font-size: 11px;
}

.data-table-filter-clear {
  border: 1px solid var(--control-border, rgba(148, 163, 184, 0.24));
  background: transparent;
  cursor: pointer;
}

.data-table-filter-clear:disabled {
  cursor: default;
  opacity: 0.45;
}

.data-table-multiselect-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 3px 5px;
  cursor: pointer;
}

.data-table-multiselect-option:hover {
  background: rgba(244, 244, 245, 0.06);
}

.data-table-multiselect-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selectable-table tr.selected td {
  color: #fafafa;
  background: rgba(244, 185, 66, 0.08);
  border-top-color: rgba(244, 185, 66, 0.45);
  border-bottom-color: rgba(244, 185, 66, 0.45);
}

.selectable-table tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--amber, #f4b942);
}

.node-ref-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.42fr);
  gap: 8px;
}

.node-ref-input,
.node-ref-select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line, var(--control-border));
  border-radius: 4px;
  padding: 7px 9px;
  outline: none;
  background: var(--surface, var(--control-bg));
  color: var(--ink, #e4e4e7);
  font: inherit;
  font-size: 13px;
}

.node-ref-input:focus,
.node-ref-select:focus {
  border-color: var(--amber, var(--accent-amber));
}

.node-ref-select {
  cursor: pointer;
}

.node-ref-input:disabled,
.node-ref-select:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* Shared command picker surface, used by Builder node/block picking and ticker picking. */
.block-picker-wrap {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
  background: rgba(0, 0, 0, 0.52);
}

.block-picker {
  width: 420px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: var(--panel-section, #141418);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.bp-search-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: #0f1924;
}

.bp-search-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 15px;
}

.bp-search {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 13px 0;
  outline: none;
  background: none;
  color: #f7fafc;
  font: inherit;
  font-size: 13.5px;
}

.bp-search::placeholder {
  color: rgba(248, 250, 252, 0.28);
}

.bp-match-count {
  flex-shrink: 0;
  border-radius: 10px;
  padding: 2px 7px;
  background: rgba(109, 195, 255, 0.12);
  color: #8dc3ff;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.bp-close {
  flex-shrink: 0;
  border: 0;
  border-radius: 4px;
  padding: 4px 6px;
  background: none;
  color: rgba(248, 250, 252, 0.35);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.bp-close:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(248, 250, 252, 0.7);
}

.bp-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 8px;
}

.bp-body::-webkit-scrollbar {
  width: 4px;
}

.bp-body::-webkit-scrollbar-track {
  background: transparent;
}

.bp-body::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.bp-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 6px 14px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bp-group-head:hover {
  background: rgba(255, 255, 255, 0.035);
}

.bp-group-arrow {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.25);
  font-size: 9px;
  transition: transform 0.12s;
}

.bp-group--open .bp-group-arrow {
  transform: rotate(90deg);
}

.bp-group-label {
  flex: 1;
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.bp-group-count {
  color: rgba(255, 255, 255, 0.22);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.bp-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  padding: 6px 14px 6px 26px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bp-item:hover,
.bp-item.is-focused {
  background: rgba(255, 255, 255, 0.07);
}

.ticker-picker-item.is-active {
  background: rgba(244, 185, 66, 0.12);
  box-shadow: inset 3px 0 0 var(--accent-amber);
}

.ticker-picker-item.is-active:hover,
.ticker-picker-item.is-active.is-focused {
  background: rgba(244, 185, 66, 0.18);
}

.bp-item-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  opacity: 0.85;
}

.bp-item-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.bp-item-name,
.bp-item-ref,
.bp-item-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-item-name {
  color: rgba(240, 244, 248, 0.92);
  font-size: 12.5px;
  font-weight: 560;
}

.bp-item-ref {
  color: rgba(255, 255, 255, 0.3);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.bp-item-desc {
  color: rgba(255, 255, 255, 0.38);
  font-size: 10px;
}

.bp-item-ports {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bp-port-badge {
  max-width: 92px;
  overflow: hidden;
  border-radius: 4px;
  padding: 1px 5px;
  background: rgba(89, 209, 140, 0.1);
  color: rgba(89, 209, 140, 0.78);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-empty {
  padding: 28px 14px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  text-align: center;
}

.bp-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 7px 14px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 10px;
}

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

@media (max-width: 900px) {
  html {
    overflow: auto;
  }

  body.has-app-rail #root {
    height: auto;
    overflow: visible;
  }

  body.has-app-rail .page-shell,
  body.has-app-rail .research-shell,
  body.has-app-rail .admin-shell {
    margin-left: 0;
    padding-top: 0;
  }

  body.has-app-rail .page-topbar,
  body.has-app-rail .research-topbar,
  body.has-app-rail .admin-topbar {
    height: auto;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
  }

  .page-layer {
    height: auto;
    min-height: calc(100vh - 64px);
    overflow: visible;
  }

  .page-header {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .app-topnav {
    justify-content: space-between;
  }

  .topnav-links {
    overflow-x: auto;
  }

  .topnav-link {
    flex: 0 0 auto;
  }

  .page-header-meta,
  .page-actions {
    justify-content: flex-start;
  }

  .page-workspace,
  .page-workspace-two,
  .page-workspace-three {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .workspace-splitter {
    display: none;
  }

  .app-panel {
    overflow: visible;
  }

  .app-form-row,
  .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-copy {
    display: none;
  }
}
