:root {
  --ai-bg: #070b12;
  --ai-bg-2: #0b111b;
  --ai-rail: #0d141f;
  --ai-panel: #171e2b;
  --ai-panel-2: #202838;
  --ai-panel-3: #283244;
  --ai-line: #30394b;
  --ai-line-strong: #46536b;
  --ai-text: #eef3ff;
  --ai-text-soft: #c7cfdd;
  --ai-muted: #8c97aa;
  --ai-muted-2: #697589;
  --ai-accent: #9a83ff;
  --ai-accent-2: #2f80ff;
  --ai-accent-soft: rgba(154, 131, 255, 0.18);
  --ai-blue-soft: rgba(47, 128, 255, 0.17);
  --ai-green: #43d18d;
  --ai-green-soft: rgba(67, 209, 141, 0.14);
  --ai-amber: #ffb454;
  --ai-amber-soft: rgba(255, 180, 84, 0.15);
  --ai-red: #ff6b7a;
  --ai-red-soft: rgba(255, 107, 122, 0.13);
  --ai-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --ai-radius: 7px;
  --ai-radius-sm: 4px;
  --ai-sidebar-width: 76px;
  --ai-topbar-height: 56px;
  --ai-font: Inter, "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ai-text);
  background: var(--ai-bg);
  font-family: var(--ai-font);
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--ai-shell-overlay);
}

a {
  color: inherit;
  text-decoration: none;
}

p,
figure {
  margin: 0;
}

code {
  color: var(--ai-code-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

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

.ai-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--ai-sidebar-width) minmax(0, 1fr);
  background: var(--ai-bg);
  max-width: 100vw;
}

.ai-shell--public {
  display: block;
}

.ai-stage {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  max-width: 100%;
}

.ai-main {
  min-width: 0;
  max-width: 100%;
  padding: 18px 24px 28px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.ai-shell--public .ai-main {
  min-height: calc(100vh - var(--ai-topbar-height));
  align-content: center;
  align-items: center;
}

.ai-stage--no-topbar .ai-main {
  min-height: 100vh;
}

.ai-sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 100vh;
  display: grid;
  grid-template-rows: 76px 1fr auto;
  background: var(--ai-sidebar-bg);
  border-right: 1px solid var(--ai-sidebar-border);
  box-shadow: var(--ai-sidebar-shadow);
}

.ai-sidebar__brand,
.ai-sidebar__footer {
  display: grid;
  place-items: center;
}

.ai-sidebar__mark,
.ai-sidebar__avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ai-brand-border);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-brand-text);
  background: var(--ai-brand-bg);
  font-weight: 800;
  font-size: 12px;
}

.ai-sidebar__logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid var(--ai-logo-border, var(--ai-brand-border));
  border-radius: var(--ai-radius-sm);
  background: var(--ai-logo-bg, var(--ai-brand-bg));
  box-shadow: var(--ai-brand-shadow);
}

.ai-sidebar__nav {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-line-strong) transparent;
}

.ai-sidebar__link,
.ai-sidebar__empty {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--ai-radius-sm);
  color: var(--ai-muted);
  background: transparent;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

button.ai-sidebar__link {
  appearance: none;
  cursor: pointer;
}

.ai-sidebar__link:hover,
.ai-sidebar__link[aria-current="page"] {
  color: var(--ai-text);
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
}

.ai-sidebar__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 3px;
  height: 28px;
  border-radius: 0 2px 2px 0;
  background: var(--ai-accent);
}

.ai-sidebar__icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: var(--ai-nav-icon, var(--ai-muted));
  background: color-mix(in srgb, var(--ai-nav-icon, #8d99ae) 18%, transparent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-sidebar__link:hover .ai-sidebar__icon,
.ai-sidebar__link[aria-current="page"] .ai-sidebar__icon {
  color: var(--ai-nav-icon, var(--ai-text));
  background: color-mix(in srgb, var(--ai-nav-icon, #8d99ae) 28%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ai-nav-icon, #8d99ae) 34%, transparent);
}

.ai-sidebar__icon svg,
.ai-sidebar-submenu__icon svg,
.ai-notification__icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-sidebar__footer {
  position: relative;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--ai-sidebar-footer-border);
}

.ai-sidebar__avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--ai-info-border);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-info);
  background: var(--ai-info-soft);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
}

.ai-sidebar__avatar:hover,
.ai-sidebar__avatar[aria-expanded="true"] {
  color: var(--ai-text);
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
}

.ai-sidebar__popover-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.ai-sidebar-popover {
  position: absolute;
  left: 64px;
  bottom: 0;
  z-index: 30;
  min-width: 220px;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  color: var(--ai-text);
  background: var(--ai-popover-bg);
  box-shadow: var(--ai-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.ai-sidebar-popover.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.ai-sidebar-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  max-width: min(260px, calc(100vw - 120px));
  transform: translate(0, -50%);
  opacity: 0;
  pointer-events: none;
  padding: 7px 9px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text);
  background: var(--ai-popover-bg);
  box-shadow: var(--ai-shadow);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: opacity 0.12s ease;
}

.ai-sidebar-tooltip::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 8px;
  height: 8px;
  transform: translateY(-50%) rotate(45deg);
  border-left: 1px solid var(--ai-line);
  border-bottom: 1px solid var(--ai-line);
  background: var(--ai-popover-bg);
}

.ai-sidebar-tooltip.is-visible {
  opacity: 1;
}

.ai-sidebar-submenu {
  position: fixed;
  z-index: 90;
  width: 292px;
  padding: 12px;
  overflow: visible;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  color: var(--ai-text-soft);
  background: var(--ai-popover-bg);
  box-shadow: var(--ai-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.ai-sidebar-submenu.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.ai-sidebar-submenu::before {
  content: "";
  position: absolute;
  top: var(--submenu-arrow-top, 28px);
  left: -6px;
  width: 10px;
  height: 10px;
  border-left: 1px solid var(--ai-line);
  border-bottom: 1px solid var(--ai-line);
  background: var(--ai-popover-bg);
  transform: rotate(45deg);
}

.ai-sidebar-submenu__items::-webkit-scrollbar {
  width: 8px;
}

.ai-sidebar-submenu__items::-webkit-scrollbar-track {
  background: var(--ai-scrollbar-track);
}

.ai-sidebar-submenu__items::-webkit-scrollbar-thumb {
  background: var(--ai-line-strong);
  border-radius: 999px;
}

.ai-sidebar-submenu__header {
  display: grid;
  gap: 3px;
  padding: 3px 4px 11px;
  border-bottom: 1px solid var(--ai-border);
}

.ai-sidebar-submenu__header span {
  color: var(--ai-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-sidebar-submenu__header strong {
  color: var(--ai-text);
  font-size: 15px;
}

.ai-sidebar-submenu__items {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  padding-top: 10px;
  max-height: var(--submenu-items-max-height, none);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-line-strong) transparent;
}

.ai-sidebar-submenu__item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ai-sidebar-submenu__item:hover,
.ai-sidebar-submenu__item:focus-visible,
.ai-sidebar-submenu__item.is-active {
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
  outline: none;
}

.ai-sidebar-submenu__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--ai-nav-icon, #8d99ae) 34%, transparent);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-nav-icon, var(--ai-accent-on-soft));
  background: color-mix(in srgb, var(--ai-nav-icon, #8d99ae) 16%, transparent);
}

.ai-sidebar-submenu__icon svg {
  width: 18px;
  height: 18px;
}

.ai-sidebar-submenu__copy {
  min-width: 0;
}

/* Reserve the same two-line slots even when a label or description is short. */
.ai-sidebar-submenu__item strong,
.ai-sidebar-submenu__item small {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.ai-sidebar-submenu__item strong {
  color: var(--ai-text);
  font-size: 13px;
  line-height: 1.35;
  height: 2.7em;
}

.ai-sidebar-submenu__item small {
  margin-top: 2px;
  color: var(--ai-muted);
  font-size: 11px;
  line-height: 1.3;
  height: 2.6em;
}

.ai-sidebar-popover strong,
.ai-sidebar-popover span,
.ai-sidebar-popover a {
  display: block;
}

.ai-sidebar-popover strong {
  color: var(--ai-text);
  font-size: 13px;
}

.ai-sidebar-popover span {
  margin-top: 3px;
  color: var(--ai-muted);
  font-size: 12px;
}

.ai-theme-switcher {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ai-line);
}

.ai-theme-switcher__label {
  margin: 0;
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-theme-switcher__options {
  display: grid;
  gap: 7px;
}

.ai-theme-switcher__option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: var(--ai-control-bg);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.ai-theme-switcher__option:hover,
.ai-theme-switcher__option:focus-visible,
.ai-theme-switcher__option[aria-pressed="true"] {
  color: var(--ai-text);
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
  outline: none;
}

.ai-theme-switcher__swatch {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ai-line-strong);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ai-bg) 0 48%, var(--ai-surface-2) 48% 100%);
  box-shadow: 0 0 0 2px var(--ai-popover-bg);
}

.ai-theme-switcher__swatch--dark {
  background: linear-gradient(135deg, #070b12 0 48%, #9a83ff 48% 100%);
}

.ai-theme-switcher__swatch--light {
  background: linear-gradient(135deg, #ffffff 0 48%, #2563eb 48% 100%);
}

.ai-sidebar-popover a {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: var(--ai-control-bg);
  font-weight: 800;
  text-align: center;
}

.ai-sidebar-popover a:hover {
  color: var(--ai-text);
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
}

.ai-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: var(--ai-topbar-height);
  display: grid;
  grid-template-columns: minmax(240px, max-content) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 8px 24px;
  background: var(--ai-topbar-bg);
  border-bottom: 1px solid var(--ai-topbar-border);
  backdrop-filter: blur(16px);
  max-width: 100%;
}

.ai-topbar--public {
  grid-template-columns: minmax(0, 1fr);
}

.ai-topbar__title {
  min-width: 0;
}

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

.ai-topbar__action svg,
.ai-icon-button svg,
.ai-drawer__header h2 svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-topbar__eyebrow,
.eyebrow {
  margin: 0 0 4px;
  color: var(--ai-accent);
  font-size: 10px;
  line-height: 1.1;
  font-weight: 800;
  text-transform: uppercase;
}

.ai-topbar__title h1 {
  margin: 0;
  color: var(--ai-text);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 760;
}

.ai-topbar__title span,
.tagline {
  display: block;
  margin-top: 3px;
  color: var(--ai-muted);
  font-size: 12px;
}

.table-shell::-webkit-scrollbar,
.ai-sidebar__nav::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-shell::-webkit-scrollbar-track,
.ai-sidebar__nav::-webkit-scrollbar-track {
  background: var(--ai-scrollbar-track);
}

.table-shell::-webkit-scrollbar-thumb,
.ai-sidebar__nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--ai-line-strong);
}

.ai-notification {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: var(--ai-control-bg);
  cursor: pointer;
}

.ai-notification:hover {
  color: var(--ai-text);
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
}

.ai-notification__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--ai-accent-on-soft);
  background: var(--ai-accent-soft);
  font-size: 11px;
  font-weight: 900;
}

.ai-sidebar__notification {
  width: 34px;
  height: 34px;
}

.ai-notification[aria-expanded="true"] {
  color: var(--ai-text);
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
}

.ai-notification__dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--ai-surface);
  border-radius: 50%;
  background: var(--ai-amber);
}

.ai-sidebar-submenu--breadcrumb::before {
  display: none;
}

.breadcrumbs ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--ai-muted);
  font-size: 12px;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--ai-muted-2);
}

.breadcrumbs a,
.breadcrumbs__menu {
  color: var(--ai-muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.breadcrumbs__menu {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.breadcrumbs li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.breadcrumbs a:hover,
.breadcrumbs__menu:hover {
  color: var(--ai-text-soft);
}

.breadcrumbs a:focus-visible,
.breadcrumbs__menu:focus-visible {
  outline: 2px solid var(--ai-accent);
  outline-offset: 3px;
}

.breadcrumbs li:last-child {
  color: var(--ai-text-soft);
  font-weight: 700;
}

.page-grid,
.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 16px;
}

.page-grid--stacked {
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr);
}

.panel-card,
.hero-card,
.login-panel,
.error-card {
  min-width: 0;
  background: var(--ai-panel-bg);
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-panel-inset-shadow), var(--ai-shadow);
}

.panel-card,
.hero-card {
  padding: 18px;
}

.hero-card {
  background: var(--ai-hero-bg);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-heading h2,
.section-heading h3,
.panel-card h3,
.hero-card h2,
.login-header h3,
.error-card h1 {
  margin: 0;
  color: var(--ai-text);
  font-weight: 760;
  line-height: 1.2;
}

.section-heading h2 {
  font-size: 22px;
}

.hero-card h2 {
  font-size: 30px;
}

.section-heading h3,
.panel-card h3,
.login-header h3 {
  font-size: 18px;
}

.section-heading p:not(.eyebrow),
.panel-card > p,
.hero-card p,
.login-panel p,
.login-header p,
.feature-list li {
  color: var(--ai-muted);
}

.ai-kpi-strip,
.workflow-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: var(--ai-strip-bg);
}

.ai-kpi-card,
.workflow-strip > div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--ai-line);
}

.ai-kpi-card__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ai-accent-border);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-kpi-icon-text);
  background: var(--ai-accent-soft);
  font-size: 11px;
  font-weight: 800;
}

.ai-kpi-card strong,
.ai-kpi-card span {
  display: block;
}

.ai-kpi-card strong {
  color: var(--ai-text);
  font-size: 26px;
  line-height: 1;
}

.ai-kpi-card span {
  margin-top: 5px;
  color: var(--ai-muted);
  font-weight: 700;
}

.dashboard-shell {
  width: min(100%, 1680px);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.model-report-shell {
  width: min(100%, 1680px);
  margin: 0 auto;
}

.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--ai-dashboard-hero-border);
  border-radius: var(--ai-radius);
  background: var(--ai-dashboard-hero-bg);
  box-shadow: var(--ai-shadow);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: auto -90px -120px auto;
  width: 260px;
  height: 260px;
  border: 1px solid var(--ai-dashboard-hero-orbit-border);
  border-radius: 50%;
  background: var(--ai-dashboard-hero-orbit-bg);
}

.dashboard-hero h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 780px;
  color: var(--ai-text);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.dashboard-hero__intro {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.dashboard-hero__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--ai-dashboard-primary-icon-border);
  border-radius: 17px;
  color: var(--ai-dashboard-primary-icon-text);
  background: var(--ai-dashboard-primary-icon-bg);
  box-shadow: var(--ai-dashboard-primary-icon-shadow);
}

.dashboard-hero__icon svg {
  display: block;
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-hero p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  max-width: 680px;
  color: var(--ai-muted);
}

.dashboard-hero__badge {
  position: relative;
  z-index: 1;
  min-width: 210px;
  padding: 18px 72px 18px 18px;
  border: 1px solid var(--ai-dashboard-soft-card-border);
  border-radius: var(--ai-radius);
  background: var(--ai-dashboard-soft-card-bg);
}

.dashboard-hero__badge-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ai-dashboard-info-icon-border);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-dashboard-info-icon-text);
  background: var(--ai-dashboard-info-icon-bg);
  box-shadow: var(--ai-dashboard-info-icon-shadow);
}

.dashboard-hero__badge-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-hero__badge span,
.dashboard-hero__badge small {
  display: block;
  color: var(--ai-muted);
  font-weight: 800;
}

.dashboard-hero__badge strong {
  display: block;
  margin: 4px 0;
  color: var(--ai-text);
  font-size: 30px;
  line-height: 1;
}

.dashboard-hero__badge .dashboard-hero__badge-icon {
  display: grid;
  place-items: center;
}

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

.dashboard-kpi-grid--platform {
  padding: 10px;
  border: 1px solid var(--ai-dashboard-kpi-platform-border);
  border-radius: var(--ai-radius);
  background: var(--ai-dashboard-kpi-platform-bg);
}

.dashboard-kpi-grid--usage {
  padding: 10px;
  border: 1px solid var(--ai-dashboard-kpi-usage-border);
  border-radius: var(--ai-radius);
  background: var(--ai-dashboard-kpi-usage-bg);
}

.dashboard-kpi-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: var(--ai-dashboard-kpi-card-bg);
  box-shadow: var(--ai-dashboard-kpi-card-inset-shadow);
}

.dashboard-kpi-card--platform {
  border-color: var(--ai-dashboard-kpi-card-platform-border);
  background: var(--ai-dashboard-kpi-card-platform-bg);
}

.dashboard-kpi-card--usage {
  border-color: var(--ai-dashboard-kpi-card-usage-border);
  background: var(--ai-dashboard-kpi-card-usage-bg);
}

.dashboard-kpi-card__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--ai-dashboard-info-icon-border);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-dashboard-info-icon-text);
  background: var(--ai-dashboard-info-icon-bg);
}

.dashboard-kpi-card__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-kpi-card strong,
.dashboard-kpi-card span,
.dashboard-kpi-card small {
  display: block;
}

.dashboard-kpi-card .dashboard-kpi-card__icon {
  display: grid;
  place-items: center;
  margin-top: 0;
}

.dashboard-kpi-card .dashboard-kpi-card__icon svg {
  display: block;
}

.dashboard-kpi-card strong {
  color: var(--ai-text);
  font-size: 25px;
  line-height: 1;
}

.dashboard-kpi-card span {
  margin-top: 4px;
  color: var(--ai-text-soft);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-kpi-card small {
  margin-top: 2px;
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(380px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-shell > .panel-card {
  padding: 16px;
}

.workspace-object-filter.model-report-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: flex-end;
  gap: 10px 12px;
}

.model-report-filter__field {
  min-width: 0;
}

.workspace-object-filter.model-report-filter .field {
  gap: 4px;
}

.workspace-object-filter.model-report-filter .field span {
  margin-bottom: 4px;
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.workspace-object-filter.model-report-filter .field input,
.workspace-object-filter.model-report-filter .field select {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
  line-height: 1.2;
}

.model-report-filter__actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  grid-column: -2 / -1;
  justify-self: end;
  margin-left: 0;
}

.model-report-filter .button-primary,
.model-report-filter .button-ghost {
  min-height: 32px;
  padding-inline: 12px;
}

.model-report-filter .button-ghost {
  min-width: 64px;
}

.dashboard-chart-card--wide,
.dashboard-agent-card {
  grid-column: span 1;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: 999px;
  color: #a7fff2;
  background: rgba(94, 234, 212, 0.09);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-token-chart {
  position: relative;
  min-height: 310px;
  padding: 14px 12px 8px;
  border: 1px solid rgba(48, 57, 75, 0.68);
  border-radius: var(--ai-radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 100% 25%,
    rgba(10, 15, 24, 0.34);
}

.dashboard-token-chart canvas {
  width: 100% !important;
  height: 286px !important;
}

.dashboard-model-list,
.dashboard-horizontal-chart {
  display: grid;
  gap: 12px;
}

.dashboard-model-token-chart {
  position: relative;
  min-height: 270px;
  padding: 12px 10px 8px;
  border: 1px solid rgba(48, 57, 75, 0.68);
  border-radius: var(--ai-radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 33%,
    rgba(10, 15, 24, 0.34);
}

.dashboard-model-token-chart canvas {
  width: 100% !important;
  height: 245px !important;
}

.dashboard-kpi-card--usage .dashboard-kpi-card__icon {
  border-color: rgba(154, 131, 255, 0.32);
  color: #d8d0ff;
  background: rgba(154, 131, 255, 0.13);
}

.dashboard-breakdown-chart {
  position: relative;
  min-height: 250px;
  padding: 12px 10px 8px;
  border: 1px solid rgba(48, 57, 75, 0.68);
  border-radius: var(--ai-radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 100% 33%,
    rgba(10, 15, 24, 0.34);
}

.dashboard-breakdown-chart canvas {
  width: 100% !important;
  height: 225px !important;
}

.dashboard-model-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(48, 57, 75, 0.75);
  border-radius: var(--ai-radius-sm);
  background: rgba(10, 15, 24, 0.38);
}

.dashboard-model-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--ai-dashboard-model-logo-border);
  border-radius: 50%;
  color: var(--ai-dashboard-model-logo-text);
  background: var(--model-accent);
  font-size: 18px;
  font-weight: 900;
}

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

.dashboard-model-row strong {
  color: var(--ai-text);
}

.dashboard-model-row small {
  margin-top: 3px;
  color: var(--ai-muted);
  font-weight: 700;
}

.dashboard-location-pill {
  padding: 6px 8px;
  border: 1px solid var(--ai-dashboard-location-pill-border);
  border-radius: 999px;
  color: var(--ai-dashboard-location-pill-text);
  background: var(--ai-dashboard-location-pill-bg);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-horizontal-chart__row {
  display: grid;
  gap: 8px;
}

.dashboard-horizontal-chart__row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ai-text-soft);
  font-weight: 800;
}

.dashboard-horizontal-chart__row span {
  color: var(--ai-muted);
}

.dashboard-horizontal-chart__track,
.dashboard-table-meter {
  display: block;
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: var(--ai-dashboard-meter-bg);
}

.dashboard-horizontal-chart__track > span,
.dashboard-table-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--model-accent, #5eead4), var(--ai-dashboard-meter-end));
}

.dashboard-agent-table .data-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.dashboard-agent-table th,
.dashboard-agent-table td {
  overflow-wrap: anywhere;
}

.dashboard-agent-table th:first-child,
.dashboard-agent-table td:first-child {
  width: 28%;
}

.dashboard-agent-table td strong {
  color: var(--ai-text);
  font-size: 15px;
  line-height: 1.2;
}

.dashboard-model-name-cell {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.dashboard-model-name-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--ai-dashboard-model-name-icon-border);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-dashboard-model-name-icon-text);
  background: var(--ai-dashboard-model-name-icon-bg);
}

.dashboard-model-name-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-table-meter {
  min-width: 120px;
}

.dashboard-workspace-usage {
  display: grid;
  gap: 18px;
}

.dashboard-workspace-usage__heading {
  align-items: flex-start;
}

.dashboard-workspace-usage__heading .muted-copy {
  margin: 6px 0 0;
  max-width: 720px;
  font-size: 13px;
}

.dashboard-workspace-usage__heading button svg,
.dashboard-workspace-usage-toolbar button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-workspace-usage__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-workspace-usage__empty {
  padding: 22px;
  border: 1px dashed var(--ai-border);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-muted);
  text-align: center;
}

.ai-modal .dashboard-workspace-usage-modal__panel {
  width: min(1120px, calc(100vw - 24px));
  max-height: min(920px, calc(100vh - 24px));
}

.dashboard-workspace-usage-modal__header {
  align-items: flex-start;
}

.dashboard-workspace-usage-modal__header .muted-copy {
  margin: 5px 0 0;
  font-size: 12px;
}

