:root {
  color-scheme: light;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-heading: "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-md: 14px;
  --font-size-lg: 22px;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --text-muted: var(--muted);
  --line: #dbe2ea;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --on-primary: #ffffff;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  --header-surface: #ffffff;
  --header-border: var(--line);
  --brand-kicker-bg: #e2e8f0;
  --nav-tab-text: #1e293b;
  --nav-hover: #f1f5f9;
  --row-hover: #f8fafc;
  --row-alt: #f3f6fa;
  --instruction-open-row-bg: #eef4ff;
  --instruction-open-row-border: #bfdbfe;
  --instruction-open-panel-bg: #f3f7ff;
  --instruction-open-panel-border: #b8cdfa;
  --instruction-open-panel-band: #e5eeff;
  --instruction-open-accent: #1d4ed8;
  --instruction-open-shadow: 0 10px 20px rgba(37, 99, 235, 0.10);
  --button-bg: #ffffff;
  --button-border: #cbd5e1;
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-border-hover: #94a3b8;
  --input-focus-ring: rgba(37, 99, 235, 0.18);
  --code-bg: #eef2ff;
  --pre-bg: #f9fafc;
  --pre-border: #eef2f8;
  --menu-bg: #ffffff;
  --menu-hover: #f8fafc;
  --tab-active-bg: #eff6ff;
  --tab-active-border: #bfdbfe;
  --progress-bg: var(--primary);
  --message-info-bg: #fff7e8;
  --message-info-border: #f5ce8c;
  --message-success-bg: #e6f4e6;
  --message-success-border: #a3d9a3;
  --message-success-text: #166534;
  --message-error-bg: #fdecec;
  --message-error-border: #efb4b4;
  --track-bg: #e2e8f0;
  --count-bg: #f8fafc;
  --count-border: #cbd5e1;
  --warning-bg: var(--tag-amber-bg);
  --warning-border: var(--tag-amber-border);
  --border: var(--line);
  --border-subtle: var(--line);
  --radius: 10px;
  --surface-radius-sm: 10px;
  --surface-radius-md: 12px;
  --surface-radius-lg: 14px;
  --surface-padding: 14px;
  --surface-padding-compact: 12px;
  --surface-alt: var(--surface-3);
  --accent: var(--primary-strong);
  --text-strong: var(--text);
  --spinner-track: rgba(15, 23, 42, 0.18);
  --danger-solid: #b91c1c;
  --danger-contrast: #ffffff;
  --badge-connected-bg: #dcfce7;
  --badge-connected-text: #166534;
  --badge-registered-bg: #e2e8f0;
  --badge-registered-text: #334155;
  --badge-beta-bg: #fef3c7;
  --badge-beta-text: #92400e;
  --badge-clock-bg: #fee2e2;
  --badge-clock-text: #991b1b;
  --badge-clock-border: #fecaca;
  --tag-slate-bg: #e2e8f0;
  --tag-slate-text: #334155;
  --tag-slate-border: #cbd5e1;
  --tag-blue-bg: #dbeafe;
  --tag-blue-text: #1d4ed8;
  --tag-blue-border: #bfdbfe;
  --tag-indigo-bg: #e0e7ff;
  --tag-indigo-text: #4338ca;
  --tag-indigo-border: #c7d2fe;
  --tag-cyan-bg: #cffafe;
  --tag-cyan-text: #0e7490;
  --tag-cyan-border: #a5f3fc;
  --tag-teal-bg: #ccfbf1;
  --tag-teal-text: #0f766e;
  --tag-teal-border: #99f6e4;
  --tag-green-bg: #dcfce7;
  --tag-green-text: #166534;
  --tag-green-border: #bbf7d0;
  --tag-lime-bg: #ecfccb;
  --tag-lime-text: #4d7c0f;
  --tag-lime-border: #d9f99d;
  --tag-amber-bg: #fef3c7;
  --tag-amber-text: #b45309;
  --tag-amber-border: #fde68a;
  --tag-orange-bg: #ffedd5;
  --tag-orange-text: #c2410c;
  --tag-orange-border: #fdba74;
  --tag-violet-bg: #ede9fe;
  --tag-violet-text: #6d28d9;
  --tag-violet-border: #ddd6fe;
  --tag-rose-bg: #ffe4e6;
  --tag-rose-text: #be123c;
  --tag-rose-border: #fecdd3;
  --tag-pink-bg: #fce7f3;
  --tag-pink-text: #be185d;
  --tag-pink-border: #f9a8d4;
  --sticky-header-top: 0px;
  --sticky-primary-nav-top: 58px;
  --sticky-subnav-top: 56px;
  --sticky-subnav-bottom: calc(var(--sticky-subnav-top) + 44px);
  --sticky-header-gap: 12px;
  --sticky-nav-gap: 14px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #172033;
  --surface-3: #0f172a;
  --text: #e5edf8;
  --muted: #94a3b8;
  --text-muted: var(--muted);
  --line: #233044;
  --primary: #60a5fa;
  --primary-strong: #93c5fd;
  --on-primary: #08111f;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  --header-surface: #0f172a;
  --header-border: #243041;
  --brand-kicker-bg: #1e293b;
  --nav-tab-text: #d7e0ec;
  --nav-hover: #162235;
  --row-hover: #132033;
  --row-alt: #182334;
  --instruction-open-row-bg: #16243a;
  --instruction-open-row-border: #31527b;
  --instruction-open-panel-bg: #0f1b31;
  --instruction-open-panel-border: #365886;
  --instruction-open-panel-band: #162949;
  --instruction-open-accent: #93c5fd;
  --instruction-open-shadow: 0 14px 26px rgba(2, 8, 23, 0.42);
  --button-bg: #111827;
  --button-border: #334155;
  --input-bg: #0f172a;
  --input-border: #334155;
  --input-border-hover: #475569;
  --input-focus-ring: rgba(96, 165, 250, 0.22);
  --code-bg: #1d2435;
  --pre-bg: #0d1422;
  --pre-border: #233044;
  --menu-bg: #111827;
  --menu-hover: #1a2435;
  --tab-active-bg: #13233a;
  --tab-active-border: #31527b;
  --progress-bg: #93c5fd;
  --message-info-bg: #2a210d;
  --message-info-border: #6f5718;
  --message-success-bg: #0f2419;
  --message-success-border: #27543a;
  --message-success-text: #7dd3a5;
  --message-error-bg: #2a1214;
  --message-error-border: #723237;
  --track-bg: #233044;
  --count-bg: #172033;
  --count-border: #334155;
  --spinner-track: rgba(229, 237, 248, 0.22);
  --danger-solid: #b91c1c;
  --danger-contrast: #ffffff;
  --badge-connected-bg: #163322;
  --badge-connected-text: #86efac;
  --badge-registered-bg: #1e293b;
  --badge-registered-text: #cbd5e1;
  --badge-beta-bg: #34270d;
  --badge-beta-text: #fcd34d;
  --badge-clock-bg: #3a1115;
  --badge-clock-text: #fca5a5;
  --badge-clock-border: #7f1d1d;
  --tag-slate-bg: #1e293b;
  --tag-slate-text: #cbd5e1;
  --tag-slate-border: #334155;
  --tag-blue-bg: #172554;
  --tag-blue-text: #93c5fd;
  --tag-blue-border: #1d4ed8;
  --tag-indigo-bg: #1e1b4b;
  --tag-indigo-text: #c7d2fe;
  --tag-indigo-border: #4338ca;
  --tag-cyan-bg: #083344;
  --tag-cyan-text: #a5f3fc;
  --tag-cyan-border: #0891b2;
  --tag-teal-bg: #132e2b;
  --tag-teal-text: #7dd3c7;
  --tag-teal-border: #0f766e;
  --tag-green-bg: #12281b;
  --tag-green-text: #86efac;
  --tag-green-border: #166534;
  --tag-lime-bg: #1a2e05;
  --tag-lime-text: #d9f99d;
  --tag-lime-border: #65a30d;
  --tag-amber-bg: #33250f;
  --tag-amber-text: #fcd34d;
  --tag-amber-border: #b45309;
  --tag-orange-bg: #3a1f0f;
  --tag-orange-text: #fdba74;
  --tag-orange-border: #c2410c;
  --tag-violet-bg: #2b1b4a;
  --tag-violet-text: #c4b5fd;
  --tag-violet-border: #7c3aed;
  --tag-rose-bg: #3a1724;
  --tag-rose-text: #fda4af;
  --tag-rose-border: #be123c;
  --tag-pink-bg: #3f1730;
  --tag-pink-text: #f9a8d4;
  --tag-pink-border: #db2777;
  --sticky-header-top: 0px;
  --sticky-primary-nav-top: 58px;
  --sticky-subnav-top: 56px;
  --sticky-subnav-bottom: calc(var(--sticky-subnav-top) + 44px);
  --sticky-header-gap: 12px;
  --sticky-nav-gap: 14px;
}

* { box-sizing: border-box; }
html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
}
html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--primary-strong);
}

a:hover {
  color: var(--primary);
}

.app-shell { padding: 2px 11px; }
.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 5px 16px;
  border: 1px solid var(--header-border);
  background: var(--header-surface);
  border-radius: 14px;
  box-shadow: var(--shadow);
  position: sticky;
  top: var(--sticky-header-top);
  z-index: 60;
}
.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--sticky-header-gap));
  height: var(--sticky-header-gap);
  background: var(--bg);
  pointer-events: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
}
.header-menu__items {
  min-width: 220px;
}
.header-menu__theme {
  padding: 4px;
}
.header-menu__theme .theme-toggle {
  width: 100%;
  justify-content: space-between;
  border-radius: 8px;
  padding: 8px 10px;
}
.header-menu__theme .theme-toggle__label,
.header-menu__theme .theme-toggle__value {
  line-height: 1.1;
}
.brand-block--inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}
.brand-kicker {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-kicker-bg);
  color: var(--primary-strong);
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.section-title,
.modal-title {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-weight: 675;
  color: var(--text-strong);
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.section-title {
  font-size: var(--font-size-md);
}

.modal-title {
  font-size: var(--font-size-md);
}
.brand-title {
  margin-top: 4px;
  font-family: var(--font-heading);
  font-weight: 650;
  font-size: var(--font-size-md);
  letter-spacing: -0.015em;
}
.brand-title--inline {
  margin-top: 0;
  line-height: 1.1;
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  background: var(--surface);
}
.app-shell > .app-nav {
  position: sticky;
  top: var(--sticky-primary-nav-top);
  z-index: 50;
}
.app-shell > .app-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--sticky-nav-gap));
  height: var(--sticky-nav-gap);
  background: var(--bg);
  pointer-events: none;
}
.app-subnav {
  position: sticky;
  top: var(--sticky-subnav-top);
  z-index: 40;
  background: var(--surface);
}
.app-subnav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--sticky-nav-gap));
  height: var(--sticky-nav-gap);
  background: var(--bg);
  pointer-events: none;
}
.app-nav--underline {
  border-bottom: 1px solid var(--line);
  gap: 2px;
}
.nav-tab {
  position: relative;
  display: inline-block;
  padding: 9px 11px;
  color: var(--nav-tab-text);
  text-decoration: none;
  border-radius: 8px 8px 0 0;
  transition: color 120ms ease, background 120ms ease;
  font-size: var(--font-size-md);
  font-weight: 550;
}
.nav-tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--primary-strong);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 140ms ease;
}
.nav-tab:hover {
  background: var(--nav-hover);
}
.nav-tab:focus-visible {
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}
.nav-tab.active {
  color: var(--primary-strong);
  font-weight: 700;
}
.nav-tab.active::after {
  transform: scaleX(1);
}

