:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: rgb(255 255 255 / 88%);
  --surface-solid: #fff;
  --surface-muted: #f7f7f9;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --subtle: #8e8e93;
  --line: rgb(29 29 31 / 9%);
  --line-strong: rgb(29 29 31 / 16%);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --green: #248a3d;
  --orange: #a94f00;
  --red: #d70015;
  --shadow: 0 1px 2px rgb(0 0 0 / 3%), 0 12px 38px rgb(0 0 0 / 6%);
  --radius-lg: 24px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 14% -10%, rgb(0 113 227 / 7%), transparent 31rem),
    linear-gradient(180deg, #fbfbfd 0, var(--page) 31rem);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="file"] {
  cursor: pointer;
}

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

h1 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.eyebrow,
.section-kicker {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.auth-gate {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
}

.auth-card {
  width: min(100%, 384px);
  padding: 36px;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: 28px;
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 24px 70px rgb(0 0 0 / 10%);
  text-align: center;
  backdrop-filter: saturate(160%) blur(24px);
  -webkit-backdrop-filter: saturate(160%) blur(24px);
}

.auth-brand,
.brand-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1688f7, #0065cc);
  box-shadow: inset 0 1px rgb(255 255 255 / 35%), 0 7px 18px rgb(0 113 227 / 20%);
  color: #fff;
  font-weight: 760;
}

.auth-brand {
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  border-radius: 17px;
  font-size: 28px;
}

.auth-card h1 {
  font-size: 28px;
}

.auth-description {
  margin: 9px 0 24px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.login-form button {
  width: 100%;
  margin-top: 2px;
}

.auth-message {
  min-height: 18px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.site-header,
main,
footer {
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  margin-bottom: 20px;
  padding: 13px 16px;
  border: 1px solid rgb(255 255 255 / 82%);
  border-radius: 19px;
  background: rgb(250 250 252 / 76%);
  box-shadow: 0 5px 24px rgb(0 0 0 / 6%);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.brand-lockup,
.header-actions,
.account-menu,
.health {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 11px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-size: 19px;
}

.header-actions {
  gap: 15px;
  min-width: 0;
}

.health {
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.account-menu {
  gap: 9px;
  min-width: 0;
  padding-left: 15px;
  border-left: 1px solid var(--line);
}

.account-name,
.account-message {
  max-width: 170px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name {
  color: var(--text);
  font-weight: 650;
}

.account-message {
  color: var(--red);
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--subtle);
}

.status-dot.status-healthy {
  background: #34c759;
  box-shadow: 0 0 0 4px rgb(52 199 89 / 11%);
}

.status-dot.status-failed {
  background: #ff3b30;
}

.status-dot.status-pending {
  animation: pulse 1.4s ease-in-out infinite;
}

.control-grid,
.workspace-grid {
  display: grid;
  align-items: start;
  gap: 18px;
}

.control-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.68fr);
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.72fr);
  margin-top: 18px;
}

.panel {
  min-width: 0;
  border: 1px solid rgb(255 255 255 / 90%);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(145%) blur(18px);
  -webkit-backdrop-filter: saturate(145%) blur(18px);
}

.launch-panel,
.server-panel,
.runs-panel,
.detail-panel {
  padding: 24px;
}

.panel-heading,
.subsection-heading,
.connection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading {
  min-height: 38px;
  margin-bottom: 20px;
}

.form-message,
.context-line,
.privacy-note,
.upload-message,
.connection-status {
  color: var(--muted);
  font-size: 11px;
}

.form-message {
  margin: 0;
  text-align: right;
}

.message-success {
  color: var(--green) !important;
}

.message-error {
  color: var(--red) !important;
}

.privacy-note {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgb(29 29 31 / 5%);
  white-space: nowrap;
}

.run-form {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.credential-field {
  max-width: 520px;
}

.credential-field small {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
}

.model-connection {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
}

.connection-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.connection-fields {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(120px, 0.4fr) minmax(240px, 1.3fr);
  gap: 10px;
}

.connection-test-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-test-controls .secondary-button {
  flex: 0 0 auto;
}

.connection-test-status {
  flex: 1 1 auto;
  min-width: 0;
}

.codex-credential-panel {
  display: grid;
  gap: 12px;
}

.api-profile-panel {
  display: grid;
  gap: 12px;
}

.api-profile-select-row,
.api-profile-import-row {
  display: grid;
  align-items: end;
  gap: 10px;
  width: min(100%, 620px);
}

.api-profile-select-row {
  grid-template-columns: minmax(230px, 1fr) auto;
}

.api-profile-import-row {
  grid-template-columns: minmax(230px, 1fr) auto;
}

.codex-profile-row,
.codex-login-tools {
  display: grid;
  gap: 10px;
}

.codex-profile-row {
  grid-template-columns: minmax(230px, 1fr) auto;
  align-items: end;
  width: min(100%, 620px);
}

.codex-profile-actions {
  display: flex;
  gap: 8px;
}

.danger-button {
  color: var(--red);
}

.codex-login-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) repeat(3, auto);
  align-items: end;
  gap: 10px;
  width: min(100%, 620px);
}