.dashboard-workspace-usage-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-workspace-usage-modal__actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-workspace-usage-modal .dashboard-workspace-usage-card-grid {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-workspace-usage-modal__body {
  align-content: start;
  min-height: min(620px, calc(100vh - 150px));
  overflow: auto;
}

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

.dashboard-workspace-usage-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-workspace-usage-tabs .is-active {
  border-color: var(--ai-accent-border);
  color: var(--ai-accent-on-soft);
  background: var(--ai-accent-soft);
}

.dashboard-workspace-usage-status {
  margin: 0;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-workspace-usage-table-panel {
  min-width: 0;
  min-height: 0;
}

.dashboard-workspace-usage-table-panel[hidden] {
  display: none;
}

.dashboard-workspace-usage-table-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--ai-border);
  border-radius: 10px;
  background: var(--ai-surface-2);
}

.dashboard-workspace-usage-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.dashboard-workspace-usage-table th,
.dashboard-workspace-usage-table td {
  padding: 10px;
  border-bottom: 1px solid var(--ai-border);
  color: var(--ai-text-soft);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.dashboard-workspace-usage-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 0;
  color: var(--ai-muted);
  background: var(--ai-surface-3);
}

.dashboard-workspace-usage-table th button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.dashboard-workspace-usage-table th button:hover,
.dashboard-workspace-usage-table th button:focus-visible {
  color: var(--ai-text);
  background: var(--ai-control-hover-bg);
  outline: none;
}

.dashboard-workspace-usage-table th:first-child,
.dashboard-workspace-usage-table td:first-child {
  position: sticky;
  z-index: 1;
  left: 0;
  min-width: 190px;
  text-align: left;
  background: var(--ai-surface-2);
}

.dashboard-workspace-usage-table th:first-child {
  z-index: 3;
  background: var(--ai-surface-3);
}

.dashboard-workspace-usage-table th:first-child button {
  justify-content: flex-start;
}

.dashboard-workspace-usage-table tbody tr:last-child td {
  border-bottom: 0;
}

.dashboard-workspace-usage-table tbody tr:hover td {
  background: var(--ai-table-row-hover-bg);
}

.dashboard-workspace-usage-table tbody tr:hover td:first-child {
  background: var(--ai-surface-3);
}

.dashboard-workspace-usage-table td a {
  color: var(--ai-text);
  text-decoration: none;
}

.dashboard-workspace-usage-table td a:hover {
  color: var(--ai-accent);
}

.dashboard-workspace-usage-table [data-sort-indicator] {
  min-width: 10px;
  color: var(--ai-info);
}

.dashboard-workspace-usage-row-status {
  display: block;
  max-width: 190px;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ai-muted);
  font-size: 10px;
  text-overflow: ellipsis;
}

.dashboard-workspace-usage-row-status.is-loading {
  color: var(--ai-info);
}

.dashboard-workspace-usage-row-status.is-error {
  color: var(--ai-danger);
}

.dashboard-workspace-usage-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.dashboard-workspace-usage-icon-action,
.dashboard-workspace-usage-row-actions .ai-icon-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
}

.dashboard-workspace-usage-icon-action svg,
.dashboard-workspace-usage-row-actions .ai-icon-button svg {
  width: 15px;
  height: 15px;
}

.dashboard-workspace-usage-icon-action.is-loading svg,
.dashboard-workspace-usage-row-actions [data-refresh-workspace]:disabled svg {
  animation: dashboard-workspace-refresh-spin 800ms linear infinite;
}

@keyframes dashboard-workspace-refresh-spin {
  to { transform: rotate(360deg); }
}

.dashboard-workspace-usage-table__empty {
  padding: 34px !important;
  color: var(--ai-muted) !important;
  text-align: center !important;
}

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

.dashboard-workspace-usage-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-surface-2);
  transition: border-color 160ms ease;
}

.dashboard-workspace-usage-card.is-loading {
  border-color: var(--ai-info-border);
}

.dashboard-workspace-usage-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-workspace-usage-card__header > div {
  min-width: 0;
}

.dashboard-workspace-usage-card__header a {
  color: var(--ai-text);
  font-size: 16px;
  font-weight: 850;
  text-decoration: none;
}

.dashboard-workspace-usage-card__header a:hover {
  color: var(--ai-accent);
}

.dashboard-workspace-usage-card__header p {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--ai-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-workspace-usage-card__body {
  min-width: 0;
  margin-top: 12px;
}

.dashboard-workspace-usage-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-workspace-usage-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--ai-border);
  border-radius: 10px;
  background: var(--ai-surface);
}

.dashboard-workspace-usage-metric span {
  overflow: hidden;
  color: var(--ai-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-workspace-usage-metric strong {
  color: var(--ai-text);
  font-size: 16px;
}

.dashboard-workspace-usage-card__models {
  margin-top: 14px;
}

.dashboard-workspace-usage-card__description {
  margin: 0 0 12px;
  color: var(--ai-text-soft);
  font-size: 12px;
  line-height: 1.55;
}

.dashboard-workspace-usage-card__models h4 {
  margin: 0 0 8px;
  color: var(--ai-text-soft);
  font-size: 12px;
}

.dashboard-workspace-usage-card__model-table {
  overflow-x: auto;
  border: 1px solid var(--ai-border);
  border-radius: 10px;
}

.dashboard-workspace-usage-card__model-table table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 10px;
}

.dashboard-workspace-usage-card__model-table th,
.dashboard-workspace-usage-card__model-table td {
  padding: 8px;
  border-bottom: 1px solid var(--ai-border);
  color: var(--ai-text-soft);
  text-align: right;
  white-space: nowrap;
}

.dashboard-workspace-usage-card__model-table th {
  color: var(--ai-muted);
  font-size: 9px;
  text-transform: uppercase;
}

.dashboard-workspace-usage-card__model-table th:first-child,
.dashboard-workspace-usage-card__model-table td:first-child {
  text-align: left;
}

.dashboard-workspace-usage-card__model-table tbody tr:last-child td {
  border-bottom: 0;
}

.dashboard-workspace-usage-card__loading {
  display: grid;
  gap: 8px;
}

.dashboard-workspace-usage-card__loading span {
  display: block;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--ai-surface) 25%, var(--ai-info-soft) 50%, var(--ai-surface) 75%);
  background-size: 200% 100%;
  animation: dashboard-workspace-usage-loading 1.2s linear infinite;
}

.dashboard-workspace-usage-card__empty-models,
.dashboard-workspace-usage-card__error {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  color: var(--ai-muted);
  background: var(--ai-surface);
  font-size: 12px;
}

.dashboard-workspace-usage-card__error {
  color: var(--ai-danger);
}

@keyframes dashboard-workspace-usage-loading {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (max-width: 1180px) {
  .dashboard-workspace-usage-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  .dashboard-workspace-usage-modal__body {
    min-height: calc(100vh - 130px);
    padding: 12px;
  }

  .dashboard-workspace-usage-toolbar,
  .dashboard-workspace-usage__heading,
  .dashboard-workspace-usage__actions,
  .dashboard-workspace-usage-modal__header,
  .dashboard-workspace-usage-modal__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-workspace-usage-tabs {
    overflow-x: auto;
  }

  .dashboard-workspace-usage-tabs button {
    flex: 1 0 auto;
  }

  .dashboard-workspace-usage__actions .button-ghost {
    justify-content: center;
  }

  .dashboard-workspace-usage-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-workspace-usage-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Dashboard pilot: restrained surfaces and a denser analytical hierarchy. */
.dashboard-shell--modern {
  width: min(100%, 1740px);
  gap: 14px;
}

.dashboard-shell--modern .dashboard-hero {
  grid-template-columns: minmax(0, 1fr) 82px auto;
  min-height: 112px;
  padding: 18px 20px;
  border-color: var(--ai-border);
  border-radius: 12px;
  background: var(--ai-surface-2);
  box-shadow: none;
}

.dashboard-shell--modern .dashboard-hero__token-robot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid var(--ai-info-border);
  border-radius: 18px;
  color: var(--ai-info);
  background: var(--ai-info-soft);
}

.dashboard-shell--modern .dashboard-hero__token-robot svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-shell--modern .dashboard-hero::after {
  display: none;
}

.dashboard-shell--modern .dashboard-hero__intro {
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.dashboard-shell--modern .dashboard-hero__icon {
  width: 42px;
  height: 42px;
  border-color: var(--ai-info-border);
  border-radius: 10px;
  color: var(--ai-info);
  background: var(--ai-info-soft);
  box-shadow: none;
}

.dashboard-shell--modern .dashboard-hero__icon svg {
  width: 21px;
  height: 21px;
}

.dashboard-shell--modern .dashboard-hero h1 {
  margin: 2px 0 0;
  color: var(--ai-text);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.dashboard-shell--modern .dashboard-hero p:not(.eyebrow) {
  max-width: 820px;
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.dashboard-shell--modern .dashboard-hero__badge {
  min-width: 230px;
  padding: 14px 62px 14px 15px;
  border-color: var(--ai-border);
  border-radius: 10px;
  background: var(--ai-surface-3);
}

.dashboard-shell--modern .dashboard-hero__badge strong {
  margin: 5px 0 3px;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.dashboard-shell--modern .dashboard-hero__badge span,
.dashboard-shell--modern .dashboard-hero__badge small {
  font-size: 10px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dashboard-shell--modern .dashboard-hero__badge-icon {
  top: 13px;
  right: 13px;
  width: 36px;
  height: 36px;
  border-color: var(--ai-info-border);
  border-radius: 9px;
  color: var(--ai-info);
  background: var(--ai-info-soft);
  box-shadow: none;
}

.dashboard-shell--modern .dashboard-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.dashboard-shell--modern .dashboard-kpi-card {
  min-height: 88px;
  padding: 14px;
  border-color: var(--ai-border);
  border-radius: 10px;
  background: var(--ai-surface-2);
  box-shadow: none;
}

.dashboard-shell--modern .dashboard-kpi-card--platform {
  min-height: 72px;
  background: color-mix(in srgb, var(--ai-surface-2) 82%, var(--ai-surface-3));
}

.dashboard-shell--modern .dashboard-kpi-card__icon {
  border-color: var(--ai-info-border);
  border-radius: 8px;
  color: var(--ai-info);
  background: var(--ai-info-soft);
}

.dashboard-shell--modern .dashboard-kpi-grid--usage .dashboard-kpi-card:nth-child(2) .dashboard-kpi-card__icon {
  border-color: color-mix(in srgb, var(--ai-success) 34%, transparent);
  color: var(--ai-success);
  background: var(--ai-success-soft);
}

.dashboard-shell--modern .dashboard-kpi-grid--usage .dashboard-kpi-card:nth-child(3) .dashboard-kpi-card__icon {
  border-color: var(--ai-accent-border);
  color: var(--ai-accent);
  background: var(--ai-accent-soft);
}

.dashboard-shell--modern .dashboard-kpi-grid--usage .dashboard-kpi-card:nth-child(4) .dashboard-kpi-card__icon {
  border-color: color-mix(in srgb, var(--ai-warning) 34%, transparent);
  color: var(--ai-warning);
  background: var(--ai-warning-soft);
}

.dashboard-shell--modern .dashboard-kpi-card strong {
  font-size: 23px;
  letter-spacing: -0.025em;
}

.dashboard-shell--modern .dashboard-kpi-card span {
  margin-top: 5px;
  font-size: 12px;
}

.dashboard-shell--modern .dashboard-kpi-card small {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 650;
}

.dashboard-shell--modern .dashboard-main-grid {
  grid-template-columns: minmax(0, 1.58fr) minmax(360px, 0.92fr);
  gap: 14px;
}

.dashboard-shell--modern > .panel-card,
.dashboard-shell--modern .dashboard-main-grid > .panel-card {
  padding: 16px;
  border-color: var(--ai-border);
  border-radius: 12px;
  background: var(--ai-surface-2);
  box-shadow: none;
}

.dashboard-shell--modern .section-heading {
  align-items: center;
  margin-bottom: 14px;
}

.dashboard-shell--modern .section-heading h3 {
  margin-top: 3px;
  font-size: 16px;
  letter-spacing: -0.012em;
}

.dashboard-shell--modern .dashboard-chip {
  min-height: 24px;
  padding: 0 8px;
  border-color: var(--ai-border);
  border-radius: 6px;
  color: var(--ai-muted);
  background: var(--ai-surface-3);
  font-size: 9px;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.dashboard-shell--modern .dashboard-token-chart,
.dashboard-shell--modern .dashboard-model-token-chart,
.dashboard-shell--modern .dashboard-breakdown-chart {
  border-color: var(--ai-border);
  border-radius: 9px;
  background: var(--ai-surface);
}

.dashboard-shell--modern .dashboard-token-chart {
  min-height: 324px;
  padding: 14px 12px 8px;
}

.dashboard-shell--modern .dashboard-token-chart canvas {
  height: 300px !important;
}

.dashboard-shell--modern .dashboard-model-token-chart {
  min-height: 286px;
}

.dashboard-shell--modern .dashboard-model-token-chart canvas {
  height: 260px !important;
}

.dashboard-shell--modern .dashboard-breakdown-chart {
  min-height: 236px;
}

.dashboard-shell--modern .dashboard-breakdown-chart canvas {
  height: 210px !important;
}

.dashboard-shell--modern .dashboard-breakdown-chart--composition {
  display: flex;
  align-items: center;
  padding: 16px 12px 8px;
}

.dashboard-shell--modern .dashboard-breakdown-chart--composition canvas {
  height: 176px !important;
}

.dashboard-shell--modern .dashboard-chart-card--top-models .dashboard-model-token-chart {
  min-height: 324px;
}

.dashboard-shell--modern .dashboard-chart-card--top-models .dashboard-model-token-chart canvas {
  height: 298px !important;
}

.dashboard-shell--modern .dashboard-agent-card {
  overflow: hidden;
}

.dashboard-shell--modern .dashboard-agent-table {
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--ai-border);
  border-radius: 9px;
}

.dashboard-shell--modern .dashboard-agent-table .data-table {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.dashboard-shell--modern .dashboard-model-name-icon {
  border-color: var(--ai-border);
  border-radius: 8px;
  color: var(--ai-info);
  background: var(--ai-info-soft);
}

.dashboard-shell--modern .dashboard-workspace-usage {
  gap: 14px;
}

.dashboard-shell--modern .dashboard-workspace-usage__heading {
  margin-bottom: 0;
}

.dashboard-shell--modern .dashboard-workspace-usage__heading .muted-copy {
  max-width: 780px;
  font-size: 11px;
}

.dashboard-workspace-chart-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ai-border);
  border-radius: 10px;
  background: var(--ai-surface);
}

.dashboard-workspace-chart-card__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.dashboard-workspace-chart-card__heading span,
.dashboard-workspace-chart-card__heading strong {
  display: block;
}

.dashboard-workspace-chart-card__heading span {
  color: var(--ai-muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-workspace-chart-card__heading strong {
  margin-top: 3px;
  color: var(--ai-text);
  font-size: 14px;
}

.dashboard-workspace-chart-card__heading p {
  margin: 0;
  color: var(--ai-muted);
  font-size: 10px;
}

.dashboard-workspace-chart-card__viewport {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-line-strong) transparent;
}

.dashboard-workspace-chart-card__stage {
  position: relative;
  min-width: 720px;
  height: 340px;
}

.dashboard-workspace-chart-card__stage canvas {
  width: 100% !important;
  height: 340px !important;
}

.dashboard-shell--modern .dashboard-workspace-usage-toolbar {
  padding-top: 2px;
}

.dashboard-shell--modern .dashboard-workspace-usage-tabs {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  background: var(--ai-surface);
}

.dashboard-shell--modern .dashboard-workspace-usage-tabs .button-ghost {
  min-height: 28px;
  border-color: transparent;
  border-radius: 6px;
  font-size: 10px;
}

.dashboard-shell--modern .dashboard-workspace-usage-tabs .is-active {
  border-color: var(--ai-border);
  color: var(--ai-text);
  background: var(--ai-surface-3);
}

.dashboard-shell--modern .dashboard-workspace-usage-table-wrap {
  border-radius: 9px;
  background: var(--ai-surface);
}

.dashboard-shell--modern .dashboard-workspace-usage-table th {
  background: var(--ai-surface-3);
}

.dashboard-shell--modern .dashboard-workspace-usage-table th:first-child {
  background: var(--ai-surface-3);
}

.dashboard-shell--modern .dashboard-workspace-usage-table td:first-child {
  background: var(--ai-surface);
}

@media (max-width: 1180px) {
  .dashboard-shell--modern .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .dashboard-shell--modern .dashboard-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-shell--modern .dashboard-hero__token-robot {
    display: none;
  }

  .dashboard-shell--modern .dashboard-hero__badge {
    width: 100%;
  }

  .dashboard-shell--modern .dashboard-kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-shell--modern .section-heading,
  .dashboard-workspace-chart-card__heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-workspace-chart-card {
    padding: 10px;
  }
}

.muted-copy {
  color: var(--ai-muted);
  font-weight: 700;
}

.data-launcher-panel {
  min-height: 420px;
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 188px));
  gap: 18px;
  justify-content: start;
  margin-top: 22px;
}

.launcher-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 12px;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 18px;
  border: 1px solid var(--ai-launcher-card-border);
  border-radius: 30px;
  color: var(--ai-text);
  text-align: center;
  text-decoration: none;
  background:
    radial-gradient(
      circle at 50% 0%,
      color-mix(in srgb, var(--launcher-accent, #5eead4) var(--ai-launcher-card-accent-mix), transparent),
      transparent 52%
    ),
    var(--ai-launcher-card-surface-bg);
  box-shadow: var(--ai-launcher-card-shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.launcher-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--launcher-accent, #5eead4) 54%, transparent);
  box-shadow:
    var(--ai-launcher-card-hover-shadow),
    0 0 0 1px color-mix(in srgb, var(--launcher-accent, #5eead4) var(--ai-launcher-card-hover-ring-mix), transparent);
}

.launcher-card__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid color-mix(in srgb, var(--launcher-accent, #5eead4) 42%, transparent);
  border-radius: 22px;
  color: var(--ai-launcher-icon-text);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--launcher-accent, #5eead4) var(--ai-launcher-icon-start-mix), #ffffff),
      color-mix(in srgb, var(--launcher-accent, #5eead4) var(--ai-launcher-icon-end-mix), var(--ai-launcher-icon-end-base))
    );
  box-shadow: 0 16px 32px color-mix(in srgb, var(--launcher-accent, #5eead4) var(--ai-launcher-icon-shadow-mix), transparent);
}

.launcher-card__icon svg {
  display: block;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.launcher-card__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.launcher-card__body strong {
  color: var(--ai-text);
  font-size: 17px;
  line-height: 1.2;
}

.launcher-card__body small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ai-text-soft);
  font-weight: 700;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.launcher-empty {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  padding: 28px;
  border: 1px dashed var(--ai-line-strong);
  border-radius: var(--ai-radius);
  color: var(--ai-text-soft);
  background: rgba(10, 15, 24, 0.34);
}

.launcher-empty strong {
  color: var(--ai-text);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.agent-capability-assign-form {
  grid-template-columns: minmax(280px, 1fr) 130px auto;
  max-width: 900px;
}

.agent-capability-assign-form .field {
  margin-bottom: 0;
}

.agent-capability-assign-form .field:first-of-type {
  max-width: 560px;
}

.agent-capability-assign-form .field small {
  min-height: 15px;
}

.agent-capability-assign-form .button-primary {
  align-self: center;
  margin-top: 18px;
}

.agent-capability-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

.agent-capability-row-actions form {
  display: flex;
}

.agent-capability-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  gap: 6px;
  color: #e9fff5;
  border-color: rgba(94, 224, 160, 0.38);
  background: rgba(94, 224, 160, 0.13);
  text-align: center;
}

.agent-capability-view-button:hover,
.agent-capability-view-button:focus-visible {
  border-color: rgba(94, 224, 160, 0.62);
  background: rgba(94, 224, 160, 0.2);
  color: #ffffff;
}

.agent-capability-view-button svg {
  flex: 0 0 auto;
}

.agent-detail-tabs .agent-permission-tabs__panel {
  min-height: 360px;
}

.agent-capability-modal__panel {
  width: min(920px, calc(100vw - 36px));
}

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

.agent-capability-modal__summary span {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--ai-line);
  border-radius: 11px;
  background: var(--ai-workspace-muted-card-bg);
}

.agent-capability-modal__summary strong {
  color: var(--ai-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agent-capability-modal__summary code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ai-text);
}

.agent-capability-list {
  display: grid;
  gap: 10px;
}

.agent-capability-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(93, 110, 138, 0.3);
  border-radius: 13px;
  background: rgba(10, 15, 24, 0.44);
}

.agent-capability-item > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.agent-capability-item h3 {
  margin: 0;
  min-width: 0;
  color: var(--ai-text);
  font-size: 14px;
}

.agent-capability-item code {
  min-width: 0;
  color: var(--ai-muted);
  overflow-wrap: anywhere;
}

.agent-capability-item p {
  margin: 0;
  color: var(--ai-text-soft);
  font-size: 13px;
  line-height: 1.5;
}

.agent-capability-item dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  margin: 0;
}

.agent-capability-item dl div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.agent-capability-item dt {
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agent-capability-item dd {
  margin: 0;
  min-width: 0;
  color: var(--ai-text-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.role-access-builder {
  display: grid;
  gap: 12px;
}

.agent-role-picker {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.agent-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 7px 6px 10px;
  border: 1px solid rgba(154, 131, 255, 0.32);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: rgba(154, 131, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.agent-role-chip code {
  color: #d8d0ff;
}

.agent-role-chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255, 107, 122, 0.28);
  border-radius: 8px;
  color: #ffd3d8;
  background: rgba(255, 107, 122, 0.12);
  cursor: pointer;
}

.agent-role-chip button:hover {
  background: rgba(255, 107, 122, 0.22);
}

.agent-role-chip svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.agent-role-confirm {
  position: fixed;
  inset: 0;
  z-index: 170;
  pointer-events: none;
  visibility: hidden;
}

.agent-role-confirm.is-open {
  pointer-events: auto;
  visibility: visible;
}

.agent-role-confirm__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 7, 13, 0.74);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.agent-role-confirm.is-open .agent-role-confirm__backdrop {
  opacity: 1;
}

.agent-role-confirm__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100vw - 28px));
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: var(--ai-popover-bg);
  box-shadow: var(--ai-shadow);
  transform: translate(-50%, -47%) scale(0.98);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.agent-role-confirm.is-open .agent-role-confirm__panel {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.workflow-strip > div:last-child {
  border-right: 0;
}

.workflow-strip strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--ai-radius-sm);
  color: var(--ai-kpi-icon-text);
  background: var(--ai-accent-soft);
  border: 1px solid var(--ai-accent-border);
}

.workflow-strip span {
  color: var(--ai-text-soft);
  font-weight: 700;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-table-shell-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--ai-line-strong) var(--ai-scrollbar-track);
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  color: var(--ai-text-soft);
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--ai-table-cell-border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--ai-muted);
  background: var(--ai-table-header-bg);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.data-table tr:hover td {
  background: var(--ai-table-row-hover-bg);
}

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


.chip--muted {
  color: var(--ai-muted);
  background: var(--ai-control-bg);
  border-color: var(--ai-line);
}

.form-card,
.agent-config,
.form-grid {
  display: grid;
  gap: 14px;
}

.form-card--danger {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ai-danger-divider);
}

.form-card--danger p {
  max-width: 560px;
  color: var(--ai-muted);
}

.form-card--danger .button-danger {
  width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}

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

.field {
  display: grid;
  gap: 7px;
  color: var(--ai-text-soft);
  font-weight: 700;
}

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

.field span,
.field > label {
  color: var(--ai-text-soft);
  font-size: 13px;
}

.field small {
  color: var(--ai-muted);
  font-weight: 500;
}

.field input,
.field select,
.field textarea,
input,
select,
textarea {
  width: 100%;
  color: var(--ai-text);
  background: var(--ai-input-bg);
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  outline: 0;
  padding: 10px 11px;
  min-height: 40px;
}

.ai-drawer .field select {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.25;
}

textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--ai-input-focus-border);
  box-shadow: var(--ai-input-focus-shadow);
}

.field input:disabled,
input:disabled {
  color: var(--ai-muted);
  background: var(--ai-input-disabled-bg);
}

.button-primary,
.button-ghost,
.button-danger,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--ai-radius-sm);
  border: 1px solid transparent;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.button-primary {
  color: var(--ai-button-primary-text);
  background: var(--ai-button-primary-bg);
  border-color: var(--ai-button-primary-border);
  box-shadow: var(--ai-button-primary-shadow);
}

.button-primary:hover {
  background: var(--ai-button-primary-hover-bg);
}

.button-ghost {
  color: var(--ai-text-soft);
  background: var(--ai-control-bg);
  border-color: var(--ai-line);
}

.button-ghost:hover {
  color: var(--ai-text);
  border-color: var(--ai-accent-border);
  background: var(--ai-control-hover-bg);
}

.button-danger {
  color: var(--ai-button-danger-text);
  background: var(--ai-button-danger-bg);
  border-color: var(--ai-button-danger-border);
}

.button-danger:hover {
  background: var(--ai-button-danger-hover-bg);
}

.button-link {
  width: fit-content;
  margin-top: 18px;
  color: var(--ai-text);
  background: var(--ai-button-link-bg);
  border-color: var(--ai-button-link-border);
}

.button-link:hover {
  border-color: var(--ai-accent-border);
  background: var(--ai-control-hover-bg);
}

.button-ghost--small,
.button-primary--small,
.button-danger--small {
  min-height: 32px;
  padding: 7px 10px;
  font-size: 12px;
}

.button-primary svg,
.button-ghost svg,
.button-danger svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: var(--ai-control-bg);
  cursor: pointer;
}

.ai-icon-button:hover {
  color: var(--ai-text);
  border-color: var(--ai-accent-border);
  background: var(--ai-control-hover-bg);
}

.ai-drawer-open {
  overflow: hidden;
}

.ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  visibility: hidden;
}

.ai-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.ai-drawer__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: var(--ai-drawer-backdrop);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ai-drawer.is-open .ai-drawer__backdrop {
  opacity: 1;
}

.ai-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, calc(100vw - 28px));
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid var(--ai-line);
  color: var(--ai-text);
  background: var(--ai-drawer-panel-bg);
  box-shadow: var(--ai-drawer-shadow);
  transform: translateX(104%);
  transition: transform 0.22s ease;
}