.nav-tab-button {
  border: none;
  background: transparent;
  cursor: pointer;
}

.navigation-trail {
  flex: 1 1 420px;
  min-width: min(100%, 320px);
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.navigation-trail__segment {
  position: relative;
  flex: 0 0 auto;
}
.navigation-trail__summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px 8px 0 0;
  color: var(--nav-tab-text);
  font-size: var(--font-size-md);
  font-weight: 650;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.navigation-trail__summary::-webkit-details-marker {
  display: none;
}
.navigation-trail__summary:hover,
.navigation-trail__segment[open] .navigation-trail__summary {
  background: var(--nav-hover);
  color: var(--primary-strong);
}
.navigation-trail__summary:focus-visible {
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}
.navigation-trail__label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}
.navigation-trail__separator {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  padding: 0 1px;
}
.navigation-trail__menu {
  position: fixed;
  z-index: 80;
  min-width: 210px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: min(440px, calc(100vh - 96px));
  overflow-y: auto;
  margin-top: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--surface-radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.navigation-trail__item {
  display: block;
  padding: 9px 10px;
  border-radius: var(--surface-radius-sm);
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
}
.navigation-trail__item:hover,
.navigation-trail__item:focus-visible {
  background: var(--row-hover);
  outline: none;
}
.navigation-trail__item.is-active {
  color: var(--primary-strong);
  background: var(--tab-active-bg);
  font-weight: 700;
}

.site-local-tab {
  border: none;
  background: transparent;
  cursor: pointer;
}

.app-main { padding-bottom: 30px; }
h1, h2, h3, th, button, summary {
  font-family: var(--font-heading);
}
h1 { margin: 8px 0 12px 0; font-size: var(--font-size-lg); letter-spacing: -0.025em; font-weight: 650; }
h2, h3 { margin: 8px 0 8px 0; font-weight: 625; letter-spacing: -0.015em; }

.meta {
  color: var(--muted);
  margin: 8px 0 12px 0;
  line-height: 1.45;
}
.agents-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
}
.agents-toolbar__actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px 12px;
  flex-wrap: wrap;
}
.agents-toolbar--instructions {
  justify-content: flex-start;
}
.agents-toolbar__actions--instruction-list {
  justify-content: flex-start;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.agents-toolbar__instruction-search-group {
  display: flex;
  align-items: flex-end;
  gap: 10px 12px;
  flex: 1 1 320px;
  min-width: 0;
  flex-wrap: wrap;
}
.agents-toolbar__instruction-paging-group {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px 12px;
  margin-left: auto;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
.agents-toolbar__search {
  flex: 1 1 320px;
  min-width: 240px;
}
.agents-toolbar__summary {
  margin-left: auto;
  text-align: right;
  min-width: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}
.agents-toolbar__actions--start {
  justify-content: flex-start;
}
.agents-toolbar__actions label {
  margin: 0;
}
.agents-toolbar__page-size,
.agents-toolbar__pager {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
.agents-toolbar__page-size label,
.agents-toolbar__pager span {
  white-space: nowrap;
}
.agents-toolbar__page-size select {
  width: auto;
  min-width: 96px;
}
.agents-toolbar__compact-select {
  width: auto;
  min-width: 76px;
  flex: 0 0 auto;
}
.message-banner {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 10px 0 14px 0;
  padding: 11px 13px;
  border-radius: var(--surface-radius-md);
  border: 1px solid transparent;
  font-size: var(--font-size-md);
  line-height: 1.4;
}
.message-banner__label {
  margin-right: 0;
  flex: 0 0 auto;
  font-weight: 700;
}
.message-banner--info { background: var(--message-info-bg); border-color: var(--message-info-border); color: var(--warning); }
.message-banner--success { background: var(--message-success-bg); border-color: var(--message-success-border); color: var(--message-success-text); }
.message-banner--warning { background: var(--message-info-bg); border-color: var(--message-info-border); color: var(--warning); }
.message-banner--error { background: var(--message-error-bg); border-color: var(--message-error-border); color: var(--danger); }
.form-status-message {
  margin-top: 12px;
  width: 100%;
}
.form-status-message .message-banner {
  margin: 0;
}
.global-action-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}
.global-action-banner {
  margin-top: 0;
}
.global-action-banner__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.global-action-banner__copy {
  min-width: 0;
}

table {
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  width: 100%;
  border-radius: var(--surface-radius-md);
  overflow: visible;
  box-shadow: var(--shadow);
}
.table-scroll-wrap,
.table-responsive {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.table-scroll-wrap > table,
.table-responsive > table {
  min-width: 100%;
}
.agent-dashboard-table {
  min-width: 1080px;
}
.site-topology-table {
  min-width: 980px;
}
.site-topology-mapping-table {
  min-width: 860px;
}
.agent-instructions-table {
  min-width: 1120px;
}
.agent-instructions-bookmarks-table {
  min-width: 760px;
}
.instruction-history-table {
  min-width: 980px;
}
.instruction-bookmarks-table {
  min-width: 860px;
}
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: var(--font-size-md); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; color: var(--text); }
td { color: var(--text); }
table > tbody > tr:nth-child(even) > td { background: var(--row-alt); }
tr.agent-row-nav { cursor: pointer; }
tr.agent-row-nav:hover td { background: var(--row-hover); }
tr.agent-row-nav:has(details.agent-row-action-menu[open]) td {
  background: var(--instruction-open-row-bg);
  box-shadow: inset 0 1px 0 var(--instruction-open-row-border), inset 0 -1px 0 var(--instruction-open-row-border);
}
tr.agent-row-nav:has(details.agent-row-action-menu[open]) td:first-child {
  box-shadow: inset 1px 0 0 var(--instruction-open-row-border), inset 0 1px 0 var(--instruction-open-row-border), inset 0 -1px 0 var(--instruction-open-row-border);
}
tr.agent-row-nav:has(details.agent-row-action-menu[open]) td:last-child {
  box-shadow: inset -1px 0 0 var(--instruction-open-row-border), inset 0 1px 0 var(--instruction-open-row-border), inset 0 -1px 0 var(--instruction-open-row-border);
}
tr.agent-row-nav:has(details.agent-row-action-menu[open]):hover td {
  background: var(--instruction-open-row-bg);
}
tr.pending-row-nav.is-pending-open { cursor: wait; pointer-events: none; }
tr.pending-row-nav.is-pending-open td {
  background: var(--row-hover);
}
tr.pending-row-nav.is-pending-open td:first-child {
  position: relative;
  padding-left: 30px;
}
tr.pending-row-nav.is-pending-open td:first-child::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 12px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--primary-strong);
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}
tr.expandable-row { cursor: pointer; }
tr.instruction-list-row--odd td { background: var(--surface); }
tr.instruction-list-row--even td { background: var(--row-alt); }
tr.expandable-row:hover td { background: var(--row-hover); }
tr.expandable-row.is-expanding { cursor: wait; }
tr.expandable-row.is-expanding td { background: var(--row-hover); }
tr.expandable-row.is-expanded td { background: var(--instruction-open-row-bg); }
tr.expandable-row.instruction-list-row.is-expanded td {
  box-shadow: inset 0 1px 0 var(--instruction-open-row-border), inset 0 -1px 0 var(--instruction-open-row-border);
}
tr.expandable-row.instruction-list-row.is-expanded td:first-child {
  position: relative;
}
tr.expandable-row.instruction-list-row.is-expanded td:first-child::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  border-radius: 999px;
  background: var(--instruction-open-accent);
}
tr.expandable-row.instruction-list-row.is-expanded .expand-indicator {
  color: var(--instruction-open-accent);
  font-weight: 800;
}
tr.expandable-row.instruction-list-row.is-expanded .instruction-list-row__title {
  color: var(--text-strong);
}
.expand-indicator {
  width: 28px;
  text-align: center;
  font-size: var(--font-size-md);
  color: var(--muted);
}
.expand-indicator .lucide-icon {
  display: block;
  margin: 0 auto;
}
.expand-indicator__spinner {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--primary-strong);
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}

.lucide-icon {
  display: inline-block;
  width: var(--icon-size, 16px);
  height: var(--icon-size, 16px);
  flex: 0 0 auto;
  vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.icon-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.icon-label--compact {
  gap: 6px;
}

.icon-label--start {
  justify-content: flex-start;
  width: 100%;
}

.icon-label__text {
  min-width: 0;
  line-height: 1.2;
}

.agent-browser-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-browser-launcher__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success-strong, #047857);
  font-size: var(--font-size-sm);
  font-weight: 700;
  white-space: nowrap;
}

.agent-browser-launcher__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success-strong, #047857);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success-strong, #047857) 18%, transparent);
}

.badge,
.tag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}
.connected { background: var(--badge-connected-bg); color: var(--badge-connected-text); }
.registered { background: var(--badge-registered-bg); color: var(--badge-registered-text); }
.beta { background: var(--badge-beta-bg); color: var(--badge-beta-text); margin-left: 6px; }
.badge-update-available { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); margin-left: 6px; padding: 2px 6px; line-height: 1; }
.badge-clock-issue { background: var(--badge-clock-bg); color: var(--badge-clock-text); border: 1px solid var(--badge-clock-border); margin-left: 6px; }
.tag-badge {
  background: var(--tag-slate-bg);
  color: var(--tag-slate-text);
  border: 1px solid var(--tag-slate-border);
}
.tag-badge[title] {
  cursor: help;
}
.tag-badge code {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}
.tag-badge--slate { background: var(--tag-slate-bg); color: var(--tag-slate-text); border-color: var(--tag-slate-border); }
.tag-badge--blue { background: var(--tag-blue-bg); color: var(--tag-blue-text); border-color: var(--tag-blue-border); }
.tag-badge--indigo { background: var(--tag-indigo-bg); color: var(--tag-indigo-text); border-color: var(--tag-indigo-border); }
.tag-badge--cyan { background: var(--tag-cyan-bg); color: var(--tag-cyan-text); border-color: var(--tag-cyan-border); }
.tag-badge--teal { background: var(--tag-teal-bg); color: var(--tag-teal-text); border-color: var(--tag-teal-border); }
.tag-badge--green { background: var(--tag-green-bg); color: var(--tag-green-text); border-color: var(--tag-green-border); }
.tag-badge--lime { background: var(--tag-lime-bg); color: var(--tag-lime-text); border-color: var(--tag-lime-border); }
.tag-badge--amber { background: var(--tag-amber-bg); color: var(--tag-amber-text); border-color: var(--tag-amber-border); }
.tag-badge--orange { background: var(--tag-orange-bg); color: var(--tag-orange-text); border-color: var(--tag-orange-border); }
.tag-badge--violet { background: var(--tag-violet-bg); color: var(--tag-violet-text); border-color: var(--tag-violet-border); }
.tag-badge--rose { background: var(--tag-rose-bg); color: var(--tag-rose-text); border-color: var(--tag-rose-border); }
.tag-badge--pink { background: var(--tag-pink-bg); color: var(--tag-pink-text); border-color: var(--tag-pink-border); }
.agent-row-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-tone-picker { display: inline-flex; align-items: center; gap: 10px; }
.tag-tone-picker .badge { white-space: nowrap; }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-actions > .btn,
.table-actions > button { margin-top: 0; }
.table-action-icon-button,
.table-action-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0;
}
.table-action-icon-button:not(.confirm-armed):not(.is-loading),
.table-action-icon-link {
  width: 32px;
}
.table-action-icon-button.confirm-armed {
  padding: 0 10px;
}
.table-action-icon-button .busy-button__content,
.table-action-icon-button .busy-button__label {
  width: 100%;
  height: 100%;
}
.instruction-list-row .table-actions {
  flex-wrap: nowrap;
  white-space: nowrap;
}
.instruction-list-row .table-actions > * {
  flex-shrink: 0;
}
.instruction-list-row .table-actions--primary,
.instruction-list-row .table-actions--overflow {
  gap: 6px;
}
.instruction-list-row .table-actions--overflow,
.instruction-row-actions-cell .table-actions {
  justify-content: flex-end;
}
.instruction-result-actions-cell {
  min-width: 116px;
  white-space: nowrap;
}
.instruction-row-actions-cell {
  width: 44px;
  min-width: 44px;
  text-align: right;
  white-space: nowrap;
}
.instruction-row-actions-cell--with-primary {
  min-width: 164px;
}
.instruction-overflow-menu {
  flex: 0 0 auto;
}
.instruction-overflow-menu .action-menu-items {
  min-width: 220px;
}
.instruction-action-menu__picker {
  min-width: 0;
}
.instruction-list-row__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.readonly-field {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--muted);
}
.btn-small { padding: 4px 9px; font-size: var(--font-size-sm); }

