:root {
  color-scheme: light;
  --canvas: #f4f5f3;
  --surface: #ffffff;
  --surface-subtle: #f8f9f7;
  --surface-strong: #ecefec;
  --ink: #202421;
  --muted: #69706b;
  --faint: #8e9690;
  --line: #d9ddd9;
  --line-strong: #bfc5c0;
  --green: #16774f;
  --green-dark: #0d5a3a;
  --green-soft: #e8f3ed;
  --orange: #b85d18;
  --orange-soft: #fff0e2;
  --red: #a13d35;
  --red-soft: #fbecea;
  --header-height: 57px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  background: var(--canvas);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

button {
  min-height: 34px;
  padding: 6px 11px;
  cursor: pointer;
  font-weight: 650;
}

button:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green-dark);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

input,
select {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  font-weight: 400;
}

textarea {
  display: block;
  width: 100%;
  min-height: 250px;
  padding: 11px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.55;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 690;
}

h1:focus {
  outline: none;
}

h1:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 690;
}

h3 {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

pre {
  max-width: 100%;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
  padding: 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.5;
}

a {
  color: var(--green-dark);
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

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

.product-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--line);
  padding-right: 18px;
  color: var(--ink);
  font-weight: 750;
}

.brand-mark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 5px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
}

.product-name {
  padding: 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.product-nav {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.nav-button {
  position: relative;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 13px;
  color: var(--muted);
  font-size: 12px;
}

.nav-button::after {
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 2px;
  background: transparent;
  content: "";
}

.nav-button.is-active {
  color: var(--ink);
}

.nav-button.is-active::after {
  background: var(--green);
}

.environment-label {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 3px 6px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 750;
}

.app-shell {
  min-height: calc(100svh - var(--header-height));
}

.view {
  min-width: 0;
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 28px 20px;
}

.section-kicker {
  margin-bottom: 4px;
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.heading-actions,
.checkpoint-actions,
.dialog-actions,
.output-heading,
.run-actionbar,
.rail-heading,
.workspace-section-heading,
.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.primary-button,
.run-button {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.primary-button:hover:not(:disabled),
.run-button:hover:not(:disabled) {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #ffffff;
}

.run-button {
  min-width: 68px;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  font-size: 19px;
  line-height: 1;
}

.library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 430px) 180px minmax(70px, 1fr);
  align-items: end;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 28px;
}

.search-control {
  position: relative;
}

.search-control input {
  padding-left: 31px;
}

.search-icon {
  position: absolute;
  z-index: 1;
  bottom: 6px;
  left: 10px;
  color: var(--muted);
  font-size: 18px;
}

.filter-control {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.result-count {
  justify-self: end;
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.inline-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.inline-status:empty {
  min-height: 0;
}

.inline-status[data-state="error"] {
  color: var(--red);
}

.inline-status[data-state="warning"] {
  color: var(--orange);
}

.inline-status[data-state="success"] {
  color: var(--green-dark);
}

#libraryStatus {
  margin: 8px 28px 0;
}

.table-frame {
  min-width: 0;
  background: var(--surface);
}

.library-pagination {
  display: flex;
  justify-content: center;
  padding: 12px 28px 18px;
}

.trust-corpus-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 0 28px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-dark);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 16px 18px;
}

.trust-corpus-panel h2,
.trust-corpus-panel p {
  margin: 0;
}

.trust-corpus-panel p:not(.section-kicker) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.trust-corpus-summary {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.trust-corpus-summary strong {
  color: var(--text);
  font-size: 16px;
}

.snapshot-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.snapshot-table th {
  height: 34px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.snapshot-table th:first-child,
.snapshot-table td:first-child {
  padding-left: 28px;
  width: 19%;
}

.snapshot-table th:nth-child(2) {
  width: 15%;
}

.snapshot-table th:nth-child(3) {
  width: 9%;
}

.snapshot-table th:nth-child(4) {
  width: 20%;
}

.snapshot-table th:nth-child(5),
.snapshot-table th:nth-child(6),
.snapshot-table th:nth-child(7) {
  width: 7%;
}

.snapshot-table th:last-child {
  width: 16%;
}

.snapshot-table td {
  height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.snapshot-table tbody tr {
  background: var(--surface);
  transition: background-color 120ms ease;
}

.snapshot-table tbody tr:hover,
.snapshot-table tbody tr.is-selected {
  background: var(--green-soft);
}

.snapshot-table tbody tr[data-state="failed"] {
  background: var(--red-soft);
}

.snapshot-table tbody tr[data-state="degraded"] {
  box-shadow: inset 3px 0 0 var(--orange);
}

.number-cell {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.row-select {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  gap: 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  text-align: left;
}

.row-select strong,
.row-select code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-select strong {
  font-size: 12px;
}

.row-select code {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}

.window-cell span {
  white-space: nowrap;
}

.recipe-cell {
  white-space: nowrap;
}

.created-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.loading-row td,
.empty-row td {
  height: 160px;
  color: var(--muted);
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--green);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 800ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-strong);
  padding: 2px 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.status-badge[data-state="ready"],
.status-badge[data-state="completed"] {
  border-color: #9ac6ae;
  background: var(--green-soft);
  color: var(--green-dark);
}

.status-badge[data-state="degraded"],
.status-badge[data-state="preparing"],
.status-badge[data-state="warning"] {
  border-color: #e1b383;
  background: var(--orange-soft);
  color: var(--orange);
}

.status-badge[data-state="failed"],
.status-badge[data-state="invalid"] {
  border-color: #ddb0aa;
  background: var(--red-soft);
  color: var(--red);
}

.snapshot-inspector {
  position: fixed;
  z-index: 25;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: min(390px, 100vw);
  overflow: auto;
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: -12px 0 28px rgba(32, 36, 33, 0.1);
  padding: 22px;
}

.inspector-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

#inspectorStatus {
  margin-top: 12px;
}

.detail-list,
.compact-detail-list {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  margin: 10px 0 0;
}

.detail-list dt,
.detail-list dd,
.compact-detail-list dt,
.compact-detail-list dd {
  min-width: 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
  font-size: 11px;
}

.detail-list dt,
.compact-detail-list dt {
  color: var(--muted);
}

.detail-list dd,
.compact-detail-list dd {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.detail-list code,
.compact-detail-list code {
  font-size: 10px;
}

.inspector-section {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 16px;
}

.issue-list {
  margin-top: 9px;
}

.issue-item {
  border-left: 3px solid var(--orange);
  background: var(--orange-soft);
  padding: 8px 9px;
  color: var(--orange);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.empty-state {
  margin: 0;
  color: var(--faint);
  font-size: 11px;
}

.inspector-actions {
  position: sticky;
  bottom: -22px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin: 24px -22px -22px;
  padding: 14px 22px;
}

.workbench-heading {
  position: sticky;
  z-index: 20;
  top: var(--header-height);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  padding: 12px 22px;
}

.workbench-title h1 {
  font-size: 17px;
}

.snapshot-lockline {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  margin-top: 5px;
}

.snapshot-lockline strong {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.snapshot-lockline code {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-metrics {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-subtle);
}

.snapshot-metrics > span {
  display: grid;
  min-width: 72px;
  place-items: center;
  border-left: 1px solid var(--line);
  padding: 6px 10px;
}

.snapshot-metrics > span:first-child {
  border-left: 0;
}

.snapshot-metrics strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.snapshot-metrics small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.workbench-grid {
  display: grid;
  grid-template-columns: 224px minmax(480px, 1fr) 340px;
  min-width: 0;
  min-height: calc(100svh - var(--header-height) - 82px);
  background: var(--surface);
}

.version-rail,
.prompt-workspace,
.run-rail {
  min-width: 0;
  padding: 18px;
}

.version-rail {
  border-right: 1px solid var(--line);
  background: var(--surface-subtle);
}

.run-rail {
  border-left: 1px solid var(--line);
  background: var(--surface-subtle);
}

.count-badge {
  min-width: 23px;
  border-radius: 4px;
  background: var(--surface-strong);
  padding: 2px 6px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.version-history,
.run-history {
  display: grid;
  gap: 1px;
  margin-top: 12px;
}

.version-item,
.run-item {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  gap: 3px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 9px 5px;
  color: var(--ink);
  text-align: left;
}

.version-item:last-child,
.run-item:last-child {
  border-bottom: 1px solid var(--line);
}

.version-item:hover:not(:disabled),
.version-item.is-active,
.run-item:hover:not(:disabled),
.run-item.is-active {
  background: var(--green-soft);
  color: var(--ink);
}

.version-item > span {
  font-size: 12px;
  font-weight: 750;
}

.version-item small,
.version-item code,
.run-item small,
.run-item time {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-reference {
  border-top: 1px solid var(--line-strong);
  margin-top: 24px;
  padding-top: 14px;
}

.compact-detail-list {
  grid-template-columns: 72px minmax(0, 1fr);
}

.compact-detail-list dt,
.compact-detail-list dd {
  padding: 6px 0;
  font-size: 9px;
}

details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.compact-code {
  max-height: 230px;
  margin-top: 8px;
  background: var(--surface);
  font-size: 9px;
}

.prompt-workspace {
  padding: 22px 24px 40px;
}

.workspace-section-heading {
  align-items: flex-end;
  margin-bottom: 16px;
}

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

.editor-control > span,
.model-controls label > span:first-child {
  min-height: 17px;
}

.rendered-prompt {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

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

.rendered-columns h3 {
  margin-bottom: 6px;
  color: var(--muted);
}

.rendered-columns pre {
  height: 180px;
}

.request-checkpoint {
  border-top: 1px solid var(--line-strong);
  margin-top: 24px;
  padding-top: 22px;
}

.fingerprint {
  display: block;
  max-width: 300px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-subtle);
  padding: 5px 7px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fingerprint[data-state="confirmed"] {
  border-color: #9ac6ae;
  background: var(--green-soft);
  color: var(--green-dark);
}

.fingerprint[data-state="ready"] {
  border-color: #e1b383;
  background: var(--orange-soft);
  color: var(--orange);
}

.model-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, 1fr);
  align-items: end;
  gap: 10px;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 5px;
}

.model-resolve-action {
  grid-template-columns: minmax(0, 1fr) auto;
}

#modelStatus {
  margin-top: 6px;
}

.model-metadata {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 10px 0 0;
}

.model-metadata > div {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 8px 10px;
}

.model-metadata > div:first-child {
  border-left: 0;
}

.model-metadata dt,
.model-metadata dd {
  min-width: 0;
  margin: 0;
}

.model-metadata dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.model-metadata dd {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkpoint-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.request-code {
  height: 290px;
  margin-top: 10px;
  background: #202421;
  color: #edf2ee;
}

.run-actionbar {
  align-items: flex-end;
}

#runStatus {
  margin-top: 9px;
}

.run-history {
  max-height: 290px;
  overflow: auto;
}

.run-item > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.run-item strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-section,
.compare-section {
  border-top: 1px solid var(--line-strong);
  margin-top: 18px;
  padding-top: 14px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 700;
}

.output-code {
  height: 260px;
  margin-top: 9px;
  background: var(--surface);
}

.compare-section label {
  margin-top: 10px;
}

.compare-section .output-code {
  height: 180px;
}

.snapshot-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100svh - 40px);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0;
  color: var(--ink);
}

.snapshot-dialog::backdrop {
  background: rgba(32, 36, 33, 0.44);
}

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

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.dialog-body {
  display: grid;
  max-height: calc(100svh - 190px);
  overflow: auto;
  gap: 8px;
  padding: 18px 20px;
}

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

.recipe-lock {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--orange);
  background: var(--orange-soft);
  margin-top: 6px;
  padding: 9px 11px;
}

.recipe-lock > span,
.recipe-lock small {
  color: var(--orange);
  font-size: 9px;
  text-transform: uppercase;
}

.recipe-lock strong {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 14px 20px;
}

@media (max-width: 1180px) {
  .workbench-grid {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .run-rail {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(210px, 0.7fr) minmax(280px, 1fr) minmax(280px, 1fr);
    align-items: start;
    gap: 18px;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .run-rail .run-actionbar,
  .run-rail #runStatus,
  .run-rail .run-history {
    grid-column: 1;
  }

  .run-rail .output-section {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin-top: 0;
  }

  .run-rail .compare-section {
    grid-column: 3;
    grid-row: 1 / span 3;
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 96px;
  }

  .product-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-content: center;
    gap: 0;
    padding: 7px 12px 0;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
    padding-right: 10px;
  }

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

  .product-name {
    grid-column: 2;
    grid-row: 1;
    overflow: hidden;
    padding: 0;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .environment-label {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .product-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 43px;
    justify-content: stretch;
  }

  .nav-button {
    flex: 1;
    padding: 0 8px;
  }

  .view-heading {
    align-items: center;
    padding: 18px 12px 14px;
  }

  .view-heading h1 {
    font-size: 20px;
  }

  .heading-actions {
    flex-shrink: 0;
  }

  .heading-actions .primary-button {
    width: 34px;
    overflow: hidden;
    padding: 0 8px;
    white-space: nowrap;
    color: transparent;
  }

  .heading-actions .primary-button span {
    color: #ffffff;
    font-size: 18px;
  }

  .library-toolbar {
    grid-template-columns: minmax(0, 1fr) 132px;
    padding: 10px 12px;
  }

  .result-count {
    grid-column: 1 / -1;
    justify-self: start;
    padding: 0;
  }

  #libraryStatus {
    margin: 8px 12px 0;
  }

  .snapshot-table,
  .snapshot-table tbody {
    display: block;
  }

  .snapshot-table thead {
    display: none;
  }

  .snapshot-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--line-strong);
    padding: 10px 12px;
  }

  .snapshot-table td,
  .snapshot-table td:first-child {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    width: auto;
    height: auto;
    min-height: 32px;
    border: 0;
    padding: 4px 6px;
    overflow: visible;
    text-align: left !important;
    text-overflow: clip;
  }

  .snapshot-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .snapshot-table td:first-child,
  .snapshot-table td:nth-child(2),
  .snapshot-table td:nth-child(4),
  .snapshot-table td:last-child {
    grid-column: 1 / -1;
  }

  .snapshot-table td:first-child {
    grid-template-columns: 1fr;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
    padding-bottom: 9px;
  }

  .snapshot-table td:first-child::before {
    display: none;
  }

  .snapshot-table .loading-row,
  .snapshot-table .empty-row {
    display: block;
    padding: 0;
  }

  .snapshot-table .loading-row td,
  .snapshot-table .empty-row td {
    display: block;
    min-height: 130px;
    padding: 50px 12px;
    text-align: center !important;
  }

  .snapshot-table .loading-row td::before,
  .snapshot-table .empty-row td::before {
    display: none;
  }

  .window-cell {
    white-space: normal;
  }

  .snapshot-inspector {
    width: 100%;
    border-left: 0;
    box-shadow: none;
    padding: 18px;
  }

  .inspector-actions {
    bottom: -18px;
    margin: 24px -18px -18px;
    padding: 12px 18px;
  }

  .workbench-heading {
    position: static;
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 91px;
    padding: 12px;
  }

  .snapshot-lockline {
    flex-wrap: wrap;
  }

  .snapshot-lockline strong {
    max-width: calc(100vw - 160px);
  }

  .snapshot-lockline code {
    width: 100%;
  }

  .snapshot-metrics {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .snapshot-metrics > span {
    flex: 1;
  }

  .workbench-grid {
    display: block;
    min-height: 0;
  }

  .version-rail,
  .prompt-workspace,
  .run-rail {
    border-right: 0;
    border-left: 0;
    padding: 16px 12px;
  }

  .version-rail {
    border-bottom: 1px solid var(--line-strong);
  }

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

  .prompt-workspace {
    padding-bottom: 28px;
  }

  .editor-columns,
  .rendered-columns,
  .model-controls,
  .model-metadata,
  .date-columns {
    grid-template-columns: 1fr;
  }

  .model-metadata > div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .model-metadata > div:first-child {
    border-top: 0;
  }

  textarea {
    min-height: 210px;
  }

  .rendered-columns pre {
    height: 150px;
  }

  .fingerprint {
    max-width: 170px;
  }

  .checkpoint-actions {
    align-items: stretch;
  }

  .checkpoint-actions button {
    flex: 1;
  }

  .request-code {
    height: 250px;
  }

  .run-rail {
    display: block;
    border-top: 1px solid var(--line-strong);
  }

  .run-history {
    max-height: none;
  }

  .output-section,
  .compare-section {
    margin-top: 18px !important;
  }

  .output-code,
  .compare-section .output-code {
    height: 220px;
  }

  .snapshot-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100svh - 16px);
  }

  .dialog-body {
    max-height: calc(100svh - 170px);
    padding: 14px;
  }

  .dialog-header,
  .dialog-actions {
    padding: 13px 14px;
  }
}

@media (max-width: 420px) {
  .snapshot-table tbody tr {
    grid-template-columns: 1fr;
  }

  .snapshot-table td,
  .snapshot-table td:first-child,
  .snapshot-table td:nth-child(2),
  .snapshot-table td:nth-child(4),
  .snapshot-table td:last-child {
    grid-column: 1;
  }

  .version-history {
    grid-template-columns: 1fr;
  }

  .workspace-section-heading {
    align-items: center;
  }
}