.ai-drawer.is-open .ai-drawer__panel {
  transform: translateX(0);
}

.ai-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--ai-drawer-header-border);
}

.ai-drawer__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.ai-drawer__header h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ai-text);
  font-size: 21px;
  line-height: 1.2;
}

.ai-drawer__header h2 svg {
  color: var(--ai-accent);
}

.ai-drawer__body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-line-strong) var(--ai-scrollbar-track);
}

.ai-drawer__body--compact {
  align-self: start;
  max-height: 100%;
  box-sizing: border-box;
}

.ai-drawer .checkbox-grid {
  grid-template-columns: 1fr;
}

.ai-drawer .checkbox-card {
  background: var(--ai-checkbox-bg);
}

.checkbox-card,
.checkbox-card > div {
  min-width: 0;
}

.checkbox-card strong,
.checkbox-card small {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.checkbox-card small {
  line-height: 1.35;
}

.ai-drawer--role-create .ai-drawer__panel {
  width: min(720px, calc(100vw - 28px));
}

.ai-drawer--role-create .checkbox-grid,
.ai-drawer--role-edit .checkbox-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ai-drawer--role-edit .ai-drawer__panel {
  width: min(720px, calc(100vw - 28px));
}

.ai-drawer--agent-edit .ai-drawer__panel {
  width: min(860px, calc(100vw - 28px));
}

.button-full {
  width: 100%;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

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

.detail-grid--compact {
  margin-top: 16px;
}

.detail-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-detail-bg);
}

.detail-card--wide {
  grid-column: 1 / -1;
}

.detail-card strong,
.detail-card span {
  display: block;
}

.detail-card strong {
  margin-bottom: 7px;
  color: var(--ai-muted);
  font-size: 12px;
}

.detail-card span {
  color: var(--ai-text);
  overflow-wrap: anywhere;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.chip-list--tight {
  margin-top: 0;
}

.chip,
.ai-badge,
.status-pill,
.help-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: var(--ai-radius-sm);
  color: var(--ai-kpi-icon-text);
  background: var(--ai-accent-soft);
  border: 1px solid var(--ai-accent-border);
  font-size: 12px;
  font-weight: 800;
}

.ai-badge--success,
.status-pill--active {
  color: var(--ai-success-on-soft);
  background: var(--ai-green-soft);
  border-color: color-mix(in srgb, var(--ai-success) 34%, transparent);
}

.status-pill--muted {
  color: var(--ai-info-on-soft);
  background: var(--ai-info-soft);
  border-color: color-mix(in srgb, var(--ai-info) 28%, transparent);
}

.ai-badge--warning,
.status-pill--draft {
  color: var(--ai-warning-on-soft);
  background: var(--ai-amber-soft);
  border-color: color-mix(in srgb, var(--ai-warning) 35%, transparent);
}

.ai-badge--danger,
.status-pill--inactive,
.status-pill--disabled,
.status-pill--archived {
  color: var(--ai-danger-on-soft);
  background: var(--ai-red-soft);
  border-color: color-mix(in srgb, var(--ai-danger) 34%, transparent);
}

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

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: var(--ai-checkbox-bg);
  font-weight: 700;
}

.checkbox-card input {
  width: auto;
  min-height: 0;
  margin-top: 2px;
  accent-color: var(--ai-accent);
}

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

.tool-category-overview {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: var(--ai-control-bg);
}

.tool-category-overview__heading,
.tool-category-section__heading,
.tool-category-card__header,
.tool-category-card__value,
.agent-card__badges {
  display: flex;
  align-items: center;
}

.tool-category-overview__heading {
  justify-content: space-between;
  gap: 12px;
}

.tool-category-overview__heading h3,
.tool-category-section__heading h3,
.tool-category-card h4 {
  margin: 0;
  color: var(--ai-text);
}

.tool-category-overview__heading > span,
.tool-category-section__count,
.tool-category-card__count,
.tool-category-badge {
  color: var(--ai-text-soft);
  font-size: 11px;
  font-weight: 800;
}

.tool-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.tool-category-card,
.tool-category-section {
  --tool-category-accent: #9a83ff;
}

.tool-category-card--sky,
.tool-category-section--sky {
  --tool-category-accent: #52bff2;
}

.tool-category-card--green,
.tool-category-section--green {
  --tool-category-accent: #43d18d;
}

.tool-category-card--amber,
.tool-category-section--amber {
  --tool-category-accent: #f6c85f;
}

.tool-category-card--red,
.tool-category-section--red {
  --tool-category-accent: #ff6b7a;
}

.tool-category-card--teal,
.tool-category-section--teal {
  --tool-category-accent: #5eead4;
}

.tool-category-card--blue,
.tool-category-section--blue {
  --tool-category-accent: #6da8ff;
}

.tool-category-card--violet,
.tool-category-section--violet {
  --tool-category-accent: #9a83ff;
}

.tool-category-card--slate,
.tool-category-section--slate {
  --tool-category-accent: #8b9bb2;
}

.tool-category-card {
  width: 100%;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 176px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--tool-category-accent) 28%, var(--ai-line));
  border-radius: var(--ai-radius-sm);
  background: var(--ai-entity-card-surface-bg);
  box-shadow: var(--ai-entity-card-shadow);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.tool-category-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--tool-category-accent);
  content: "";
}

.tool-category-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tool-category-accent) 60%, var(--ai-line));
  box-shadow: var(--ai-entity-card-hover-shadow);
}

.tool-category-card.is-selected {
  border-color: color-mix(in srgb, var(--tool-category-accent) 78%, var(--ai-line));
  background: color-mix(in srgb, var(--tool-category-accent) 9%, var(--ai-entity-card-surface-bg));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tool-category-accent) 18%, transparent);
}

.tool-category-card:focus-visible {
  outline: 2px solid var(--tool-category-accent);
  outline-offset: 2px;
}

.tool-category-card__header {
  justify-content: space-between;
  gap: 10px;
}

.tool-category-card__icon,
.tool-category-section__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--tool-category-accent) 45%, transparent);
  color: var(--tool-category-accent);
  background: color-mix(in srgb, var(--tool-category-accent) 12%, var(--ai-control-bg));
}

.tool-category-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.tool-category-card__icon svg,
.tool-category-section__icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-category-card__count,
.tool-category-section__count {
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--tool-category-accent) 24%, var(--ai-line));
  border-radius: 999px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--tool-category-accent) 8%, var(--ai-control-bg));
}

.tool-category-card__body {
  display: grid;
  align-content: start;
  gap: 6px;
}

.tool-category-card h4 {
  font-size: 16px;
}

.tool-category-card p,
.tool-category-section__heading p {
  margin: 0;
  color: var(--ai-muted);
  line-height: 1.45;
}

.tool-category-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tool-category-card__value {
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ai-table-cell-border);
  color: var(--ai-muted);
  font-size: 11px;
}

.tool-category-card__value code {
  overflow-wrap: anywhere;
  color: var(--tool-category-accent);
  text-align: right;
}

.tool-category-catalog {
  display: grid;
  gap: 20px;
}

.tool-category-section {
  display: grid;
  gap: 14px;
  scroll-margin-top: 82px;
}

.tool-category-section[hidden] {
  display: none;
}

.tool-category-section__heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 0 2px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--tool-category-accent) 32%, var(--ai-line));
}

.tool-category-section__icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.tool-category-section__heading .eyebrow {
  margin-bottom: 2px;
  color: var(--tool-category-accent);
}

.tool-category-section__heading > div > p:last-child {
  margin-top: 3px;
  font-size: 12px;
}

.tool-category-section__empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--ai-line-strong);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-muted);
  text-align: center;
  background: var(--ai-filter-empty-bg);
}

.agent-card__badges {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-category-badge {
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid var(--ai-line);
  border-radius: 999px;
  background: var(--ai-control-bg);
}

.ai-filterable {
  display: grid;
  gap: 12px;
}

.ai-filterable__toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

.ai-filterable__search {
  display: grid;
  gap: 6px;
  min-width: min(100%, 360px);
  color: var(--ai-text-soft);
  font-weight: 800;
}

.ai-filterable__search span,
.ai-filterable__count {
  color: var(--ai-muted);
  font-size: 12px;
}

.ai-filterable__search input {
  min-height: 38px;
}

.ai-filterable__count {
  padding: 8px 10px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-control-bg);
  font-weight: 800;
}

.ai-filterable__empty {
  display: none;
  padding: 18px;
  border: 1px dashed var(--ai-line-strong);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-muted);
  text-align: center;
  background: var(--ai-filter-empty-bg);
}

.ai-filterable.is-empty .ai-filterable__empty {
  display: block;
}

.ai-filterable.is-loading {
  opacity: 0.72;
}

.ai-filterable.is-error .ai-filterable__search input {
  border-color: color-mix(in srgb, var(--ai-danger) 50%, transparent);
}

[data-ai-filter-item][hidden] {
  display: none !important;
}

.agent-card {
  --entity-accent: #9a83ff;
  display: grid;
  gap: 13px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--ai-entity-card-border);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 18px 12px,
      color-mix(in srgb, var(--entity-accent) var(--ai-entity-card-accent-mix), transparent),
      transparent 48%
    ),
    var(--ai-entity-card-surface-bg);
  box-shadow: var(--ai-entity-card-shadow);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.agent-card--agent {
  --entity-accent: #ff9f68;
}

.agent-card--tool {
  --entity-accent: #f6c85f;
}

.agent-card--model {
  --entity-accent: #5eead4;
}

.agent-card--inactive {
  --entity-accent: #ff6b7a;
}

.agent-card--workspace {
  --entity-accent: #43d18d;
}

.agent-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--entity-accent) 48%, transparent);
  background:
    radial-gradient(
      circle at 18px 12px,
      color-mix(in srgb, var(--entity-accent) var(--ai-entity-card-hover-accent-mix), transparent),
      transparent 48%
    ),
    var(--ai-entity-card-hover-surface-bg);
  box-shadow:
    var(--ai-entity-card-hover-shadow),
    0 0 0 1px color-mix(in srgb, var(--entity-accent) var(--ai-entity-card-hover-ring-mix), transparent);
}

.agent-card__main {
  display: grid;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.agent-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
}

.agent-card__header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.agent-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--entity-accent) 42%, transparent);
  border-radius: 14px;
  color: var(--ai-entity-icon-text);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--entity-accent) var(--ai-entity-icon-start-mix), #ffffff),
      color-mix(in srgb, var(--entity-accent) var(--ai-entity-icon-end-mix), var(--ai-entity-icon-end-base))
    );
  box-shadow: 0 10px 22px color-mix(in srgb, var(--entity-accent) var(--ai-entity-icon-shadow-mix), transparent);
}

.agent-card__icon svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agent-card h3 {
  margin: 9px 0 0;
  color: var(--ai-text);
  font-size: 18px;
  line-height: 1.2;
}

.agent-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ai-muted);
  line-height: 1.45;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.agent-card__meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ai-table-cell-border);
}

.agent-card__meta span {
  color: var(--ai-muted);
}

.agent-card__meta code {
  min-width: 0;
  max-width: 100%;
  justify-self: end;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: right;
}

.object-actions,
.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.object-actions {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--ai-table-cell-border);
}

.object-actions form {
  margin: 0;
}

.object-actions--inline {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.object-actions.prompt-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 38px;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
  width: 100%;
}

.prompt-card-actions form {
  display: flex;
  min-width: 0;
  width: 100%;
  height: 100%;
}

.prompt-card-action {
  display: inline-flex;
  align-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 8px;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  font-weight: 400;
  font-size: 10.5px;
  line-height: 1;
  text-align: center;
}

.prompt-card-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt-card-action svg,
.prompt-test-action svg {
  display: block;
}

.prompt-card-action--open {
  color: #f8fbff;
  border-color: rgba(128, 108, 255, 0.52);
  background: linear-gradient(180deg, rgba(128, 108, 255, 0.96), rgba(97, 72, 223, 0.96));
}

.prompt-card-action--edit {
  color: #dff8ff;
  border-color: rgba(88, 199, 255, 0.34);
  background: rgba(88, 199, 255, 0.12);
}

.prompt-card-action--copy,
.prompt-card-action--activate {
  color: #e9fff5;
  border-color: rgba(94, 224, 160, 0.34);
  background: rgba(94, 224, 160, 0.12);
}

.prompt-card-action--deactivate {
  color: #fff1f2;
  border-color: rgba(255, 107, 122, 0.38);
  background: rgba(255, 107, 122, 0.14);
}

.prompt-card-action:hover {
  transform: translateY(-1px);
}

.prompt-items-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}

.prompt-items-table th,
.prompt-items-table td {
  padding: 10px 9px;
}

.prompt-items-table th:nth-child(1),
.prompt-items-table td:nth-child(1) {
  width: 18%;
}

.prompt-items-table th:nth-child(2),
.prompt-items-table td:nth-child(2) {
  width: 17%;
}

.prompt-items-table th:nth-child(3),
.prompt-items-table td:nth-child(3) {
  width: auto;
}

.prompt-items-table th:nth-child(4),
.prompt-items-table td:nth-child(4) {
  width: 96px;
}

.prompt-items-table th:nth-child(5),
.prompt-items-table td:nth-child(5) {
  width: 288px;
}

.prompt-items-table tbody tr {
  height: 88px;
}

.prompt-items-table td {
  height: 88px;
  max-height: 88px;
}

.prompt-item-cell-clamp {
  display: -webkit-box;
  max-height: 56px;
  overflow: hidden;
  font-size: 11.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

code.prompt-item-cell-clamp {
  white-space: normal;
  word-break: break-word;
}

.prompt-group-card {
  position: relative;
  overflow: visible;
}

.prompt-group-delete-trigger {
  position: absolute;
  top: -13px;
  right: -13px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #ff5d6d, #d92f45);
  box-shadow: 0 10px 20px rgba(255, 65, 86, 0.22);
  cursor: pointer;
}

.prompt-group-delete-trigger svg {
  width: 15px;
  height: 15px;
  display: block;
  color: #ffffff;
  stroke: currentColor;
  stroke-width: 2.7;
}

.prompt-group-delete-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(255, 65, 86, 0.3);
}

.prompt-test-action {
  color: #f4fbff;
  border-color: rgba(246, 200, 95, 0.36);
  background: rgba(246, 200, 95, 0.12);
  font-weight: 600;
}

.prompt-item-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.prompt-item-actions form {
  display: flex;
  flex: 0 0 auto;
}

.prompt-item-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  min-width: 82px;
  min-height: 34px;
  padding: 7px 7px;
  gap: 4px;
  font-size: 9.2px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.prompt-item-action svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.prompt-test-modal__panel {
  width: min(1180px, calc(100vw - 44px));
}

.prompt-test-form {
  display: grid;
  min-height: 0;
}

.prompt-test-options {
  padding: 18px 18px 0;
}

.prompt-test-options .field {
  max-width: 420px;
}

.prompt-test-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  min-height: 0;
}

.prompt-test-grid textarea {
  min-height: 380px;
  resize: vertical;
  font-family: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
}

[data-prompt-test-status].is-error {
  color: #ffb4be;
}

@media (max-width: 900px) {
  .prompt-test-grid {
    grid-template-columns: 1fr;
  }

  .prompt-card-action {
    width: 100%;
  }
}

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

.dashboard-stats--compact {
  margin-top: 12px;
}

.stat-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(93, 110, 138, 0.3);
  border-radius: 14px;
  background: rgba(13, 19, 29, 0.72);
}

.stat-card span {
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong {
  min-width: 0;
  color: var(--ai-text);
  overflow-wrap: anywhere;
}

.config-section {
  scroll-margin-top: 90px;
}

.message-stack {
  display: grid;
  gap: 12px;
}

.message-row {
  padding: 14px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-workspace-card-bg);
}

.message-row strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ai-text);
}

.message-row p {
  color: var(--ai-text-soft);
  white-space: pre-wrap;
}

.message-row--assistant {
  border-color: rgba(154, 131, 255, 0.34);
  background: rgba(154, 131, 255, 0.08);
}

.message-row--user {
  border-color: rgba(47, 128, 255, 0.32);
  background: rgba(47, 128, 255, 0.08);
}

.workspace-card {
  min-height: 210px;
}

.workspace-hero {
  display: grid;
  gap: 16px;
}

.workspace-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workspace-summary-grid .detail-card {
  padding: 11px 12px;
}

.workspace-summary-grid .detail-card strong {
  margin-bottom: 5px;
  font-size: 11px;
}

.workspace-summary-grid .detail-card span {
  font-size: 13px;
  line-height: 1.25;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  overflow: visible;
}

.workspace-object-panel,
.workspace-history-panel {
  position: relative;
}

.workspace-object-panel {
  z-index: 2;
  min-width: 0;
}

.workspace-history-panel {
  z-index: 1;
  min-width: 0;
}

.workspace-object-panel .section-heading h3 {
  font-size: 16px;
  line-height: 1.25;
}

.workspace-object-filter {
  display: grid;
  gap: 9px;
}

.workspace-object-filter .field {
  gap: 5px;
}

.workspace-object-filter .field input {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 12px;
}

.workspace-object-filter [data-ai-filter-count] {
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 800;
}

.workspace-list {
  display: grid;
  gap: 12px;
}

.workspace-row-card,
.file-row-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: var(--ai-workspace-card-bg);
}

.workspace-row-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.workspace-row-card__delete {
  position: absolute;
  top: -11px;
  right: -11px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 107, 122, 0.82);
  cursor: pointer;
  opacity: 0.92;
  box-shadow: 0 6px 18px rgba(255, 107, 122, 0.2);
  z-index: 3;
}

.workspace-row-card__delete:hover,
.workspace-row-card__delete:focus-visible {
  opacity: 1;
  background: rgba(255, 107, 122, 1);
  outline: none;
}

.workspace-row-card__delete svg {
  width: 15px;
  height: 15px;
  display: block;
  stroke: currentColor;
  stroke-width: 2.8;
  transform: translate(0, 0);
}

.workspace-history-panel .workspace-row-card > div:first-of-type {
  padding-right: 32px;
}

.workspace-row-card h3,
.file-row-card h3 {
  margin: 8px 0 6px;
}

.workspace-row-card p,
.file-row-card p {
  color: var(--ai-text-soft);
}

.workspace-row-card small,
.file-row-card small {
  color: var(--ai-muted);
  font-weight: 800;
}

.file-row-card {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
}

.file-row-card__type {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: var(--ai-radius-sm);
  color: #d9e7ff;
  background: linear-gradient(135deg, rgba(47, 128, 255, 0.28), rgba(154, 131, 255, 0.2));
  border: 1px solid rgba(154, 131, 255, 0.3);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.file-row-card__body {
  min-width: 0;
}

.file-row-card__body h3,
.file-row-card__body p,
.file-row-card__body code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-chat-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.28fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  overflow: visible;
}

.workspace-chat-expanded-open {
  overflow: hidden;
}

body.workspace-chat-expanded-open :is(.ai-sidebar, .ai-topbar, .breadcrumbs) {
  visibility: hidden;
}

.workspace-chat-shell--expanded {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  /* Above the portal, but below its drawers, dialogs and message previews. */
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--ai-workspace-expanded-bg);
  box-shadow: none;
}

.workspace-chat-shell--expanded .workspace-reference-toggle,
.workspace-chat-shell--expanded .workspace-topic-panel {
  display: none !important;
}

.workspace-chat-shell--expanded .workspace-chat-panel {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: var(--ai-workspace-expanded-panel-bg);
}

.workspace-chat-shell--expanded .workspace-chat-header {
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 18px;
  background: var(--ai-workspace-expanded-header-bg);
}

.workspace-chat-shell--expanded .workspace-chat-header > div:first-child {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
}

.workspace-chat-shell--expanded .workspace-chat-header .eyebrow,
.workspace-chat-shell--expanded .workspace-prompt > small {
  display: none;
}

.workspace-chat-shell--expanded .workspace-chat-header :is(h2, p) {
  margin: 0;
}