.btn, button, a.btn {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid var(--button-border);
  border-radius: 9px;
  background: var(--button-bg);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  margin-top: 8px;
  font-size: var(--font-size-md);
}
.btn.active-tab {
  background: var(--primary);
  border-color: var(--primary-strong);
  color: var(--on-primary);
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary-strong);
  color: var(--on-primary);
  font-weight: 600;
}
.btn-primary:hover {
  filter: brightness(1.05);
}
button:disabled,
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.7;
  cursor: not-allowed;
}
button:hover, .btn:hover { filter: brightness(0.98); }
button.is-loading,
.btn.is-loading {
  position: relative;
  opacity: 0.85;
  cursor: wait !important;
  pointer-events: none;
}
button.busy-button,
.btn.busy-button {
  position: relative;
  overflow: visible;
}
a.is-loading {
  padding-left: 28px;
}
a.is-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--primary-strong);
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}
button.is-loading:not(.busy-button):not(.busy-submit-button) {
  color: transparent !important;
}
button.is-loading:not(.busy-button):not(.busy-submit-button)::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--primary-strong);
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}
button.busy-submit-button.is-loading {
  color: transparent !important;
}
button.busy-submit-button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--primary-strong);
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}
.busy-button__content {
  display: inline-grid;
  grid-template-columns: minmax(0, max-content);
  align-items: center;
  justify-items: center;
  min-width: 0;
  max-width: none;
  overflow: visible;
}
.busy-button__label {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.busy-button__label--hidden {
  visibility: hidden;
}
.busy-button__confirm {
  grid-area: 1 / 1;
  display: inline-block;
  text-align: center;
  min-width: 0;
  width: auto;
  max-width: min(28rem, 80vw);
  font-size: var(--font-size-xs);
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
  padding: 0 6px;
  z-index: 1;
}
button.busy-button.is-loading .busy-button__content,
.btn.busy-button.is-loading .busy-button__content {
  visibility: hidden;
}
.busy-button__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--primary-strong);
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn.confirm-armed,
button.confirm-armed,
.action-menu-item.confirm-armed,
.action-menu-item.confirm-armed:hover,
.action-menu-item.confirm-armed:focus {
  background: var(--danger-solid) !important;
  border-color: var(--danger-solid) !important;
  color: var(--danger-contrast) !important;
}

details.action-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin: 0;
}
details.action-menu > summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
  margin: 0;
}
details.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-items {
  position: fixed;
  left: var(--action-menu-left, 8px);
  top: var(--action-menu-top, 8px);
  right: auto;
  bottom: auto;
  z-index: 2000;
  min-width: 180px;
  max-width: min(360px, calc(100vw - 16px));
  max-height: var(--action-menu-max-height, calc(100vh - 16px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: var(--menu-bg);
  border: 1px solid var(--line);
  border-radius: var(--surface-radius-md);
  box-shadow: var(--shadow);
  padding: 6px;
}
.action-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--menu-bg);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font-size: var(--font-size-md);
  cursor: pointer;
}
.action-menu-item:hover { background: var(--menu-hover); }
.action-menu-item--icon-only,
.action-menu-item--icon-only .busy-button__content,
.action-menu-item--icon-only .busy-button__label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.action-menu-item--editor {
  cursor: default;
}
.action-menu-item--editor:hover {
  background: var(--menu-bg);
}
.action-menu-section {
  margin: 4px 0 2px;
  padding: 6px 10px 2px;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.action-menu-divider {
  margin: 6px 4px;
  border: 0;
  border-top: 1px solid var(--line);
}

.tag-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.tag-picker__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}
.tag-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1;
}
.tag-picker__remove {
  margin: 0;
  min-width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  opacity: 0.8;
  font-size: var(--font-size-sm);
}
.tag-picker__remove:hover {
  background: var(--menu-hover);
  color: inherit;
  opacity: 1;
}
.tag-picker__input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tag-picker__input {
  min-width: 0;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.tag-picker__button {
  margin-top: 0;
  white-space: nowrap;
}
.tag-picker__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-picker__suggestion {
  margin-top: 0;
  cursor: pointer;
  background: transparent;
}
.tag-picker--menu {
  min-width: 220px;
}

code { background: var(--code-bg); padding: 2px 4px; border-radius: 4px; }
code, pre { color: var(--text); font-family: var(--font-mono); }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; background: var(--pre-bg); padding: 8px; border: 1px solid var(--pre-border); }

.box {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--surface-padding);
  margin-bottom: 12px;
  border-radius: var(--surface-radius-lg);
  box-shadow: var(--shadow);
}
.settings-tabs {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.settings-tabs__nav {
  width: 220px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 12px;
  align-self: flex-start;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}
.settings-tabs__tab {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--surface-radius-sm);
  background: transparent;
  text-align: left;
  font-size: var(--font-size-md);
  font-weight: 550;
  color: var(--nav-tab-text);
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.settings-tabs__tab:hover {
  background: var(--row-hover);
}
.settings-tabs__tab.is-active {
  background: var(--tab-active-bg);
  border-color: var(--tab-active-border);
  color: var(--primary-strong);
  font-weight: 700;
}
.settings-tabs__tab.is-pending {
  position: relative;
  padding-left: 32px;
  color: var(--primary-strong);
  background: var(--row-hover);
  pointer-events: none;
  cursor: wait;
}
.settings-tabs__tab.is-pending::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 12px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--primary-strong);
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}
.settings-tabs__panel {
  flex: 1;
  min-width: 0;
}
.settings-tab-content {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.settings-section + .settings-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.settings-section h3,
.settings-section h4 {
  margin: 0 0 12px 0;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
}
.settings-field {
  min-width: 0;
  max-width: min(760px, 100%);
}
.settings-truncate {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-git-repo-table {
  table-layout: fixed;
  width: 100%;
}
.settings-git-repo-table__name {
  width: 18%;
}
.settings-git-repo-table__remote {
  width: 34%;
}
.settings-git-repo-table__branch {
  width: 16%;
}
.settings-git-repo-table__auth {
  width: 10%;
}
.settings-git-repo-table__last-used {
  width: 15%;
}
.settings-git-repo-table__actions {
  width: 7%;
}
.table-action-icon-button.is-pending-confirmation {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--accent);
}
.settings-group {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
  overflow: visible;
}
.settings-group__title {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.settings-group--collapsible > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: var(--font-size-sm);
  font-weight: 650;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.settings-group--collapsible > summary::-webkit-details-marker {
  display: none;
}
.settings-group--collapsible > summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: var(--font-size-md);
  line-height: 1;
}
.settings-group--collapsible[open] > summary::after {
  content: "\2212";
}
.settings-group__body {
  padding: 14px;
  min-width: 0;
}
.settings-tab-content--ingress {
  max-width: none;
}
.ingress-limit-group__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ingress-limit-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.ingress-limit-row.is-disabled {
  border-style: dashed;
  background: var(--surface-3);
}
.ingress-limit-row__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ingress-limit-row__copy {
  min-width: 0;
}
.ingress-limit-row__eyebrow {
  margin-bottom: 4px;
  color: var(--primary-strong);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ingress-limit-row__title {
  color: var(--text);
  font-size: var(--font-size-md);
  font-weight: 700;
  line-height: 1.35;
}
.ingress-limit-row__copy .loading-note {
  margin-top: 4px;
  max-width: 62ch;
}
.ingress-limit-row__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}
.ingress-limit-row__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 5px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--primary-strong);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ingress-limit-row__state.is-disabled {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--muted);
}
.ingress-limit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: 600;
}
.ingress-limit-toggle input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin: 0;
}
.ingress-limit-row__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
}
.ingress-limit-row.is-disabled .ingress-limit-row__grid {
  opacity: 0.68;
}
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.settings-field label {
  margin-top: 0;
}
.settings-readonly-value {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-sizing: border-box;
  background: var(--input-bg);
  color: var(--text);
}
.settings-readonly-value--multiline {
  min-height: 72px;
  white-space: pre-wrap;
  word-break: break-word;
}
.settings-field--checkbox {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.settings-field--checkbox input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin-top: 4px;
}
@media (max-width: 900px) {
  .settings-tabs {
    flex-direction: column;
  }
  .settings-tabs__nav {
    width: 100%;
    min-width: 0;
    position: static;
    top: auto;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    padding-bottom: 12px;
    border-right: 0;
  border-bottom: 1px solid var(--line);
  }
  .ingress-limit-row__header {
    flex-direction: column;
  }
  .ingress-limit-row__status {
    width: 100%;
    align-items: flex-start;
  }
}
label { display: block; margin-top: 12px; margin-bottom: 6px; font-weight: 700; }
input[type=text],
input[type=date],
input[type=time],
input[type=month],
input[type=week],
input[type=file],
input[type=number],
input[type=password],
input[type=url],
select,
textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-sizing: border-box;
  background: var(--input-bg);
  color: var(--text);
}
select {
  min-height: 2.5rem;
  padding-right: 2.75rem;
  border-radius: 10px;
  line-height: 1.3;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
select:hover {
  border-color: var(--input-border-hover);
}
select:focus,
select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}
select:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background-color: var(--surface-2);
  border-color: var(--line);
}
select option,
select optgroup {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  text-align: start;
}
select option {
  font-weight: 500;
}
select option:disabled,
select optgroup:disabled {
  color: var(--muted);
}
select optgroup {
  font-weight: 700;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.search-textbox {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-sizing: border-box;
  background: var(--input-bg);
  color: var(--text);
  color-scheme: inherit;
}
.search-textbox::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type=checkbox],
input[type=radio] {
  accent-color: var(--primary);
}
input[type=file] {
  padding: 6px;
}
input[type=file]::file-selector-button {
  margin-right: 10px;
  padding: 7px 12px;
  border: 1px solid var(--button-border);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--text);
  cursor: pointer;
}
input[type=file]::file-selector-button:hover {
  background: var(--nav-hover);
}
select,
textarea,
input[type=text],
input[type=date],
input[type=time],
input[type=month],
input[type=week],
input[type=number],
input[type=password],
input[type=url],
input[type=file] {
  color-scheme: inherit;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator,
input[type=week]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.8;
}
input[type=date]::-webkit-calendar-picker-indicator:hover,
input[type=time]::-webkit-calendar-picker-indicator:hover,
input[type=month]::-webkit-calendar-picker-indicator:hover,
input[type=week]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.date-time-input {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(8rem, 0.85fr);
  gap: 8px;
  width: 100%;
}
.date-time-input input {
  min-width: 0;
}
@media (max-width: 560px) {
  .date-time-input {
    grid-template-columns: 1fr;
  }
}

