@import url("https://cdn.jsdelivr.net/npm/@radix-ui/colors@3.0.0/gray.css");
@import url("https://cdn.jsdelivr.net/npm/@radix-ui/colors@3.0.0/green.css");
@import url("https://cdn.jsdelivr.net/npm/@radix-ui/colors@3.0.0/red.css");
@import url("https://cdn.jsdelivr.net/npm/@radix-ui/colors@3.0.0/amber.css");

:root {
  color-scheme: light;
  --canvas: var(--gray-2, #f9f9f9);
  --sidebar: var(--gray-1, #fcfcfc);
  --surface: #fff;
  --surface-subtle: var(--gray-3, #f0f0f0);
  --surface-hover: var(--gray-4, #e8e8e8);
  --border: var(--gray-6, #d9d9d9);
  --border-strong: var(--gray-7, #cecece);
  --text: var(--gray-12, #202020);
  --muted: var(--gray-11, #646464);
  --subtle: var(--gray-10, #838383);
  --accent: var(--green-9, #30a46c);
  --accent-hover: var(--green-10, #2b9a66);
  --accent-strong: var(--green-11, #218358);
  --accent-soft: var(--green-3, #e1f8ec);
  --danger: var(--red-9, #e5484d);
  --danger-hover: var(--red-10, #dc3e42);
  --danger-soft: var(--red-3, #ffebec);
  --warning: var(--amber-11, #ad5700);
  --warning-soft: var(--amber-3, #fff4d5);
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 10px;
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--canvas);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

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

svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

::selection {
  color: var(--text);
  background: var(--accent-soft);
}

.hidden {
  display: none !important;
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  width: 24px;
  height: 24px;
  color: #fff;
  background: var(--text);
  border-radius: 6px;
  place-items: center;
}

.brand-mark svg {
  width: 14px;
  height: 14px;
}

.project-switcher {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  margin: 5px 0 15px;
  padding: 7px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.project-switcher > span:nth-child(2),
.sidebar-foot > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.project-switcher small,
.sidebar-foot small {
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.25;
}

.project-switcher strong,
.sidebar-foot strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-switcher > svg {
  width: 14px;
  height: 14px;
  color: var(--subtle);
}

.project-avatar,
.workspace-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  place-items: center;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label,
.sidebar-head > span {
  padding: 0 8px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  line-height: 26px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
}

.nav-item svg {
  width: 15px;
  height: 15px;
  color: var(--subtle);
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-subtle);
}

.nav-item.active {
  color: var(--text);
  background: var(--surface-hover);
  font-weight: 600;
}

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

.agents-section {
  display: flex;
  min-height: 0;
  margin-top: 18px;
  flex: 1;
  flex-direction: column;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
}

.agent-list {
  display: flex;
  min-height: 0;
  padding: 2px 0 10px;
  overflow: auto;
  flex-direction: column;
  gap: 2px;
}

.agent-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 4px 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
}

.agent-item:hover {
  color: var(--text);
  background: var(--surface-subtle);
}

.agent-item.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.agent-glyph {
  display: grid;
  width: 24px;
  height: 24px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  place-items: center;
}

.agent-item.active .agent-glyph {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
}

.agent-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.agent-meta strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-meta small {
  color: var(--subtle);
  font-size: 10px;
}

.agent-status {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.sidebar-foot {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid var(--border);
}

.app-main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-bottom: 1px solid var(--border);
}

.breadcrumb,
.top-actions,
.heading-actions {
  display: flex;
  align-items: center;
}

.breadcrumb {
  min-width: 0;
  gap: 7px;
  font-size: 12px;
}

.breadcrumb span {
  color: var(--subtle);
}

.breadcrumb strong {
  overflow: hidden;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb svg {
  width: 12px;
  height: 12px;
  color: var(--gray-8, #bbb);
}

.top-actions {
  gap: 8px;
}

.account-button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  place-items: center;
}

.account-button:hover {
  border-color: var(--accent);
}

.service-pill,
.credit-pill,
.save-state,
.status-chip,
.environment-badge,
.price-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
}

.service-pill.ready {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.service-pill.missing {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 25%, var(--border));
}

.credit-pill {
  gap: 5px;
  border-radius: 6px;
}

.credit-pill span {
  color: var(--subtle);
}

.credit-pill strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--gray-8, #bbb);
  border-radius: 50%;
}

.ready .status-dot,
.status-dot.ready {
  background: var(--accent);
}

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

.icon-button,
.text-button,
.button,
.copy-button,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.icon-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  color: var(--muted);
}

.icon-button.small {
  width: 26px;
  min-height: 26px;
  background: transparent;
  border-color: transparent;
}

.icon-button.quiet {
  width: 28px;
  min-height: 28px;
  background: transparent;
  border-color: transparent;
}

.icon-button:hover,
.button.secondary:hover,
.copy-button:hover,
.text-button:hover {
  color: var(--text);
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

.button.primary,
.send-button {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button.primary:hover,
.send-button:hover {
  background: color-mix(in srgb, var(--accent-strong) 88%, #000);
  border-color: color-mix(in srgb, var(--accent-strong) 88%, #000);
}

.button.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button.danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.button.danger-outline {
  color: var(--danger);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}

.button.danger-outline:hover {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
}

.button:disabled,
.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.content {
  padding: 36px 40px 64px;
}

.view {
  display: none;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.view.active {
  display: block;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 65px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

h2 {
  margin-bottom: 3px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 14px;
  font-weight: 600;
}

.page-description {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.heading-actions {
  flex: 0 0 auto;
  gap: 8px;
}

.save-state {
  min-height: 25px;
  color: var(--subtle);
  background: transparent;
  border-color: transparent;
  border-radius: 5px;
}

.save-state.saved {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 20%, var(--border));
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 20px;
  align-items: start;
}

.form-stack,
.config-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.config-column {
  position: sticky;
  top: 76px;
}

.manifest-grid {
  display: block;
  max-width: 820px;
}

.manifest-stack,
.manifest-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 16px;
}

.manifest-stack {
  gap: 12px;
}

.manifest-summary {
  position: sticky;
  top: 76px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-panel,
.config-panel,
.api-panel,
.key-panel {
  padding: 20px;
}

.manifest-panel,
.deployment-summary {
  padding: 20px;
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.resource-row:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

.resource-icon {
  display: grid;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  place-items: center;
}

.resource-icon svg {
  width: 15px;
  height: 15px;
}

.resource-input {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

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

.resource-input input {
  width: 100%;
  height: 24px;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.resource-input input::placeholder {
  color: var(--gray-9, #8d8d8d);
}

.resource-input small {
  overflow: hidden;
  color: var(--subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-resource {
  opacity: 0;
  transition: opacity 120ms ease;
}

.resource-row:hover .remove-resource,
.resource-row:focus-within .remove-resource,
.remove-resource:focus-visible {
  opacity: 1;
}

.add-resource-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-top: 10px;
  padding: 0;
  color: var(--accent-strong);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
}

.add-resource-button:hover {
  color: var(--accent-hover);
}

.add-resource-button svg {
  width: 14px;
  height: 14px;
}

.field-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.45;
}

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

.field-note svg {
  width: 12px;
  height: 12px;
  margin-top: 1px;
}

.summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.summary-head > div {
  min-width: 0;
}

.summary-head > div > span {
  display: block;
  margin-bottom: 4px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary-head h2 {
  overflow: hidden;
  margin: 0;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--border);
}

.summary-counts > div {
  display: flex;
  min-width: 0;
  padding: 17px 0;
  flex-direction: column;
}

.summary-counts > div + div {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.summary-counts strong {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.summary-counts span {
  color: var(--subtle);
  font-size: 10px;
}

.runtime-list {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.runtime-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 27px;
}

.runtime-list dt,
.runtime-list dd {
  margin: 0;
  font-size: 11px;
}

.runtime-list dt {
  color: var(--subtle);
}

.runtime-list dd {
  overflow: hidden;
  color: var(--text);
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-list {
  padding-top: 13px;
}

.readiness-list p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.readiness-list svg {
  width: 12px;
  height: 12px;
  color: var(--accent-strong);
}

.panel-title {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 18px;
}

.panel-title.compact {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.section-icon,
.tool-icon,
.dialog-icon,
.empty-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  place-items: center;
}

.section-icon svg,
.tool-icon svg,
.dialog-icon svg,
.empty-icon svg {
  width: 15px;
  height: 15px;
}

.field-grid {
  display: grid;
  gap: 16px;
}

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

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field > span,
.deployment-select > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.field > span b {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 4px;
  color: var(--subtle);
  background: var(--surface-subtle);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

.field input,
.field textarea,
.field select,
.deployment-select select,
.composer textarea {
  width: 100%;
  min-width: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  outline: none;
}

.field input,
.field select,
.deployment-select select {
  height: 36px;
  padding: 0 10px;
}

.field textarea,
.composer textarea {
  padding: 10px 11px;
  line-height: 1.55;
  resize: vertical;
}

.field input:hover,
.field textarea:hover,
.field select:hover,
.deployment-select select:hover,
.composer textarea:hover {
  border-color: var(--gray-8, #bbb);
}

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

.field small {
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.4;
}

#agent-instructions,
#mcp-servers {
  font-family: var(--font-mono);
  font-size: 12px;
}

.settings-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.tool-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 62px;
  padding: 10px 12px;
}

.tool-row + .tool-row {
  border-top: 1px solid var(--border);
}

.tool-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tool-row strong {
  font-size: 12px;
  font-weight: 600;
}

.tool-row small {
  color: var(--muted);
  font-size: 11px;
}

.tool-icon {
  width: 30px;
  height: 30px;
  background: var(--surface);
}

.switch {
  display: inline-flex;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: relative;
  width: 32px;
  height: 18px;
  background: var(--gray-7, #cecece);
  border: 1px solid var(--gray-8, #bbb);
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.switch span::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  content: "";
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
  transition: transform 120ms ease;
}

.switch input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(14px);
}

.switch input:focus-visible + span {
  box-shadow: var(--focus);
}

.mcp-field {
  margin-top: 16px;
}

.environment-badge {
  min-height: 23px;
  padding: 0 7px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 5px;
  font-size: 10px;
}

.environment-badge > span {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.config-panel {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.config-panel > .panel-title {
  margin-bottom: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 3px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.segmented button {
  min-width: 0;
  height: 27px;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 550;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.active {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.range-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 12px;
  align-items: center;
  min-height: 36px;
}

.range-line input {
  height: 4px;
  padding: 0;
  accent-color: var(--accent);
}

.range-line output {
  height: 30px;
  padding: 0 7px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 28px;
  text-align: center;
}

.money-input {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
}

.money-input > span {
  display: grid;
  height: 36px;
  color: var(--subtle);
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  place-items: center;
}

.money-input input {
  border-radius: 0 6px 6px 0;
}

.cost-card {
  padding: 15px 16px;
}

.cost-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 11px;
}

.cost-summary span {
  color: var(--muted);
}

.cost-summary strong {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.meter {
  height: 4px;
  overflow: hidden;
  background: var(--surface-subtle);
  border-radius: 99px;
}

.meter i {
  display: block;
  width: 12%;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 160ms ease;
}

.cost-card small {
  display: block;
  margin-top: 9px;
  color: var(--subtle);
  font-size: 10px;
}

.version-card {
  display: flex;
  gap: 10px;
  padding: 4px 2px;
  color: var(--muted);
}

.version-card > svg {
  margin-top: 2px;
  color: var(--subtle);
}

.version-card strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.version-card p {
  margin: 3px 0 0;
  font-size: 10px;
  line-height: 1.5;
}

.deployment-select {
  display: flex;
  align-items: center;
  gap: 9px;
}

.deployment-select select {
  width: 250px;
}

.playground-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.8fr);
  gap: 16px;
  height: calc(100vh - 178px);
  min-height: 560px;
}

.console,
.trace {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.console {
  overflow: hidden;
}

.console-head,
.trace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.console-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.console-head strong {
  font-size: 12px;
  font-weight: 600;
}

.text-button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  font-size: 11px;
}

.transcript {
  display: flex;
  min-height: 0;
  padding: 20px;
  overflow: auto;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  background: var(--canvas);
}

.empty-chat {
  display: flex;
  max-width: 320px;
  margin: auto;
  align-items: center;
  color: var(--muted);
  text-align: center;
  flex-direction: column;
}

.empty-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  background: var(--surface);
}

.empty-chat h3 {
  margin-bottom: 4px;
  color: var(--text);
}

.empty-chat p {
  margin-bottom: 0;
  font-size: 11px;
}

.message {
  display: flex;
  max-width: min(760px, 88%);
  flex-direction: column;
  gap: 4px;
}

.message.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message > span {
  color: var(--subtle);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bubble {
  padding: 9px 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message.user .bubble {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.approval-card {
  margin: 12px 16px 0;
  padding: 12px;
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 25%, var(--border));
  border-radius: 7px;
}

.approval-card h3 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 12px;
}

.approval-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}

.approval-actions {
  display: flex;
  gap: 7px;
}

.composer {
  padding: 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.composer textarea {
  display: block;
  min-height: 70px;
  max-height: 180px;
  resize: none;
}

.composer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.composer > div > span {
  color: var(--subtle);
  font-size: 10px;
}

kbd {
  min-width: 17px;
  margin: 0 1px;
  padding: 1px 4px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-bottom-color: var(--border-strong);
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 9px;
}

.send-button {
  min-height: 30px;
  padding: 0 10px;
}

.send-button svg {
  width: 13px;
  height: 13px;
}

.trace-head {
  align-items: flex-end;
  padding-top: 11px;
  padding-bottom: 10px;
}

.trace-head .eyebrow {
  margin-bottom: 1px;
}

.trace-head h2 {
  margin: 0;
  font-size: 13px;
}

.status-chip {
  min-height: 23px;
  border-radius: 5px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-chip.running {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 25%, var(--border));
}

.status-chip.completed {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.status-chip.failed {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 22%, var(--border));
}

.event-list {
  min-height: 0;
  padding: 10px 14px;
  overflow: auto;
  flex: 1;
}

.trace-empty {
  padding: 28px 8px;
  color: var(--subtle);
  font-size: 11px;
  text-align: center;
}

.event {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  padding: 8px 0;
}

.event + .event {
  border-top: 1px solid var(--border);
}

.event-icon {
  display: grid;
  width: 24px;
  height: 24px;
  color: var(--subtle);
  background: var(--surface-subtle);
  border-radius: 5px;
  place-items: center;
}

.event-icon svg {
  width: 12px;
  height: 12px;
}

.event-copy {
  min-width: 0;
}

.event-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-copy p,
.event-copy time {
  margin: 2px 0 0;
  color: var(--subtle);
  font-size: 9px;
  line-height: 1.4;
}

.run-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}

.run-stats > div {
  padding: 11px 10px;
  text-align: center;
}

.run-stats > div + div {
  border-left: 1px solid var(--border);
}

.run-stats span,
.run-stats strong {
  display: block;
}

.run-stats span {
  margin-bottom: 3px;
  color: var(--subtle);
  font-size: 9px;
  text-transform: uppercase;
}

.run-stats strong {
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.key-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: var(--radius);
}

.key-banner code {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
}

.deploy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  margin-bottom: 16px;
}

.method,
.price-version {
  min-height: 23px;
  padding: 0 7px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 21px;
}

.endpoint-picker {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.endpoint-picker button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.endpoint-picker button.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
}

.api-panel {
  position: relative;
}

.api-panel pre {
  min-height: 180px;
  margin: 0;
  padding: 15px;
  overflow: auto;
  color: #d6d6d6;
  background: #191919;
  border: 1px solid #2e2e2e;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.copy-button {
  position: absolute;
  right: 28px;
  bottom: 28px;
  min-height: 28px;
  padding: 0 8px;
  color: #bcbcbc;
  background: #292929;
  border-color: #3b3b3b;
  font-size: 10px;
}

.copy-button:hover {
  color: #fff;
  background: #333;
  border-color: #4a4a4a;
}

.api-key-list {
  display: flex;
  min-height: 180px;
  flex-direction: column;
}

.api-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.api-key-row:first-child {
  border-top: 1px solid var(--border);
}

.api-key-row > div {
  min-width: 0;
}

.api-key-row strong,
.api-key-row code,
.api-key-row small {
  display: block;
}

.api-key-row strong {
  font-size: 11px;
  font-weight: 600;
}

.api-key-row code {
  margin: 2px 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.api-key-row small {
  color: var(--subtle);
  font-size: 9px;
}

.revoke-button {
  min-height: 27px;
  padding: 0 8px;
  color: var(--danger);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
}

.revoke-button:hover {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 20%, var(--border));
}

.empty-list {
  display: grid;
  min-height: 150px;
  color: var(--subtle);
  font-size: 11px;
  place-items: center;
  text-align: center;
}

.deployments-panel,
.runs-panel {
  overflow: hidden;
}

.deployments-panel > .panel-title,
.runs-panel > .panel-title {
  margin: 0;
  padding: 16px 18px 13px;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--subtle);
  background: var(--canvas);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

td:first-child {
  color: var(--text);
  font-weight: 550;
}

tbody tr:hover td {
  background: var(--gray-2, #f9f9f9);
}

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

td code {
  padding: 2px 4px;
  color: var(--muted);
  background: var(--surface-subtle);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
}

.table-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 550;
}

.table-status::before {
  width: 5px;
  height: 5px;
  content: "";
  background: var(--subtle);
  border-radius: 50%;
}

.table-status.active,
.table-status.completed {
  color: var(--accent-strong);
}

.table-status.active::before,
.table-status.completed::before {
  background: var(--accent);
}

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

.table-status.failed::before {
  background: var(--danger);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.metric-grid article {
  min-width: 0;
  padding: 17px 18px;
  background: var(--surface);
}

.metric-grid span,
.metric-grid strong,
.metric-grid small {
  display: block;
}

.metric-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.metric-grid strong {
  margin: 7px 0 3px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
}

.metric-grid small {
  color: var(--subtle);
  font-size: 9px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: 360px;
  padding: 10px 13px;
  color: #fff;
  background: var(--text);
  border: 1px solid #333;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 16%);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
  border-color: var(--danger-hover);
}

dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 60px rgb(0 0 0 / 20%);
}

dialog::backdrop {
  background: rgb(0 0 0 / 35%);
}

dialog form {
  padding: 20px;
}

.auth-dialog {
  width: min(420px, calc(100vw - 32px));
}

.auth-dialog::backdrop {
  background: color-mix(in srgb, var(--canvas) 84%, #000);
}

.auth-card {
  padding: 30px;
  text-align: center;
}

.auth-mark {
  display: grid;
  width: 38px;
  height: 38px;
  margin: 0 auto 18px;
  color: #fff;
  background: var(--text);
  border-radius: 8px;
  place-items: center;
}

.auth-mark svg {
  width: 19px;
  height: 19px;
}

.auth-card h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.auth-card > p:not(.eyebrow):not(.auth-status) {
  max-width: 320px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.google-button {
  display: flex;
  min-height: 44px;
  margin: 24px 0 8px;
  align-items: center;
  justify-content: center;
}

.auth-status {
  margin: 8px 0 18px;
  color: var(--subtle);
  font-size: 10px;
}

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

.auth-card > small {
  display: block;
  padding-top: 16px;
  color: var(--subtle);
  border-top: 1px solid var(--border);
  font-size: 9px;
  line-height: 1.5;
}

.account-dialog-card {
  padding: 20px;
}

.account-workspace {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 42px;
  padding: 0 11px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
}

.account-workspace span {
  color: var(--subtle);
}

.account-workspace strong {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-header {
  display: flex;
  gap: 11px;
  margin-bottom: 20px;
}

.dialog-header h2 {
  margin: 1px 0 4px;
  font-size: 15px;
}

.dialog-header p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.dialog-header.danger .dialog-icon {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 20%, var(--border));
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

@media (max-width: 1080px) {
  .content {
    padding-right: 24px;
    padding-left: 24px;
  }

  .builder-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
  }

  .manifest-grid {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .playground-grid {
    grid-template-columns: minmax(0, 1.35fr) 290px;
  }

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .sidebar {
    padding: 0 8px;
  }

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

  .brand > span:last-child,
  .project-switcher > span:nth-child(2),
  .project-switcher > svg,
  .nav-label,
  .nav-item span,
  .sidebar-head > span,
  .agent-meta,
  .agent-status,
  .sidebar-foot > div:nth-child(2),
  .sidebar-foot .icon-button {
    display: none;
  }

  .project-switcher {
    display: flex;
    justify-content: center;
    padding: 7px;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .agent-item {
    display: flex;
    justify-content: center;
    padding: 4px;
  }

  .sidebar-head {
    justify-content: center;
  }

  .sidebar-foot {
    display: flex;
    justify-content: center;
  }

  .builder-grid,
  .manifest-grid,
  .playground-grid {
    grid-template-columns: 1fr;
  }

  .config-column,
  .manifest-summary {
    position: static;
  }

  .playground-grid {
    height: auto;
    min-height: 0;
  }

  .console {
    min-height: 650px;
  }

  .trace {
    min-height: 420px;
  }

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

@media (max-width: 640px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: 48px;
    padding: 0 10px;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    width: 34px;
    height: 47px;
    margin-right: 4px;
  }

  .brand-mark {
    width: 22px;
    height: 22px;
  }

  .project-switcher,
  .agents-section,
  .sidebar-foot {
    display: none;
  }

  .side-nav {
    min-width: 0;
    flex: 1;
    flex-direction: row;
    justify-content: flex-end;
  }

  .nav-item {
    width: 38px;
    min-height: 47px;
    border-radius: 0;
  }

  .nav-item.active {
    background: transparent;
    box-shadow: inset 0 -2px var(--accent);
  }

  .topbar {
    position: static;
    height: 46px;
    padding: 0 14px;
  }

  .service-pill,
  .credit-pill span {
    display: none;
  }

  .content {
    padding: 24px 14px 48px;
  }

  .page-heading {
    min-height: 0;
    margin-bottom: 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .save-state {
    display: none;
  }

  .heading-actions .button {
    flex: 1;
  }

  .field-grid.two,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .form-panel,
  .config-panel,
  .manifest-panel,
  .deployment-summary,
  .api-panel,
  .key-panel {
    padding: 16px;
  }

  .panel-title {
    margin-bottom: 15px;
  }

  .tool-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  .resource-row {
    grid-template-columns: 30px minmax(0, 1fr) 28px;
    gap: 8px;
  }

  .remove-resource {
    opacity: 1;
  }

  .deployment-select {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .deployment-select select {
    width: 100%;
  }

  .console {
    min-height: 590px;
  }

  .trace {
    min-height: 380px;
  }

  .transcript {
    padding: 14px;
  }

  .message {
    max-width: 94%;
  }

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

  .metric-grid {
    gap: 0;
  }

  .metric-grid article + article {
    border-top: 1px solid var(--border);
  }

  .key-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .key-banner .button {
    width: 100%;
  }
}

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