.workspace-chat-shell--expanded .workspace-chat-header h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.workspace-chat-shell--expanded .workspace-message-stream {
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.workspace-chat-shell--expanded .document-chat-setup {
  min-height: 0;
  overflow-y: auto;
}

.workspace-chat-shell--expanded .workspace-prompt {
  position: relative;
  bottom: auto;
  min-height: 0;
  max-height: 42vh;
  max-height: 42dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 18px max(12px, env(safe-area-inset-bottom));
  gap: 8px;
}

.workspace-chat-shell--expanded .workspace-prompt textarea {
  min-height: 64px;
  height: 64px;
}

.workspace-chat-shell--expanded .workspace-prompt__utility-actions {
  flex-direction: row;
}

.workspace-chat-shell--expanded .workspace-prompt__settings {
  gap: 8px 14px;
}

@media (max-width: 600px) {
  .workspace-chat-shell--expanded .workspace-chat-header {
    padding: 8px 12px;
  }

  .workspace-chat-shell--expanded .workspace-chat-header__actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .workspace-chat-shell--expanded .workspace-prompt {
    padding-inline: 12px;
  }

  .workspace-chat-shell--expanded .workspace-prompt__actions {
    justify-content: space-between;
  }

  .workspace-chat-shell--expanded .workspace-prompt__setting {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 3px;
  }

  .workspace-chat-shell--expanded .workspace-prompt__setting select {
    width: 100%;
    min-width: 0;
  }
}

.workspace-chat-expand-toggle {
  align-items: center;
  gap: 7px;
}

@media (max-height: 600px) {
  /* Keep Expand reachable when the normal header and composer exceed the viewport. */
  .workspace-chat-shell:not(.workspace-chat-shell--expanded) .workspace-chat-panel {
    min-height: 520px;
    max-height: none;
  }
}

.workspace-chat-expand-toggle svg {
  width: 16px;
  height: 16px;
}

.workspace-chat-shell--references-collapsed {
  grid-template-columns: 42px minmax(0, 1fr);
}

.workspace-reference-toggle {
  display: none;
}

.workspace-chat-shell--references-collapsed .workspace-reference-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: calc(100vh - var(--ai-topbar-height) - 46px);
  min-height: 0;
  max-height: calc(100vh - var(--ai-topbar-height) - 46px);
  width: 42px;
  padding: 12px 8px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: var(--ai-workspace-card-bg);
  color: var(--ai-text-soft);
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  box-shadow: var(--ai-workspace-card-hover-shadow);
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.workspace-reference-toggle:hover,
.workspace-reference-toggle:focus-visible {
  border-color: var(--ai-workspace-info-border-strong);
  background: var(--ai-workspace-info-soft);
  color: var(--ai-text);
  outline: none;
}

.workspace-reference-toggle svg {
  width: 18px;
  height: 18px;
}

.workspace-reference-toggle span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-topic-panel,
.workspace-chat-panel {
  height: calc(100vh - var(--ai-topbar-height) - 46px);
  min-height: 0;
  max-height: calc(100vh - var(--ai-topbar-height) - 46px);
}

.workspace-topic-panel {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  overflow: visible;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.workspace-chat-panel {
  position: relative;
  z-index: 1;
}

.workspace-chat-shell--references-collapsed .workspace-topic-panel {
  position: absolute;
  left: 0;
  top: 0;
  width: min(340px, calc(100vw - 72px));
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(-100% - 18px));
  visibility: hidden;
}

.workspace-chat-shell--expanded.workspace-chat-shell--references-collapsed,
.workspace-chat-shell--expanded {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.workspace-chat-shell--expanded.workspace-chat-shell--references-collapsed .workspace-chat-panel,
.workspace-chat-shell--expanded .workspace-chat-panel {
  grid-column: 1 / -1 !important;
  grid-row: 1 / -1 !important;
}

.workspace-chat-shell--expanded.workspace-chat-shell--references-collapsed .workspace-reference-toggle,
.workspace-chat-shell--expanded.workspace-chat-shell--references-collapsed .workspace-topic-panel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.workspace-reference-collapse {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.workspace-reference-collapse svg {
  width: 18px;
  height: 18px;
}

.workspace-file-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-workspace-tabs-bg);
}

.workspace-file-tabs__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ai-muted);
  background: transparent;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 0;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.workspace-file-tabs__button:hover,
.workspace-file-tabs__button:focus-visible {
  color: var(--ai-text);
  border-color: var(--ai-workspace-info-border);
  background: var(--ai-workspace-info-soft);
  outline: none;
}

.workspace-file-tabs__button.is-active {
  color: var(--ai-workspace-info-on-soft);
  border-color: var(--ai-workspace-info-border-strong);
  background: var(--ai-workspace-browser-header-bg);
}

.workspace-file-pane {
  min-height: 0;
  overflow: visible;
}

.workspace-file-pane .workspace-object-filter {
  align-content: start;
  gap: 8px;
  height: 100%;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-workspace-panel-glow-bg);
  overflow: visible;
}

.workspace-file-pane[hidden] {
  display: none !important;
}

.workspace-created-files-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  padding: 22px 16px;
  border: 1px dashed var(--ai-workspace-info-border);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-workspace-empty-bg);
  text-align: center;
}

.workspace-created-files-empty__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--ai-workspace-empty-icon-border);
  border-radius: 14px;
  color: var(--ai-workspace-empty-icon-text);
  background: var(--ai-workspace-empty-icon-bg);
}

.workspace-created-files-empty--recalled .workspace-created-files-empty__icon {
  border-color: var(--ai-workspace-info-border);
  color: var(--ai-workspace-info-on-soft);
  background: var(--ai-workspace-info-soft);
}

.workspace-created-files-empty__icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-created-files-empty strong {
  color: var(--ai-text);
  font-size: 14px;
}

.workspace-created-files-empty p {
  max-width: 260px;
  margin: 0;
  color: var(--ai-muted);
  font-size: 12px;
  line-height: 1.5;
}

.workspace-topic-list {
  display: grid;
  gap: 10px;
}

.workspace-topic-list span {
  padding: 10px 11px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: rgba(141, 153, 174, 0.08);
  font-weight: 800;
}

.chat-reference-rail {
  position: relative;
  display: grid;
  gap: 10px;
  z-index: 2;
  overflow: visible;
}

.workspace-file-pane .chat-reference-rail--scroll {
  overflow: visible;
  min-height: calc((104px * 3) + (10px * 2));
}

.chat-reference-slot {
  position: relative;
  min-height: 104px;
  transition: min-height 0.16s ease;
}

.chat-reference-slot:hover,
.chat-reference-slot:focus-within {
  min-height: 148px;
  z-index: 12;
}

.chat-reference-card {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  min-height: 104px;
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: var(--ai-workspace-card-bg);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: width 0.16s ease, min-height 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.chat-reference-card:hover {
  z-index: 12;
  width: min(640px, calc(100vw - 120px));
  min-height: 148px;
  border-color: var(--ai-accent-border);
  background: var(--ai-workspace-card-hover-bg);
  box-shadow: var(--ai-workspace-card-hover-shadow);
}

.chat-reference-card:focus-visible {
  border-color: var(--ai-accent-border);
  box-shadow: var(--ai-focus-ring);
  outline: none;
}

.chat-reference-card__type {
  width: max-content;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--ai-workspace-reference-type-text);
  background: var(--ai-workspace-reference-type-bg);
  border: 1px solid var(--ai-workspace-reference-type-border);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.chat-reference-card strong,
.chat-reference-card small,
.chat-reference-card code {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reference-card strong {
  color: var(--ai-text);
  font-size: 13px;
}

.chat-reference-card small {
  color: var(--ai-muted);
  line-height: 1.3;
}

.chat-reference-card code {
  color: var(--ai-code-text);
}

.chat-reference-card__chunk {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ai-text-soft);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-reference-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.chat-reference-card__meta span {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  border: 1px solid var(--ai-workspace-reference-meta-border);
  border-radius: 8px;
  color: var(--ai-workspace-reference-meta-text);
  background: var(--ai-workspace-reference-meta-bg);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reference-card--created .chat-reference-card__type {
  border-color: var(--ai-workspace-created-type-border);
  color: var(--ai-workspace-created-type-text);
  background: var(--ai-workspace-created-type-bg);
}

.chat-reference-card--created .chat-reference-card__meta span {
  border-color: var(--ai-workspace-created-meta-border);
  color: var(--ai-workspace-created-meta-text);
  background: var(--ai-workspace-created-meta-bg);
}

.chat-reference-card:hover strong,
.chat-reference-card:hover small,
.chat-reference-card:hover code,
.chat-reference-card:hover .chat-reference-card__meta span {
  white-space: normal;
}

.workspace-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.workspace-chat-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-bottom: 1px solid var(--ai-line);
}

.workspace-chat-header h2 {
  margin: 0 0 6px;
}

.workspace-chat-header__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.section-heading--tight {
  margin-bottom: 10px;
}

.document-scope-panel {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--ai-accent-border);
  border-radius: var(--ai-radius);
  background: var(--ai-accent-soft);
}

.document-scope-panel[hidden] {
  display: none;
}

.document-chat-setup {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--ai-accent-border);
  border-radius: var(--ai-radius);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--ai-accent) 15%, transparent), transparent 34%),
    var(--ai-workspace-card-bg);
}

.document-chat-setup__form {
  display: grid;
  gap: 12px;
}

.document-chat-setup__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.document-picker-list {
  display: grid;
  gap: 9px;
}

.document-picker-card {
  display: grid;
  grid-template-columns: auto 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-workspace-card-bg);
  cursor: pointer;
}

.document-picker-card:hover,
.document-picker-card:focus-within {
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
}

.document-picker-card input {
  width: auto;
  min-height: 0;
  margin-top: 4px;
}

.document-picker-card__type {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: var(--ai-radius-sm);
  color: var(--ai-workspace-reference-type-text);
  background: var(--ai-workspace-reference-type-bg);
  border: 1px solid var(--ai-workspace-reference-type-border);
  font-size: 10px;
  font-weight: 900;
}

.document-picker-card strong,
.document-picker-card small,
.document-picker-card code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-picker-card strong {
  color: var(--ai-text);
}

.document-picker-card small {
  color: var(--ai-muted);
  line-height: 1.35;
}

.document-picker-card code {
  margin-top: 4px;
  color: var(--ai-code-text);
  white-space: nowrap;
}

.folder-browser {
  display: grid;
  gap: 12px;
}

.folder-browser--tree {
  align-content: start;
}

.folder-tree,
.folder-tree__files {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.folder-tree .folder-tree {
  margin-left: 19px;
  padding-left: 12px;
  border-left: 1px solid rgba(154, 131, 255, 0.16);
}

.folder-tree__folder {
  border-radius: var(--ai-radius-sm);
}

.folder-tree__folder summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  cursor: pointer;
}

.folder-tree__folder summary:hover {
  background: rgba(154, 131, 255, 0.08);
}

.folder-tree__folder summary svg,
.folder-tree__file svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--ai-accent);
}

.folder-tree__folder summary svg {
  color: #f6c85f;
  fill: #f6c85f;
  stroke: #d09218;
}

.folder-tree__files {
  margin-left: 19px;
  padding-left: 12px;
  border-left: 1px solid rgba(154, 131, 255, 0.16);
}

.folder-tree__file {
  display: grid;
  grid-template-columns: auto 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: var(--ai-radius-sm);
  cursor: pointer;
}

.folder-tree__file:hover,
.folder-tree__file:focus-within {
  background: rgba(88, 199, 255, 0.08);
}

.folder-tree__file input {
  width: auto;
  min-height: 0;
  margin-top: 3px;
}

.folder-tree__file strong,
.folder-tree__file small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-tree__file strong {
  color: var(--ai-text);
  font-size: 13px;
}

.folder-tree__file small {
  color: var(--ai-muted);
  font-size: 11px;
}

.folder-browser__folder {
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-workspace-card-bg);
}

.folder-browser__folder summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  color: var(--ai-text);
  cursor: pointer;
}

.folder-browser__folder summary svg {
  width: 17px;
  height: 17px;
  color: var(--ai-accent);
}

.folder-browser__folder .document-picker-list {
  padding: 0 12px 12px;
}

.workspace-message-stream {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  height: 100%;
  padding: 18px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-accent-border) transparent;
}

.workspace-message-stream::-webkit-scrollbar {
  width: 8px;
}

.workspace-message-stream::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--ai-accent-border);
}

.workspace-message-stream::-webkit-scrollbar-track {
  background: transparent;
}

.workspace-message-stream--empty {
  align-content: center;
  justify-items: center;
  min-height: 320px;
  padding-right: 0;
  text-align: center;
}

.workspace-empty-state {
  display: grid;
  gap: 8px;
  max-width: 420px;
  padding: 22px;
  border: 1px dashed rgba(154, 131, 255, 0.36);
  border-radius: var(--ai-radius);
  background: rgba(154, 131, 255, 0.08);
}

.workspace-empty-state strong {
  color: var(--ai-text);
  font-size: 15px;
}

.workspace-empty-state p {
  color: var(--ai-muted);
  font-size: 13px;
}

.workspace-message {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  max-width: min(760px, 88%);
  padding: 13px 52px 10px 14px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: var(--ai-workspace-message-bg);
}

.workspace-message--wide-content {
  width: min(920px, 85%);
  max-width: 85%;
}

.workspace-message__avatar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ai-workspace-message-avatar-border);
  border-radius: 999px;
  background: var(--ai-workspace-message-avatar-bg);
  color: var(--ai-muted);
}

.workspace-message__avatar-icon {
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: url("../assets/icons/chat-robot-head.svg") center / contain no-repeat;
  -webkit-mask: url("../assets/icons/chat-robot-head.svg") center / contain no-repeat;
}

.workspace-message strong {
  display: block;
  max-width: 100%;
  margin-bottom: 6px;
  color: var(--ai-muted);
  font-size: 12px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-message__content {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--ai-text-soft);
}

.workspace-message__content p {
  max-width: 100%;
  margin: 0;
  color: var(--ai-text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-message__source {
  display: block;
  max-width: 100%;
  font-family: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-message__rendered-html {
  max-width: 100%;
  overflow-x: hidden;
  color: var(--ai-text-soft);
  line-height: 1.65;
}

.workspace-message__rendered-html :where(*) {
  box-sizing: border-box;
  max-width: 100%;
}

.workspace-message__rendered-html :where(h1, h2, h3, h4, h5, h6) {
  margin: 0 0 10px;
  color: var(--ai-text);
  line-height: 1.18;
}

.workspace-message__rendered-html :where(h1) {
  font-size: 24px;
}

.workspace-message__rendered-html :where(h2) {
  font-size: 20px;
}

.workspace-message__rendered-html :where(h3) {
  font-size: 17px;
}

.workspace-message__rendered-html :where(p, ul, ol, blockquote, pre, table, figure) {
  margin: 0 0 12px;
}

.workspace-message__rendered-html :where(p, li, td, th) {
  color: var(--ai-text-soft);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-message__rendered-html :where(ul, ol) {
  padding-left: 22px;
}

.workspace-message__rendered-html :where(a) {
  color: var(--ai-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-message__rendered-html :where(code) {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--ai-workspace-inline-code-bg);
  color: var(--ai-text);
}

.workspace-message__rendered-html :where(pre) {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  background: var(--ai-workspace-code-bg);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-message__rendered-html :where(table) {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.workspace-message__rendered-html :where(th, td) {
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--ai-workspace-table-border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-message__rendered-html :where(th) {
  border-color: var(--ai-workspace-info-border);
  color: var(--ai-workspace-table-header-text);
  background: var(--ai-workspace-table-header-bg);
}

.workspace-message__rendered-html :where(img) {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.workspace-message__rendered-html .desktop-screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin-top: 16px;
  max-width: 100%;
}

.workspace-message__rendered-html .desktop-screenshot-gallery figure {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--ai-line);
  border-radius: 6px;
  overflow: hidden;
}

.workspace-message__rendered-html .desktop-screenshot-gallery a {
  display: block;
}

.workspace-message__rendered-html .desktop-screenshot-gallery img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: contain;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--ai-workspace-code-bg);
}

.workspace-message__rendered-html .desktop-screenshot-gallery figcaption {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-top: 1px solid var(--ai-line);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.workspace-message__rendered-html mjx-container {
  max-width: 100% !important;
  overflow-x: auto;
  overflow-y: hidden;
}

.workspace-message__rendered-html mjx-container[display="true"] {
  padding: 6px 0;
}

.workspace-message__rendered-html > :last-child {
  margin-bottom: 0;
}

.workspace-message--user {
  justify-self: end;
  border-color: var(--ai-button-link-border);
  background: var(--ai-button-link-bg);
}

.workspace-message--user .workspace-message__avatar {
  border-color: var(--ai-button-link-border);
  background: var(--ai-button-link-bg);
  color: var(--ai-info-on-soft);
}

.workspace-message--user .workspace-message__avatar-icon {
  mask-image: url("../assets/icons/chat-user-bust.svg");
  -webkit-mask-image: url("../assets/icons/chat-user-bust.svg");
}

.workspace-message-edit-input {
  display: block;
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid rgba(142, 194, 255, 0.34);
  border-radius: 10px;
  background: var(--ai-workspace-code-bg);
  color: var(--ai-text);
  font: inherit;
  line-height: 1.55;
  padding: 10px 12px;
  outline: none;
}

.workspace-message-edit-input:focus {
  border-color: var(--ai-workspace-info-border-strong);
  box-shadow: var(--ai-input-focus-shadow);
}

.workspace-message--assistant {
  justify-self: start;
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
}

.workspace-message--assistant .workspace-message__avatar {
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
  color: var(--ai-accent-on-soft);
}

.workspace-message--status {
  border-color: var(--ai-workspace-info-border);
  background: var(--ai-workspace-info-soft);
}

.workspace-message--status strong {
  color: var(--ai-workspace-info-on-soft);
}

.workspace-message--status .workspace-message__content {
  color: var(--ai-text-soft);
  font-size: 13px;
}

.workspace-message--status .workspace-message__avatar {
  border-color: var(--ai-workspace-info-border);
  background: var(--ai-workspace-info-soft);
  color: var(--ai-workspace-info-on-soft);
}

.workspace-execution-activity {
  box-sizing: border-box;
  justify-self: start;
  width: min(760px, 88%);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ai-workspace-info-border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--ai-workspace-info-soft) 78%, var(--ai-panel));
  box-shadow: 0 12px 28px rgba(3, 8, 20, 0.16);
}

.workspace-execution-activity__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--ai-workspace-info-border);
  background: color-mix(in srgb, var(--ai-workspace-info-soft) 88%, transparent);
  color: var(--ai-text);
  text-align: left;
  cursor: pointer;
}

.workspace-execution-activity__header:hover {
  background: color-mix(in srgb, var(--ai-workspace-info-soft) 72%, var(--ai-accent-soft));
}

.workspace-execution-activity__heading,
.workspace-execution-activity__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workspace-execution-activity__heading > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--ai-workspace-info-on-soft);
}

.workspace-execution-activity__heading strong,
.workspace-execution-activity__heading small {
  display: block;
  min-width: 0;
}

.workspace-execution-activity__heading strong {
  color: var(--ai-text);
  font-size: 13px;
  line-height: 1.2;
}

.workspace-execution-activity__heading small {
  margin-top: 2px;
  color: var(--ai-muted);
  font-size: 10.5px;
  line-height: 1.2;
}

.workspace-execution-activity__meta {
  flex: 0 0 auto;
  color: var(--ai-workspace-info-on-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-execution-activity__meta svg {
  width: 17px;
  height: 17px;
  transition: transform 160ms ease;
}

.workspace-execution-activity--collapsed .workspace-execution-activity__header {
  border-bottom-color: transparent;
}

.workspace-execution-activity--collapsed .workspace-execution-activity__meta svg {
  transform: rotate(-90deg);
}

.workspace-execution-activity--collapsed .workspace-execution-activity__viewport {
  display: none;
}

.workspace-execution-activity__viewport {
  box-sizing: border-box;
  display: grid;
  gap: 6px;
  height: 204px;
  max-height: 204px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-accent-border) transparent;
}

.workspace-execution-activity__viewport::-webkit-scrollbar {
  width: 7px;
}

.workspace-execution-activity__viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--ai-accent-border);
}

.workspace-execution-activity__item {
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: 60px;
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ai-panel) 84%, transparent);
  color: var(--ai-text);
}

.workspace-execution-activity__item-main {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  flex: 1 1 auto;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--ai-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace-execution-activity__item:hover {
  border-color: var(--ai-workspace-info-border-strong);
  background: color-mix(in srgb, var(--ai-workspace-info-soft) 58%, var(--ai-panel));
}

.workspace-execution-activity__item-main:focus-visible,
.workspace-execution-activity__browser-button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--ai-workspace-info-border-strong);
}

.workspace-execution-activity__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ai-muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ai-muted) 14%, transparent);
}

.workspace-execution-activity__item--running .workspace-execution-activity__status-dot {
  background: var(--ai-info);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ai-info) 16%, transparent);
  animation: workspaceToolProcessPulse 1.8s ease-in-out infinite;
}

.workspace-execution-activity__item--completed .workspace-execution-activity__status-dot {
  background: var(--ai-success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ai-success) 16%, transparent);
}

.workspace-execution-activity__item--failed .workspace-execution-activity__status-dot,
.workspace-execution-activity__item--blocked .workspace-execution-activity__status-dot {
  background: var(--ai-danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ai-danger) 16%, transparent);
}

.workspace-execution-activity__item-body,
.workspace-execution-activity__item-head {
  min-width: 0;
}