.w-full { width: 100%; }
.max-w-420 { max-width: 420px; }
.max-w-520 { max-width: 520px; }
.max-none { max-width: none; }
.adin-creds-table-wrap {
  overflow-x: auto;
}
.adin-creds-table {
  min-width: 1120px;
  table-layout: fixed;
}
.adin-creds-agent-link {
  font-weight: 700;
  text-underline-offset: 5px;
}
.adin-creds-cell-button {
  margin: 0 0 0 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.adin-creds-cell-button:hover,
.adin-creds-cell-button:focus-visible {
  color: var(--primary-strong);
  outline: none;
}
.adin-creds-cell-button__text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adin-creds-cell-button__text--mono {
  font-family: var(--font-mono);
}
.adin-creds-stage {
  display: grid;
  gap: 8px;
}
.adin-creds-stage--modal {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
}
.adin-creds-stage__badge {
  width: fit-content;
  border: 1px solid transparent;
}
.adin-creds-stage__badge--setup {
  background: var(--tag-slate-bg);
  color: var(--tag-slate-text);
  border-color: var(--tag-slate-border);
}
.adin-creds-stage__badge--connect {
  background: var(--tag-blue-bg);
  color: var(--tag-blue-text);
  border-color: var(--tag-blue-border);
}
.adin-creds-stage__badge--license {
  background: var(--tag-amber-bg);
  color: var(--tag-amber-text);
  border-color: var(--tag-amber-border);
}
.adin-creds-stage__badge--ready {
  background: var(--badge-connected-bg);
  color: var(--badge-connected-text);
  border-color: #86efac;
}
.adin-creds-stage__detail {
  color: var(--muted);
  white-space: normal;
  word-break: break-word;
}
.adin-creds-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.adin-creds-modal {
  width: min(920px, 96vw);
}
.adin-creds-modal__value {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  resize: vertical;
  cursor: text;
}
.adin-creds-modal__value--mono {
  font-family: var(--font-mono);
}
.adin-creds-modal__textarea {
  min-height: 180px;
  font-family: var(--font-mono);
}
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.m-0 { margin: 0; }
.nowrap { white-space: nowrap; }
.hidden { display: none; }

.inline-expand-cell { padding: 0 !important; }
.inline-expand-box { margin: 0; width: 100%; max-width: none; box-sizing: border-box; border-left: none; border-right: none; }
.instruction-expand-row .inline-expand-cell {
  position: relative;
  overflow: hidden;
  background: var(--instruction-open-panel-bg) !important;
  padding: 0 0 12px !important;
}
.instruction-expand-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: -1px;
  padding: 14px 16px 16px;
  border: 1px solid var(--instruction-open-panel-border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, var(--instruction-open-panel-band) 0%, var(--instruction-open-panel-bg) 56px);
  box-shadow: var(--instruction-open-shadow);
  animation: instruction-expand-in 0.18s ease-out;
}
.instruction-expand-panel--loading {
  min-height: 92px;
}
.instruction-expand-panel__eyebrow {
  margin-bottom: 10px;
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--instruction-open-accent);
}
.instruction-expand-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--instruction-open-panel-border);
}
.instruction-expand-panel__identity {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.instruction-expand-panel__title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.instruction-expand-panel__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  color: var(--text-strong);
}
.instruction-expand-panel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
}
.instruction-expand-panel__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: var(--font-size-sm);
}
.instruction-expand-panel__meta-label {
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.instruction-expand-panel__status {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
  flex-shrink: 0;
}
.instruction-expand-panel__status-text {
  color: var(--muted);
  font-size: var(--font-size-sm);
}
.instruction-detail-table {
  border: 0;
  box-shadow: none;
  background: transparent;
}
.instruction-detail-table th,
.instruction-detail-table td {
  background: transparent;
}
.instruction-detail-table th {
  width: 180px;
  white-space: nowrap;
}
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.detail-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-start;
}
.detail-strip__item {
  min-width: 140px;
}
.detail-strip__row {
  display: flex;
  flex: 0 0 100%;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: flex-start;
}
.detail-strip__row--taxonomy {
  padding-top: 2px;
}
.detail-strip__item--wide {
  min-width: 220px;
  max-width: 420px;
}
.detail-strip__label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
}
.detail-strip__value {
  display: block;
  font-size: var(--font-size-md);
}
.detail-strip__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.no-top-margin { margin-top: 0 !important; }
.result-table-wrap { overflow: auto; max-height: 420px; border: 1px solid var(--input-border); padding: 8px; background: var(--input-bg); }
.instruction-summary-table {
  border: 0;
  box-shadow: none;
  background: transparent;
  margin-bottom: 8px;
}
.instruction-summary-table th,
.instruction-summary-table td {
  background: transparent;
  vertical-align: top;
}
.instruction-summary-table th {
  width: 120px;
  white-space: nowrap;
}
.instruction-payload-details {
  margin: 8px 0;
}
.instruction-payload-details > summary {
  cursor: pointer;
  font-weight: 600;
}
.instruction-payload-details__body {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.instruction-payload-preview {
  display: grid;
  gap: 10px;
}
.instruction-payload-preview__fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}
.instruction-payload-preview__field {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--pre-border);
  border-radius: 8px;
  background: var(--surface-3);
}
.instruction-payload-preview__label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.instruction-payload-preview__value {
  white-space: pre-wrap;
  word-break: break-word;
}
.instruction-payload-preview__section {
  display: grid;
  gap: 8px;
}
.instruction-payload-preview__section-title {
  font-weight: 600;
}
.instruction-status-tabs {
  margin-top: 10px;
  margin-bottom: 8px;
  padding-top: 4px;
  gap: 6px;
  box-shadow: inset 0 -1px 0 var(--line);
}
.instruction-agent-results-table {
  min-width: 820px;
}
.instruction-message-cell {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.instruction-result-cell {
  line-height: 1.35;
  font-family: var(--font-mono);
}
.instruction-result-cell--compact {
  white-space: nowrap;
}
.instruction-result-cell--long {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: min(40vw, 480px);
}
.instruction-result-raw {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--pre-border);
  border-radius: 8px;
  background: var(--pre-bg);
  padding: 10px;
  max-height: 460px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}
.instruction-result-modal-table {
  min-width: 640px;
}
.instruction-result-modal-table--tabular {
  width: max-content;
  min-width: 100%;
}
.instruction-result-column--compact {
  white-space: nowrap;
}
.instruction-result-column--long {
  min-width: 180px;
}
@keyframes instruction-expand-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .instruction-expand-panel__header {
    flex-direction: column;
  }

  .instruction-expand-panel__status {
    justify-items: start;
    text-align: left;
  }
}