.codex-cancel-button {
  color: var(--red);
}

.codex-import-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  align-items: end;
  gap: 10px;
  width: min(100%, 470px);
}

.connection-status {
  min-height: 16px;
  margin: 0;
}

label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: rgb(255 255 255 / 92%);
  box-shadow: inset 0 1px 1px rgb(0 0 0 / 2%);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder {
  color: #a1a1a6;
}

input:focus,
select:focus {
  border-color: rgb(0 113 227 / 58%);
  background: #fff;
  box-shadow: 0 0 0 4px rgb(0 113 227 / 9%);
}

input:disabled,
select:disabled {
  cursor: not-allowed;
  background: rgb(235 235 240 / 70%);
  color: var(--subtle);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  padding: 0 17px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

button:hover:not(:disabled) {
  background: var(--blue-hover);
  box-shadow: 0 5px 14px rgb(0 113 227 / 17%);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgb(0 113 227 / 70%);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.logout-button,
.secondary-button,
.link-button {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 66%);
  color: var(--blue);
  font-size: 11px;
}

.logout-button {
  padding: 0 11px;
}

.secondary-button:hover:not(:disabled),
.link-button:hover:not(:disabled),
.logout-button:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 3px 10px rgb(0 0 0 / 7%);
}

.context-line {
  min-height: 17px;
  margin: 12px 0 0;
}

.instance-upload {
  display: grid;
  grid-template-columns: minmax(130px, 0.65fr) minmax(135px, 0.65fr) minmax(230px, 1.25fr) auto;
  align-items: end;
  gap: 11px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
}

.upload-copy {
  display: grid;
  align-self: center;
  gap: 1px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.upload-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.upload-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upload-message {
  grid-column: 2 / -1;
  min-height: 16px;
  margin: 0;
}

.directory-picker input,
#new-server-pem,
#codex-auth-file-input {
  padding: 4px;
  color: var(--muted);
  font-size: 10px;
}

input::file-selector-button {
  height: 32px;
  margin-right: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: #e9e9ed;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

.server-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.wide-field,
#add-server-button {
  grid-column: 1 / -1;
}

.trust-field {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 9px;
  min-height: 42px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.trust-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--blue);
}

.server-message {
  min-height: 18px;
  margin-top: 12px;
}

.operation-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-muted);
}