.workspace-execution-activity__item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-execution-activity__item-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ai-text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-execution-activity__item-head > span {
  flex: 0 0 auto;
  color: var(--ai-workspace-info-on-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-execution-activity__item-body > small {
  display: -webkit-box;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ai-text-soft);
  font-size: 10.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.workspace-execution-activity__item-main > time {
  align-self: end;
  color: var(--ai-muted);
  font-size: 9px;
  white-space: nowrap;
}

.workspace-execution-activity__browser-button {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 30px;
  margin: 8px 10px 8px 0;
  padding: 6px 10px;
  white-space: nowrap;
}

.workspace-execution-activity__browser-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.workspace-message--tool-result {
  box-sizing: border-box;
  min-width: 0;
  max-width: 82%;
  width: min(560px, 82%);
  padding: 12px 14px 10px 56px;
  border-color: color-mix(in srgb, var(--ai-success) 28%, transparent);
  background: var(--ai-green-soft);
}

.workspace-message--tool-result .workspace-message__avatar {
  top: 13px;
  left: 14px;
  right: auto;
  border-color: color-mix(in srgb, var(--ai-success) 34%, transparent);
  background: var(--ai-green-soft);
  color: var(--ai-success-on-soft);
}

.workspace-message--tool-result-failed {
  border-color: color-mix(in srgb, var(--ai-danger) 34%, transparent);
  background: var(--ai-red-soft);
}

.workspace-message--tool-result-failed .workspace-message__avatar {
  border-color: color-mix(in srgb, var(--ai-danger) 38%, transparent);
  background: var(--ai-red-soft);
  color: var(--ai-danger-on-soft);
}

.workspace-message--tool-result-collapsed {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 14px;
}

.workspace-message--tool-result-collapsed .workspace-message__avatar {
  position: static;
  flex: 0 0 auto;
}

.workspace-message--tool-result-collapsed > strong {
  display: none;
}

.workspace-tool-result-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace-message--tool-result-collapsed .workspace-tool-result-toggle {
  flex: 1 1 auto;
  margin-bottom: 0;
}

.workspace-tool-result-toggle__chevron {
  width: 17px;
  height: 17px;
  color: var(--ai-muted);
  transition: transform 160ms ease;
}

.workspace-message--tool-result-collapsed .workspace-tool-result-toggle__chevron {
  transform: rotate(-90deg);
}

.workspace-message--tool-result-collapsed .workspace-tool-result-content,
.workspace-message--tool-result-collapsed .workspace-message-footer--status {
  display: none;
}

.workspace-tool-result-content {
  display: grid;
  gap: 8px;
}

.workspace-tool-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-tool-result-title svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: currentColor;
}

.workspace-tool-result-content {
  min-width: 0;
}

.workspace-tool-result-content p {
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-tool-result-content b {
  color: var(--ai-text);
}

.workspace-tool-result-details {
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

.workspace-tool-result-debug {
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 7px;
  color: var(--ai-success-on-soft);
  border-color: color-mix(in srgb, var(--ai-success) 28%, transparent);
  background: var(--ai-green-soft);
  font-size: 10.5px;
  font-weight: 500;
}

.workspace-browser-session-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  min-height: 30px;
  padding: 6px 10px;
  border-color: var(--ai-workspace-info-border);
  background: var(--ai-workspace-info-soft);
  color: var(--ai-workspace-info-on-soft);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

.workspace-browser-session-open svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.workspace-browser-viewer {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 1300;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(780px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  overflow: hidden;
  border: 1px solid var(--ai-workspace-info-border);
  border-radius: 14px;
  background: var(--ai-workspace-browser-bg);
  box-shadow: var(--ai-workspace-browser-shadow);
  backdrop-filter: blur(18px);
}

.workspace-browser-viewer.is-open {
  display: grid;
}

.workspace-browser-viewer.is-dragging {
  user-select: none;
}

.workspace-browser-viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ai-workspace-info-border);
  background: var(--ai-workspace-browser-header-bg);
  cursor: move;
}

.workspace-browser-viewer__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workspace-browser-viewer__title strong,
.workspace-browser-viewer__title small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-browser-viewer__title strong {
  color: var(--ai-text);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-browser-viewer__title small {
  color: var(--ai-muted);
  font-size: 11px;
}

.workspace-browser-viewer__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--ai-workspace-info-border);
  border-radius: 10px;
  background: var(--ai-workspace-info-soft);
  color: var(--ai-workspace-info-on-soft);
}

.workspace-browser-viewer__icon svg {
  width: 19px;
  height: 19px;
}

.workspace-browser-viewer__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.workspace-browser-viewer__body {
  position: relative;
  display: grid;
  min-height: 0;
  padding: 10px;
}

.workspace-browser-viewer__body img {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(93, 110, 138, 0.28);
  border-radius: 10px;
  background: var(--ai-workspace-preview-frame-bg);
  object-fit: contain;
}

.workspace-browser-viewer__state {
  align-self: center;
  justify-self: center;
  max-width: 80%;
  color: var(--ai-muted);
  font-size: 13px;
  text-align: center;
}

.workspace-browser-viewer__state--error {
  color: var(--ai-danger-on-soft);
}

.workspace-message--tool-process {
  box-sizing: border-box;
  min-width: 0;
  max-width: 84%;
  width: min(620px, 84%);
  padding: 12px 14px 10px 56px;
  border-color: var(--ai-workspace-info-border);
  background: var(--ai-workspace-info-soft);
}

.workspace-message--tool-process .workspace-message__avatar {
  top: 13px;
  left: 14px;
  right: auto;
  border-color: var(--ai-workspace-info-border-strong);
  background: var(--ai-workspace-info-soft);
  color: var(--ai-workspace-info-on-soft);
}

.workspace-message--tool-process-active {
  animation: workspaceToolProcessPulse 1.8s ease-in-out infinite;
}

.workspace-message--tool-process-completed {
  border-color: color-mix(in srgb, var(--ai-success) 32%, transparent);
  background: var(--ai-green-soft);
}

.workspace-message--tool-process-completed .workspace-message__avatar {
  border-color: color-mix(in srgb, var(--ai-success) 38%, transparent);
  background: var(--ai-green-soft);
  color: var(--ai-success-on-soft);
}

.workspace-message--tool-process-failed {
  border-color: color-mix(in srgb, var(--ai-danger) 34%, transparent);
  background: var(--ai-red-soft);
}

.workspace-message--tool-process-failed .workspace-message__avatar {
  border-color: color-mix(in srgb, var(--ai-danger) 38%, transparent);
  background: var(--ai-red-soft);
  color: var(--ai-danger-on-soft);
}

.workspace-message--tool-process-cancelled {
  border-color: var(--ai-line);
  background: var(--ai-control-bg);
}

.workspace-message--tool-process-collapsed {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 14px;
}

.workspace-message--tool-process-collapsed .workspace-message__avatar {
  position: static;
  flex: 0 0 auto;
}

.workspace-message--tool-process-collapsed > strong {
  display: none;
}

.workspace-tool-process-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace-message--tool-process-collapsed .workspace-tool-process-toggle {
  flex: 1 1 auto;
  margin-bottom: 0;
}

.workspace-tool-process-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.workspace-tool-process-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tool-process-title svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.workspace-tool-process-toggle__chevron {
  width: 17px;
  height: 17px;
  color: var(--ai-muted);
  transition: transform 160ms ease;
}

.workspace-message--tool-process-collapsed .workspace-tool-process-toggle__chevron {
  transform: rotate(-90deg);
}

.workspace-message--tool-process-collapsed .workspace-tool-process-content,
.workspace-message--tool-process-collapsed .workspace-message-footer--status {
  display: none;
}

.workspace-tool-process-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.workspace-tool-process-message {
  min-width: 0;
  min-height: 64px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 13px;
  border: 1px solid var(--ai-workspace-info-border);
  border-radius: 10px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-tool-process-message p {
  margin: 0;
  color: var(--ai-text-soft);
  font-size: 14px;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-tool-process-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.workspace-tool-process-grid div {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 22px;
  padding: 3px 6px;
  border: 1px solid var(--ai-line);
  border-radius: 6px;
  background: var(--ai-workspace-card-bg);
}

.workspace-tool-process-grid span {
  flex: 0 0 auto;
  color: var(--ai-muted);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-tool-process-grid strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ai-text);
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tool-process-progress {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-tool-process-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58c7ff, #5ee0a0);
}

.workspace-tool-process-progress--indeterminate span {
  position: absolute;
  width: 38%;
  animation: workspaceToolProcessBar 1.35s ease-in-out infinite;
}

.workspace-tool-process-history-btn {
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

@keyframes workspaceToolProcessPulse {
  0%, 100% {
    box-shadow: 0 0 0 color-mix(in srgb, var(--ai-info) 0%, transparent);
  }
  50% {
    box-shadow: 0 0 24px color-mix(in srgb, var(--ai-info) 14%, transparent);
  }
}

@keyframes workspaceToolProcessBar {
  0% {
    left: -40%;
  }
  100% {
    left: 104%;
  }
}

.workspace-message--handoff-group {
  box-sizing: border-box;
  min-width: 0;
  max-width: 88%;
  width: min(720px, 88%);
  padding: 13px 14px 10px 56px;
}

.workspace-message--handoff-group .workspace-message__avatar {
  top: 13px;
  left: 14px;
  right: auto;
}

.workspace-message--handoff-collapsed {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 14px;
}

.workspace-message--handoff-collapsed .workspace-message__avatar {
  position: static;
  flex: 0 0 auto;
}

.workspace-handoff-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace-handoff-toggle__title {
  min-width: 0;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-handoff-toggle__meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ai-muted);
  font-size: 11px;
  white-space: nowrap;
}

.workspace-handoff-toggle svg {
  width: 17px;
  height: 17px;
  color: var(--ai-muted);
  transition: transform 160ms ease;
}

.workspace-message--handoff-collapsed .workspace-handoff-toggle {
  flex: 1 1 auto;
  margin-bottom: 0;
}

.workspace-message--handoff-collapsed .workspace-handoff-toggle svg {
  transform: rotate(-90deg);
}

.workspace-handoff-content {
  display: block;
  min-width: 0;
}

.workspace-message--handoff-collapsed .workspace-handoff-content {
  display: none;
}

.workspace-handoff-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workspace-handoff-row {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--ai-workspace-info-border);
  border-radius: 7px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-handoff-row span {
  color: var(--ai-text-soft);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.workspace-handoff-row strong {
  display: inline;
  margin: 0;
  color: var(--ai-text);
  font-size: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.workspace-handoff-row small {
  color: var(--ai-muted);
  font-size: 12px;
  line-height: 1.45;
}

.workspace-message .workspace-message-footer--status {
  justify-content: flex-end;
}

.workspace-message--handoff-collapsed .workspace-message-footer--status {
  display: none;
}

.workspace-message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--ai-workspace-message-footer-border);
}

.workspace-message--user .workspace-message-footer {
  flex-direction: row-reverse;
}

.workspace-message-timestamp {
  flex: 0 0 auto;
  color: var(--ai-muted);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.workspace-message-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.workspace-message-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ai-workspace-message-action-border);
  border-radius: 10px;
  background: var(--ai-workspace-message-action-bg);
  color: var(--ai-muted);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.workspace-message-action:hover,
.workspace-message-action:focus-visible,
.workspace-message-action--done {
  border-color: var(--ai-workspace-info-border-strong);
  background: var(--ai-workspace-info-soft);
  color: var(--ai-text);
  transform: translateY(-1px);
  outline: none;
}

.workspace-message-action--active {
  border-color: color-mix(in srgb, var(--ai-success) 55%, transparent);
  background: var(--ai-green-soft);
  color: var(--ai-text);
}

.workspace-message-action--cancel-edit,
.workspace-message-action--resend {
  display: none;
}

.workspace-message--editing .workspace-message-action--edit {
  display: none;
}

.workspace-message--editing .workspace-message-action--cancel-edit,
.workspace-message--editing .workspace-message-action--resend {
  display: inline-flex;
}

.workspace-message-action:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  transform: none;
}

.workspace-message-action svg {
  width: 16px;
  height: 16px;
}

.workspace-message-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.workspace-message-fullscreen--open {
  display: block;
}

.workspace-message-fullscreen-open {
  overflow: hidden;
}

.workspace-message-fullscreen__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: var(--ai-workspace-message-fullscreen-backdrop);
  cursor: pointer;
}

.workspace-message-fullscreen__panel {
  position: absolute;
  inset: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--ai-workspace-message-fullscreen-panel-border);
  border-radius: 26px;
  background: var(--ai-workspace-message-fullscreen-panel-bg);
  box-shadow: var(--ai-workspace-message-fullscreen-shadow);
  overflow: hidden;
}

.workspace-message-fullscreen__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--ai-line);
}

.workspace-message-fullscreen__header h2 {
  margin: 0;
  color: var(--ai-text);
  font-size: 19px;
}

.workspace-message-fullscreen__body {
  overflow: auto;
  padding: clamp(22px, 4vw, 54px);
}

.workspace-message-fullscreen__body .workspace-message__content {
  max-width: 960px;
  margin: 0 auto;
  color: var(--ai-text);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.75;
  text-align: justify;
}

.workspace-message-fullscreen__body .workspace-message__content p {
  color: inherit;
}

.workspace-message-fullscreen__body .workspace-message__rendered-html {
  color: var(--ai-text);
}

.workspace-message-fullscreen__body .workspace-message__rendered-html :where(p, li, td, th) {
  color: inherit;
}

.workspace-tool-detail-modal__panel {
  width: min(980px, calc(100vw - 36px));
}

.workspace-execution-activity-modal__panel {
  width: min(1040px, calc(100vw - 36px));
  max-height: min(820px, calc(100vh - 36px));
}

.workspace-execution-activity-detail {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
}

.workspace-execution-activity-detail .workspace-execution-plan {
  margin: 0;
}

.workspace-execution-activity-detail .workspace-tool-detail__section pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
}

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

.workspace-execution-activity-io__box {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ai-panel) 90%, var(--ai-workspace-info-soft));
}

.workspace-execution-activity-io__box h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ai-line);
  color: var(--ai-text);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-execution-activity-io__content {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-accent-border) transparent;
}

.workspace-execution-activity-io__content pre {
  box-sizing: border-box;
  min-width: max-content;
  min-height: 180px;
  margin: 0;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--ai-text-soft);
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.workspace-execution-activity-io__empty {
  margin: 0;
  padding: 14px;
  color: var(--ai-muted);
  font-size: 12px;
  line-height: 1.55;
}

.workspace-execution-activity-detail__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--ai-line);
}

.workspace-execution-activity--modal {
  justify-self: stretch;
  width: 100%;
  max-width: none;
  box-shadow: none;
}

.workspace-execution-activity--modal .workspace-execution-activity__header {
  cursor: default;
}

.workspace-execution-activity-empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 36px;
  color: var(--ai-muted);
  text-align: center;
}

.workspace-execution-activity-empty > svg {
  width: 32px;
  height: 32px;
  margin-bottom: 10px;
  color: var(--ai-workspace-info-on-soft);
}

.workspace-execution-activity-empty strong {
  color: var(--ai-text);
}

.workspace-execution-activity-empty p {
  max-width: 420px;
  margin: 6px 0 0;
}

.workspace-tool-prompt-debug-modal__panel {
  width: min(1320px, calc(100vw - 28px));
}

.workspace-file-preview-modal__panel {
  width: min(1840px, calc(100vw - 24px));
}

.workspace-file-list-modal__panel {
  width: min(70vw, calc(100vw - 28px));
}

.workspace-file-preview {
  display: grid;
  gap: 14px;
}

.workspace-file-more-row {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding-top: 10px;
  margin-top: 6px;
  padding-bottom: 0;
}

.workspace-file-more-button {
  width: 100%;
  justify-content: center;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-slot:nth-of-type(n+4) {
  display: none;
}

.workspace-file-pane .chat-reference-rail--scroll {
  gap: 8px;
  min-height: calc((82px * 3) + (8px * 2));
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-slot {
  min-height: 82px;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-slot:hover,
.workspace-file-pane .chat-reference-rail--scroll .chat-reference-slot:focus-within {
  min-height: 124px;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card {
  min-height: 82px;
  gap: 4px;
  padding: 8px;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card:hover {
  width: min(640px, calc(100vw - 120px));
  min-height: 124px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card__type {
  padding: 3px 6px;
  font-size: 8.5px;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card strong {
  font-size: 11.5px;
  line-height: 1.2;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card small {
  font-size: 10.5px;
  line-height: 1.2;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card code {
  font-size: 10px;
  line-height: 1.2;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card__chunk {
  font-size: 10px;
  line-height: 1.25;
  -webkit-line-clamp: 1;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card__meta {
  gap: 3px;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card__meta span {
  padding: 2px 5px;
  border-radius: 6px;
  font-size: 8px;
}

.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card:hover strong,
.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card:hover small,
.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card:hover code,
.workspace-file-pane .chat-reference-rail--scroll .chat-reference-card:hover .chat-reference-card__meta span {
  white-space: normal;
}

.workspace-file-list-modal__body {
  overflow: hidden;
}

.workspace-file-list-full {
  display: grid;
  gap: 10px;
  overflow: auto;
  max-height: min(680px, calc(100vh - 190px));
  padding-right: 4px;
}

.workspace-file-list-full .chat-reference-slot {
  min-height: auto;
}

.workspace-file-list-full .chat-reference-card {
  position: static;
  min-height: 94px;
}

.workspace-file-list-full .chat-reference-card:hover {
  width: 100%;
  min-height: 112px;
}

.workspace-file-preview__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.workspace-file-preview__meta-row {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-file-preview__meta-row span {
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workspace-file-preview__meta-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ai-text);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-file-preview__viewer {
  overflow: hidden;
  min-height: 520px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-workspace-preview-bg);
}

.workspace-file-preview__frame {
  display: block;
  width: 100%;
  min-height: 620px;
  border: 0;
  background: var(--ai-workspace-preview-frame-bg);
}

.workspace-file-preview__image {
  display: grid;
  place-items: center;
  min-height: 520px;
  margin: 0;
  padding: 18px;
}

.workspace-file-preview__image img {
  display: block;
  max-width: 100%;
  max-height: 680px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: var(--ai-workspace-preview-image-shadow);
}

.workspace-file-preview__fallback {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 520px;
  padding: 28px;
  text-align: center;
}

.workspace-file-preview__fallback-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--ai-workspace-info-border);
  border-radius: 16px;
  color: var(--ai-workspace-info-on-soft);
  background: var(--ai-workspace-info-soft);
}

.workspace-file-preview__fallback-icon svg {
  width: 26px;
  height: 26px;
}

.workspace-file-preview__fallback h3,
.workspace-file-preview__text h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 14px;
}

.workspace-file-preview__fallback p,
.workspace-file-preview__text p {
  max-width: 720px;
  margin: 0;
  color: var(--ai-text-soft);
}

.workspace-file-preview__fallback pre,
.workspace-file-preview__text pre,
.workspace-file-preview__inline-text pre {
  width: min(760px, 100%);
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-workspace-code-bg);
  color: var(--ai-text-soft);
  font-family: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  white-space: pre-wrap;
}

.workspace-file-preview__inline-text {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 520px;
  padding: 18px;
}

.workspace-file-preview__inline-text h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 14px;
}

.workspace-file-preview__inline-text pre {
  width: 100%;
  max-height: 560px;
}

.workspace-file-preview__table-wrap {
  overflow: auto;
  max-height: 620px;
  padding: 12px;
}

.workspace-file-preview__table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  color: var(--ai-text-soft);
  font-size: 12px;
}

.workspace-file-preview__table th,
.workspace-file-preview__table td {
  padding: 8px 10px;
  border: 1px solid var(--ai-workspace-table-border);
  text-align: left;
  vertical-align: top;
}

.workspace-file-preview__table th {
  color: var(--ai-workspace-table-header-text);
  background: var(--ai-workspace-table-header-bg);
}

.workspace-file-preview__text {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-tool-detail,
.workspace-tool-process-history {
  gap: 16px;
}

.workspace-tool-process-modal__panel {
  width: min(1040px, calc(100vw - 36px));
}

.workspace-archive-modal__panel {
  width: min(1080px, calc(100vw - 36px));
}

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

.workspace-tool-detail__row {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-tool-detail__row span {
  color: var(--ai-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-tool-detail__row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ai-text);
  font-size: 13px;
}

.workspace-tool-detail__section {
  display: grid;
  gap: 8px;
}

.workspace-tool-detail__section h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 13px;
}

.workspace-tool-detail__section p {
  margin: 0;
  color: var(--ai-text-soft);
}

.workspace-tool-detail__section pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-workspace-code-bg);
  color: var(--ai-text-soft);
  font-family: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.workspace-tool-detail__section--error {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--ai-danger) 32%, transparent);
  border-radius: 12px;
  background: var(--ai-red-soft);
}

.workspace-tool-detail__section--prompt-debug {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--ai-success) 24%, transparent);
  border-radius: 12px;
  background: var(--ai-green-soft);
}

.workspace-tool-detail-prompt-list {
  display: grid;
  gap: 10px;
}

.workspace-tool-detail-prompt-item {
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-tool-detail-prompt-item summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  color: var(--ai-text-soft);
  cursor: pointer;
}

.workspace-tool-detail-prompt-item summary span {
  overflow: hidden;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tool-detail-prompt-item summary small {
  overflow: hidden;
  color: var(--ai-muted);
  font-size: 10.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tool-detail-prompt-item pre {
  max-height: 360px;
  margin: 0;
}

.workspace-tool-detail-prompt-item__body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--ai-line);
}

.workspace-tool-detail-prompt-item__grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-tool-prompt-debug {
  gap: 14px;
}

.workspace-tool-prompt-debug__layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.32fr) minmax(0, 1fr);
  gap: 14px;
  min-height: min(680px, calc(100vh - 190px));
}

.workspace-tool-prompt-debug__list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: min(680px, calc(100vh - 190px));
  overflow: auto;
  padding-right: 4px;
}

.workspace-tool-prompt-debug__item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ai-line);
  border-radius: 9px;
  background: var(--ai-workspace-muted-card-bg);
  color: var(--ai-text-soft);
  text-align: left;
  cursor: pointer;
}

.workspace-tool-prompt-debug__item:hover,
.workspace-tool-prompt-debug__item:focus-visible,
.workspace-tool-prompt-debug__item.is-active {
  border-color: var(--ai-workspace-info-border-strong);
  background: var(--ai-workspace-info-soft);
  color: var(--ai-text);
  outline: none;
}

.workspace-tool-prompt-debug__item strong {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tool-prompt-debug__item small {
  overflow: hidden;
  color: var(--ai-muted);
  font-size: 10.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tool-prompt-debug__detail {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  max-height: min(680px, calc(100vh - 190px));
  overflow: auto;
  padding-right: 4px;
}

.workspace-tool-prompt-debug__detail .workspace-tool-detail__section pre {
  max-height: min(430px, calc(100vh - 360px));
  white-space: pre-wrap;
}

.workspace-tool-process-history-list {
  display: grid;
  gap: 10px;
}

.workspace-archive-history,
.workspace-archive-history-list {
  display: grid;
  gap: 14px;
}

.workspace-archive-group {
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-archive-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  color: var(--ai-text);
}

.workspace-archive-group summary span {
  font-weight: 700;
}

.workspace-archive-group summary small {
  color: var(--ai-muted);
  font-size: 12px;
}

.workspace-archive-group__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 14px;
}

.workspace-archive-message-list {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.workspace-archive-message {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  background: var(--ai-workspace-card-bg);
}

.workspace-archive-message--user {
  border-color: var(--ai-button-link-border);
  background: var(--ai-button-link-bg);
}

.workspace-archive-message--assistant {
  border-color: var(--ai-accent-border);
  background: var(--ai-accent-soft);
}

.workspace-archive-message--failed {
  border-color: color-mix(in srgb, var(--ai-danger) 34%, transparent);
}

.workspace-archive-message__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workspace-archive-message__meta strong {
  color: var(--ai-text);
  font-size: 12px;
}

.workspace-archive-message__meta time {
  color: var(--ai-muted);
  font-size: 11px;
  white-space: nowrap;
}

.workspace-archive-message p,
.workspace-archive-message small {
  margin: 0;
  color: var(--ai-text-soft);
  white-space: pre-wrap;
}

.workspace-tool-process-history-item {
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  background: var(--ai-workspace-muted-card-bg);
}

.workspace-tool-process-history-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  color: var(--ai-text);
  cursor: pointer;
  list-style: none;
}

.workspace-tool-process-history-item summary::-webkit-details-marker {
  display: none;
}

.workspace-tool-process-history-item summary span {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tool-process-history-item summary time {
  flex: 0 0 auto;
  color: var(--ai-muted);
  font-size: 11px;
}

.workspace-tool-process-history-item > p {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--ai-text-soft);
  font-size: 13px;
}

.workspace-tool-process-history-item .workspace-tool-detail__grid,
.workspace-tool-process-history-item .workspace-tool-detail__section {
  margin: 0 12px 12px;
}

.workspace-prompt {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--ai-line);
  background: var(--ai-workspace-expanded-header-bg);
  z-index: 4;
}