.result-table-wrap .instruction-result-modal-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}
.result-table-wrap .diagnostics-timings-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
}
.sort-header {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.sort-header:hover,
.sort-header:focus-visible {
  color: var(--accent);
  outline: none;
}
.instruction-batch-result-modal {
  width: min(1320px, 98vw);
}
.instruction-batch-result-modal .instruction-result-modal-table {
  min-width: 760px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  z-index: 2000;
}
.modal-panel {
  width: min(1180px, 98vw);
  max-height: min(90vh, 900px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 24;
  background: var(--surface);
  padding-bottom: 8px;
  box-shadow: inset 0 -1px 0 var(--line);
}
.modal-header--sticky {
  position: sticky;
  top: 0;
  z-index: 24;
}
.modal-header h3 {
  margin: 0;
}
.modal-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  margin-top: 0;
  flex-shrink: 0;
}
.instruction-editor-modal {
  width: min(1180px, 98vw);
}
.instruction-editor-modal__body {
  padding-top: 4px;
}
.instruction-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.query-builder-modal {
  width: min(1280px, 98vw);
  max-height: 80vh;
}
.query-builder-body {
  display: grid;
  gap: 12px;
}
.query-builder-target-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.query-builder-tab-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}
.query-builder-tab-shell {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  overflow: hidden;
}
.query-builder-tab-shell.active {
  border-color: var(--border-subtle);
  border-bottom-color: var(--surface);
  background: var(--surface);
  font-weight: 600;
}
.query-builder-tab,
.query-builder-add-tab,
.query-builder-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}
.query-builder-tab {
  min-width: 88px;
  padding: 6px 10px;
  border: 0;
  border-radius: 0;
  white-space: nowrap;
}
.query-builder-tab-title-input {
  min-width: 120px;
  max-width: 220px;
  min-height: 32px;
  padding: 5px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
}
.query-builder-tab.active {
  font-weight: 600;
}
.query-builder-add-tab,
.query-builder-tab-close {
  width: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 6px;
}
.query-builder-tab-close {
  width: 28px;
  min-width: 28px;
  border: 0;
  border-radius: 0;
  color: var(--text-muted);
}
.query-builder-add-tab:hover,
.query-builder-tab-close:hover {
  background: var(--surface-2);
  color: var(--text);
}
.query-builder-modal .instruction-result-monaco {
  min-height: 0;
}
.query-builder-modal .instruction-result-monaco__surface {
  height: 320px;
  min-height: 260px;
  border-radius: 8px;
}
.query-builder-results {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.query-builder-results__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .query-builder-target-row {
    grid-template-columns: 1fr;
  }
}
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.auth-center {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-center h1 {
  margin-top: 0;
}
.field-help {
  margin-top: 4px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.4;
}
.loading-note {
  color: var(--muted);
  font-size: var(--font-size-sm);
}
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  z-index: 10000;
  background: var(--progress-bg);
  opacity: 0.85;
  animation: nav-progress-move 1s linear infinite;
}
@keyframes nav-progress-move {
  0% { transform: scaleX(0.15); transform-origin: left; }
  50% { transform: scaleX(0.6); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}
.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
}
.modal-tab-row {
  top: 52px;
  z-index: 23;
  margin-top: 0;
  padding: 6px 0 8px;
  box-shadow: inset 0 -1px 0 var(--line);
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 12px;
  margin-top: 8px;
}
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}
.scope-picker-list {
  max-height: 260px;
  overflow: auto;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
}
.scope-picker-option {
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.scope-picker-option__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  font-size: var(--font-size-md);
}
.scope-picker-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scope-picker-chip {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: var(--font-size-md);
}
.scope-picker-chip--agent {
  min-width: min(100%, 320px);
}
.access-editor {
  display: grid;
  gap: 18px;
}
.access-editor__feature {
  display: grid;
  gap: 12px;
}
.access-editor__feature--compound {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.access-editor__feature-header {
  display: grid;
  gap: 6px;
}
.access-editor__feature-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.access-editor__group-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.access-editor__feature-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--font-size-md);
  line-height: 1.2;
}
.access-editor__feature-copy {
  margin: 0;
  color: var(--muted);
  font-size: var(--font-size-md);
  line-height: 1.5;
}
.access-editor__hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-3) 100%);
  box-shadow: var(--shadow);
}
.access-editor__eyebrow {
  margin-bottom: 6px;
  color: var(--primary-strong);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.access-editor__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--font-size-md);
  line-height: 1.2;
}
.access-editor__summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.access-editor__search {
  margin-top: 10px;
  width: min(100%, 1040px);
}
.access-editor__search input[type=text] {
  width: 100%;
  padding-left: 14px;
  padding-right: 14px;
  height: 52px;
  border: 2px solid #8b95a3;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: none;
  font-size: var(--font-size-md);
}
.access-editor__search input[type=text]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: none;
}
.access-editor__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.access-editor__card {
  margin: 0;
}
@media (max-width: 900px) {
  .access-editor__hero {
    flex-direction: column;
  }
  .access-editor__summary {
    justify-content: flex-start;
  }
}
.snapshot-browser {
  --snapshot-pane-top: calc(var(--sticky-subnav-bottom) + 12px);
  --snapshot-pane-max-height: calc(100vh - var(--snapshot-pane-top) - 12px);
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.snapshot-browser__sidebar,
.snapshot-browser__content {
  min-width: 0;
}
.snapshot-browser__sidebar {
  position: sticky;
  top: var(--snapshot-pane-top);
  z-index: 30;
  align-self: start;
  height: var(--snapshot-pane-max-height);
  max-height: var(--snapshot-pane-max-height);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}
.snapshot-browser__content {
  position: sticky;
  top: var(--snapshot-pane-top);
  align-self: start;
  height: var(--snapshot-pane-max-height);
  max-height: var(--snapshot-pane-max-height);
  overflow: hidden;
  display: grid;
  gap: 12px;
  min-height: 0;
}
.snapshot-browser__content > .box {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.snapshot-preview {
  max-height: 540px;
  overflow: auto;
}
.instruction-result-monaco {
  min-height: 65vh;
}
.instruction-result-monaco__surface {
  height: 65vh;
  min-height: 420px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}
details.action-menu[data-menu-placement="up"] .action-menu-items {
  transform-origin: bottom right;
}
details.action-menu[data-menu-placement="down"] .action-menu-items {
  transform-origin: top right;
}
.snapshot-browser .instruction-result-monaco {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.snapshot-browser .instruction-result-monaco__surface {
  height: 100%;
  min-height: min(56vh, 520px);
}
.snapshot-table--compact th,
.snapshot-table--compact td {
  padding: 6px 8px;
  line-height: 1.2;
  vertical-align: top;
}
.snapshot-table--compact code {
  font-size: var(--font-size-sm);
}
.snapshot-table--entries td,
.snapshot-table--entries th {
  padding-top: 3px;
  padding-bottom: 3px;
}
.snapshot-table--entries tbody tr {
  cursor: pointer;
}
.script-repository-group__heading {
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  margin-bottom: 4px;
  padding: 3px 0;
  border: 0;
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.script-repository-group__heading:hover {
  color: var(--text);
}
.script-repository-group__chevron {
  width: 14px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.script-repository-group__chevron .lucide-icon {
  display: block;
}
.script-repository-group__title {
  min-width: 0;
}
.script-repository-group__count {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--count-border);
  border-radius: 999px;
  background: var(--count-bg);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0;
}
.script-repository-list {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  gap: 4px;
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.script-upload-panel {
  margin: 0 0 12px;
  padding: var(--surface-padding-compact);
  border: 1px solid var(--line);
  border-radius: var(--surface-radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.script-upload-panel__heading {
  margin-bottom: 8px;
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.script-upload-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.script-review-workspace {
  overflow: hidden;
}
.script-review-workspace__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.script-review-workspace__copy {
  display: grid;
  gap: 6px;
}
.script-review-workspace__copy .section-title {
  margin-bottom: 0;
}
.script-review-workspace__copy .loading-note {
  margin: 0;
  max-width: 72ch;
}
.script-review-workspace__summary {
  min-width: 144px;
  padding: 8px 0 8px 16px;
  border-left: 1px solid var(--line);
  text-align: right;
}
.script-review-workspace__summary-value {
  font-size: clamp(1.75rem, 2vw, 2.25rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-strong);
}
.script-review-workspace__summary-label {
  margin-top: 4px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}
.script-review-action-tabs {
  margin-top: 16px;
}
.script-review-empty-state {
  padding: 24px 0 10px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.script-review-empty-state__title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 6px;
}
.script-review-request-list {
  gap: 12px;
  margin-bottom: 0;
}
.script-review-request {
  margin: 0;
  padding: 12px;
}
.script-review-request__header {
  align-items: flex-start;
  gap: 12px 18px;
}
.script-review-request__identity {
  min-width: 0;
}
.script-review-request__identity .meta {
  margin-bottom: 0;
}
.script-review-request__actions {
  flex-shrink: 0;
}
.script-review-request__actions .btn {
  margin-top: 0;
}
.script-review-request__table td:last-child,
.script-review-request__table th:last-child {
  width: 1%;
  white-space: nowrap;
}
.script-review-request__table .btn {
  margin-top: 0;
}
.global-script-variant-list {
  display: grid;
  gap: 8px;
}
.global-script-variant-item {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.global-script-variant-item.is-current {
  border-color: var(--primary-strong);
  background: color-mix(in srgb, var(--count-bg) 70%, var(--surface));
}
.global-script-variant-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.global-script-variant-item__title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.script-upload-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-weight: 400;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.script-upload-item > input[type="checkbox"] {
  margin-top: 2px;
}
.script-upload-item__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.script-upload-item__actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.script-upload-item__name {
  font-size: var(--font-size-sm);
  color: var(--text-strong);
}
.script-upload-item__path {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.script-repository-group__items {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.script-repository-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.script-repository-preview__header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.script-repository-preview__headline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.script-repository-preview__title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.script-repository-preview__meta {
  margin: 0;
  font-size: var(--font-size-sm);
}
.script-repository-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.script-repository-preview__header .agents-toolbar__actions {
  margin-left: auto;
}
.script-segment-tabs {
  flex: 1 1 auto;
  min-width: 0;
}
.script-repository-workspace {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.script-repository-sidepanel {
  align-self: start;
  min-width: 0;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.script-upload-metadata {
  display: grid;
  gap: 10px;
}
.script-repository-preview__editor {
  position: relative;
  height: 100%;
  min-height: 0;
}
.script-repository-preview__editor.is-loading .instruction-result-monaco__surface {
  opacity: 0.35;
}
.script-repository-preview__loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--text-muted);
  font-size: var(--font-size-md);
  font-weight: 600;
  pointer-events: none;
}
.script-conflict-modal {
  width: min(1320px, 98vw);
}
.script-global-review-modal {
  width: min(1400px, 99vw);
}
.script-conflict-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.script-repository-item {
  appearance: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 2px 8px 6px;
  cursor: pointer;
  display: grid;
  gap: 1px;
}
.script-repository-item:hover {
  background: var(--nav-hover);
}
.script-repository-item:focus-visible {
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}
.script-repository-item.active {
  background: var(--count-bg);
  border-color: var(--count-border);
}
.script-repository-item__name {
  font-size: var(--font-size-md);
  font-weight: 400;
  padding-left: 16px;
  color: var(--text-strong);
}
.script-repository-item__path {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.script-repository-item__meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  .snapshot-browser {
    grid-template-columns: 1fr;
  }
  .snapshot-browser__sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .snapshot-browser__content {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .snapshot-browser__content > .box {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .script-repository-layout {
    grid-template-columns: 1fr;
  }
  .script-repository-workspace {
    min-width: 0;
  }
  .script-repository-sidepanel {
    order: -1;
  }
  .script-repository-list {
    max-height: 320px;
  }
  .script-repository-preview__headline {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .script-review-workspace__header {
    align-items: flex-start;
    flex-direction: column;
  }
  .script-review-workspace__summary {
    min-width: 0;
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
    width: 100%;
  }
  .script-review-request__actions {
    width: 100%;
    justify-content: flex-start;
  }
}
.filter-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  border-radius: 10px 10px 0 0;
  padding: 11px 12px 9px;
  margin: 0;
  position: relative;
  color: var(--nav-tab-text);
  font-size: var(--font-size-md);
  font-weight: 550;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}
.filter-tab::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background: var(--primary-strong);
  transform: scaleX(0);
  transition: transform 140ms ease;
}
.filter-tab:hover {
  background: var(--nav-hover);
}
.filter-tab:focus-visible {
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}
.filter-tab.active {
  color: var(--primary-strong);
  font-weight: 700;
}
.filter-tab.is-pending {
  padding-left: 30px;
  color: var(--primary-strong);
  background: var(--nav-hover);
  pointer-events: none;
  cursor: wait;
}
.filter-tab.is-pending::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 10px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--primary-strong);
  border-radius: 50%;
  animation: btn-spin 0.75s linear infinite;
}
.filter-tab.active::after {
  transform: scaleX(1);
}

/* Keep every filter-tab__count badge on the Agent Script Reviews tab style. */
.filter-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 20px;
  min-width: 1.75em;
  padding: 0 8px;
  font-size: var(--font-size-xs);
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid var(--count-border);
  background: var(--count-bg);
  color: color-mix(in srgb, var(--text) 70%, var(--muted));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 72%, transparent);
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.filter-tab:hover .filter-tab__count {
  transform: translateY(-1px);
}
.filter-tab.active .filter-tab__count,
.filter-tab.is-pending .filter-tab__count {
  border-color: color-mix(in srgb, var(--primary-strong) 42%, var(--count-border));
  background: color-mix(in srgb, var(--primary-strong) 10%, var(--surface));
  color: var(--primary-strong);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 82%, transparent);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
}
.stat-card__label {
  color: var(--muted);
  font-size: var(--font-size-sm);
}
.stat-card__value {
  font-size: var(--font-size-lg);
  font-weight: 800;
  margin-top: 4px;
}
.stat-card__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--font-size-sm);
}
.metric-group {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.metric-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--font-size-md);
}
.metric-row__track {
  margin-top: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--track-bg);
  overflow: hidden;
}
.metric-row__fill {
  height: 100%;
  background: var(--primary);
}

@media (max-width: 860px) {
  :root {
    --sticky-primary-nav-top: 82px;
    --sticky-subnav-top: 114px;
    --sticky-subnav-bottom: calc(var(--sticky-subnav-top) + 44px);
  }
  .app-shell { padding: 12px; }
  h1 { font-size: var(--font-size-lg); }
  .app-header { padding: 12px; }
  th, td { font-size: var(--font-size-md); padding: 8px; }
  .auth-center { min-height: calc(100vh - 150px); }
  .global-action-banner__content {
    flex-direction: column;
    align-items: flex-start;
  }
  .agents-toolbar,
  .agents-toolbar__actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .agents-toolbar__actions--instruction-list {
    flex-wrap: wrap;
    width: 100%;
  }
  .agents-toolbar__instruction-search-group,
  .agents-toolbar__instruction-paging-group {
    width: 100%;
  }
  .agents-toolbar__instruction-paging-group {
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .agents-toolbar__summary {
    margin-left: 0;
    text-align: left;
  }
  .agents-toolbar__page-size,
  .agents-toolbar__pager {
    flex-wrap: wrap;
  }
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid var(--button-border);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
}
.theme-toggle:hover {
  background: var(--nav-hover);
}
.theme-toggle__label {
  font-size: var(--font-size-sm);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}
.theme-toggle__value {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--primary-strong);
}

summary,
details {
  color: var(--text);
}

::selection {
  background: var(--primary);
  color: var(--on-primary);
}
.action-menu-items--picker {
  min-width: 320px;
  max-width: 360px;
}

.agent-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.agent-picker__selection {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.agent-picker__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--font-size-sm);
  line-height: 1;
}
.agent-picker__remove {
  margin: 0;
  min-width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  opacity: 0.8;
  font-size: var(--font-size-sm);
}
.agent-picker__remove:hover {
  background: var(--menu-hover);
  color: inherit;
  opacity: 1;
}
.agent-picker__input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.agent-picker__input {
  min-width: 0;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.agent-picker__suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.agent-picker__suggestion {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.agent-picker__suggestion.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.agent-picker__suggestion:hover {
  background: var(--menu-hover);
}
.agent-picker__primary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.agent-picker__status {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--surface);
}
.agent-picker__status--online {
  background: var(--success-strong, #047857);
}
.agent-picker__status--offline {
  background: var(--text-muted);
}
.agent-picker__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
}
.agent-picker__suggestion.is-selected .agent-picker__check {
  background: var(--accent);
  color: var(--accent-contrast);
}
.agent-picker__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.agent-picker--menu {
  min-width: 280px;
}
.agent-picker--menu .agent-picker__primary {
  font-weight: 500;
}

#components-reconnect-modal {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(4px);
}
#components-reconnect-modal > div {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px 32px;
}
#components-reconnect-modal h5,
#components-reconnect-modal p {
  color: var(--text);
}
#components-reconnect-modal a {
  color: var(--primary);
}
#components-reconnect-modal button {
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  cursor: pointer;
}