.operation-card p {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.operation-card .secondary-button {
  flex: 0 0 auto;
}

.runs-panel,
.detail-panel {
  min-height: 500px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

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

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

th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover,
.selected-row {
  background: rgb(0 113 227 / 4%);
}

.mono {
  color: var(--blue);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.action-cell {
  text-align: right;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgb(110 110 115 / 9%);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.status-running,
.status-preparing,
.status-collecting,
.status-provisioning,
.status-pending {
  background: rgb(255 149 0 / 10%);
  color: var(--orange);
}

.status-queued {
  background: rgb(0 113 227 / 9%);
  color: var(--blue);
}

.status-succeeded,
.status-completed,
.status-online,
.status-ready {
  background: rgb(52 199 89 / 10%);
  color: var(--green);
}

.status-failed,
.status-timeout,
.status-timed_out,
.status-cancelled,
.status-interrupted,
.status-offline {
  background: rgb(255 59 48 / 9%);
  color: var(--red);
}

.empty-state {
  margin: 30px 0 0;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  margin: 12px 0;
  text-align: left;
  font-size: 12px;
}

.detail-fields {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0 0 24px;
  font-size: 12px;
}

.detail-fields dt {
  color: var(--muted);
}

.detail-fields dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.subsection-heading {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.trajectory-heading {
  margin-top: 20px;
}

.event-count {
  color: var(--muted);
  font-size: 11px;
}

.artifact-list,
.event-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.artifact-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  padding: 7px 0;
}

.artifact-list a {
  color: var(--blue);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.artifact-list a:hover {
  text-decoration: underline;
}

.artifact-list span {
  color: var(--muted);
  font-size: 10px;
}

.event-list {
  display: grid;
  max-height: 430px;
  gap: 9px;
  overflow-y: auto;
}

.event-list li {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 74%);
}

.event-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.event-header time {
  color: var(--muted);
  font-weight: 400;
}

.event-list pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  color: #303036;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

footer {
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body {
  overflow-x: hidden;
}

#app-shell,
main,
.app-view,
.disclosure-content,
.api-profile-list,
.server-card-grid {
  min-width: 0;
  max-width: 100%;
}

.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.section-nav {
  display: flex;
  min-width: 0;
  justify-content: center;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-nav-track {
  display: flex;
  min-width: max-content;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgb(29 29 31 / 6%);
  border-radius: 13px;
  background: rgb(118 118 128 / 9%);
}

.section-nav-button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 15px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.section-nav-button:hover:not(:disabled) {
  background: rgb(255 255 255 / 52%);
  box-shadow: none;
  color: var(--text);
}

.section-nav-button.is-active {
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 4px 12px rgb(0 0 0 / 5%);
  color: var(--text);
}

.app-view > .launch-panel {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.app-view > .api-management-panel,
.app-view > .server-panel {
  width: min(100%, 1040px);
  margin-inline: auto;
}

.api-management-panel,
.monitor-panel {
  padding: 24px;
}

.run-primary-flow {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.8fr) 20px
    minmax(170px, 0.9fr) 20px
    minmax(220px, 1.2fr) 20px
    minmax(104px, auto);
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.flow-arrow {
  display: grid;
  height: 42px;
  place-items: center;
  color: #b0b0b5;
  font-size: 17px;
}

#run-button {
  grid-column: auto;
  width: auto;
  min-width: 104px;
  justify-self: stretch;
}

.run-api-hint {
  margin: 10px 0 0;
  color: var(--orange);
  font-size: 12px;
}

.run-instance-row {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  min-width: 0;
}

.run-instance-row .context-line {
  display: flex;
  min-height: 42px;
  align-items: center;
  margin: 0;
  overflow-wrap: anywhere;
}

.disclosure-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(247 247 249 / 78%);
  overflow: clip;
}

.disclosure-card > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.disclosure-card > summary::-webkit-details-marker {
  display: none;
}

.disclosure-card > summary:focus-visible {
  outline: 2px solid rgb(0 113 227 / 70%);
  outline-offset: -3px;
}

.disclosure-card > summary small {
  flex: 1;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.disclosure-card > summary::after {
  content: "+";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgb(29 29 31 / 6%);
  color: var(--muted);
  font-size: 16px;
  font-weight: 450;
}

.disclosure-card[open] > summary {
  border-bottom: 1px solid var(--line);
}

.disclosure-card[open] > summary::after {
  content: "−";
}

.disclosure-content {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.instance-tools {
  margin-top: 14px;
}

.instance-tools .instance-upload {
  margin-top: 0;
}

.effort-field,
.credential-field {
  grid-column: auto;
  width: min(100%, 420px);
}

.api-profile-override {
  width: min(100%, 620px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
}

.api-profile-override small {
  overflow-wrap: anywhere;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 500;
}

.view-description {
  margin: -8px 0 18px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

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

.api-profile-panel {
  margin-bottom: 22px;
}

.api-profile-primary-composer {
  display: grid;
  grid-template-columns:
    minmax(160px, 0.65fr)
    minmax(170px, 0.7fr)
    minmax(240px, 1.15fr)
    auto;
  align-items: end;
  gap: 10px;
}

.api-profile-primary-composer > button {
  min-height: 44px;
}

.api-profile-advanced {
  margin-top: 2px;
}

.api-profile-composer {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.75fr)
    minmax(180px, 0.9fr)
    minmax(120px, 0.55fr)
    minmax(260px, 1.4fr);
  gap: 10px;
}

.api-profile-import-row {
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.35fr) auto;
  width: 100%;
}

.api-list-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.api-list-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.api-profile-list,
.server-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
}

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

.api-vendor-group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 72%);
  box-shadow: inset 0 1px rgb(255 255 255 / 76%);
}

.api-vendor-group > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.api-vendor-group > summary::-webkit-details-marker,
.api-profile-row-details > summary::-webkit-details-marker {
  display: none;
}

.api-vendor-group > summary::after {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
}

.api-vendor-group[open] > summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.api-vendor-group > summary:focus-visible,
.api-profile-row-details > summary:focus-visible {
  outline: 2px solid rgb(0 113 227 / 70%);
  outline-offset: -3px;
}

.api-vendor-group > summary strong {
  min-width: 72px;
  color: var(--text);
  font-size: 15px;
}

.api-vendor-status {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.api-vendor-content {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.api-vendor-toolbar {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

.api-vendor-toolbar .secondary-button,
.api-profile-row-actions .secondary-button {
  min-height: 44px;
}

.api-profile-rows {
  display: grid;
  gap: 8px;
}

.api-profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: rgb(118 118 128 / 6%);
}

.api-profile-row-identity {
  min-width: 0;
}

.api-profile-row-identity h4 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.api-profile-row-identity p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}

.api-profile-row-actions {
  display: flex;
  gap: 7px;
}

.api-profile-row-details {
  grid-column: 1 / -1;
  min-width: 0;
  border-top: 1px solid var(--line);
}

.api-profile-row-details > summary {
  width: max-content;
  padding: 9px 2px 0;
  cursor: pointer;
  list-style: none;
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}

.api-profile-row-details > .api-profile-metadata {
  margin-top: 10px;
}

.api-profile-card,
.server-card {
  display: grid;
  min-width: 0;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgb(255 255 255 / 72%);
  box-shadow: inset 0 1px rgb(255 255 255 / 70%);
}

.api-profile-card-heading,
.server-card-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.api-profile-card-heading h3,
.server-card-heading h3 {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.api-profile-metadata,
.server-card-metrics,
.audit-fields {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
  font-size: 11px;
}

.api-profile-metadata dt,
.server-card-metrics dt,
.audit-fields dt {
  color: var(--muted);
}

.api-profile-metadata dd,
.server-card-metrics dd,
.audit-fields dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

.api-profile-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.api-profile-card-actions .secondary-button {
  min-height: 44px;
}

.server-card-id,
.server-card-message {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}

.server-card-message {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.server-resource-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.server-resource-metric {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px 7px;
  border-radius: 12px;
  background: rgb(118 118 128 / 7%);
  text-align: center;
}

.server-resource-metric strong,
.server-resource-metric span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.server-resource-metric strong {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.server-resource-metric span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.server-card-summary {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.server-onboarding {
  margin-top: 18px;
}

.server-onboarding .server-form {
  width: min(100%, 760px);
}

.monitor-panel {
  margin-bottom: 18px;
}

#history-view .workspace-grid {
  margin-top: 0;
}

.monitor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.monitor-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 10px;
}

.monitor-metrics > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.monitor-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.monitor-metrics strong {
  overflow-wrap: anywhere;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.monitor-note {
  margin: 12px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}

.run-audit-panel {
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-muted);
}

.run-audit-panel .subsection-heading {
  padding-top: 0;
  border-top: 0;
}

.audit-summary {
  margin: 10px 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
}

.audit-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.audit-list li {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
}

.status-valid,
.status-verified,
.status-available,
.status-success,
.status-succeeded,
.status-passed,
.status-ok {
  background: rgb(52 199 89 / 10%);
  color: var(--green);
}

.status-review_required,
.status-degraded,
.status-unverified,
.status-not_tested,
.status-untested,
.status-authenticated_unconfirmed,
.status-in_progress,
.status-testing,
.status-pending {
  background: rgb(255 149 0 / 10%);
  color: var(--orange);
}

.status-infra_failure,
.status-invalid,
.status-rejected,
.status-error,
.status-legacy_unbound,
.status-credential_rejected {
  background: rgb(255 59 48 / 9%);
  color: var(--red);
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@media (max-width: 1220px) {
  .control-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

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

  .run-primary-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(104px, auto);
    gap: 12px;
  }

  .flow-arrow {
    display: none;
  }

  .monitor-metrics {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 1440px);
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    top: 7px;
    margin-top: 7px;
  }

  .section-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    width: 100%;
  }

  .section-nav-track {
    min-width: 100%;
  }

  .section-nav-button {
    flex: 1 0 auto;
  }

  .section-nav-button,
  .logout-button,
  .secondary-button,
  .link-button {
    min-height: 44px;
  }

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

  #run-button {
    width: 100%;
  }

  .run-instance-row {
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
  }

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

  .api-profile-primary-composer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .api-profile-composer .api-base-field {
    grid-column: 1 / -1;
  }

  .api-profile-import-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .api-profile-import-row .secondary-button {
    grid-column: 1 / -1;
  }

  .run-agent-row,
  .connection-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .run-agent-row label:nth-child(2),
  .connection-fields label:nth-child(2) {
    grid-column: span 1;
  }

  .run-agent-row label:last-child,
  .connection-fields label:last-child {
    grid-column: 1 / -1;
  }

  .codex-login-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

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

  .upload-copy,
  .upload-message {
    grid-column: 1 / -1;
  }

  .health span:last-child {
    display: none;
  }

  .account-name,
  .account-message {
    max-width: 100px;
  }
}

@media (max-width: 640px) {
  #runs-table th:last-child,
  #runs-table td.action-cell {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--surface-solid);
    box-shadow: -12px 0 18px -18px rgb(29 29 31 / 55%);
  }

  #runs-table th:last-child {
    z-index: 3;
  }

  #runs-table td.action-cell {
    min-width: 78px;
    padding-left: 18px;
  }

  #runs-table tbody tr:hover > td.action-cell,
  #runs-table tbody tr.selected-row > td.action-cell {
    background: #f5f9ff;
  }
}