.workspace-prompt textarea {
  max-height: 96px;
  resize: none;
}

.workspace-prompt__settings {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.workspace-prompt-attachments {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  background: var(--ai-workspace-message-action-bg);
}

.workspace-prompt-attachments[hidden] {
  display: none;
}

.workspace-prompt-attachments__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ai-text-soft);
  font-size: 11px;
}

.workspace-prompt-attachments__header strong {
  color: var(--ai-text);
  font-size: 12px;
}

.workspace-prompt-attachments__summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.workspace-prompt-attachments__summary > button {
  padding: 3px 7px;
  border: 1px solid var(--ai-line);
  border-radius: 7px;
  color: var(--ai-text-soft);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.workspace-prompt-attachments__summary > button:hover,
.workspace-prompt-attachments__summary > button:focus-visible {
  color: var(--ai-danger);
  border-color: color-mix(in srgb, var(--ai-danger) 42%, transparent);
  background: color-mix(in srgb, var(--ai-danger) 10%, transparent);
  outline: none;
}

.workspace-prompt-attachments__summary > button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.workspace-prompt-attachments__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-prompt-attachment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: min(100%, 350px);
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-panel);
}

.workspace-prompt-attachment .workspace-file-icon {
  width: 34px;
  height: 40px;
}

.workspace-prompt-attachment__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workspace-prompt-attachment__body strong,
.workspace-prompt-attachment__body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-prompt-attachment__body strong {
  color: var(--ai-text);
  font-size: 12px;
}

.workspace-prompt-attachment__body small {
  color: var(--ai-muted);
  font-size: 10px;
}

.workspace-prompt-attachment > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 28px;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  color: var(--ai-muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}

.workspace-prompt-attachment > button:hover,
.workspace-prompt-attachment > button:focus-visible {
  color: var(--ai-danger);
  border-color: color-mix(in srgb, var(--ai-danger) 42%, transparent);
  background: color-mix(in srgb, var(--ai-danger) 14%, transparent);
  outline: none;
}

.workspace-prompt-attachment > button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.workspace-prompt-attachment > button svg {
  width: 16px;
  height: 16px;
}

.workspace-prompt__setting {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--ai-text-soft);
}

.workspace-prompt__setting > span {
  color: var(--ai-text-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.workspace-prompt__setting select {
  width: auto;
  min-height: 32px;
  padding: 5px 30px 5px 10px;
  border-radius: 9px;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.workspace-prompt__reasoning select,
.workspace-prompt__effort select {
  min-width: 118px;
}

.workspace-prompt__voice-mode select {
  min-width: 126px;
}

.workspace-prompt__setting select:disabled {
  opacity: 0.55;
}

.workspace-prompt__actions {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
}

.workspace-prompt__utility-actions {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
}

.workspace-prompt-voice-button,
.workspace-prompt-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ai-line);
  border-radius: 12px;
  color: var(--ai-muted);
  background: var(--ai-workspace-message-action-bg);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.workspace-prompt-voice-button:hover,
.workspace-prompt-voice-button:focus-visible,
.workspace-prompt-upload-button:hover,
.workspace-prompt-upload-button:focus-visible {
  color: var(--ai-workspace-info-on-soft);
  border-color: var(--ai-workspace-info-border-strong);
  background: var(--ai-workspace-info-soft);
  outline: none;
  transform: translateY(-1px);
}

.workspace-prompt-voice-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.workspace-prompt-voice-button.is-listening {
  color: var(--ai-workspace-info-on-soft);
  border-color: var(--ai-workspace-info-border-strong);
  background: var(--ai-workspace-info-soft);
  box-shadow: 0 0 0 3px rgba(88, 199, 255, 0.12);
  animation: workspace-voice-pulse 1.6s ease-in-out infinite;
}

.workspace-prompt-voice-button svg,
.workspace-prompt-upload-button svg {
  width: 19px;
  height: 19px;
}

.workspace-prompt-voice-status {
  grid-column: 1 / -1;
  color: var(--ai-text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.workspace-prompt-voice-status.is-listening {
  color: var(--ai-workspace-info-on-soft);
}

.workspace-prompt-voice-status.is-error {
  color: #ff9ca7;
}

@keyframes workspace-voice-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(88, 199, 255, 0.1); }
  50% { box-shadow: 0 0 0 7px rgba(88, 199, 255, 0.02); }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-prompt-voice-button.is-listening {
    animation: none;
  }
}

.workspace-chat-upload-form {
  display: grid;
  gap: 14px;
}

.workspace-chat-upload-picker {
  display: grid;
  gap: 8px;
}

.workspace-chat-upload-picker > span {
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workspace-chat-upload-picker small {
  color: var(--ai-muted);
}

.workspace-chat-upload-picker__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--ai-workspace-info-border);
  border-radius: 12px;
  color: var(--ai-workspace-info-on-soft);
  background: var(--ai-workspace-browser-header-bg);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.workspace-chat-upload-picker__button:hover,
.workspace-chat-upload-picker__button:focus-within {
  border-color: rgba(88, 199, 255, 0.48);
  background: linear-gradient(135deg, rgba(88, 199, 255, 0.22), rgba(154, 131, 255, 0.16));
  transform: translateY(-1px);
}

.workspace-chat-upload-picker__button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.workspace-chat-upload-picker__button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.workspace-chat-upload-picker__button strong {
  font-size: 13px;
  font-weight: 900;
}

.workspace-chat-upload-progress {
  margin: 0;
}

.workspace-chat-upload-form .muted-copy.is-error {
  color: #ff9ca7;
}

.workspace-prompt small {
  grid-column: 1 / -1;
  color: var(--ai-muted);
}

.tool-llm-config {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(88, 199, 255, 0.18);
  border-radius: var(--ai-radius-sm);
  background: rgba(88, 199, 255, 0.045);
}

.tool-llm-config__builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.tool-llm-config__add {
  min-height: 42px;
}

.tool-llm-config__list,
.tool-llm-config__table {
  display: grid;
  gap: 8px;
}

.tool-llm-config__row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--ai-line);
  border-radius: 10px;
  background: var(--ai-workspace-muted-card-bg);
}

.tool-llm-config__row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tool-llm-config__row small {
  color: rgba(185, 197, 214, 0.7);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-llm-config__row b,
.tool-llm-config__row code {
  min-width: 0;
  overflow: hidden;
  color: var(--ai-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-llm-config__delete {
  min-width: 82px;
}

.tool-llm-config__empty,
.tool-llm-config__error {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed rgba(93, 110, 138, 0.3);
  border-radius: 10px;
  color: var(--ai-muted);
  font-size: 12px;
}

.tool-llm-config__error {
  border-color: rgba(255, 107, 122, 0.34);
  background: rgba(255, 107, 122, 0.08);
  color: #ffb3bd;
}

.tool-llm-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-llm-detail-list span {
  display: inline-grid;
  gap: 2px;
  min-width: 160px;
  padding: 9px 10px;
  border: 1px solid rgba(88, 199, 255, 0.18);
  border-radius: 10px;
  background: rgba(88, 199, 255, 0.07);
}

.tool-llm-detail-list b {
  color: var(--ai-text);
  font-size: 12px;
}

.tool-llm-detail-list code,
.tool-llm-detail-list small {
  color: var(--ai-muted);
  font-size: 11px;
}

.ai-drawer--workspace-docs .ai-drawer__panel {
  width: min(720px, calc(100vw - 28px));
}

.agent-firewall-hero {
  margin-bottom: 18px;
}

.firewall-dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.firewall-dashboard .detail-card span {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.agent-permission-tabs__nav {
  display: flex;
  gap: 0;
  padding: 8px 8px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--ai-line);
}

.agent-permission-tabs__button {
  position: relative;
  min-height: 46px;
  padding: 11px 18px;
  color: var(--ai-text-soft);
  background: rgba(141, 153, 174, 0.06);
  border: 1px solid var(--ai-line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-right: 6px;
  transform: translateY(1px);
}

.agent-permission-tabs__button:hover,
.agent-permission-tabs__button.is-active {
  color: var(--ai-text);
  background: linear-gradient(180deg, rgba(88, 199, 255, 0.2), rgba(12, 18, 27, 0.9));
  border-color: rgba(88, 199, 255, 0.44);
  box-shadow: 0 -8px 24px rgba(88, 199, 255, 0.08);
}

.agent-permission-tabs__button.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: #58c7ff;
  content: "";
}

.firewall-legend,
.firewall-bulk-actions,
.firewall-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.firewall-bulk-form {
  margin: 12px 0;
}

.firewall-matrix-toolbar {
  max-width: 420px;
  margin: 12px 0;
}

.user-agent-access-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
}

.user-agent-access-toolbar .field {
  width: min(100%, 440px);
}

.user-agent-access-summary {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  color: var(--ai-muted);
  background: var(--ai-workspace-card-bg);
  font-size: 11px;
}

.user-agent-access-summary strong {
  color: var(--ai-accent);
  font-size: 18px;
}

.user-agent-access-table-shell {
  max-height: 62vh;
  overflow: auto;
}

.user-agent-access-table td > strong,
.user-agent-access-table td > small {
  display: block;
}

.user-agent-access-table td > small {
  margin-top: 3px;
  color: var(--ai-muted);
  line-height: 1.45;
}

.access-flag {
  display: inline-flex;
  min-width: 58px;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid var(--ai-line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.access-flag--yes {
  color: #dffcf2;
  border-color: rgba(67, 209, 141, 0.42);
  background: rgba(67, 209, 141, 0.14);
}

.access-flag--no {
  color: #ffe1e5;
  border-color: rgba(255, 107, 122, 0.42);
  background: rgba(255, 107, 122, 0.12);
}

.firewall-matrix-shell {
  overflow: auto;
  max-height: 68vh;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: var(--ai-workspace-card-bg);
}

.firewall-matrix {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.firewall-matrix th,
.firewall-matrix td {
  border-right: 1px solid var(--ai-line);
  border-bottom: 1px solid var(--ai-line);
  padding: 8px;
  text-align: center;
  vertical-align: middle;
}

.firewall-matrix thead th,
.firewall-matrix tbody th {
  position: sticky;
  z-index: 2;
  color: var(--ai-text);
  background: rgba(12, 18, 27, 0.98);
  font-weight: 500;
}

.firewall-matrix thead th {
  top: 0;
  min-width: 164px;
}

.firewall-matrix tbody th {
  left: 0;
  min-width: 220px;
  text-align: left;
}

.firewall-matrix thead th:first-child {
  left: 0;
  z-index: 3;
}

.firewall-matrix th span,
.firewall-matrix th code {
  display: block;
}

.firewall-matrix th code {
  margin-top: 3px;
  color: var(--ai-muted);
  font-size: 11px;
}

.firewall-row-actions {
  margin-top: 8px;
}

.firewall-row-actions button {
  min-height: 24px;
  padding: 4px 7px;
  color: var(--ai-text-soft);
  background: rgba(141, 153, 174, 0.08);
  border: 1px solid var(--ai-line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.firewall-row-actions button:hover {
  color: var(--ai-text);
  border-color: rgba(154, 131, 255, 0.45);
}

.firewall-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ai-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.firewall-legend .firewall-cell {
  width: 104px;
  min-width: 104px;
  min-height: 28px;
  padding: 6px 8px;
  cursor: default;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
}

.firewall-matrix .firewall-cell {
  font-weight: 500;
}

.data-table .firewall-cell {
  font-weight: 400;
}

.firewall-cell--allowed {
  color: #dffcf2;
  background: rgba(67, 209, 141, 0.16);
  border-color: rgba(67, 209, 141, 0.42);
}

.firewall-cell--blocked {
  color: #ffe1e5;
  background: rgba(255, 107, 122, 0.16);
  border-color: rgba(255, 107, 122, 0.45);
}

.firewall-cell--boss {
  color: #fff3cf;
  background: rgba(246, 200, 95, 0.16);
  border-color: rgba(246, 200, 95, 0.46);
}

.firewall-cell--approval {
  color: #e8e2ff;
  background: rgba(154, 131, 255, 0.17);
  border-color: rgba(154, 131, 255, 0.48);
}

.firewall-cell--inactive {
  color: var(--ai-muted);
  background: rgba(141, 153, 174, 0.08);
  border-color: var(--ai-line);
}

.firewall-cell:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.firewall-create-grid,
.firewall-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: rgba(12, 18, 27, 0.56);
}

.firewall-create-grid .button-primary,
.firewall-create-grid .button-ghost,
.firewall-filter-grid .button-ghost {
  align-self: end;
}

.firewall-create-grid .field input,
.firewall-create-grid .field select,
.firewall-create-grid .field textarea,
.firewall-create-grid .field select option {
  font-weight: 400;
}

.firewall-quick-controls {
  display: grid;
  width: min(100%, 420px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1vh, 16px);
  align-items: start;
  align-content: start;
  justify-content: start;
  padding: clamp(8px, 1.25vh, 18px);
  border: 1px solid rgba(88, 199, 255, 0.26);
  border-radius: var(--ai-radius-sm);
  background: linear-gradient(135deg, rgba(88, 199, 255, 0.1), rgba(67, 209, 141, 0.06));
}

#firewall-rule-drawer .ai-drawer__header {
  gap: 10px;
  padding: clamp(12px, 1.5vh, 20px) 14px clamp(10px, 1.2vh, 16px);
}

#firewall-rule-drawer .ai-drawer__panel {
  width: min(480px, calc(100vw - 28px));
}

#firewall-rule-drawer .ai-drawer__body {
  gap: clamp(8px, 1vh, 16px);
  padding: clamp(12px, 1.8vh, 24px);
}

#firewall-rule-drawer .ai-drawer__actions {
  gap: 6px;
}

#firewall-rule-drawer .form-grid {
  grid-template-columns: 1fr;
  column-gap: 10px;
  row-gap: clamp(8px, 1.35vh, 22px);
  align-items: start;
  align-content: start;
}

#firewall-rule-drawer .field {
  width: min(100%, 420px);
  gap: clamp(4px, 0.45vh, 8px);
  align-self: start;
  align-content: start;
}

.firewall-quick-controls .field,
.firewall-quick-controls .firewall-scope-field {
  margin: 0;
}

#firewall-rule-drawer .field input,
#firewall-rule-drawer .field select,
#firewall-rule-drawer .field textarea {
  height: 48px;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
}

#firewall-rule-drawer .field select option {
  font-weight: 400;
}

#firewall-rule-drawer .field textarea {
  min-height: 48px;
  height: 48px;
}

.firewall-state-select {
  height: 48px;
  min-height: 48px;
  border-width: 1px;
  border-style: solid;
  font-weight: 400;
}

.firewall-state-select--allowed {
  color: #dffcf2;
  background-color: rgba(67, 209, 141, 0.16);
  border-color: rgba(67, 209, 141, 0.42);
}

.firewall-state-select--blocked {
  color: #ffe1e5;
  background-color: rgba(255, 107, 122, 0.16);
  border-color: rgba(255, 107, 122, 0.45);
}

.firewall-state-select--boss {
  color: #fff3cf;
  background-color: rgba(246, 200, 95, 0.16);
  border-color: rgba(246, 200, 95, 0.46);
}

.firewall-state-select--approval {
  color: #e8e2ff;
  background-color: rgba(154, 131, 255, 0.17);
  border-color: rgba(154, 131, 255, 0.48);
}

.firewall-state-select--inactive {
  color: var(--ai-muted);
  background-color: rgba(141, 153, 174, 0.08);
  border-color: var(--ai-line);
}

.firewall-scope-field {
  min-width: 0;
  padding: 0;
  border: 0;
}

.firewall-scope-field .field {
  width: 100%;
}

.firewall-locked-select select {
  pointer-events: none;
  color: var(--ai-text);
  background-image: none;
  border-color: rgba(141, 153, 174, 0.22);
  opacity: 0.82;
}

.advanced-settings {
  align-self: start;
  width: 100%;
  min-height: 0;
  padding: clamp(8px, 1.1vh, 16px);
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: rgba(141, 153, 174, 0.05);
}

#firewall-rule-drawer .advanced-settings {
  width: min(100%, 420px);
}

.advanced-settings summary {
  display: flex;
  align-items: center;
  height: 48px;
  min-height: 48px;
  padding: 10px 0;
  cursor: pointer;
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 900;
  list-style-position: inside;
}

#firewall-rule-drawer .button-primary--small,
#firewall-rule-drawer .button-danger--small,
#firewall-rule-drawer .button-ghost--small {
  height: 48px;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.2;
}

#firewall-rule-drawer .ai-icon-button {
  width: 48px;
  height: 48px;
  min-height: 48px;
}

.advanced-settings .form-grid {
  margin-top: clamp(8px, 1vh, 16px);
  padding: 0;
  border: 0;
  background: transparent;
}

.advanced-settings input[readonly] {
  cursor: pointer;
  background: rgba(88, 199, 255, 0.08);
  border-color: rgba(88, 199, 255, 0.24);
}

@media (max-height: 760px) {
  #firewall-rule-drawer .ai-drawer__body {
    padding: 12px;
  }

  #firewall-rule-drawer .form-grid {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .firewall-quick-controls,
  .advanced-settings {
    padding: 8px;
  }

  .advanced-settings .form-grid {
    margin-top: 8px;
  }
}

@media (max-width: 720px) {
  .firewall-quick-controls {
    width: 100%;
    grid-template-columns: 1fr;
  }

  #firewall-rule-drawer .field,
  .advanced-settings {
    width: 100%;
  }
}

.firewall-picker {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 14px;
}

.firewall-picker__panel {
  min-height: 360px;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: rgba(12, 18, 27, 0.56);
}

.firewall-picker__panel h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.firewall-picker__list,
.firewall-picker__selected {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.firewall-picker__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: rgba(8, 12, 19, 0.42);
}

.firewall-picker__item > div {
  min-width: 0;
}

.firewall-picker__item strong,
.firewall-picker__item code,
.firewall-picker__item p {
  display: block;
}

.firewall-picker__item strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firewall-picker__item code {
  display: none !important;
}

.firewall-picker__item p {
  margin: 6px 0 0;
  color: var(--ai-text-soft);
  font-size: 12px;
}

.firewall-picker__selected-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 10px 42px 10px 10px;
  border: 1px solid rgba(88, 199, 255, 0.3);
  border-radius: 8px;
  color: var(--ai-text);
  background: rgba(88, 199, 255, 0.1);
  cursor: pointer;
  font-weight: 500;
  text-align: left;
}

.firewall-picker__selected-item span:first-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.firewall-picker__selected-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #ffe1e5;
  background: rgba(255, 107, 122, 0.16);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  font-family: sans-serif;
}

.notice-card {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: rgba(141, 153, 174, 0.08);
}

.notice-card--warning {
  color: #fff3cf;
  border-color: rgba(246, 200, 95, 0.34);
  background: rgba(246, 200, 95, 0.1);
}

.firewall-tool-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 8px;
}

.firewall-tool-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  color: var(--ai-text-soft);
  border: 1px solid var(--ai-line);
  border-radius: 999px;
  background: rgba(141, 153, 174, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.ai-modal-open {
  overflow: hidden;
}

.ai-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  visibility: hidden;
}

.ai-modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

.ai-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 7, 13, 0.74);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ai-modal.is-open .ai-modal__backdrop {
  opacity: 1;
}

.ai-modal__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(780px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius);
  background: rgba(13, 20, 31, 0.98);
  box-shadow: var(--ai-shadow);
  transform: translate(-50%, -47%) scale(0.98);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ai-modal__panel--compact {
  width: min(520px, calc(100vw - 28px));
}

.ai-modal .workspace-file-preview-modal__panel {
  width: min(1560px, calc(100vw - 20px));
  max-height: min(920px, calc(100vh - 24px));
}

.ai-modal .workspace-file-list-modal__panel {
  width: min(70vw, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 36px));
}

.ai-modal.is-open .ai-modal__panel {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.ai-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--ai-line);
}

.ai-modal__header h2 {
  margin: 2px 0 0;
}

.ai-modal__body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 16px;
}

.ai-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--ai-line);
}

.ai-modal__body h3 {
  margin: 0;
}

.ai-modal__body p {
  color: var(--ai-text-soft);
}

.document-viewer {
  overflow: hidden;
  min-height: 315px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-workspace-code-bg);
}

.document-viewer iframe {
  display: block;
  width: 100%;
  height: 390px;
  border: 0;
  background: var(--ai-workspace-preview-frame-bg);
}

.matched-chunk-panel {
  display: grid;
  gap: 12px;
}

.section-heading--compact {
  gap: 10px;
}

.matched-chunk-list {
  display: grid;
  gap: 10px;
  max-height: 212px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-line-strong) var(--ai-scrollbar-track);
}

.matched-chunk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-workspace-card-bg);
}

.matched-chunk-textarea {
  height: 86px;
  min-height: 86px;
  max-height: 86px;
  resize: none;
  overflow: auto;
  padding: 9px;
  color: var(--ai-text-soft);
  background: var(--ai-workspace-code-bg);
  font-size: 12px;
  line-height: 1.35;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-line-strong) var(--ai-scrollbar-track);
}

.matched-chunk-actions {
  display: grid;
  align-content: start;
  justify-items: end;
  min-width: 0;
}

.matched-chunk-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(154, 131, 255, 0.42);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text);
  background: var(--ai-accent-soft);
  font-size: 13px;
  font-weight: 900;
}

.ai-modal__body pre {
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text-soft);
  background: var(--ai-workspace-code-bg);
  white-space: pre-wrap;
}

.asset-repository-panel {
  min-height: calc(100vh - 168px);
}

.asset-repository-heading {
  align-items: flex-start;
}

.asset-toolbar {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.asset-toolbar svg {
  width: 15px;
  height: 15px;
}

.asset-toolbar__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 156px;
  text-align: center;
}

.asset-toolbar__button span {
  flex: 1 1 auto;
  text-align: center;
}