.git-instruction-file-list {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.git-instruction-file-list table {
  margin: 0;
}

.git-instruction-file-list thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
}

table > tbody > tr.git-instruction-file-row--invalid > td {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.script-workspace-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.script-workspace-page--full {
  width: 100%;
  min-height: calc(100vh - 112px);
}

.script-workspace-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.script-workspace-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  overflow-x: auto;
  min-height: 42px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.script-workspace-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px 8px 0 0;
  color: var(--nav-tab-text);
  background: transparent;
  font-weight: 550;
}

.script-workspace-tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--primary-strong);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 140ms ease;
}

.script-workspace-tab.active {
  color: var(--primary-strong);
  font-weight: 700;
}

.script-workspace-tab.active::after {
  transform: scaleX(1);
}

.script-workspace-tab__link {
  color: inherit;
  text-decoration: none;
}

.script-workspace-tab__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: var(--font-size-xs);
  font-weight: 800;
  cursor: pointer;
}

.script-workspace-tab__close:hover {
  color: var(--danger);
}

.script-workspace-home {
  min-height: calc(100vh - 54px);
}

.script-workspace-home__header,
.script-workspace-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.script-workspace-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.script-workspace-layout--prototype {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(250px, 300px);
  gap: 8px;
  height: calc(100vh - 54px);
  min-height: 0;
  align-items: stretch;
}

.script-workspace-panel,
.script-workspace-editor-panel {
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.script-workspace-sidebar,
.script-workspace-right-rail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.script-workspace-editor-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.script-workspace-sidebar,
.script-workspace-main {
  min-width: 0;
}

.script-workspace-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.script-workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.script-workspace-toolbar__grow {
  flex: 1 1 220px;
}

.script-workspace-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.script-workspace-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.script-workspace-card-list--compact {
  grid-template-columns: 1fr;
}

.script-workspace-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 9px 0;
  text-align: left;
}

.script-workspace-card.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.script-workspace-card__title {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 650;
  min-width: 0;
}

.script-workspace-card__description,
.script-workspace-card__meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.script-workspace-card__description--inline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-workspace-scope-picker {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.script-workspace-scope-picker summary {
  cursor: pointer;
  font-weight: 650;
}

.script-workspace-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-height: 260px;
  overflow: auto;
  margin-top: 10px;
}

.script-workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.script-workspace-grid__wide {
  grid-column: 1 / -1;
}

.script-workspace-draft-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.script-workspace-draft-list--ide {
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  margin-top: 0;
}

.script-workspace-draft-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.script-workspace-draft-item--compact {
  border-radius: 6px;
  padding: 6px 8px;
}

.script-workspace-draft-item--compact .script-workspace-draft-item__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: var(--font-size-sm);
}

.script-workspace-draft-item:hover {
  background: var(--menu-hover);
}

.script-workspace-draft-item.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.script-workspace-draft-item__title {
  font-weight: 600;
}

.script-workspace-script-item__path {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  overflow-wrap: anywhere;
}

.script-workspace-script-item__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.script-workspace-draft-item__meta {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.script-workspace-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

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

.script-workspace-editor-title {
  font-weight: 550;
  font-size: 1rem;
}

.script-workspace-editor-panel {
  position: relative;
}

.script-workspace-editor-overlay {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.script-workspace-editor-frame {
  flex: 1;
  min-height: 0;
}

.script-workspace-editor-frame .script-workspace-monaco {
  height: 100%;
}

.script-workspace-scope-summary {
  border-bottom: 0;
  padding-bottom: 0;
}

.script-workspace-scope-summary summary {
  cursor: pointer;
  font-weight: 700;
}

.script-workspace-scope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.script-workspace-sidebar .pane-header,
.script-workspace-right-rail .pane-header,
.script-workspace-editor-panel .workspace-editor-header {
  flex: 0 0 auto;
}

.script-workspace-sidebar .script-workspace-pager {
  flex: 0 0 auto;
  padding: 8px;
  border-top: 1px solid var(--line);
  margin-top: 0;
}

.script-workspace-right-rail .queue-list {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

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

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

.script-workspace-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.script-workspace-column__heading {
  font-weight: 700;
}

.script-workspace-editor {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  font: 13px/1.5 var(--font-family-mono, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace);
}

.script-workspace-target-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.script-workspace-target-list--compact {
  max-height: 220px;
  overflow: auto;
}

.script-workspace-target-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 12px;
}

.script-workspace-static-value {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
}

.script-workspace-empty-action {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}

.script-workspace-right-rail .section-title {
  margin-bottom: 8px;
}

.script-workspace-monitor {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.script-workspace-monitor-action {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  margin-top: 0;
}

.script-workspace-monitor-action summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-family: var(--font-family-mono, Consolas, monospace);
  font-size: var(--font-size-xs);
  font-weight: 500;
  list-style: none;
}

.script-workspace-monitor-action summary::-webkit-details-marker {
  display: none;
}

.script-workspace-monitor-action summary::before {
  content: "▸";
  color: var(--muted);
}

.script-workspace-monitor-action[open] summary::before {
  content: "▾";
}

.script-workspace-monitor-action time {
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.script-workspace-monitor-agent-list {
  max-height: 220px;
  overflow: auto;
  border-top: 0;
}

.script-workspace-monitor-agent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 26px;
  padding: 2px 0 2px 14px;
  border-top: 0;
  font-family: var(--font-family-mono, Consolas, monospace);
  font-size: var(--font-size-xs);
}

.script-workspace-monitor-agent-row:first-child {
  border-top: 0;
}

.script-workspace-merge-modal {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.script-workspace-merge-modal__card {
  width: min(90vw, 1400px);
  min-height: 80vh;
  max-height: 90vh;
  overflow: auto;
}

.modal-card {
  width: min(880px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.script-workspace-diff-host {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 58vh;
  overflow: hidden;
}

.script-workspace-merge-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.script-workspace-compare-side-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.script-workspace-metadata-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.script-workspace-create-modal {
  width: min(900px, 92vw);
  max-height: 88vh;
  overflow: auto;
}

.script-workspace-page .primary-button,
.script-workspace-page .ghost-button,
.script-workspace-page .text-button,
.script-workspace-page .icon-button,
.modal .primary-button,
.modal .ghost-button,
.modal .text-button,
.modal .icon-button {
  display: inline-block;
  border: 1px solid var(--button-border);
  border-radius: 9px;
  background: var(--button-bg);
  color: var(--text);
  text-decoration: none;
  font-size: var(--font-size-md);
}

.script-workspace-page .ghost-button,
.script-workspace-page .primary-button,
.script-workspace-page .text-button,
.script-workspace-page .icon-button,
.modal .ghost-button,
.modal .primary-button,
.modal .text-button,
.modal .icon-button {
  min-height: 32px;
  margin-top: 8px;
  padding: 4px 9px;
}

.script-workspace-page .primary-button,
.modal .primary-button {
  background: var(--primary);
  border-color: var(--primary-strong);
  color: var(--on-primary);
  font-weight: 600;
}

.script-workspace-page .text-button,
.modal .text-button {
  border: 0;
  padding-left: 0;
  padding-right: 0;
  color: var(--primary-strong);
  background: transparent;
}

.script-workspace-page .icon-button,
.modal .icon-button {
  width: 32px;
  padding: 0;
}

.script-workspace-page .rail-switch {
  display: inline-flex;
  gap: 4px;
  margin: 6px 0 8px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.script-workspace-page .rail-switch-button {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 650;
  text-decoration: none;
}

.script-workspace-page .rail-switch-button.active {
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.script-workspace-page .queue-empty {
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.script-workspace-page .queue-actions-panel {
  padding: 0 0 6px;
}

.script-workspace-page .queue-actions-panel--centered {
  display: flex;
  justify-content: center;
}

.script-workspace-page .queue-item {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.script-workspace-page .queue-item--compact {
  padding: 5px 0;
}

.script-workspace-page .upload-script-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  font-family: var(--font-family-mono, Consolas, monospace);
  font-size: var(--font-size-xs);
}

.script-workspace-page .upload-status-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  max-height: 280px;
  overflow: auto;
}

.script-workspace-page .upload-status-script {
  margin-top: 6px;
  color: var(--text);
  font-family: var(--font-family-mono, Consolas, monospace);
  font-size: var(--font-size-xs);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-workspace-page .upload-status-subsection {
  margin-top: 6px;
  border-top: 1px solid var(--line);
}

.script-workspace-page .upload-status-subsection summary {
  padding: 6px 0;
  cursor: pointer;
  color: var(--text);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.modal.upload-modal,
.modal.script-workspace-create-modal,
.modal.source-modal,
.modal.base-version-modal,
.modal.diff-modal {
  width: min(880px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.modal.upload-modal .modal-header,
.modal.script-workspace-create-modal .modal-header,
.modal.source-modal .modal-header,
.modal.base-version-modal .modal-header,
.modal.diff-modal .modal-header {
  position: static;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  padding: var(--surface-padding);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
  font-family: var(--font-sans);
}

.modal.upload-modal .modal-header h2,
.modal.script-workspace-create-modal .modal-header h2,
.modal.source-modal .modal-header h2,
.modal.base-version-modal .modal-header h2,
.modal.diff-modal .modal-header h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: var(--font-size-md);
  font-weight: 675;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

.modal.diff-modal {
  width: min(90vw, calc(100vw - 32px));
  min-height: 80vh;
  max-height: calc(100vh - 24px);
}

.modal.source-modal {
  width: min(560px, calc(100vw - 40px));
}

.modal.upload-modal {
  width: min(640px, calc(100vw - 40px));
}

.modal.base-version-modal {
  width: min(760px, calc(100vw - 40px));
}

.modal .workspace-form {
  display: grid;
  gap: 14px;
  padding: var(--surface-padding);
}

.modal .workspace-form label span,
.modal legend {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: 650;
}

.modal .workspace-form input[type="text"],
.modal .workspace-form textarea,
.modal .workspace-form select {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
}

.modal.script-workspace-create-modal .workspace-form input[type="text"]:hover,
.modal.script-workspace-create-modal .workspace-form textarea:hover {
  border-color: var(--input-border-hover);
}

.modal.script-workspace-create-modal .workspace-form input::placeholder,
.modal.script-workspace-create-modal .workspace-form textarea::placeholder,
.modal.script-workspace-create-modal .tag-picker__input::placeholder {
  color: var(--muted);
  font-weight: 400;
  opacity: 0.78;
}

.modal.script-workspace-create-modal .workspace-form input[type="text"]:focus,
.modal.script-workspace-create-modal .workspace-form textarea:focus,
.modal.script-workspace-create-modal .tag-picker__input:focus {
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

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

.modal fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-3);
  padding: 12px;
}

.modal.script-workspace-create-modal .scope-fieldset,
.modal.script-workspace-create-modal .picker-fieldset {
  min-width: 0;
}

.modal.script-workspace-create-modal .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 7px 0;
  color: var(--text);
  font-size: var(--font-size-sm);
}

.modal.script-workspace-create-modal .check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.modal.script-workspace-create-modal .field-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
}

.modal-body {
  padding: var(--surface-padding);
}

.modal-body > .message-banner:first-child,
.modal-body > .compare-metadata:first-child,
.modal-body > .script-workspace-grid:first-child {
  margin-top: 0;
}

.modal.source-modal .script-workspace-monitor-agent-list {
  max-height: min(56vh, 520px);
}

.modal.source-modal .script-workspace-monitor-agent-row {
  min-height: 30px;
  padding-left: 0;
  border-top: 1px solid var(--line);
}

.modal.source-modal .script-workspace-monitor-agent-row:first-child {
  border-top: 0;
}

.modal.diff-modal .script-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.modal.diff-modal .script-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: var(--font-size-xs);
  font-weight: 650;
}

.modal.diff-modal .message-banner {
  margin: 0 0 12px;
}

.compare-layout-switch {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
}

.compare-layout-switch .ghost-button {
  min-height: 24px;
  margin: 0;
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: var(--font-size-xs);
  font-weight: 650;
}

.compare-layout-switch .ghost-button.active {
  color: var(--primary-strong);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.compare-metadata {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
}

.compare-metadata summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.compare-metadata summary::-webkit-details-marker {
  display: none;
}

.compare-metadata summary::after {
  content: "Show";
  margin-left: auto;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.compare-metadata[open] summary {
  margin-bottom: 8px;
}

.compare-metadata[open] summary::after {
  content: "Hide";
}

.compare-metadata .script-workspace-grid {
  margin-top: 0;
}

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

.metadata-grid label span,
.metadata-grid .settings-field label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 650;
}

.metadata-grid input,
.metadata-grid textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text);
  background: var(--input-bg);
  font-size: var(--font-size-sm);
}

.base-version-list {
  display: grid;
  gap: 8px;
  max-height: 22vh;
  overflow: auto;
  margin-bottom: 12px;
}

.base-version-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text);
  text-align: left;
}

.base-version-option.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

.base-version-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.diff-source-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.diff-source-row--inline {
  grid-template-columns: 1fr;
}

.diff-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-3);
}

.diff-source-item strong {
  font-size: var(--font-size-sm);
}

.source-button {
  min-height: 24px;
  margin: 0;
  padding: 0;
  font-size: var(--font-size-xs);
}

.monaco-diff-wrap {
  height: min(58vh, 560px);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.monaco-diff-wrap--inline {
  height: min(62vh, 620px);
  min-height: 480px;
}

.compare-action-row {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
  padding: 10px 0 0;
  background: var(--surface);
}

.compare-action-row--inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compare-action-row .busy-button,
.compare-action-row .busy-button__content,
.compare-action-row .busy-button__label {
  width: 100%;
}

.upload-target-fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-3);
}

.upload-target-fieldset legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.upload-target-option {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.upload-target-option input {
  margin-top: 3px;
}

.upload-target-option strong,
.upload-target-agent span {
  display: block;
  color: var(--text);
  font-size: var(--font-size-sm);
}

.upload-target-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--font-size-xs);
}