@media (max-width: 620px) {
  .auth-card {
    padding: 28px 22px;
  }

  .launch-panel,
  .api-management-panel,
  .monitor-panel,
  .server-panel,
  .runs-panel,
  .detail-panel {
    padding: 18px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 17px;
  }

  .form-message {
    text-align: left;
  }

  .privacy-note {
    align-self: flex-start;
  }

  .run-target-row,
  .run-agent-row,
  .run-primary-flow,
  .run-instance-row,
  .api-scope-grid,
  .api-profile-composer,
  .api-profile-primary-composer,
  .connection-fields,
  .codex-profile-row,
  .codex-login-row,
  .codex-import-row,
  .api-profile-select-row,
  .api-profile-import-row,
  .server-form,
  .instance-upload,
  .run-action-row {
    grid-template-columns: 1fr;
  }

  .api-profile-composer .api-base-field,
  .api-profile-import-row .secondary-button {
    grid-column: 1;
  }

  .api-profile-primary-composer > button {
    width: 100%;
  }

  .run-instance-row .context-line {
    min-height: auto;
  }

  .connection-test-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .connection-test-controls .secondary-button {
    width: 100%;
  }

  .codex-profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .run-agent-row label:nth-child(2),
  .run-agent-row label:last-child,
  .connection-fields label:nth-child(2),
  .connection-fields label:last-child,
  .wide-field,
  #add-server-button,
  .upload-copy,
  .upload-message,
  #run-button,
  .credential-field {
    grid-column: 1;
  }

  #run-button,
  #add-server-button,
  #upload-button {
    width: 100%;
  }

  #run-button {
    justify-self: stretch;
  }

  .section-nav-track {
    min-width: max-content;
  }

  .section-nav-button {
    padding-inline: 13px;
  }

  .api-profile-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .api-vendor-group > summary {
    min-height: 56px;
    padding-inline: 13px;
  }

  .api-vendor-content {
    padding: 0 9px 9px;
  }

  .api-vendor-toolbar .secondary-button {
    width: 100%;
  }

  .api-profile-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 11px;
  }

  .api-profile-row-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .codex-import-row {
    width: 100%;
  }

  .upload-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .trust-field {
    min-height: auto;
  }
}

@media (max-width: 430px) {
  .site-header {
    gap: 10px;
  }

  .eyebrow,
  .site-header h1,
  .account-name {
    display: none;
  }

  .header-actions,
  .account-menu {
    gap: 7px;
  }

  .account-menu {
    padding-left: 8px;
  }

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

  .section-nav-button {
    padding-inline: 12px;
  }

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

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