.asset-refresh-control {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-radius: 999px;
  color: #ffffff;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.asset-refresh-control:hover,
.asset-refresh-control:focus-visible {
  border-color: rgba(94, 234, 212, 0.62);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.asset-refresh-control svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-explorer {
  min-height: calc(100vh - 310px);
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(154, 131, 255, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(94, 234, 212, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(13, 19, 29, 0.68), rgba(8, 12, 20, 0.86));
}

.asset-explorer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(154, 131, 255, 0.14);
  color: var(--ai-text);
  font-weight: 900;
}

.asset-explorer__header small {
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 700;
}

.asset-tree {
  min-height: calc(100vh - 370px);
  max-height: calc(100vh - 310px);
  overflow: auto;
  padding: 14px;
  scrollbar-width: thin;
}

.asset-tree__folder {
  display: grid;
  gap: 4px;
}

.asset-tree__branch {
  display: grid;
  gap: 4px;
  margin-left: 20px;
  padding-left: 12px;
  border-left: 1px solid rgba(154, 131, 255, 0.14);
}

.asset-tree__row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  color: var(--ai-text);
  background: transparent;
  text-align: left;
  cursor: default;
}

.asset-tree__row:hover,
.asset-tree__row:focus-visible {
  outline: none;
  background: rgba(94, 234, 212, 0.08);
}

.asset-tree__row svg {
  width: 19px;
  height: 19px;
}

.asset-tree__row--folder svg {
  color: #f6c85f;
  fill: #f6c85f;
  stroke: #c88716;
}

.asset-tree__row--folder {
  grid-template-columns: 14px 22px minmax(0, 1fr);
}

.asset-tree__row--file svg {
  color: #f8fafc;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

.asset-tree__row strong,
.asset-tree__row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-tree__row strong {
  font-size: 13px;
  font-weight: 900;
}

.asset-tree__row small {
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 700;
}

.asset-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 320px;
  gap: 8px;
  color: var(--ai-text-soft);
  text-align: center;
}

.asset-empty svg {
  width: 52px;
  height: 52px;
  color: #f6c85f;
  fill: #f6c85f;
  stroke: #c88716;
}

.asset-empty strong {
  color: var(--ai-text);
  font-size: 18px;
}

.asset-context-menu {
  position: fixed;
  z-index: 160;
  display: grid;
  min-width: 174px;
  overflow: hidden;
  border: 1px solid rgba(154, 131, 255, 0.22);
  border-radius: 12px;
  background: rgba(9, 14, 23, 0.98);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.35);
}

.asset-context-menu[hidden] {
  display: none;
}

.asset-context-menu button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 0;
  padding: 10px 12px;
  color: var(--ai-text);
  background: transparent;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

.asset-context-menu button:hover {
  background: rgba(94, 234, 212, 0.1);
}

.asset-context-menu button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-context-menu button[data-asset-action="new-folder"] svg {
  fill: #f6c85f;
  stroke: #d09218;
}

.asset-context-menu button[data-asset-action="upload"] svg {
  color: #58c7ff;
}

.asset-context-menu button[data-asset-action="rename"] svg,
.asset-context-menu button[data-asset-action="properties"] svg {
  color: #5eead4;
}

.asset-context-menu button[data-asset-action="delete"] svg {
  color: #ff6b7a;
}

.asset-upload-target {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(94, 234, 212, 0.18);
  border-radius: 12px;
  background: rgba(94, 234, 212, 0.06);
}