.upload-target-agent {
  display: grid;
  gap: 4px;
}

.upload-target-agent select {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 8px;
  color: var(--text);
  background: var(--input-bg);
  font-size: var(--font-size-sm);
}

.script-workspace-toolbar--center {
  justify-content: center;
}

.script-workspace-page--full {
  width: 100%;
  max-width: none;
}

.script-workspace-page .home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

.script-workspace-page .home-grid--workspace-only {
  max-width: none;
}

.script-workspace-page .workspace-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.script-workspace-page .workspace-list .section-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.2;
}

.script-workspace-page .workspace-list .eyebrow,
.modal .eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.script-workspace-page .workspace-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 9px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.script-workspace-page .workspace-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.25;
}

.script-workspace-page .workspace-card-description {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-workspace-page .workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.script-workspace-page .audience-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.script-workspace-page .audience-row span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: var(--font-size-xs);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-workspace-page .scope-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 13%, var(--surface));
  color: var(--primary-strong);
  font-size: var(--font-size-xs);
  font-weight: 800;
}

.script-workspace-page .scope-pill--private {
  background: color-mix(in srgb, var(--success) 13%, var(--surface));
  color: var(--success-strong, #047857);
}

.script-workspace-page .file-browser,
.script-workspace-page .queue-panel,
.script-workspace-page .workspace-editor-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.script-workspace-page .pane-header {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.script-workspace-page .pane-header--compact {
  padding: 9px 10px;
}

.script-workspace-page .pane-header--switch-only {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.script-workspace-page .script-workspace-toolbar.pane-header--switch-only {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: stretch;
  gap: 8px;
}

.script-workspace-page .script-workspace-toolbar .ghost-button,
.script-workspace-page .script-workspace-toolbar .primary-button,
.script-workspace-page .pane-header--switch-only .ghost-button,
.script-workspace-page .pane-header--switch-only .primary-button {
  margin-top: 0;
}

.script-workspace-page .left-header-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
  list-style: none;
}

.script-workspace-page .left-header-toggle::-webkit-details-marker {
  display: none;
}

.script-workspace-page .left-header-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-workspace-page .left-header-stats {
  display: flex;
  grid-column: 1 / -1;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-family-mono, Consolas, monospace);
  font-size: var(--font-size-xs);
}

.script-workspace-page .left-header-caret {
  color: var(--muted);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: lowercase;
}

.script-workspace-page .left-header-caret::before {
  content: "▸";
}

.script-workspace-page .script-workspace-scope-summary[open] .left-header-caret::before {
  content: "▾";
}

.script-workspace-page .left-header-details {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.script-workspace-page .file-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.script-workspace-page .script-workspace-sidebar > .queue-empty {
  margin: 0;
  padding: 8px;
}

.script-workspace-page .file-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 26px;
}

.script-workspace-page .file-entry:not(.has-upload-check) {
  grid-template-columns: minmax(0, 1fr);
}

.script-workspace-page .upload-check {
  width: 14px;
  height: 14px;
  margin: 0;
}

.script-workspace-page .file-button {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 25px;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.script-workspace-page .file-button:hover,
.script-workspace-page .file-button.active {
  background: var(--menu-hover);
}

.script-workspace-page .file-button.active {
  color: var(--primary-strong);
}

.script-workspace-page .file-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
  opacity: 0.6;
}

.script-workspace-page .file-button.has-draft .file-dot,
.script-workspace-page .upload-script-row .file-dot {
  background: var(--primary-strong);
  opacity: 1;
}

.script-workspace-page .file-id {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-family-mono, Consolas, monospace);
  font-size: var(--font-size-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-workspace-page .workspace-editor-section {
  min-width: 0;
}

.script-workspace-page .workspace-editor-header {
  min-height: 50px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.script-workspace-page .editor-stage {
  flex: 1;
  min-height: 0;
  padding: 14px;
}

.script-workspace-page .empty-editor {
  height: 100%;
  min-height: 360px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.script-workspace-page .empty-editor-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
}

.script-workspace-page .empty-editor-inner--stacked {
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.script-workspace-page .empty-editor-inner--stacked h2 {
  margin: 0;
  font-size: 1.1rem;
}

.script-workspace-page .empty-editor-inner--stacked p {
  max-width: 540px;
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.script-workspace-page .empty-editor-kicker {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.script-workspace-page .empty-editor-actions {
  flex-wrap: wrap;
}

.script-workspace-page .queue-panel {
  min-width: 0;
}

.script-workspace-page .queue-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.script-workspace-page .editor-icon-button,
.script-workspace-page .current-script-refresh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--button-border);
  border-radius: 9px;
  background: var(--button-bg);
  color: var(--text);
}

.script-workspace-page .ghost-button.active,
.script-workspace-page .ghost-button:hover,
.modal .ghost-button.active,
.modal .ghost-button:hover {
  background: var(--menu-hover);
  color: var(--primary-strong);
}

/* Script workspace prototype parity overrides. Keep these after the manager
   compatibility rules above so the repository replacement matches the mockup. */
.script-workspace-page {
  --tabs-height: 42px;
  gap: 0;
}

.script-workspace-page--full {
  min-height: 100vh;
}

.script-workspace-home {
  min-height: calc(100vh - var(--tabs-height) - 12px);
}

.script-workspace-layout--prototype {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(250px, 300px);
  gap: 8px;
  height: calc(100vh - var(--tabs-height) - 12px);
}

.script-workspace-page .workspace-list .eyebrow,
.script-workspace-page .left-header-details .eyebrow,
.modal.upload-modal .eyebrow,
.modal.script-workspace-create-modal .eyebrow,
.modal.source-modal .eyebrow,
.modal.base-version-modal .eyebrow,
.modal.diff-modal .eyebrow {
  display: inline-block;
  width: fit-content;
  margin: 0 0 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.script-workspace-page .workspace-card:first-of-type {
  border-top: 0;
}

.script-workspace-page .workspace-card h3 {
  margin: 2px 0 5px;
  font-size: 15px;
  font-weight: 675;
}

.script-workspace-page .workspace-card-description {
  font-weight: 400;
}

.script-workspace-page .pane-header--compact {
  padding: 8px;
}

.script-workspace-page .left-header-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
}

.script-workspace-page .left-header-toggle:hover {
  background: var(--menu-hover);
}

.script-workspace-page .left-header-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-md);
  font-weight: 675;
}

.script-workspace-page .left-header-summary {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  padding: 0 0 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

.script-workspace-page .script-workspace-scope-summary[open] .left-header-summary {
  display: none;
}

.script-workspace-page .left-header-details {
  gap: 8px;
  margin-top: 0;
  padding: 8px 7px 4px;
}

.script-workspace-page .left-header-details .script-discovery-panel {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin: 2px -7px -4px;
  padding: 8px 7px 4px;
  border-top: 1px solid var(--line);
}

.script-workspace-page .script-prefix-group {
  display: grid;
  gap: 2px;
}

.script-workspace-page .script-prefix-group__summary {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.script-workspace-page .script-prefix-group__summary:hover {
  background: var(--menu-hover);
}

.script-workspace-page .script-prefix-group__summary::-webkit-details-marker {
  display: none;
}

.script-workspace-page .script-prefix-group__summary::before {
  content: "▸";
  grid-column: 1;
  width: 12px;
  color: var(--muted);
  font-size: 11px;
}

.script-workspace-page .script-prefix-group[open] > .script-prefix-group__summary::before {
  content: "▾";
}

.script-workspace-page .script-prefix-group__name {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.script-workspace-page .script-prefix-group__count {
  grid-column: 3;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.script-workspace-page .script-prefix-group__items {
  display: grid;
  gap: 2px;
}

.script-workspace-page .file-entry.has-upload-check {
  grid-template-columns: 18px minmax(0, 1fr);
}

.script-workspace-page .file-button {
  grid-template-columns: 10px minmax(0, 1fr) auto;
  min-height: 26px;
  padding: 4px 7px;
  border: 1px solid transparent;
}

.script-workspace-page .file-button .busy-button__content,
.script-workspace-page .file-button .busy-button__label {
  width: 100%;
  min-width: 0;
}

.script-workspace-page .file-button .busy-button__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  overflow: hidden;
}

.script-workspace-page .file-button .busy-button__label {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  justify-items: stretch;
  gap: 7px;
  overflow: hidden;
}

.script-workspace-page .file-button:hover {
  background: var(--menu-hover);
}

.script-workspace-page .file-button.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
}

.script-workspace-page .file-dot {
  background: var(--tag-slate-border);
  opacity: 1;
}

.script-workspace-page .file-button.has-draft .file-dot,
.script-workspace-page .upload-script-row .file-dot {
  background: var(--tag-green-text);
}

.script-workspace-page .file-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.script-workspace-page .script-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 18px;
  padding: 1px 6px;
  border: 1px solid var(--tag-blue-border);
  border-radius: 999px;
  background: var(--tag-blue-bg);
  color: var(--tag-blue-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.script-workspace-page .workspace-editor-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.004em;
}

.script-workspace-page .editor-icon-button,
.script-workspace-page .current-script-refresh-button {
  width: 24px;
  min-height: 24px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.script-workspace-page .editor-icon-button:hover,
.script-workspace-page .current-script-refresh-button:hover {
  border-color: var(--button-border);
  background: var(--menu-hover);
  color: var(--primary-strong);
}

.script-workspace-page .empty-editor {
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-3);
  text-align: center;
}

.script-workspace-page .empty-editor-inner--stacked h3,
.script-workspace-page .empty-editor h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.1rem;
}

.script-workspace-page .empty-editor-actions {
  flex-direction: column;
  flex-wrap: nowrap;
  padding: 20px;
}

.script-workspace-page .empty-editor-actions > .busy-button {
  margin-top: 0;
}

.script-workspace-page .queue-id {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--muted);
  text-transform: none;
}

.script-workspace-page .monitor-action summary,
.script-workspace-page .script-workspace-monitor-action summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
}

.script-workspace-page .monitor-action summary .meta,
.script-workspace-page .script-workspace-monitor-action summary .meta {
  display: none;
}

.script-workspace-page .upload-status-section {
  max-height: 280px;
}

.modal.diff-modal .script-meta-row {
  display: none;
}

.modal.diff-modal .modal-header h2 {
  font-weight: 550;
}

.compare-metadata summary.compare-heading {
  justify-content: space-between;
}

.base-version-list {
  max-height: 56vh;
}

.base-version-option p {
  margin: 6px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  line-height: 1.45;
}

.compare-action-row {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), var(--surface) 34%);
}

.compare-action-row .primary-button,
.compare-action-row .ghost-button,
.compare-action-row .busy-button,
.compare-action-row .busy-button__content,
.compare-action-row .busy-button__label {
  width: fit-content;
}

.compare-action-row .primary-button,
.compare-action-row .busy-button:last-child {
  justify-self: end;
}

.compare-action-row--inline {
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
}

.source-group {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.source-group:first-child {
  border-top: 0;
  padding-top: 0;
}

@media (max-width: 1100px) {
  .script-workspace-layout,
  .script-workspace-layout--prototype {
    grid-template-columns: 1fr;
  }

  .script-workspace-panel,
  .script-workspace-editor-panel {
    min-height: auto;
    height: auto;
    max-height: none;
  }

  .script-workspace-columns {
    grid-template-columns: 1fr;
  }

  .script-workspace-heading {
    flex-direction: column;
  }

  .script-workspace-heading__actions {
    justify-content: flex-start;
  }
}

.agent-details-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.agent-details-toolbar__identity {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.agent-details-toolbar__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-details-toolbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.agent-browser-modal-shell {
  position: fixed;
  top: 5.5rem;
  right: 1.5rem;
  width: min(72rem, calc(100vw - 3rem));
  height: min(46rem, calc(100vh - 7rem));
  z-index: 1800;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--surface-radius-lg);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18), var(--shadow);
  overflow: hidden;
  resize: both;
}

.agent-browser-modal-shell.is-minimized {
  width: min(28rem, calc(100vw - 3rem));
  height: auto;
  min-height: 0;
  right: 1.5rem !important;
  bottom: 1.5rem !important;
  top: auto !important;
  left: auto !important;
  resize: none;
  overflow: visible;
}

.agent-browser-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: var(--surface-padding);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--line);
  cursor: move;
}

.agent-browser-modal-shell.is-minimized .agent-browser-modal__header {
  border-bottom: none;
  box-shadow: none;
}

.agent-browser-modal__window-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agent-browser-modal__window-button {
  margin-top: 0;
  flex: 0 0 auto;
}

.agent-browser-modal__window-button,
.agent-browser-modal__window-button .busy-button__content,
.agent-browser-modal__window-button .busy-button__label {
  width: 32px;
  height: 32px;
}

.agent-browser-modal__toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  padding: var(--surface-padding) var(--surface-padding) 0;
}

.agent-browser-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 12rem;
  color: var(--text);
  font-size: var(--font-size-sm);
  font-weight: 650;
}

.agent-browser-modal__field--compact {
  min-width: 7rem;
}

.agent-browser-modal__field--grow {
  flex: 1 1 18rem;
}

.agent-browser-modal__field input,
.agent-browser-modal__field select {
  min-height: 2.35rem;
  color: var(--text);
  background-color: var(--input-bg);
  border-color: var(--input-border);
}

.agent-browser-modal__toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agent-browser-modal__toolbar-actions .btn,
.agent-browser-session-card__actions .btn {
  margin-top: 0;
}

.agent-browser-modal__empty {
  margin: var(--surface-padding);
  padding: var(--surface-padding);
  border: 1px dashed var(--line);
  border-radius: var(--surface-radius-md);
  background: var(--surface-3);
  color: var(--muted);
}

.agent-browser-modal__note {
  margin: var(--surface-padding) var(--surface-padding) 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--surface-radius-md);
  background: var(--surface-3);
  color: var(--muted);
  font-size: var(--font-size-sm);
  line-height: 1.45;
}

.remote-desktop-readiness-list {
  display: grid;
  gap: 6px;
  margin: 8px var(--surface-padding) 0;
  padding: 0;
  list-style: none;
  color: var(--text);
  font-size: var(--font-size-sm);
}

.remote-desktop-readiness-list__item {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--surface-radius-sm);
  background: var(--surface-3);
}

.remote-desktop-readiness-list__status {
  color: var(--muted);
  font-weight: 700;
  text-transform: capitalize;
}

.remote-desktop-readiness-list__status--ok {
  color: var(--success);
}

.remote-desktop-readiness-list__status--failed {
  color: var(--danger);
}

.agent-browser-session-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 14rem;
  padding: var(--surface-padding);
  overflow: auto;
}

.agent-browser-session-card {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--surface-radius-md);
  background: var(--surface-3);
}

.agent-browser-session-card__main {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
}

.agent-browser-session-card__title-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.agent-browser-session-card__details {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: var(--font-size-sm);
}

.agent-browser-session-card__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.is-dragging-floating-window {
  user-select: none;
}

.remote-desktop-page {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  background: #0f172a;
  color: #f8fafc;
  overflow: hidden;
}

.remote-desktop-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.remote-desktop-shell:fullscreen,
.remote-desktop-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  background: #0f172a;
}

.remote-desktop-toolbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.32);
  background: #111827;
}

.remote-desktop-toolbar h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 650;
}

.remote-desktop-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 320px;
  min-width: 0;
}

.remote-desktop-scale-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
}

.remote-desktop-scale-button {
  min-height: 2rem;
  border-color: transparent;
  color: #cbd5e1;
  background: transparent;
}

.remote-desktop-scale-button[aria-pressed="true"] {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.72);
  border-color: rgba(147, 197, 253, 0.42);
}

.remote-desktop-clipboard {
  position: relative;
}

.remote-desktop-clipboard__toggle[aria-pressed="true"] {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.72);
  border-color: rgba(147, 197, 253, 0.42);
}

.remote-desktop-clipboard__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(380px, calc(100vw - 24px));
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.42);
}

.remote-desktop-clipboard__panel[hidden] {
  display: none;
}

.remote-desktop-clipboard__label {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.remote-desktop-clipboard__text {
  width: 100%;
  min-height: 7rem;
  max-height: min(34vh, 18rem);
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  color: #f8fafc;
  background: #020617;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.remote-desktop-clipboard__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.remote-desktop-clipboard__status {
  min-height: 18px;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}

.remote-desktop-clipboard__status[data-state="success"] {
  color: #bbf7d0;
}

.remote-desktop-clipboard__status[data-state="warning"] {
  color: #fde68a;
}

.remote-desktop-eyebrow {
  margin-bottom: 2px;
  color: #94a3b8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.remote-desktop-status {
  flex: 0 1 min(560px, 100%);
  min-width: min(280px, 100%);
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 14px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.remote-desktop-status[data-state="connected"] {
  border-color: rgba(34, 197, 94, 0.55);
  color: #bbf7d0;
}

.remote-desktop-status[data-state="warning"] {
  border-color: rgba(245, 158, 11, 0.58);
  color: #fde68a;
}

.remote-desktop-status[data-state="waiting"],
.remote-desktop-status[data-state="closing"] {
  border-color: rgba(56, 189, 248, 0.55);
  color: #bae6fd;
}

.remote-desktop-status[data-state="error"],
.remote-desktop-status[data-state="closed"] {
  border-color: rgba(248, 113, 113, 0.58);
  color: #fecaca;
}

@media (max-width: 760px) {
  .remote-desktop-clipboard {
    position: static;
  }

  .remote-desktop-clipboard__panel {
    position: fixed;
    top: 74px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

.remote-desktop-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #020617;
  outline: none;
}

.remote-desktop-stage--fit {
  overflow: hidden;
}

.remote-desktop-stage--actual {
  overflow: auto;
}

.remote-desktop-display {
  display: block;
  transform-origin: 0 0;
  z-index: 0;
}

.remote-desktop-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #94a3b8;
  text-align: left;
  pointer-events: auto;
}

.remote-desktop-placeholder[hidden] {
  display: none;
}

.remote-desktop-placeholder__card {
  width: min(100%, 720px);
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.92);
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.35);
}

.remote-desktop-placeholder strong {
  color: #e2e8f0;
  font-size: 18px;
}

.remote-desktop-placeholder__message {
  margin: 0;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.45;
}

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

.remote-desktop-retry-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 650;
}

.remote-desktop-retry-field input,
.remote-desktop-retry-field select {
  min-height: 2.35rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
}

.remote-desktop-retry-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .remote-desktop-retry-form {
    grid-template-columns: 1fr;
  }

  .agent-browser-modal-shell {
    left: 0.75rem;
    right: 0.75rem;
    top: 4.75rem;
    width: auto;
    height: calc(100vh - 6rem);
    resize: none;
  }

  .agent-browser-modal__toolbar {
    align-items: stretch;
  }

  .agent-browser-modal__field,
  .agent-browser-modal__field--compact,
  .agent-browser-modal__field--grow {
    min-width: 100%;
    flex: 1 1 100%;
  }

  .agent-browser-session-list {
    padding: 12px;
  }

  .agent-browser-session-card {
    flex-direction: column;
  }

  .agent-browser-session-card__actions {
    width: 100%;
  }
}