.asset-upload-picker {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(154, 131, 255, 0.16);
  border-radius: 14px;
  background: rgba(13, 19, 29, 0.72);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.asset-upload-picker:hover,
.asset-upload-picker:focus-within {
  border-color: rgba(94, 234, 212, 0.42);
  background: rgba(94, 234, 212, 0.07);
  transform: translateY(-1px);
}

.asset-upload-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.asset-upload-picker__copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.asset-upload-picker__copy strong {
  color: var(--ai-text);
  font-size: 14px;
  font-weight: 900;
}

.asset-upload-picker__copy small {
  color: var(--ai-text-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.asset-upload-picker__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(94, 234, 212, 0.34);
  border-radius: 999px;
  color: var(--ai-text);
  background: rgba(94, 234, 212, 0.09);
  font-size: 12px;
  font-weight: 900;
}

.asset-upload-picker__button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-upload-picker__button svg use[href$="#ti-folder"] {
  fill: #f6c85f;
  stroke: #d09218;
}

.asset-upload-picker em {
  grid-column: 1 / -1;
  color: var(--ai-muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.asset-upload-progress {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 14px;
  background: rgba(94, 234, 212, 0.07);
}

.asset-upload-progress[hidden] {
  display: none;
}

.asset-upload-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 900;
}

.asset-upload-progress__header span {
  color: var(--ai-text-soft);
}

.asset-upload-progress__track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.asset-upload-progress__track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5eead4, #58c7ff);
  box-shadow: 0 0 18px rgba(94, 234, 212, 0.36);
  transition: width 120ms ease;
}

.asset-upload-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 122, 0.28);
  border-radius: 12px;
  color: #ffd4da;
  background: rgba(255, 107, 122, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.asset-upload-error[hidden] {
  display: none;
}

.asset-upload-target span,
.asset-meta-grid span {
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.asset-meta-grid div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(154, 131, 255, 0.14);
  border-radius: 12px;
  background: rgba(13, 19, 29, 0.72);
}

.asset-meta-grid code {
  min-width: 0;
  overflow: hidden;
  color: var(--ai-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-explorer-page {
  height: var(--user-explorer-height, calc(100vh - 148px));
  min-height: 420px;
}

.user-explorer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.user-explorer-page[data-explorer-mode="dms"] .user-explorer-panel {
  grid-template-rows: auto auto minmax(260px, 1fr);
  /* Short viewports can scroll the panel instead of collapsing the file browser. */
  overflow: auto;
}

.user-explorer-worker-activity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 16px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  background: var(--ai-control-bg);
}

.user-explorer-worker-activity__label {
  margin: 0;
  padding-top: 2px;
}

.user-explorer-worker-activity__status {
  min-width: 0;
  max-height: min(180px, 24vh);
  overflow: auto;
  overflow-wrap: anywhere;
  color: var(--ai-text-soft);
  font-size: 13px;
  line-height: 1.6;
  scrollbar-width: thin;
}

.user-explorer-worker-activity__status > div + div {
  margin-top: 6px;
}

.user-explorer-worker-activity__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  color: var(--ai-text-muted);
}

.user-explorer-worker-activity__meta small {
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.user-explorer-worker-activity__meta [data-explorer-worker-checked]:empty {
  display: none;
}

.user-explorer-heading {
  align-items: center;
  margin-bottom: 0;
}

.user-explorer-title {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.user-explorer-title__icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid var(--ai-user-explorer-title-icon-border);
  border-radius: 14px;
  color: var(--ai-user-explorer-title-icon-text);
  background: var(--ai-user-explorer-title-icon-bg);
}

.user-explorer-title__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-explorer-title code {
  color: #5eead4;
  font-size: 12px;
}

.user-explorer-shell {
  --user-explorer-sidebar-width: 280px;
  display: grid;
  grid-template-columns: minmax(220px, var(--user-explorer-sidebar-width)) 10px minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.user-explorer-sidebar,
.user-explorer-main {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(154, 131, 255, 0.16);
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 0%, rgba(94, 234, 212, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(13, 19, 29, 0.72), rgba(8, 12, 20, 0.88));
}

.user-explorer-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.user-explorer-resizer {
  align-self: stretch;
  width: 10px;
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent, rgba(154, 131, 255, 0.16), transparent);
  cursor: col-resize;
  position: relative;
}

.user-explorer-resizer::before {
  content: "";
  position: absolute;
  inset: 42% 3px;
  border-radius: 999px;
  background: rgba(154, 131, 255, 0.42);
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease;
}

.user-explorer-resizer:hover::before,
.user-explorer-resizer:focus-visible::before,
.user-explorer-resizing .user-explorer-resizer::before {
  opacity: 1;
  background: rgba(94, 234, 212, 0.68);
}

.user-explorer-resizer:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.32);
  outline-offset: 2px;
}

.user-explorer-resizing {
  cursor: col-resize;
  user-select: none;
}

.user-explorer-sidebar__head {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(154, 131, 255, 0.14);
}

.user-explorer-sidebar__head span {
  color: var(--ai-text);
  font-size: 13px;
  font-weight: 900;
}

.user-explorer-sidebar__head small {
  min-width: 0;
  overflow: hidden;
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-explorer-tree {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 5px;
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 12px;
  scrollbar-width: thin;
}

.user-explorer-tree__node,
.user-explorer-tree__branch {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 5px;
}

.user-explorer-tree__branch {
  margin-left: 14px;
  padding-left: 9px;
  border-left: 1px solid rgba(154, 131, 255, 0.14);
}

.user-explorer-tree__item {
  display: grid;
  grid-template-columns: 18px 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ai-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.user-explorer-tree__item {
  padding-left: calc(9px + (var(--tree-depth, 0) * 3px));
}

.user-explorer-tree__item:hover,
.user-explorer-tree__item:focus-visible,
.user-explorer-tree__item.is-active {
  border-color: rgba(94, 234, 212, 0.24);
  background: rgba(94, 234, 212, 0.08);
  outline: none;
}

.user-explorer-tree__item svg {
  width: 20px;
  height: 20px;
  fill: #f6c85f;
  stroke: #d09218;
}

.user-explorer-tree__toggle {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--ai-muted);
  border-radius: 6px;
  transition: background 140ms ease, color 140ms ease;
}

.user-explorer-tree__toggle::before,
details.folder-tree__folder > summary::before,
.asset-tree__folder > summary::before,
.workspace-chat-file-tree__folder > summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 1px solid var(--ai-line);
  border-radius: 3px;
  color: var(--ai-muted);
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.user-explorer-tree__toggle.is-expanded::before,
details.folder-tree__folder[open] > summary::before,
.asset-tree__folder[open] > summary::before,
.workspace-chat-file-tree__folder[open] > summary::before {
  content: "\2212";
}

details.folder-tree__folder > summary,
.asset-tree__folder > summary {
  list-style: none;
}

details.folder-tree__folder > summary::-webkit-details-marker,
.asset-tree__folder > summary::-webkit-details-marker {
  display: none;
}

.user-explorer-tree__toggle:not(.is-empty):hover {
  color: var(--ai-text);
  background: rgba(255, 255, 255, 0.08);
}

.user-explorer-tree__toggle.is-empty {
  opacity: 0;
}

.user-explorer-tree__item span {
  min-width: 0;
}

.user-explorer-tree__item strong,
.user-explorer-tree__item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-explorer-tree__item strong {
  font-size: 12px;
  font-weight: 900;
}

.user-explorer-tree__item small {
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 700;
}

.user-explorer-main {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.user-explorer-main__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 360px);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(154, 131, 255, 0.14);
}

.user-explorer-location {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.user-explorer-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  color: var(--ai-muted);
}

.user-explorer-breadcrumbs button {
  max-width: 180px;
  overflow: hidden;
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 10px;
  color: var(--ai-text);
  background: rgba(94, 234, 212, 0.08);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.user-explorer-breadcrumbs button:hover,
.user-explorer-breadcrumbs button:focus-visible {
  border-color: rgba(94, 234, 212, 0.44);
  outline: none;
}

.user-explorer-current-path {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 5px 4px 10px;
  border: 1px solid rgba(154, 131, 255, 0.16);
  border-radius: 10px;
  background: rgba(9, 14, 23, 0.5);
}

.user-explorer-current-path > svg,
.user-explorer-current-path button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-explorer-current-path > svg {
  color: #f6c85f;
}

.user-explorer-current-path code {
  min-width: 0;
  overflow-x: auto;
  color: var(--ai-text-soft);
  font-size: 11px;
  line-height: 1.4;
  scrollbar-width: thin;
  white-space: nowrap;
  user-select: all;
}

.user-explorer-current-path button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
  border: 0;
  border-radius: 7px;
  padding: 5px 8px;
  color: var(--ai-muted);
  background: rgba(154, 131, 255, 0.09);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.user-explorer-current-path button:hover,
.user-explorer-current-path button:focus-visible {
  color: var(--ai-text);
  background: rgba(94, 234, 212, 0.12);
  outline: none;
}

.user-explorer-current-path button.is-copied {
  color: var(--ai-accent);
  background: rgba(94, 234, 212, 0.14);
}

.user-explorer-search {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}

.user-explorer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.user-explorer-summary,
.user-explorer-actions,
.user-explorer-view-toggle {
  min-height: 46px;
  border: 1px solid rgba(154, 131, 255, 0.18);
  border-radius: 13px;
  background: rgba(9, 14, 23, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.user-explorer-summary {
  display: inline-flex;
  align-items: stretch;
  padding: 4px 6px;
}

.user-explorer-summary__label {
  display: flex;
  align-items: center;
  padding: 0 8px 0 5px;
  color: var(--ai-accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.user-explorer-summary__stat {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 7px;
  min-width: 76px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(154, 131, 255, 0.07);
}

.user-explorer-summary__stat small {
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.user-explorer-summary__stat strong {
  color: var(--ai-text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.user-explorer-summary__divider {
  width: 1px;
  margin: 7px 5px;
  background: rgba(154, 131, 255, 0.16);
}

.user-explorer-summary__section-divider {
  width: 1px;
  margin: 5px 8px;
  background: rgba(94, 234, 212, 0.28);
}

.user-explorer-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
}

.user-explorer-actions button,
.user-explorer-view-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  padding: 9px 11px;
  color: var(--ai-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.user-explorer-actions button:hover,
.user-explorer-actions button:focus-visible,
.user-explorer-view-toggle button:hover,
.user-explorer-view-toggle button:focus-visible,
.user-explorer-view-toggle button.is-active {
  color: var(--ai-text);
  background: rgba(94, 234, 212, 0.1);
  outline: none;
}

.user-explorer-actions button:first-child {
  color: var(--ai-text-soft);
}

.user-explorer-actions button:last-child {
  color: var(--ai-accent);
  background: rgba(94, 234, 212, 0.07);
}

.user-explorer-view-toggle {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 4px;
  padding: 4px;
  justify-self: end;
}

.user-explorer-view-toggle button {
  min-width: 82px;
}

.user-explorer-view-toggle .user-explorer-refresh-button {
  min-width: 44px;
  padding-inline: 11px;
}

.user-explorer-view-toggle .user-explorer-refresh-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.user-explorer-view-toggle .user-explorer-refresh-button.is-loading svg {
  animation: aiSpin 900ms linear infinite;
}

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

.user-explorer-actions svg,
.user-explorer-view-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-explorer-status {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 6;
  padding: 10px 12px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  color: var(--ai-text-soft);
  background: rgba(10, 24, 32, 0.94);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
}

.user-explorer-status.is-error {
  border-color: rgba(255, 107, 122, 0.34);
  color: #ffd1d6;
  background: rgba(255, 107, 122, 0.08);
}

.user-explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: auto;
  padding: 14px 14px 58px;
  scrollbar-width: thin;
}

.user-explorer-grid--list {
  display: block;
}

.user-explorer-list {
  display: grid;
  min-width: 1040px;
  border: 1px solid rgba(154, 131, 255, 0.14);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(9, 14, 23, 0.46);
}

.user-explorer-list__head,
.user-explorer-list__row {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(100px, 0.55fr) minmax(150px, 0.8fr) minmax(120px, 0.65fr) minmax(140px, 0.75fr) minmax(90px, 0.45fr);
  align-items: center;
  gap: 12px;
}

.user-explorer-page[data-explorer-mode="dms"] .user-explorer-list {
  min-width: 1480px;
}

.user-explorer-page[data-explorer-mode="dms"] .user-explorer-list__head,
.user-explorer-page[data-explorer-mode="dms"] .user-explorer-list__row {
  grid-template-columns: minmax(280px, 1.6fr) minmax(100px, 0.5fr) minmax(195px, 0.75fr) minmax(120px, 0.6fr) minmax(110px, 0.55fr) minmax(152px, 0.7fr) minmax(152px, 0.7fr) minmax(120px, 0.6fr) minmax(90px, 0.45fr);
}

.user-explorer-list__head {
  padding: 10px 14px;
  color: var(--ai-muted);
  background: rgba(154, 131, 255, 0.08);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-explorer-list__row {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(154, 131, 255, 0.1);
  padding: 9px 14px;
  color: var(--ai-text-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.user-explorer-list__row:hover,
.user-explorer-list__row:focus-visible,
.user-explorer-list__row.is-selected {
  color: var(--ai-text);
  background: rgba(94, 234, 212, 0.08);
  outline: none;
}

.user-explorer-list__row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.user-explorer-list__row > .user-explorer-processing-cell,
.user-explorer-processing-cell {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.user-explorer-format-cell {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  max-width: 220px;
}

.user-explorer-format-scroll {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.user-explorer-format-scroll::-webkit-scrollbar {
  display: none;
}

.user-explorer-format-scroll .user-explorer-dms-badge {
  max-width: none;
}

.user-explorer-dms-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 140px;
  min-height: 24px;
  padding: 4px 9px;
  overflow: hidden;
  border: 1px solid var(--ai-line);
  border-radius: 999px;
  color: var(--ai-text-soft);
  background: var(--ai-panel-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.user-explorer-dms-badge > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-explorer-dms-badge--light {
  background: rgba(255, 255, 255, 0.06);
}

.user-explorer-dms-badge--secondary {
  background: rgba(140, 151, 170, 0.16);
}

.user-explorer-dms-badge--success {
  color: #9df0c7;
  background: var(--ai-green-soft);
}

.user-explorer-dms-badge--warning {
  color: #ffd391;
  background: var(--ai-amber-soft);
}

.user-explorer-dms-badge--error {
  color: var(--ai-red);
  background: var(--ai-red-soft);
}

.user-explorer-dms-badge--info {
  color: #9cc5ff;
  background: var(--ai-blue-soft);
}

.user-explorer-processing-empty {
  color: var(--ai-muted);
}

.user-explorer-list__name {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.user-explorer-list__name .user-explorer-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.user-explorer-list__name .user-explorer-item__icon svg {
  width: 18px;
  height: 18px;
}

.user-explorer-list__name .user-explorer-item__icon img {
  width: 22px;
  height: 22px;
}

.user-explorer-list__name strong,
.user-explorer-list__name small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-explorer-list__name strong {
  color: var(--ai-text);
  font-size: 12px;
  font-weight: 900;
}

.user-explorer-list__name small {
  color: var(--ai-muted);
  font-size: 10px;
  font-weight: 700;
}

.user-explorer-item {
  display: grid;
  grid-template-rows: auto;
  min-height: 0;
  border: 1px solid rgba(154, 131, 255, 0.16);
  border-radius: 14px;
  background: rgba(9, 14, 23, 0.72);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.16);
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.user-explorer-item:hover,
.user-explorer-item:focus-within,
.user-explorer-item.is-selected {
  border-color: rgba(94, 234, 212, 0.42);
  background: rgba(94, 234, 212, 0.06);
  transform: translateY(-1px);
}

.user-explorer-item__open {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 0;
  padding: 10px 12px;
  color: var(--ai-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.user-explorer-item__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--ai-user-explorer-file-icon-border);
  border-radius: 12px;
  background: var(--ai-user-explorer-file-icon-bg);
}

.user-explorer-item__icon--folder {
  border-color: var(--ai-user-explorer-folder-icon-border);
  background: var(--ai-user-explorer-folder-icon-bg);
}

.user-explorer-item__icon svg {
  width: 21px;
  height: 21px;
}

.user-explorer-item__icon--folder svg {
  fill: #f6c85f;
  stroke: #d09218;
}

.user-explorer-item__icon img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.user-explorer-item__body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.user-explorer-item__body strong,
.user-explorer-item__body small,
.user-explorer-item__body em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-explorer-item__body strong {
  color: var(--ai-text);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.user-explorer-item__body small {
  color: var(--ai-muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.user-explorer-item__body em {
  color: var(--ai-text-soft);
  display: -webkit-box;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.user-explorer-item__processing {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin-top: 3px;
}

.user-explorer-item__processing .user-explorer-dms-badge {
  min-height: 21px;
  padding: 3px 7px;
  font-size: 10px;
}

.user-explorer-item__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 12px 12px;
}

.user-explorer-item__actions button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(154, 131, 255, 0.18);
  border-radius: 10px;
  color: var(--ai-text-soft);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.user-explorer-item__actions button:hover,
.user-explorer-item__actions button:focus-visible {
  color: var(--ai-text);
  border-color: rgba(94, 234, 212, 0.34);
  outline: none;
}

.user-explorer-item__actions button[data-delete-item]:hover {
  color: #ff6b7a;
  border-color: rgba(255, 107, 122, 0.34);
}

.user-explorer-item__actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.user-explorer-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 300px;
  gap: 8px;
  color: var(--ai-text-soft);
  text-align: center;
}

.user-explorer-empty svg {
  width: 52px;
  height: 52px;
  fill: #f6c85f;
  stroke: #d09218;
}

.user-explorer-empty strong {
  color: var(--ai-text);
  font-size: 18px;
}

.user-explorer-form-error,
.user-explorer-preview__error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 122, 0.32);
  border-radius: 12px;
  color: #ffd1d6;
  background: rgba(255, 107, 122, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.user-explorer-preview__panel {
  width: min(1100px, calc(100vw - 48px));
  min-width: 0;
  overflow: hidden;
}

.user-explorer-preview {
  min-width: 0;
  overflow-x: hidden;
}

.user-explorer-preview-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--ai-line);
  border-radius: 14px;
  background: rgba(6, 13, 24, 0.66);
}

.user-explorer-preview-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.user-explorer-preview-tabs button:hover,
.user-explorer-preview-tabs button:focus-visible,
.user-explorer-preview-tabs button.is-active {
  outline: none;
  background: rgba(88, 199, 255, 0.12);
  color: var(--ai-text);
}

.user-explorer-preview-pane {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.user-explorer-preview-pane[hidden] {
  display: none;
}

.user-explorer-dms-content {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.user-explorer-dms-content > h3 {
  margin: 0;
  color: var(--ai-text);
  font-size: 14px;
}

.user-explorer-dms-tabs,
.user-explorer-format-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--ai-line);
}

.user-explorer-dms-tabs button,
.user-explorer-format-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 10px;
  background: transparent;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.user-explorer-dms-tabs button:hover,
.user-explorer-dms-tabs button:focus-visible,
.user-explorer-dms-tabs button.is-active,
.user-explorer-format-tabs button:hover,
.user-explorer-format-tabs button:focus-visible,
.user-explorer-format-tabs button.is-active {
  outline: none;
  border-bottom-color: var(--ai-accent);
  color: var(--ai-text);
}

.user-explorer-dms-pane[hidden],
.user-explorer-format-pane[hidden] {
  display: none;
}

.user-explorer-dms-pane {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.user-explorer-dms-pane .user-explorer-preview__loading {
  min-height: 180px;
}

.user-explorer-format-pane {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.user-explorer-format-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.user-explorer-format-actions button svg {
  width: 15px;
  height: 15px;
}

.user-explorer-processing-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 7px 4px 10px;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: rgba(6, 13, 24, 0.48);
  color: var(--ai-text-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.user-explorer-processing-option select {
  min-height: 26px;
  max-width: 210px;
  padding: 3px 26px 3px 8px;
  border: 1px solid var(--ai-line-strong);
  border-radius: 6px;
  background: var(--ai-panel-2);
  color: var(--ai-text);
  font: inherit;
  cursor: pointer;
}

.user-explorer-processing-option select:focus-visible {
  outline: 2px solid var(--ai-accent);
  outline-offset: 2px;
}

.user-explorer-processing-option select:disabled {
  cursor: wait;
  opacity: 0.65;
}

.user-explorer-processing-help {
  max-width: 190px;
  color: var(--ai-muted);
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .user-explorer-processing-option {
    width: 100%;
    justify-content: space-between;
  }

  .user-explorer-processing-help {
    width: 100%;
    max-width: none;
  }
}

.user-explorer-format-pane pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.5;
}

.user-explorer-format-pane > pre {
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--ai-line);
  border-radius: 8px;
  background: rgba(6, 13, 24, 0.66);
  color: var(--ai-text-soft);
}

.user-explorer-dms-empty {
  padding: 12px;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 800;
}

.user-explorer-chunk-table-component,
.user-explorer-chunk-tabulator {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.user-explorer-chunk-tabulator .tabulator-tableholder {
  overflow-x: auto;
}

.user-explorer-chunk-tabulator .tabulator-row .tabulator-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-explorer-chunk-cell {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.45;
}

.user-explorer-chunk-modal {
  z-index: 140;
}

.user-explorer-chunk-modal__panel {
  width: min(920px, calc(100vw - 36px));
}

.user-explorer-chunk-preview-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.user-explorer-chunk-preview-nav span {
  min-width: 64px;
  color: var(--ai-muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.user-explorer-chunk-preview-pane[hidden] {
  display: none;
}

.user-explorer-chunk-preview-pane pre {
  max-height: min(560px, calc(100vh - 230px));
  overflow: auto;
  overflow-wrap: anywhere;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.user-explorer-transfer__panel {
  width: min(680px, calc(100vw - 48px));
}

.user-explorer-transfer-tree.user-explorer-tree {
  height: auto;
  max-height: 380px;
  min-height: 260px;
  padding: 12px;
  border: 1px solid rgba(154, 131, 255, 0.16);
  border-radius: 12px;
  background: rgba(9, 14, 23, 0.48);
}

.user-explorer-transfer-tree .user-explorer-tree__item.is-selected {
  border-color: rgba(94, 234, 212, 0.34);
  background: rgba(94, 234, 212, 0.12);
}

.user-explorer-transfer-tree .user-explorer-tree__item.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.user-explorer-preview__loading {
  min-height: 320px;
  display: grid;
  place-items: center;
  color: var(--ai-text-soft);
  font-weight: 800;
}

.user-explorer-context-menu button[data-explorer-context-action="new-folder"] svg {
  fill: #f6c85f;
  stroke: #d09218;
}

.user-explorer-context-menu button[data-explorer-context-action="upload"] svg,
.user-explorer-context-menu button[data-explorer-context-action="open"] svg {
  color: #58c7ff;
}

.user-explorer-context-menu button[data-explorer-context-action="rename"] svg,
.user-explorer-context-menu button[data-explorer-context-action="move"] svg,
.user-explorer-context-menu button[data-explorer-context-action="copy"] svg,
.user-explorer-context-menu button[data-explorer-context-action="properties"] svg {
  color: #5eead4;
}

.user-explorer-context-menu button[data-explorer-context-action="delete"] svg {
  color: #ff6b7a;
}

.workspace-created-file-copy-modal__panel {
  width: min(680px, calc(100vw - 48px));
}

.workspace-created-file-copy-tree.user-explorer-tree {
  height: auto;
  max-height: 380px;
  min-height: 260px;
  padding: 12px;
  border: 1px solid rgba(154, 131, 255, 0.16);
  border-radius: 12px;
  background: rgba(9, 14, 23, 0.48);
}

.workspace-created-file-copy-tree .user-explorer-tree__item.is-selected {
  border-color: rgba(94, 234, 212, 0.34);
  background: rgba(94, 234, 212, 0.12);
}

.workspace-created-file-context-menu button[data-created-file-action="copy"] svg {
  color: #5eead4;
}

.workspace-recalled-file-context-menu button[data-recalled-file-action="remove"] svg {
  color: #ff6b7a;
}

.workspace-chat-file-status {
  margin: 8px 0 10px;
  padding: 9px 11px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 10px;
  color: var(--ai-text-soft);
  background: rgba(94, 234, 212, 0.07);
  font-size: 12px;
  font-weight: 800;
}

.workspace-chat-file-status.is-error {
  border-color: rgba(255, 107, 122, 0.32);
  color: #ffd1d6;
  background: rgba(255, 107, 122, 0.08);
}

.asset-preview-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px;
  border: 1px dashed rgba(88, 199, 255, 0.28);
  border-radius: 16px;
  background: rgba(88, 199, 255, 0.06);
  color: var(--ai-text-soft);
  text-align: center;
}

.asset-preview-placeholder svg {
  width: 44px;
  height: 44px;
  color: #58c7ff;
}

.asset-preview-placeholder strong {
  color: var(--ai-text);
  font-size: 17px;
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: start;
  padding: 11px 13px;
  border-radius: var(--ai-radius-sm);
  border: 1px solid var(--ai-line);
  color: var(--ai-text-soft);
  background: rgba(32, 40, 56, 0.85);
}

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

.flash-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -3px -5px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: currentColor;
  background: transparent;
  cursor: pointer;
  opacity: 0.74;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.flash-close:hover,
.flash-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.flash-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.flash-close svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flash-success {
  color: #c8ffdf;
  border-color: rgba(67, 209, 141, 0.34);
  background: var(--ai-green-soft);
}

.flash-error,
.flash-danger {
  color: #ffd0d5;
  border-color: rgba(255, 107, 122, 0.35);
  background: var(--ai-red-soft);
}

.flash-info {
  color: #cfe3ff;
  border-color: rgba(47, 128, 255, 0.34);
  background: var(--ai-blue-soft);
}

.flash-details {
  margin-top: 10px;
}

.flash-details summary {
  cursor: pointer;
  font-weight: 700;
}

.flash-details pre {
  max-height: 360px;
  margin: 10px 0 0;
  padding: 12px;
  overflow: auto;
  border-radius: var(--ai-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffe8eb;
  background: rgba(3, 7, 18, 0.72);
  white-space: pre-wrap;
  word-break: break-word;
}

.login-surface {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100vw - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: 16px;
  max-width: 100%;
}

.login-ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(154, 131, 255, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(47, 128, 255, 0.08), transparent 38%),
    radial-gradient(circle at 50% 50%, rgba(18, 26, 40, 0.88), rgba(4, 8, 14, 0.96) 68%);
}

.login-ambient::before,
.login-ambient::after {
  content: "";
  position: absolute;
  inset: -20%;
  opacity: 0.48;
  background-image:
    linear-gradient(rgba(154, 131, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 128, 255, 0.1) 1px, transparent 1px);
  background-size: 68px 68px;
  transform: rotate(-8deg);
  animation: login-grid-drift 24s linear infinite;
}

.login-ambient::after {
  opacity: 0.26;
  background-size: 112px 112px;
  transform: rotate(11deg);
  animation-duration: 38s;
  animation-direction: reverse;
}

.login-ambient span {
  position: absolute;
  width: var(--size);
  height: var(--size);
  left: var(--x);
  top: var(--y);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.9), rgba(154, 131, 255, 0.82) 12%, rgba(47, 128, 255, 0.06) 60%, transparent 72%);
  filter: blur(var(--blur));
  opacity: var(--opacity);
  animation: login-node-float var(--duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

.login-ambient span:nth-child(1) { --x: 8%; --y: 18%; --size: 180px; --blur: 8px; --opacity: 0.28; --duration: 15s; --delay: -4s; }
.login-ambient span:nth-child(2) { --x: 78%; --y: 12%; --size: 130px; --blur: 10px; --opacity: 0.22; --duration: 19s; --delay: -11s; }
.login-ambient span:nth-child(3) { --x: 64%; --y: 72%; --size: 220px; --blur: 14px; --opacity: 0.18; --duration: 24s; --delay: -7s; }
.login-ambient span:nth-child(4) { --x: 22%; --y: 78%; --size: 120px; --blur: 8px; --opacity: 0.2; --duration: 18s; --delay: -2s; }
.login-ambient span:nth-child(5) { --x: 47%; --y: 6%; --size: 90px; --blur: 5px; --opacity: 0.22; --duration: 16s; --delay: -13s; }
.login-ambient span:nth-child(6) { --x: 86%; --y: 58%; --size: 160px; --blur: 12px; --opacity: 0.19; --duration: 22s; --delay: -5s; }
.login-ambient span:nth-child(7) { --x: 4%; --y: 62%; --size: 110px; --blur: 7px; --opacity: 0.16; --duration: 20s; --delay: -9s; }
.login-ambient span:nth-child(8) { --x: 36%; --y: 42%; --size: 74px; --blur: 4px; --opacity: 0.2; --duration: 14s; --delay: -6s; }
.login-ambient span:nth-child(9) { --x: 92%; --y: 28%; --size: 70px; --blur: 5px; --opacity: 0.21; --duration: 17s; --delay: -1s; }
.login-ambient span:nth-child(10) { --x: 12%; --y: 44%; --size: 58px; --blur: 3px; --opacity: 0.2; --duration: 13s; --delay: -8s; }

@keyframes login-grid-drift {
  from {
    transform: translate3d(0, 0, 0) rotate(-8deg);
  }
  to {
    transform: translate3d(68px, 68px, 0) rotate(-8deg);
  }
}

@keyframes login-node-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  33% {
    transform: translate3d(34px, -28px, 0) scale(1.12);
  }
  66% {
    transform: translate3d(-26px, 30px, 0) scale(0.92);
  }
}

.login-panel {
  padding: 24px;
  min-width: 0;
}

.login-panel--brand {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.login-brand {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.login-brand__logo {
  display: block;
  width: 88px;
  height: 132px;
  object-fit: contain;
  border: 1px solid rgba(154, 131, 255, 0.28);
  border-radius: var(--ai-radius);
  background: linear-gradient(180deg, rgba(154, 131, 255, 0.14), rgba(47, 128, 255, 0.06));
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.28);
}

.login-brand [data-login-reveal] {
  opacity: 0;
  filter: blur(12px);
  text-shadow: 0 0 24px rgba(154, 131, 255, 0.42);
  transition: opacity 0.68s ease, filter 0.68s ease, text-shadow 0.68s ease;
}

.login-brand.is-revealed [data-login-reveal] {
  opacity: 1;
  filter: blur(0);
  text-shadow: none;
}

.login-brand.is-revealed .eyebrow {
  transition-delay: 0.08s;
}

.login-brand.is-revealed .login-brand__logo {
  transition-delay: 0.16s;
}

.login-brand.is-revealed p[data-login-reveal] {
  transition-delay: 0.24s;
}

.login-panel--brand h2 {
  max-width: 620px;
  margin: 0;
  color: var(--ai-text);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.login-panel--brand h2.is-typing::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 0.96em;
  margin-left: 7px;
  background: var(--ai-text);
  vertical-align: -0.06em;
  opacity: 1;
  box-shadow: 0 0 18px rgba(237, 243, 255, 0.36);
}

.login-panel--brand h2.is-typed::after {
  animation: login-caret-blink 1.25s step-end infinite;
}

@keyframes login-caret-blink {
  0%,
  49.99% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.login-panel--brand p {
  max-width: 620px;
  margin-top: 16px;
  color: var(--ai-text-soft);
}

.login-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.login-meta-grid > div {
  padding: 13px;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  background: var(--ai-detail-bg);
}

.login-meta-grid strong,
.login-meta-grid span {
  display: block;
}

.login-meta-grid strong {
  color: var(--ai-muted);
  font-size: 12px;
}

.login-meta-grid span {
  margin-top: 5px;
  color: var(--ai-text);
  overflow-wrap: anywhere;
}

.login-panel--form {
  align-self: center;
}

.login-header {
  margin-bottom: 18px;
}

.login-header p {
  margin-top: 6px;
}

.error-card {
  width: min(720px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px;
}

.error-card--debug {
  width: min(1040px, calc(100vw - 40px));
}

.error-debug-summary {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  padding: 14px;
  border-radius: var(--ai-radius-sm);
  border: 1px solid rgba(255, 107, 122, 0.35);
  color: #ffd0d5;
  background: rgba(255, 107, 122, 0.1);
}

.error-debug-summary span {
  color: var(--ai-text-muted);
  overflow-wrap: anywhere;
}

.error-debug-field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--ai-text-muted);
  font-weight: 700;
}

.error-debug-field input,
.error-debug-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ai-line);
  border-radius: var(--ai-radius-sm);
  color: var(--ai-text);
  background: rgba(8, 13, 24, 0.86);
}

.error-debug-field input {
  padding: 11px 12px;
}

.error-debug-field textarea {
  min-height: 320px;
  padding: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.error-actions .button-link {
  margin-top: 0;
}

.button-link--ghost {
  color: var(--ai-text-soft);
  background: rgba(141, 153, 174, 0.08);
  border-color: var(--ai-line);
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.nav-panel {
  display: none;
}

@media (max-width: 1320px) {
  .user-explorer-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .user-explorer-toolbar {
    justify-content: flex-start;
  }
}

@media (max-width: 1180px) {
  .ai-topbar {
    grid-template-columns: minmax(220px, max-content) minmax(0, 1fr);
  }

  .page-grid,
  .grid-two,
  .dashboard-main-grid,
  .workspace-chat-shell,
  .login-surface {
    grid-template-columns: 1fr;
  }

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

  .workspace-object-filter.model-report-filter {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .firewall-dashboard,
  .firewall-create-grid,
  .firewall-filter-grid,
  .firewall-quick-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 780px) {
  :root {
    --ai-sidebar-width: 0px;
  }

  .ai-shell {
    display: block;
  }

  .ai-sidebar {
    position: static;
    height: auto;
    grid-template-rows: none;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 10px 12px;
  }

  .ai-sidebar__nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 8px;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--ai-line-strong) transparent;
  }

  .ai-sidebar__link {
    flex: 0 0 auto;
  }

  .ai-sidebar-tooltip {
    display: none;
  }

  .ai-sidebar-submenu {
    display: none;
  }

  .ai-sidebar__footer {
    display: grid;
    place-items: center;
    grid-auto-flow: column;
    padding: 0 0 0 8px;
    border-top: 0;
  }

  .ai-sidebar-popover {
    left: auto;
    right: 0;
    bottom: auto;
    top: 44px;
  }

  .ai-topbar {
    position: static;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 16px;
  }

  .ai-drawer--role-create .checkbox-grid,
  .ai-drawer--role-edit .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .ai-main {
    padding: 14px;
  }

  .user-explorer-page {
    height: auto;
    min-height: 0;
  }

  .user-explorer-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .user-explorer-worker-activity {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-explorer-worker-activity__meta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
  }

  .user-explorer-title {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .user-explorer-title__icon {
    width: 42px;
    height: 42px;
  }

  .user-explorer-toolbar,
  .user-explorer-actions {
    width: 100%;
  }

  .user-explorer-summary {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 1px minmax(0, 1fr);
  }

  .user-explorer-summary__stat {
    min-width: 0;
  }

  .user-explorer-summary__section-divider {
    grid-column: 1 / -1;
    width: auto;
    height: 1px;
    margin: 3px 5px;
  }

  .user-explorer-actions button {
    flex: 1 1 0;
  }

  .user-explorer-shell {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .user-explorer-resizer {
    display: none;
  }

  .user-explorer-sidebar {
    max-height: 260px;
  }

  .user-explorer-main {
    height: 540px;
  }

  .user-explorer-main__top {
    grid-template-columns: minmax(0, 1fr);
  }

  .user-explorer-search {
    grid-column: 1;
    grid-row: 2;
  }

  .panel-card,
  .login-panel {
    padding: 14px;
  }

  .workspace-chat-panel {
    padding: 0;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .dashboard-hero__intro {
    grid-template-columns: 1fr;
  }

  .dashboard-hero__badge {
    min-width: 0;
  }

  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }

  .workspace-object-filter.model-report-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-report-filter__field {
    max-width: none;
  }

  .model-report-filter__actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    margin-left: 0;
  }

  .model-report-filter .button-primary,
  .model-report-filter .button-ghost {
    flex: 1 1 0;
    width: auto;
  }

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

  .dashboard-token-chart {
    min-height: 250px;
    padding: 12px 8px 6px;
  }

  .dashboard-token-chart canvas {
    height: 230px !important;
  }

  .dashboard-model-token-chart {
    min-height: 220px;
  }

  .dashboard-model-token-chart canvas {
    height: 200px !important;
  }

  .dashboard-breakdown-chart {
    min-height: 220px;
  }

  .dashboard-breakdown-chart canvas {
    height: 200px !important;
  }

  .dashboard-agent-table .data-table {
    font-size: 12px;
  }

  .launcher-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .asset-explorer__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .asset-tree {
    max-height: none;
  }

  .asset-tree__branch {
    margin-left: 12px;
    padding-left: 8px;
  }

  .asset-meta-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-model-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .workspace-row-card,
  .file-row-card,
  .workspace-prompt {
    grid-template-columns: 1fr;
  }

  .matched-chunk-row {
    grid-template-columns: 1fr;
  }

  .workspace-topic-panel,
  .workspace-chat-panel {
    min-height: auto;
    max-height: none;
  }

  .workspace-chat-shell--references-collapsed {
    grid-template-columns: 1fr;
  }

  .workspace-chat-shell--references-collapsed .workspace-reference-toggle {
    min-height: auto;
    max-height: none;
    width: 100%;
    min-height: 42px;
    writing-mode: horizontal-tb;
  }

  .workspace-chat-shell--references-collapsed .workspace-topic-panel {
    position: static;
    width: auto;
    transform: none;
    display: none;
  }

  .workspace-chat-shell:not(.workspace-chat-shell--references-collapsed) .workspace-reference-toggle {
    display: none;
  }

  .workspace-chat-shell--expanded.workspace-chat-shell--references-collapsed,
  .workspace-chat-shell--expanded {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .workspace-chat-shell--expanded.workspace-chat-shell--references-collapsed .workspace-reference-toggle,
  .workspace-chat-shell--expanded.workspace-chat-shell--references-collapsed .workspace-topic-panel,
  .workspace-chat-shell--expanded .workspace-reference-toggle,
  .workspace-chat-shell--expanded .workspace-topic-panel {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .workspace-chat-shell--expanded.workspace-chat-shell--references-collapsed .workspace-chat-panel,
  .workspace-chat-shell--expanded .workspace-chat-panel {
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
  }

  .workspace-message {
    max-width: 100%;
  }

  .workspace-execution-activity {
    width: 100%;
  }

  .workspace-execution-activity-io {
    grid-template-columns: 1fr;
  }

  .workspace-execution-activity__heading small,
  .workspace-execution-activity__item-main > time {
    display: none;
  }

  .workspace-execution-activity__browser-button span {
    display: none;
  }

  .workspace-execution-activity__browser-button {
    padding-inline: 8px;
  }

  .workspace-message--tool-result,
  .workspace-message--tool-process {
    width: auto;
    max-width: 100%;
  }

  .workspace-tool-process-grid {
    grid-template-columns: 1fr;
  }

  .tool-llm-config__builder,
  .tool-llm-config__row {
    grid-template-columns: 1fr;
  }

  .tool-llm-config__add {
    margin-bottom: 0;
  }

  .workspace-tool-detail__grid {
    grid-template-columns: 1fr;
  }

  .workspace-tool-prompt-debug__layout {
    grid-template-columns: 1fr;
  }

  .workspace-tool-prompt-debug__list,
  .workspace-tool-prompt-debug__detail {
    max-height: none;
  }

  .workspace-tool-detail-prompt-item__grid {
    grid-template-columns: 1fr;
  }

  .workspace-file-preview__meta {
    grid-template-columns: 1fr;
  }

  .workspace-file-preview__viewer,
  .workspace-file-preview__fallback,
  .workspace-file-preview__image,
  .workspace-file-preview__inline-text {
    min-height: 360px;
  }

  .workspace-file-preview__frame {
    min-height: 420px;
  }

  .workspace-message-fullscreen__panel {
    inset: 10px;
    border-radius: 18px;
  }

  .workspace-message-fullscreen__header {
    padding: 14px;
  }

  .workspace-message-fullscreen__body {
    padding: 18px;
  }

  .chat-reference-card:hover {
    width: 100%;
    min-height: 104px;
  }

  .dashboard-location-pill {
    grid-column: 2;
    width: max-content;
  }

  .section-heading,
  .action-row {
    display: grid;
    justify-content: stretch;
  }

  .form-grid,
  .checkbox-grid,
  .login-meta-grid,
  .inline-form,
  .agent-capability-assign-form,
  .firewall-dashboard,
  .firewall-create-grid,
  .firewall-filter-grid,
  .firewall-quick-controls,
  .workflow-strip {
    grid-template-columns: 1fr;
  }

  .agent-capability-modal__summary,
  .agent-capability-item > div:first-child,
  .agent-capability-item dl {
    grid-template-columns: 1fr;
  }

  .detail-grid:not(.workspace-summary-grid) {
    grid-template-columns: 1fr;
  }

  .workspace-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow-x: auto;
  }

  .login-surface {
    width: min(100%, calc(100vw - 28px));
  }

  .login-panel--brand {
    min-height: auto;
  }

  .login-brand {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
  }

  .login-brand__logo {
    width: 62px;
    height: 92px;
  }

  .login-panel--brand h2 {
    max-width: 100%;
    font-size: clamp(28px, 8vw, 32px);
  }
}

/* Keep model dashboard/reporting filters desktop-oriented even if generic form rules load later. */
.workspace-object-filter.model-report-filter {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px 12px;
}

.workspace-object-filter.model-report-filter > .field,
.workspace-object-filter.model-report-filter > .model-report-filter__field {
  width: auto;
  min-width: 0;
}

.workspace-object-filter.model-report-filter > .field input,
.workspace-object-filter.model-report-filter > .field select {
  width: 100%;
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
}

.workspace-object-filter.model-report-filter > .button-primary,
.workspace-object-filter.model-report-filter > .button-ghost,
.workspace-object-filter.model-report-filter > .model-report-filter__actions {
  width: auto;
  align-self: end;
}

.workspace-object-filter.model-report-filter > .model-report-filter__actions {
  display: flex;
  justify-self: end;
  gap: 8px;
}

@media (max-width: 1180px) {
  .workspace-object-filter.model-report-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .tool-category-grid {
    grid-template-columns: 1fr;
  }

  .tool-category-section__heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .tool-category-section__count {
    grid-column: 2;
    justify-self: start;
  }

  .workspace-object-filter.model-report-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-object-filter.model-report-filter > .model-report-filter__actions {
    justify-self: stretch;
  }

  .workspace-object-filter.model-report-filter > .button-primary,
  .workspace-object-filter.model-report-filter > .button-ghost,
  .workspace-object-filter.model-report-filter > .model-report-filter__actions .button-primary,
  .workspace-object-filter.model-report-filter > .model-report-filter__actions .button-ghost {
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  .workspace-object-filter.model-report-filter {
    grid-template-columns: 1fr;
  }
}
