:root {
  color-scheme: light;
  --ink: #162f35;
  --ink-soft: #40585d;
  --midnight: #102d33;
  --midnight-2: #173a41;
  --teal: #0c7773;
  --teal-dark: #075a58;
  --teal-soft: #dcefeb;
  --aqua: #6dc0b6;
  --cream: #f3f0e9;
  --sand: #e9e2d6;
  --paper: #fffdf9;
  --white: #ffffff;
  --line: #d8ded9;
  --line-dark: rgba(255, 255, 255, 0.14);
  --muted: #6f807f;
  --amber: #b66a25;
  --amber-soft: #fff0dd;
  --rose: #a94b4f;
  --rose-soft: #fbe9e8;
  --green: #2f7d62;
  --shadow-sm: 0 5px 18px rgba(24, 49, 54, 0.07);
  --shadow-lg: 0 22px 65px rgba(11, 39, 44, 0.18);
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.45;
}

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

button,
label[for] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(57, 173, 164, 0.38);
  outline-offset: 2px;
}

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

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.025em;
}

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

.app-header {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(195px, 1fr) auto minmax(195px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 10px clamp(18px, 2.4vw, 38px);
  border-bottom: 1px solid #dfe2dd;
  background: rgba(255, 253, 249, 0.97);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--midnight);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11);
}

.brand-mark i {
  display: block;
  width: 3px;
  border-radius: 4px;
  background: #8bd0c7;
}

.brand-mark i:nth-child(1),
.brand-mark i:nth-child(5) {
  height: 11px;
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(4) {
  height: 21px;
}

.brand-mark i:nth-child(3) {
  height: 29px;
  background: #f0b06c;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f4f1ea;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.primary-nav a:hover {
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

.primary-nav a[aria-current="page"] {
  border-color: #b7d2cd;
  background: #e6f1ee;
  color: var(--teal-dark);
  box-shadow: inset 0 -2px 0 rgba(12, 119, 115, 0.16);
}

.primary-nav a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.case-name-field {
  display: flex;
  align-items: center;
  justify-self: stretch;
  gap: 12px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f5ef;
}

.case-name-field span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-name-field input {
  min-width: 0;
  width: 100%;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.context-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: stretch;
  justify-self: stretch;
  min-width: 0;
}

.workbench-context {
  position: relative;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(130px, 0.23fr) minmax(500px, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  min-height: 104px;
  padding: 13px clamp(18px, 2.4vw, 38px);
  border-bottom: 1px solid #d9ddd7;
  background:
    linear-gradient(90deg, rgba(12, 119, 115, 0.045), transparent 32%),
    #f8f6f0;
  box-shadow: 0 8px 24px rgba(24, 49, 54, 0.045);
}

.context-heading {
  min-width: 0;
}

.context-heading .eyebrow {
  margin-bottom: 2px;
}

.context-heading h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.run-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 11px 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
}

.run-state-pill i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.run-state-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.run-state-pill strong {
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.run-state-pill small {
  font-size: 8.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  opacity: 0.82;
}

.run-state-pill[data-state="new"] {
  border-color: #dfe3dd;
  background: #eef1ed;
  color: #6b7672;
}

.run-state-pill[data-state="unsaved"] {
  border-color: #f0d9b6;
  background: var(--amber-soft, #fbeede);
  color: var(--amber, #b5731f);
}

.run-state-pill[data-state="saved"] {
  border-color: #b9dfd7;
  background: var(--teal-soft, #dcefec);
  color: var(--teal-dark, #0c7773);
}

/* When the experiment inputs are collapsed the summary line already carries the
   run state, so the standalone pill is redundant. */
body.context-collapsed .run-state-pill {
  display: none;
}

.context-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 74px;
  padding: 10px 15px 11px;
  overflow: hidden;
  border: 1px solid #cdd8d4;
  background: #f7f6f0;
  color: var(--ink);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.transcript-context-card {
  border-radius: 10px 0 0 10px;
}

.pipeline-context-card {
  border-radius: 0 10px 10px 0;
}

.context-card::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--teal);
  content: "";
  opacity: 0;
  transition: opacity 150ms ease;
}

.context-card:hover,
.context-card:focus-visible {
  z-index: 1;
  border-color: #8bbab3;
  background: #f0f6f3;
  box-shadow: 0 6px 18px rgba(21, 63, 67, 0.09);
}

.context-card:hover::after,
.context-card:focus-visible::after {
  opacity: 1;
}

.context-label {
  display: block;
  margin-bottom: 1px;
  color: var(--teal-dark);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
}

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

.context-card strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.22;
}

.context-card small {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.3;
}

.context-arrow {
  display: grid;
  z-index: 2;
  place-items: center;
  border-top: 1px solid #cdd8d4;
  border-bottom: 1px solid #cdd8d4;
  background: #e9f1ed;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 850;
}

.context-library-button {
  min-height: 52px;
  white-space: nowrap;
}

.header-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
}

.contextual-actions-empty {
  min-width: 1px;
  min-height: 1px;
}

.local-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.local-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ca778;
  box-shadow: 0 0 0 4px rgba(76, 167, 120, 0.12);
}

.button,
.icon-button {
  border: 0;
  font-weight: 750;
}

.button {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 10px;
}

.button.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.button.ghost span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  margin-left: 5px;
  border-radius: 10px;
  background: var(--sand);
  font-size: 11px;
}

.button.dark {
  background: var(--midnight);
  color: #fff;
}

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

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

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  letter-spacing: 0.08em;
}

.icon-button:hover,
.button.ghost:hover {
  background: #f1eee7;
}

.more-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 40;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.more-menu button,
.more-menu label,
.more-menu a {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 650;
  text-decoration: none;
}

.more-menu button:hover,
.more-menu label:hover,
.more-menu a:hover {
  background: #f4f2ec;
}

.more-menu .more-menu-save {
  background: var(--midnight);
  color: #fff;
}

.more-menu .more-menu-save:hover {
  background: var(--midnight-2);
}

.more-menu-divider {
  display: block;
  height: 1px;
  margin: 7px 4px;
  background: var(--line);
}

.application-status-strip {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 7px clamp(18px, 2.4vw, 38px);
  border-bottom: 1px solid #d7d1c5;
  background: #eee8dc;
  color: #53605d;
  font-size: 11px;
}

.application-status-strip p {
  margin: 0;
}

.application-status-strip strong {
  color: var(--ink);
}

.privacy-icon {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1;
}

.schema-version {
  margin-left: auto;
  color: #7b756c;
  font-weight: 750;
}

.transparency-link {
  margin-left: auto;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.transparency-link:hover,
.pipeline-review-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workspace {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(400px, 41.5%) minmax(620px, 58.5%);
  height: auto;
  min-height: 0;
  overflow: hidden;
}

.transcript-panel,
.questionnaire-panel {
  min-width: 0;
  overflow-y: auto;
}

.transcript-panel {
  padding: clamp(28px, 3.4vw, 52px) clamp(26px, 3.4vw, 54px) 70px;
  background:
    radial-gradient(circle at 8% 0%, rgba(82, 174, 162, 0.12), transparent 31%),
    linear-gradient(145deg, #16383f 0%, #102d33 64%, #0d282d 100%);
  color: #f5f4ef;
}

.panel-intro,
.questionnaire-title-row,
.pipeline-title-row,
.agent-report-head,
.field-head,
.section-summary,
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.transcript-panel .eyebrow {
  color: #8ed2c8;
}

.panel-intro h1,
.questionnaire-title-row h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 3vw, 43px);
  line-height: 1.04;
}

.step-label {
  flex: 0 0 auto;
  padding-top: 6px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.questionnaire-panel .step-label {
  color: #83908c;
}

.panel-copy {
  max-width: 610px;
  margin: 17px 0 22px;
  color: rgba(245, 244, 239, 0.68);
  font-size: 14px;
}

.transcript-shell {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.17);
}

#transcript {
  display: block;
  width: 100%;
  min-height: 330px;
  padding: 22px 23px;
  border: 0;
  background: transparent;
  color: #233a3e;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.7;
  resize: vertical;
}

#transcript::placeholder {
  color: #9ba6a4;
}

.transcript-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 8px 12px 8px 20px;
  border-top: 1px solid #e3e5e1;
  color: #82908e;
  font-size: 11px;
}

.text-button {
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.text-button.muted {
  color: #81908e;
}

.pipeline-card,
.agent-report {
  margin-top: 18px;
  padding: 18px 19px;
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.pipeline-card.attention {
  border-color: rgba(117, 211, 199, 0.7);
  box-shadow: 0 0 0 4px rgba(109, 192, 182, 0.12);
}

.pipeline-review-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  color: #9edcd3;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.pipeline-title-row h2,
.agent-report h2 {
  margin-bottom: 0;
  color: #fff;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.pipeline-control-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
}

.pipeline-control-row label {
  grid-column: 1 / -1;
  color: #a7d8d1;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pipeline-control-row select {
  min-width: 0;
  min-height: 40px;
  padding: 9px 34px 9px 11px;
  border: 1px solid rgba(116, 211, 198, 0.52);
  border-radius: 9px;
  background: rgba(111, 196, 185, 0.12);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 3px 0 0 #70c7bc;
}

.pipeline-control-row select:hover {
  border-color: rgba(139, 225, 214, 0.8);
  background: rgba(111, 196, 185, 0.17);
}

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #bbcbc8;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.service-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ba8a6;
}

.service-status.ready i {
  background: #66ce95;
  box-shadow: 0 0 0 4px rgba(102, 206, 149, 0.11);
}

.service-status.unavailable {
  color: #e1b886;
}

.service-status.unavailable i {
  background: #e1a55e;
}

.version-pill {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #a9cbc7;
  font-size: 10px;
  font-weight: 800;
}

.pipeline-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.pipeline-flow span {
  flex: 0 0 auto;
  color: #d7e4e2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pipeline-flow i {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, #69bdb3, rgba(105, 189, 179, 0.16));
}

.pipeline-card > p {
  margin: 13px 0 0;
  color: rgba(245, 244, 239, 0.57);
  font-size: 12px;
}

.analyze-button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 70px;
  margin-top: 16px;
  padding: 13px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #e9aa65, #f0bf7d);
  color: #1c3438;
  text-align: left;
  box-shadow: 0 13px 34px rgba(0, 0, 0, 0.15);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.analyze-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 17px 40px rgba(0, 0, 0, 0.2);
}

.analyze-button:active {
  transform: translateY(0);
}

.analyze-button strong,
.analyze-button small {
  display: block;
}

.analyze-button strong {
  font-size: 14px;
}

.analyze-button small {
  margin-top: 2px;
  color: rgba(28, 52, 56, 0.63);
  font-size: 11px;
  font-weight: 650;
}

.analyze-icon {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.52);
  font-size: 19px;
}

.analyze-button.running .analyze-icon {
  animation: pulse 900ms ease-in-out infinite alternate;
}

@keyframes pulse {
  to {
    transform: rotate(8deg) scale(1.08);
  }
}

.agent-report-head {
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-dark);
}

.agent-report-head > span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

.agent-trace {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.trace-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 9px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 11px;
}

.trace-row i {
  position: relative;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(135, 207, 198, 0.5);
  border-radius: 50%;
}

.trace-row i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #82cec4;
  content: "";
}

.trace-row strong {
  display: block;
  margin-bottom: 1px;
  color: #edf5f3;
  font-size: 11px;
}

.agent-warnings {
  display: grid;
  gap: 7px;
  margin-top: 15px;
}

.agent-warning {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(237, 176, 104, 0.1);
  color: #e6c49d;
  font-size: 10px;
}

.questionnaire-panel {
  position: relative;
  background: #eeece6;
}

.questionnaire-header {
  position: sticky;
  top: 0;
  z-index: 12;
  padding: 27px clamp(24px, 3vw, 44px) 0;
  border-bottom: 1px solid #d7d9d3;
  background: var(--paper);
}

.questionnaire-title-row {
  align-items: center;
}

.questionnaire-title-row h1 {
  color: var(--ink);
  font-size: clamp(27px, 2.6vw, 38px);
}

.progress-grid {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(110px, 1.3fr) repeat(3, auto);
  align-items: center;
  gap: 17px;
  margin-top: 20px;
}

.progress-copy strong,
.progress-copy span {
  display: block;
}

.progress-copy strong {
  color: var(--ink);
  font-size: 13px;
}

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

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: #dfe3df;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #64b7ac);
  transition: width 320ms ease;
}

.stat {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 5px;
  min-width: 52px;
}

.stat strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.stat.review strong {
  color: var(--amber);
}

.stat.confirmed strong {
  color: var(--green);
}

.questionnaire-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 21px;
}

.filter-tabs {
  display: flex;
  gap: 1px;
}

.filter-tabs button {
  padding: 11px 10px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #7c8a87;
  font-size: 11px;
  font-weight: 800;
}

.filter-tabs button.active {
  border-bottom-color: var(--teal);
  color: var(--ink);
}

.search-control {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 170px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f5f3ed;
  color: #86928f;
}

.search-control input {
  min-width: 0;
  width: 100%;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.questionnaire-content {
  display: grid;
  gap: 14px;
  padding: 22px clamp(24px, 3vw, 44px) 80px;
}

.question-section {
  overflow: hidden;
  border: 1px solid #d8dcd7;
  border-radius: 15px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.question-section > summary {
  list-style: none;
}

.question-section > summary::-webkit-details-marker {
  display: none;
}

.section-summary {
  align-items: center;
  padding: 17px 19px;
  cursor: pointer;
  user-select: none;
}

.section-name {
  display: flex;
  align-items: center;
  gap: 11px;
}

.section-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
}

.section-name strong,
.section-name small {
  display: block;
}

.section-name strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.section-name small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.section-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-status {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #7f8e8a;
  border-bottom: 1.5px solid #7f8e8a;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.question-section[open] .chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}

.field-list {
  border-top: 1px solid #e2e5df;
}

.field-card {
  position: relative;
  padding: 18px 19px 20px;
  border-bottom: 1px solid #e3e5e0;
  background: rgba(255, 255, 255, 0.62);
}

.field-card:last-child {
  border-bottom: 0;
}

.field-card.agent-filled {
  box-shadow: inset 3px 0 0 #65b4aa;
}

.field-card.needs-review {
  box-shadow: inset 3px 0 0 #d8934f;
}

.field-card.confirmed {
  box-shadow: inset 3px 0 0 #4e9b79;
}

.field-head {
  align-items: flex-start;
}

.field-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.field-index {
  flex: 0 0 auto;
  color: #9aa4a1;
  font-family: var(--serif);
  font-size: 12px;
}

.field-title h3 {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.field-title p {
  max-width: 610px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
}

.field-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.field-head-right {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

/* Compact-density expanded card: the whole header collapses the field. */
.field-head-collapse {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.field-head-collapse:focus-visible {
  outline: 2px solid var(--teal-dark, #0c7773);
  outline-offset: 3px;
  border-radius: 6px;
}

.field-collapse-hint {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ecefeb;
  color: #687773;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.field-collapse-hint i {
  font-style: normal;
  font-size: 10px;
  line-height: 1;
}

.field-head-collapse:hover .field-collapse-hint,
.field-head-collapse:focus-visible .field-collapse-hint {
  background: var(--ink, #1f2a2c);
  color: #fff;
}

.field-head-collapse:hover .field-title h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.field-badge {
  padding: 4px 7px;
  border-radius: 999px;
  background: #ecefeb;
  color: #687773;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-badge.agent {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.field-badge.review {
  background: var(--amber-soft);
  color: var(--amber);
}

.field-badge.confirmed {
  background: #e1f1e9;
  color: var(--green);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.choice-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 37px;
  padding: 8px 9px;
  border: 1px solid #d7ddd8;
  border-radius: 9px;
  background: #fff;
  color: #44585b;
  text-align: left;
  font-size: 10px;
  font-weight: 680;
  line-height: 1.25;
}

.choice-button:hover {
  border-color: #9cc8c0;
  background: #fbfefd;
}

.choice-indicator {
  position: relative;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid #aebbb7;
  border-radius: 4px;
  background: #fff;
}

.choice-button.single .choice-indicator {
  border-radius: 50%;
}

.choice-button.selected {
  border-color: #75b8ae;
  background: #eaf5f2;
  color: #174b4b;
}

.choice-button.selected .choice-indicator {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: inset 0 0 0 3px #eaf5f2;
}

.choice-button.selected:not(.single) .choice-indicator::after {
  position: absolute;
  top: 1px;
  left: 4px;
  width: 3px;
  height: 7px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  content: "";
  transform: rotate(45deg);
}

.choice-button.selected:not(.single) .choice-indicator {
  box-shadow: none;
}

.field-input {
  width: 100%;
  min-height: 42px;
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid #d1d9d4;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}

textarea.field-input {
  min-height: 110px;
  resize: vertical;
}

.selected-details {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.detail-card {
  padding: 12px 13px 13px;
  border: 1px solid #cfe0dc;
  border-radius: 10px;
  background: #f1f8f6;
}

.detail-card.provisional {
  border-color: #ead8c0;
  background: #fff8ed;
}

.detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-title-row strong {
  color: #315559;
  font-size: 10px;
}

.detail-status {
  color: var(--teal);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-card.provisional .detail-status {
  color: var(--amber);
}

.detail-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.detail-choice {
  padding: 7px 9px;
  border: 1px solid #cbdad6;
  border-radius: 7px;
  background: #fff;
  color: #4a6263;
  font-size: 9px;
  font-weight: 700;
}

.detail-choice.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.detail-input-row {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.detail-input-row label {
  color: #5c6f6e;
  font-size: 9px;
  font-weight: 780;
}

.detail-input-row input {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #cbd7d3;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
}

.evidence-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  margin-top: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f4f5f1;
  color: #667572;
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.45;
}

.evidence-row span {
  color: var(--teal);
  font-family: var(--sans);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 11px;
}

.field-action {
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #788784;
  font-size: 9px;
  font-weight: 800;
}

.field-action:hover {
  background: #f0f2ee;
}

.field-action.confirm {
  border-color: #bad8ce;
  color: var(--green);
}

.field-action.confirm.active {
  border-color: var(--green);
  background: #e4f2eb;
}

.empty-filter {
  margin: 40px;
  padding: 48px;
  border: 1px dashed #bdc7c2;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(680px, calc(100% - 32px));
  max-height: min(720px, calc(100vh - 44px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: rgba(10, 31, 35, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-head {
  align-items: center;
  padding: 23px 25px 15px;
}

.dialog-head h2 {
  margin-bottom: 0;
  font-size: 27px;
}

.dialog-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #eeece5;
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
}

.dialog-copy {
  margin: 0;
  padding: 0 25px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.history-list {
  display: grid;
  gap: 9px;
  max-height: 510px;
  overflow-y: auto;
  padding: 17px 25px 25px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.history-item h3 {
  margin-bottom: 3px;
  font-size: 13px;
}

.history-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
}

.history-actions {
  display: flex;
  gap: 5px;
}

.history-actions button {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
}

.history-actions button.delete {
  color: var(--rose);
}

.history-empty {
  padding: 50px 25px;
  color: var(--muted);
  text-align: center;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 20px 25px 24px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: 360px;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--midnight);
  color: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(185px, 1fr) auto minmax(185px, 1fr);
    gap: 11px;
  }

  .primary-nav a {
    padding-inline: 9px;
  }

  .local-status {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(360px, 43%) minmax(540px, 57%);
  }

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

  .progress-grid {
    grid-template-columns: minmax(125px, 1fr) minmax(90px, 1fr) repeat(3, auto);
    gap: 11px;
  }
}

@media (max-width: 900px) {
  body {
    display: block;
    height: auto;
    overflow: visible;
  }

  .app-header {
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    min-height: 0;
    padding-block: 8px 7px;
  }

  .app-header .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .app-header .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .app-header .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .app-header .primary-nav a {
    flex: 1 0 auto;
    min-height: 34px;
  }

  .app-header .contextual-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .app-header .contextual-actions-empty {
    display: none;
  }

  .workbench-context {
    grid-template-columns: 1fr auto;
    gap: 11px 18px;
    padding-block: 14px 16px;
  }

  .workbench-context .context-strip {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .application-status-strip {
    align-items: flex-start;
  }

  .schema-version {
    display: none;
  }

  .workspace {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .transcript-panel,
  .questionnaire-panel {
    overflow: visible;
  }

  .transcript-panel {
    padding: 34px 22px 45px;
  }

  #transcript {
    min-height: 300px;
  }

  .questionnaire-header {
    position: relative;
    padding: 26px 20px 0;
  }

  .questionnaire-content {
    padding: 18px 16px 60px;
  }
}

@media (max-width: 620px) {
  .brand small {
    display: none;
  }

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

  .brand strong {
    font-size: 20px;
  }

  .app-header .primary-nav a {
    min-height: 32px;
    padding: 6px;
    font-size: 9.5px;
  }

  .contextual-actions .button,
  .contextual-actions .icon-button {
    min-height: 38px;
  }

  .contextual-actions .button {
    padding-inline: 11px;
    font-size: 10px;
  }

  .contextual-actions .icon-button {
    width: 38px;
    height: 38px;
  }

  .application-status-strip {
    font-size: 10px;
  }

  .context-strip {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .workbench-context {
    gap: 10px 12px;
    min-height: 0;
    padding-block: 12px 14px;
  }

  .context-heading h2 {
    font-size: 14px;
  }

  .context-card {
    min-height: 62px;
    border-radius: 9px;
  }

  .context-arrow {
    display: none;
  }

  .progress-grid {
    grid-template-columns: 1fr repeat(3, auto);
  }

  .progress-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .questionnaire-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-tabs {
    overflow-x: auto;
  }

  .search-control {
    width: 100%;
    margin-bottom: 12px;
  }

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

  .field-head {
    display: block;
  }

  .field-badges {
    justify-content: flex-start;
    margin-top: 8px;
  }

  .detail-input-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .pipeline-control-row {
    grid-template-columns: 1fr;
  }
}

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

/* Repository experiment workflow */

.history-dialog {
  width: min(900px, calc(100% - 32px));
}

.dialog-copy code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eeece5;
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.library-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 25px;
  border-bottom: 1px solid var(--line);
  background: #f5f6f2;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.library-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.library-status span:last-child {
  padding-right: 0;
  border-right: 0;
}

.library-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ca778;
}

.history-record {
  min-width: 0;
}

.history-record-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
}

.history-record-head code {
  overflow: hidden;
  color: #879490;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0 6px;
}

.history-metadata span {
  padding: 4px 6px;
  border: 1px solid #dce3df;
  border-radius: 5px;
  background: #f6f8f5;
  color: #55706e;
  font-size: 8px;
  font-weight: 750;
}

.save-experiment-dialog {
  width: min(700px, calc(100% - 32px));
}

.save-experiment-dialog .dialog-field {
  margin: 18px 25px 0;
}

.save-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 18px 25px;
  background: var(--line);
}

.save-summary > div {
  min-width: 0;
  padding: 12px;
  background: var(--paper);
}

.save-summary dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.save-summary dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.deidentified-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 18px 25px 0;
  padding: 14px;
  border: 1px solid #e3cba8;
  border-radius: 10px;
  background: var(--amber-soft);
}

.deidentified-confirmation input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.deidentified-confirmation strong,
.deidentified-confirmation small {
  display: block;
}

.deidentified-confirmation strong {
  color: #6f4e2e;
  font-size: 10px;
}

.deidentified-confirmation small {
  margin-top: 4px;
  color: #846746;
  font-size: 9px;
  line-height: 1.5;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

@media (max-width: 620px) {
  .library-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-status span {
    padding-right: 0;
    border-right: 0;
  }

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

  .history-record-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .save-summary {
    grid-template-columns: 1fr;
  }
}

/* Pipeline transparency page */

body.pipeline-page {
  display: block;
  height: auto;
  min-height: 100vh;
  overflow: visible;
  background:
    radial-gradient(circle at 92% 6%, rgba(100, 190, 178, 0.12), transparent 24%),
    var(--cream);
}

.pipeline-app-header {
  position: sticky;
  top: 0;
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(16px);
}

.pipeline-app-header .button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.page-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f4f1ea;
}

.page-switcher a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.page-switcher a.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(22, 47, 53, 0.08);
}

.pipeline-safety-banner {
  position: relative;
  top: 0;
}

.transparency-shell {
  width: min(1320px, calc(100% - 44px));
  margin: 0 auto;
  padding: 68px 0 90px;
}

.transparency-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: end;
  gap: clamp(42px, 7vw, 100px);
  padding: 18px 0 55px;
}

.hero-copy {
  max-width: 860px;
}

.hero-copy h1 {
  max-width: 850px;
  margin-bottom: 22px;
  font-size: clamp(44px, 6.1vw, 78px);
  line-height: 0.98;
}

.hero-copy > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

.hero-version-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: 18px;
  background: var(--midnight);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.hero-version-card::after {
  position: absolute;
  top: -55px;
  right: -45px;
  width: 145px;
  height: 145px;
  border: 32px solid rgba(109, 192, 182, 0.1);
  border-radius: 50%;
  content: "";
}

.hero-version-card strong,
.hero-version-card code,
.hero-version-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.hero-version-card strong {
  margin-top: 25px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
}

.hero-version-card code {
  margin: 8px 0 23px;
  color: #91d2c9;
  font-size: 11px;
}

.hero-version-card small {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}

.live-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #c7e9e4;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #62c991;
  box-shadow: 0 0 0 4px rgba(98, 201, 145, 0.14);
}

.execution-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 70px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.execution-summary article {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 88px;
  padding: 17px 20px;
  border-right: 1px solid var(--line);
}

.execution-summary article:last-child {
  border-right: 0;
}

.summary-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-family: var(--serif);
  font-weight: 700;
}

.execution-summary small,
.execution-summary strong {
  display: block;
}

.execution-summary small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.execution-summary strong {
  margin-top: 3px;
  font-size: 15px;
}

.transparency-layout {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr);
  align-items: start;
  gap: clamp(45px, 7vw, 95px);
}

.pipeline-sidebar {
  position: sticky;
  top: 135px;
}

.pipeline-sidebar nav {
  display: grid;
  gap: 3px;
  margin: 15px 0 28px;
}

.pipeline-sidebar nav a {
  padding: 8px 10px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.pipeline-sidebar nav a:hover {
  border-left-color: var(--teal);
  color: var(--ink);
}

.sidebar-note {
  padding: 16px;
  border: 1px solid #c9ded9;
  border-radius: 12px;
  background: #e7f2ef;
}

.sidebar-note strong {
  font-size: 11px;
}

.sidebar-note p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.transparency-content {
  min-width: 0;
}

.transparency-section {
  scroll-margin-top: 120px;
  padding: 15px 0 82px;
  border-bottom: 1px solid #d8d8d0;
}

.transparency-section + .transparency-section {
  padding-top: 76px;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.section-kicker > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--midnight);
  color: #a5d8d2;
  font-size: 9px;
  font-weight: 850;
}

.section-kicker .eyebrow {
  margin: 0;
}

.transparency-section h2,
.source-links h2 {
  max-width: 800px;
  margin-bottom: 14px;
  font-size: clamp(31px, 4vw, 47px);
  line-height: 1.07;
}

.section-lede {
  max-width: 820px;
  margin-bottom: 30px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}

.plain-badge,
.count-badge {
  flex: 0 0 auto;
  margin-top: 7px;
  padding: 7px 10px;
  border: 1px solid #bfd9d3;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plain-badge.warning {
  border-color: #e0bf9e;
  background: var(--amber-soft);
  color: #8e531f;
}

.count-badge {
  border-color: #bfd9d3;
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.count-badge strong {
  font-size: 13px;
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 249, 0.7);
}

.workflow-list li:last-child {
  grid-column: 1 / -1;
  background: var(--teal-soft);
}

.workflow-list li > span {
  color: var(--teal);
  font-family: var(--serif);
  font-size: 22px;
}

.workflow-list strong {
  display: block;
  margin-bottom: 4px;
}

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

.policy-card {
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid #28484e;
  border-radius: 16px;
  background: #102a30;
  box-shadow: 0 22px 58px rgba(15, 43, 49, 0.13);
}

.policy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 45px;
  padding: 8px 12px 8px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #a5c8c3;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

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

.policy-toolbar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.policy-toolbar button {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8e8e5;
  font-size: 10px;
  font-weight: 750;
}

.policy-card pre {
  max-height: 590px;
  margin: 0;
  overflow: auto;
  padding: 25px;
  white-space: pre-wrap;
}

.policy-card code {
  color: #d2dfdc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.75;
}

.subsection-title {
  margin: 38px 0 15px;
  font-family: var(--sans);
  font-size: 16px;
}

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

.context-grid article,
.contract-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
}

.context-grid article > span {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 7px;
  border-radius: 5px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.context-grid strong,
.contract-grid strong {
  display: block;
  font-size: 13px;
}

.context-grid p,
.contract-grid p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.callout {
  display: flex;
  gap: 13px;
  margin-top: 18px;
  padding: 17px;
  border: 1px solid #bfd9d3;
  border-radius: 13px;
  background: var(--teal-soft);
}

.callout > span {
  display: grid;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
}

.callout strong {
  display: block;
  font-size: 12px;
}

.callout p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.caution-callout {
  border-color: #e4c5a5;
  background: var(--amber-soft);
}

.caution-callout > span {
  background: var(--amber);
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--muted);
}

.catalog-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.rule-catalog {
  display: grid;
  gap: 22px;
}

.rule-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
}

.rule-section > header h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.rule-section > header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.rule-item {
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--paper);
}

.rule-section .rule-item:nth-child(2) {
  border-radius: 13px 13px 0 0;
}

.rule-section .rule-item:last-child {
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 13px 13px;
}

.rule-item summary {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(180px, 0.7fr) 22px;
  align-items: center;
  gap: 18px;
  padding: 15px 17px;
  list-style: none;
  cursor: pointer;
}

.rule-item summary::-webkit-details-marker {
  display: none;
}

.rule-item summary div strong,
.rule-item summary div code {
  display: block;
}

.rule-item summary div strong {
  font-size: 12px;
}

.rule-item summary div code {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.rule-mechanism {
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 750;
}

.rule-item summary > i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-style: normal;
  transition: transform 150ms ease;
}

.rule-item[open] summary > i {
  transform: rotate(45deg);
}

.rule-detail {
  padding: 0 17px 18px;
  border-top: 1px solid #ebe9e2;
}

.rule-detail > p {
  max-width: 760px;
  margin: 15px 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}

.rule-meta span {
  display: flex;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #f0eee8;
  color: var(--muted);
  font-size: 9px;
  text-transform: capitalize;
}

.rule-meta b {
  color: var(--ink-soft);
}

.choice-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.choice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.choice-tags span {
  padding: 5px 7px;
  border: 1px solid #cbe0dc;
  border-radius: 6px;
  background: #edf6f3;
  color: #34625f;
  font-size: 9px;
}

.choice-tags .free-text-choice {
  border-color: #dccab9;
  background: #f7efe6;
  color: #7e5b3c;
}

.catalog-empty {
  padding: 35px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.boundary-diagram {
  display: grid;
  grid-template-columns: minmax(130px, 0.65fr) auto minmax(300px, 1.5fr) auto minmax(130px, 0.65fr);
  align-items: center;
  gap: 11px;
  margin: 32px 0;
}

.boundary-diagram > i {
  color: var(--teal);
  font-family: var(--serif);
  font-style: normal;
  font-size: 21px;
}

.boundary-input,
.boundary-output,
.browser-boundary {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-align: center;
}

.boundary-input small,
.boundary-output small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.boundary-input strong,
.boundary-output strong {
  font-size: 11px;
}

.browser-boundary {
  border: 1px solid #30746e;
  background: var(--midnight);
  color: #fff;
}

.browser-boundary > span {
  display: block;
  margin-bottom: 12px;
  color: #8bcac1;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.browser-boundary div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.browser-boundary b {
  font-size: 10px;
}

.browser-boundary i {
  color: #79bcb3;
  font-style: normal;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.tool-grid article {
  padding: 17px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tool-grid article:nth-child(2n) {
  border-right: 0;
}

.tool-grid article:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.tool-grid article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-grid strong {
  font-size: 11px;
}

.tool-grid span {
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 800;
}

.tool-grid p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

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

.future-section {
  border-bottom: 0;
}

.future-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.future-checklist span {
  padding: 8px 10px;
  border: 1px dashed #8caaa6;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
}

.source-links {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-top: 15px;
  padding: 35px;
  border-radius: 17px;
  background: var(--midnight);
  color: #fff;
}

.source-links h2 {
  margin: 0;
  color: #fff;
  font-size: 29px;
}

.source-links > div:last-child {
  display: grid;
  gap: 7px;
  min-width: 250px;
}

.source-links a {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #bde1dc;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.source-links a:hover {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 1050px) {
  .pipeline-app-header .local-status {
    display: none;
  }

  .transparency-hero {
    grid-template-columns: minmax(0, 1fr) 275px;
    gap: 45px;
  }

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

  .execution-summary article:nth-child(2) {
    border-right: 0;
  }

  .execution-summary article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .transparency-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 45px;
  }

  .boundary-diagram {
    grid-template-columns: 1fr;
  }

  .boundary-diagram > i {
    transform: rotate(90deg);
    text-align: center;
  }
}

@media (max-width: 780px) {
  .pipeline-app-header {
    position: relative;
  }

  .transparency-shell {
    width: min(100% - 30px, 720px);
    padding-top: 45px;
  }

  .transparency-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: clamp(41px, 11vw, 66px);
  }

  .transparency-layout {
    display: block;
  }

  .pipeline-sidebar {
    display: none;
  }

  .workflow-list,
  .context-grid,
  .contract-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .workflow-list li:last-child {
    grid-column: auto;
  }

  .tool-grid article,
  .tool-grid article:nth-child(2n),
  .tool-grid article:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tool-grid article:last-child {
    border-bottom: 0;
  }

  .source-links {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .pipeline-safety-banner {
    display: none;
  }

  .execution-summary {
    grid-template-columns: 1fr;
  }

  .execution-summary article,
  .execution-summary article:nth-child(2),
  .execution-summary article:nth-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .execution-summary article:last-child {
    border-bottom: 0;
  }

  .section-title-row {
    display: block;
  }

  .plain-badge,
  .count-badge {
    display: inline-block;
    margin: -10px 0 20px;
  }

  .rule-item summary {
    grid-template-columns: 1fr 22px;
  }

  .rule-mechanism {
    grid-column: 1;
    grid-row: 2;
  }

  .rule-item summary > i {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .source-links {
    padding: 25px;
  }
}

/* Lab overview page */

.lab-body {
  display: block;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

a.button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.lab-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(18px, 2.4vw, 38px) 70px;
}

.lab-tabs {
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.lab-tabs button {
  padding: 10px 2px 12px;
  font-size: 12px;
}

.lab-tabs button span {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  margin-left: 5px;
  border-radius: 9px;
  background: var(--sand);
  color: var(--ink-soft);
  font-size: 9px;
}

.lab-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.lab-section-head h1 {
  margin: 4px 0 0;
  font-size: 21px;
}

.lab-section-head .step-label {
  padding-top: 0;
  color: var(--muted);
}

.lab-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.lab-table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

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

.lab-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.lab-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

.lab-table td strong {
  color: var(--ink);
  font-size: 12.5px;
}

.lab-table tbody tr {
  cursor: pointer;
}

.lab-table tbody tr:hover {
  background: #f6f8f5;
}

.lab-table tbody tr.selected {
  background: #eef4f0;
}

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

.lab-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lab-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(16, 26, 22, 0.34);
}

.lab-detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(540px, 94vw);
  padding: 22px 26px 26px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: -18px 0 40px rgba(16, 26, 22, 0.14);
}

.lab-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lab-detail-title {
  display: flex;
  gap: 8px;
}

.lab-detail-title input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f5ef;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.lab-card-meta {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.lab-card-meta code,
.run-detail-meta code {
  color: var(--muted);
  font-size: 8px;
}

.lab-detail-transcript,
.lab-detail-pipelines {
  display: grid;
  gap: 8px;
}

.lab-detail-transcript #detail-text {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.lab-detail-pipelines #detail-pipelines {
  display: grid;
  gap: 8px;
}

.lab-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.button.ghost.danger {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--rose);
}

.lab-run-list {
  max-height: none;
  padding: 0;
}

.note-count {
  display: inline-grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  margin-left: 4px;
  border-radius: 8px;
  background: var(--sand);
  font-size: 8px;
}

.dialog-textarea-field {
  display: block;
  margin: 12px 25px 0;
}

.dialog-textarea-field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f7f5ef;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

.run-detail-meta {
  display: grid;
  gap: 8px;
  padding: 17px 25px 0;
}

.run-notes {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 14px 25px 0;
}

.note-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  background: #fff;
}

.note-item p {
  margin: 0 0 5px;
  font-size: 11px;
  line-height: 1.5;
}

.note-item small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.history-empty.compact {
  padding: 18px;
}

.run-note-form {
  padding: 4px 25px 25px;
}

.run-note-form .dialog-textarea-field {
  margin: 10px 0 0;
}

.run-note-form-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.run-note-author {
  flex: 1;
}

.lab-detail[hidden],
.lab-detail-backdrop[hidden] {
  display: none;
}

/* Experiment library */

.experiment-library-body {
  background:
    linear-gradient(180deg, rgba(12, 119, 115, 0.035), transparent 250px),
    var(--cream);
}

.experiments-main {
  display: grid;
  gap: 22px;
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 28px clamp(18px, 3vw, 46px) 72px;
}

.experiments-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.experiments-intro h1 {
  margin: 3px 0 8px;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
}

.experiments-lede {
  max-width: 700px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.experiments-provenance {
  flex: 0 0 auto;
  padding: 8px 0;
  border: 0;
  background: transparent;
}

.experiment-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.experiment-summary article {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  min-height: 88px;
  padding: 16px 19px;
  border-right: 1px solid var(--line);
}

.experiment-summary article:last-child {
  border-right: 0;
}

.experiment-summary span {
  align-self: center;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.experiment-summary strong {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: 31px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
}

.experiment-summary small {
  grid-column: 1;
  color: var(--muted);
  font-size: 9px;
}

.experiment-ledger {
  min-width: 0;
}

.experiment-ledger-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
}

.experiment-ledger-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.experiment-ledger-head > p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.experiment-controls {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(230px, 0.4fr);
  gap: 10px;
  margin-bottom: 10px;
}

.experiment-search,
.experiment-filter {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}

.experiment-search {
  gap: 9px;
  padding: 0 13px;
  color: var(--muted);
}

.experiment-search input,
.experiment-filter select {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.experiment-search:focus-within,
.experiment-filter:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(57, 173, 164, 0.17);
}

.experiment-filter {
  gap: 12px;
  padding-left: 13px;
}

.experiment-filter > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.experiment-filter select {
  height: 40px;
  padding-right: 12px;
  font-weight: 700;
}

.experiment-table-shell {
  position: relative;
  min-height: 190px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.experiment-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  table-layout: fixed;
}

.experiment-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #f5f4ef;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
}

.experiment-table th:nth-child(1) { width: 20%; }
.experiment-table th:nth-child(2) { width: 16%; }
.experiment-table th:nth-child(3) { width: 23%; }
.experiment-table th:nth-child(4) { width: 8%; }
.experiment-table th:nth-child(5) { width: 8%; }
.experiment-table th:nth-child(6) { width: 6%; }
.experiment-table th:nth-child(7) { width: 19%; }

.experiment-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10.5px;
  vertical-align: middle;
}

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

.experiment-table tbody tr {
  position: relative;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.experiment-table tbody tr:hover {
  background: #f3f7f4;
}

.experiment-table tbody tr.selected {
  background: var(--teal-soft);
  box-shadow: inset 4px 0 0 var(--teal);
}

.experiment-table tbody tr:focus-visible {
  outline: 3px solid rgba(57, 173, 164, 0.38);
  outline-offset: -3px;
}

.experiment-table td > strong,
.experiment-table td > small,
.experiment-table td > code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.experiment-table td > strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.experiment-table td > small,
.experiment-table td > code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8.5px;
}

.experiment-table td > code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.experiment-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.notes-cell {
  display: inline-grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
}

.notes-cell.has-notes {
  border-color: #c5ddd8;
  background: #edf6f3;
  color: var(--teal-dark);
  font-weight: 850;
}

.saved-cell time {
  font-variant-numeric: tabular-nums;
}

.experiment-state {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 220px;
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}

.experiment-state[hidden] {
  display: none;
}

.experiment-state strong,
.detail-loading strong,
.detail-error strong {
  margin-top: 11px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
}

.experiment-state p,
.detail-loading p,
.detail-error p {
  max-width: 430px;
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.55;
}

.experiment-state.error {
  background: var(--rose-soft);
}

.loading-mark {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid #bad4ce;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: library-spin 800ms linear infinite;
}

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

.experiment-detail {
  gap: 0;
  width: min(540px, 96vw);
  padding: 20px 26px 0;
}

.experiment-detail .lab-detail-head {
  position: sticky;
  top: -20px;
  z-index: 4;
  margin: 0 -26px;
  padding: 15px 26px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.97);
}

.experiment-detail #experiment-detail-content {
  display: grid;
  gap: 18px;
  padding: 20px 0 26px;
}

.experiment-detail-title h2 {
  margin: 0 0 5px;
  font-size: 25px;
  line-height: 1.12;
}

.experiment-detail-title p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.experiment-detail-title > code,
.detail-hash {
  color: #71827f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  word-break: break-all;
}

.experiment-lineage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: -5px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.experiment-lineage > div,
.detail-facts > div {
  min-width: 0;
  padding: 10px 12px;
  background: #fff;
}

.experiment-lineage dt,
.detail-facts dt {
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.experiment-lineage dd,
.detail-facts dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.experiment-lineage code {
  color: inherit;
  font-size: 8px;
}

.experiment-detail-section {
  display: grid;
  gap: 9px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.experiment-detail-section h3 {
  margin: 0;
  font-size: 13px;
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-section-heading .eyebrow,
.experiment-detail-section > .eyebrow {
  margin: 0;
}

.detail-section-heading > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.experiment-detail-section blockquote {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--aqua);
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.55;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.detail-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.detail-counts > div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-right: 1px solid var(--line);
}

.detail-counts > div:last-child {
  border-right: 0;
}

.detail-counts strong {
  color: var(--teal-dark);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.detail-counts span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.takeaways-section {
  padding: 16px;
  border: 1px solid #e5d3bd;
  border-radius: 9px;
  background: #fffaf2;
}

.detail-warning-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.detail-warning-list li::marker {
  color: var(--amber);
}

.detail-calm-state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-calm-state > i {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-style: normal;
  font-weight: 850;
}

.detail-calm-state span,
.detail-calm-state strong,
.detail-calm-state small {
  display: block;
}

.detail-calm-state strong {
  font-size: 10px;
}

.detail-calm-state small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.detail-trace {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-trace li {
  display: grid;
  grid-template-columns: 13px 1fr;
  gap: 9px;
  min-height: 36px;
}

.detail-trace li > i {
  position: relative;
}

.detail-trace li > i::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.detail-trace li:not(:last-child) > i::after {
  position: absolute;
  top: 11px;
  bottom: -2px;
  left: 6px;
  width: 1px;
  background: #bdd4ce;
  content: "";
}

.detail-trace strong,
.detail-trace small {
  display: block;
}

.detail-trace strong {
  font-size: 10px;
}

.detail-trace small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.detail-muted {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.mapped-field-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.mapped-field-list > div {
  display: grid;
  grid-template-columns: minmax(125px, 0.65fr) 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.mapped-field-list strong {
  font-size: 9px;
}

.mapped-field-list span {
  color: var(--ink-soft);
  font-size: 9px;
}

.mapped-field-list > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

.detail-note-list {
  display: grid;
  gap: 7px;
}

.detail-note-list article {
  padding: 10px 12px;
  border-left: 3px solid var(--teal);
  background: #fff;
}

.detail-note-list p {
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.detail-note-list small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.experiment-detail-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -26px;
  padding: 14px 26px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.97);
}

.experiment-detail-footer[hidden] {
  display: none;
}

.experiment-detail-footer small {
  color: var(--muted);
  font-size: 8.5px;
}

.detail-loading,
.detail-error {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 390px;
  color: var(--muted);
  text-align: center;
}

.detail-error .button {
  margin-top: 15px;
}

a:focus-visible {
  outline: 3px solid rgba(57, 173, 164, 0.38);
  outline-offset: 2px;
}

@media (max-width: 1050px) {
  .experiment-summary article {
    grid-template-columns: 1fr;
  }

  .experiment-summary strong {
    grid-column: 1;
    grid-row: 2;
    margin: 4px 0;
  }

  .experiment-summary small {
    grid-row: 3;
  }
}

@media (max-width: 900px) {
  .experiments-intro {
    display: grid;
  }

  .experiments-provenance {
    justify-self: start;
  }

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

  .experiment-summary article:nth-child(2) {
    border-right: 0;
  }

  .experiment-summary article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

}

@media (max-width: 680px) {
  .experiments-main {
    gap: 18px;
    padding-top: 22px;
  }

  .experiments-intro {
    gap: 10px;
  }

  .experiments-provenance {
    flex-wrap: wrap;
    gap: 6px 9px;
  }

  .experiment-summary article {
    min-height: 88px;
    padding: 13px 14px;
  }

  .experiment-summary strong {
    font-size: 27px;
  }

  .experiment-controls {
    grid-template-columns: 1fr;
  }

  .experiment-ledger-head {
    align-items: end;
  }

  .experiment-table-shell {
    margin-right: calc(-1 * clamp(18px, 3vw, 46px));
    border-radius: 12px 0 0 12px;
  }

  .experiment-table {
    min-width: 980px;
  }

  .experiment-detail {
    width: min(580px, 98vw);
    padding-inline: 20px;
  }

  .experiment-detail .lab-detail-head,
  .experiment-detail-footer {
    margin-inline: -20px;
    padding-inline: 20px;
  }

  .mapped-field-list > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

/* Keep the two essential experiment-library exits visible after the shared
   Lab and narrow-header rules hide secondary navigation. */
@media (max-width: 900px) {
  .lab-body.experiment-library-body .header-actions a.button.ghost[href="lab.html"],
  .lab-body.experiment-library-body .header-actions a.button.dark[href="index.html"] {
    display: inline-flex;
  }
}

@media (max-width: 420px) {
  .lab-body.experiment-library-body .header-actions a.button.ghost[href="lab.html"] {
    display: none;
  }
}

/* Workbench evaluation workflow */

.source-heading-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}

.source-collapse-button {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #c5e4df;
  font-size: 9px;
  font-weight: 800;
}

.source-collapse-button:hover,
.source-collapse-button:focus-visible {
  border-color: #8ed2c8;
  background: rgba(142, 210, 200, 0.12);
}

.source-collapsed-rail {
  display: none;
}

.workspace.source-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.workspace.source-collapsed .transcript-panel {
  overflow: hidden;
  padding: 0;
}

.workspace.source-collapsed .source-panel-content {
  display: none;
}

.workspace.source-collapsed .source-collapsed-rail {
  display: flex;
  align-items: center;
  flex-direction: column;
  height: 100%;
  min-height: 520px;
  padding: 17px 0;
}

.source-collapsed-rail span {
  color: #9ed9d1;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.source-collapsed-rail button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9px;
  background: #e9f5f2;
  color: var(--teal-dark);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}

.evaluation-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
  padding: 9px;
  border: 1px solid #d9dfda;
  border-radius: 11px;
  background: #f4f4ef;
}

.evaluation-modes {
  display: flex;
  padding: 3px;
  border: 1px solid #d7ddd8;
  border-radius: 8px;
  background: #fff;
}

.evaluation-modes button {
  min-height: 31px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.evaluation-modes button.active {
  background: var(--midnight);
  color: #fff;
  box-shadow: 0 2px 8px rgba(13, 42, 48, 0.12);
}

.evaluation-status strong,
.evaluation-status span {
  display: block;
}

.evaluation-status strong {
  color: var(--ink);
  font-size: 10px;
}

.evaluation-status span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.35;
}

.review-note-button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 9px;
  white-space: nowrap;
}

.review-note-button span {
  min-width: 17px;
  height: 17px;
  font-size: 8px;
}

.gold-progress-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #bcd8d1;
  border-left: 4px solid var(--teal);
  border-radius: 9px;
  background: #eaf4f1;
}

.gold-progress-panel[hidden] {
  display: none;
}

.gold-progress-panel .eyebrow {
  margin-bottom: 2px;
}

.gold-progress-panel strong,
.gold-progress-panel > div > span {
  display: block;
}

.gold-progress-panel strong {
  font-size: 11px;
}

.gold-progress-panel > div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

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

.gold-progress-actions .text-button {
  max-width: 190px;
  font-size: 9px;
  line-height: 1.3;
}

.gold-progress-actions .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 9px;
  white-space: nowrap;
}

.field-card.gold-reviewed {
  box-shadow: inset 3px 0 0 var(--green);
}

.field-card.gold-invalid {
  box-shadow: inset 3px 0 0 var(--amber);
}

.gold-field-review {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  padding-right: 10px;
}

.gold-field-review > span {
  color: var(--teal-dark);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gold-review-button {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #c7d7d2;
  border-radius: 7px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 800;
}

.gold-review-button.selected {
  border-color: var(--green);
  background: #e4f2eb;
  color: var(--green);
}

.gold-review-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.gold-review-warning {
  color: #995e25;
  font-size: 8px;
  font-weight: 750;
}

.review-note-dialog {
  width: min(720px, calc(100% - 32px));
}

.review-note-form {
  display: grid;
  gap: 13px;
  padding: 18px 25px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.review-note-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 12px;
}

.review-note-dialog .dialog-field,
.publish-gold-dialog .dialog-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.review-note-dialog .dialog-field > span,
.publish-gold-dialog .dialog-field > span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.review-note-dialog input,
.review-note-dialog select,
.review-note-dialog textarea,
.publish-gold-dialog input,
.publish-gold-dialog textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #cdd7d2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.review-note-dialog textarea,
.publish-gold-dialog textarea {
  min-height: 86px;
  resize: vertical;
}

.review-note-form .dialog-actions {
  padding: 3px 0 0;
}

.recent-review-notes {
  padding: 16px 25px 22px;
}

.recent-review-notes h3 {
  margin: 0;
  font-size: 11px;
}

.recent-review-note-list,
#recent-review-note-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.structured-note {
  padding: 9px 11px;
  border-left: 3px solid var(--teal);
  background: #fff;
}

.structured-note[data-category="missed"],
.structured-note[data-category="incorrect"] {
  border-left-color: var(--amber);
}

.structured-note[data-category="handled_well"] {
  border-left-color: var(--green);
}

.structured-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}

.note-category-chip,
.note-field-chip {
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 7.5px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.note-category-chip.missed,
.note-category-chip.incorrect {
  background: var(--amber-soft);
  color: #91551e;
}

.note-category-chip.handled_well {
  background: #e2f1e9;
  color: var(--green);
}

.note-field-chip {
  background: #edf0ed;
  color: var(--muted);
}

.structured-note p {
  margin: 0 0 4px;
  color: var(--ink-soft);
  font-size: 9.5px;
  line-height: 1.45;
}

.structured-note small {
  color: var(--muted);
  font-size: 8px;
}

.drawer-note-form {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #cfdcd7;
  border-radius: 9px;
  background: #f3f7f5;
}

.drawer-note-controls {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 8px;
}

.drawer-note-form label,
.run-note-classifiers label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.drawer-note-form label > span,
.run-note-classifiers label > span {
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.drawer-note-form select,
.drawer-note-form textarea,
.drawer-note-form input,
.run-note-classifiers select {
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  border: 1px solid #cbd6d1;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 9px;
}

.drawer-note-form textarea {
  min-height: 76px;
  resize: vertical;
}

.drawer-note-author-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
}

.drawer-note-author-row .button {
  min-height: 36px;
  font-size: 9px;
}

.run-note-classifiers {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 9px;
  margin-top: 12px;
}

.publish-gold-dialog {
  width: min(700px, calc(100% - 32px));
}

.publish-gold-dialog > .dialog-field {
  margin: 14px 25px 0;
}

.existing-validation-choice {
  margin: 16px 25px 0;
  padding: 12px 14px;
  border: 1px solid #bcd8d1;
  border-radius: 9px;
  background: #edf6f3;
}

.existing-validation-choice label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.existing-validation-choice input {
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
  margin-top: 1px;
  accent-color: var(--teal);
}

.existing-validation-choice strong,
.existing-validation-choice small {
  display: block;
}

.existing-validation-choice strong {
  font-size: 10px;
}

.existing-validation-choice small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

@media (max-width: 900px) {
  .workspace.source-collapsed .transcript-panel {
    padding: 0;
  }

  .workspace.source-collapsed .source-collapsed-rail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    width: 100%;
    height: auto;
    min-height: 56px;
    padding: 9px 18px;
  }

  .source-collapsed-rail span {
    writing-mode: horizontal-tb;
    transform: none;
  }

  .source-collapsed-rail button {
    width: auto;
    height: 36px;
    margin: 0;
    padding: 0 13px;
    font-family: var(--sans);
    font-size: 10px;
  }

  .source-collapsed-rail button::after {
    content: " Expand source";
  }

  .evaluation-toolbar {
    grid-template-columns: auto 1fr;
  }

  .review-note-button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .source-heading-actions {
    align-items: flex-end;
  }

  .evaluation-toolbar {
    grid-template-columns: 1fr;
  }

  .evaluation-modes {
    width: 100%;
  }

  .evaluation-modes button {
    flex: 1;
  }

  .review-note-button {
    grid-column: auto;
  }

  .gold-progress-panel,
  .gold-progress-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gold-progress-actions .text-button {
    max-width: none;
    text-align: left;
  }

  .field-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .gold-field-review {
    align-items: stretch;
    flex: 1 0 100%;
    flex-wrap: wrap;
    padding: 0 0 4px;
  }

  .gold-review-button {
    flex: 1;
    min-height: 38px;
  }

  .review-note-grid {
    grid-template-columns: 1fr;
  }

  .drawer-note-controls,
  .drawer-note-author-row,
  .run-note-classifiers {
    grid-template-columns: 1fr;
  }

  .review-note-dialog,
  .publish-gold-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
  }
}

/* Process overview page */

.process-main {
  max-width: 980px;
  gap: 44px;
}

.process-intro h1 {
  margin: 6px 0 12px;
  font-size: 26px;
}

.process-lede {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.process-principles {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.process-principles span {
  padding: 6px 10px;
  border: 1px solid #dce3df;
  border-radius: 7px;
  background: #f6f8f5;
  color: #55706e;
  font-size: 10px;
  font-weight: 750;
}

.process-flow {
  display: grid;
  gap: 0;
}

.process-stage {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
}

.process-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.process-marker span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.process-stage.current .process-marker span {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.process-marker i {
  flex: 1;
  width: 2px;
  margin: 6px 0;
  border-radius: 2px;
  background: var(--line);
}

.process-stage.last .process-marker i {
  background: transparent;
}

.process-card {
  margin-bottom: 26px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.process-stage.current .process-card {
  border-color: var(--teal);
  box-shadow: 0 8px 26px rgba(31, 122, 112, 0.12);
}

.process-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.process-card-head h2 {
  margin: 0;
  font-size: 16px;
}

.process-card > p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

.process-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.process-card li {
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.status-chip {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.status-chip.focus {
  background: var(--teal);
  color: #fff;
}

.status-chip.live {
  border: 1px solid #cfdcd2;
  background: #eaf3ec;
  color: #3c6b4f;
}

.status-chip.planned {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.process-branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 9px;
  margin: 12px 0;
}

.process-branch {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: 9px;
  background: var(--paper);
}

.process-branch h3 {
  margin: 0 0 5px;
  font-size: 11.5px;
}

.process-branch p {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.process-iterate {
  display: grid;
  gap: 16px;
  justify-items: start;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.process-iterate h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.process-loop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.process-loop span {
  padding: 8px 11px;
  border: 1px solid #dce3df;
  border-radius: 8px;
  background: #f6f8f5;
  color: #3d5652;
  font-size: 10.5px;
  font-weight: 750;
}

.process-loop i {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

/* Login page */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--midnight, #16211d);
}

.login-shell {
  width: min(430px, calc(100vw - 32px));
  padding: 24px 0;
}

.login-card {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding: 30px 32px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.login-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 12px;
  width: 100%;
}

.login-field {
  width: 100%;
}

.login-button {
  width: 100%;
  justify-content: center;
}

.login-error {
  margin: 0;
  color: var(--rose);
  font-size: 11px;
  font-weight: 700;
}

.login-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.save-name-input {
  width: 100%;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
}

.save-name-input:focus {
  border-bottom-color: var(--teal);
  outline: none;
}

/* Workbench density and collapsible chrome */

.tools-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chrome-collapse {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.chrome-collapse[aria-expanded="false"] {
  transform: rotate(180deg);
}

.banner-collapsed-label {
  display: none;
  color: #6f6a58;
  font-size: 10px;
  font-weight: 700;
}

body.banner-collapsed .privacy-banner {
  padding-top: 4px;
  padding-bottom: 4px;
}

body.banner-collapsed .privacy-banner p,
body.banner-collapsed .privacy-banner .transparency-link,
body.banner-collapsed .privacy-banner .schema-version {
  display: none;
}

body.banner-collapsed .banner-collapsed-label {
  display: block;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-collapsed-summary {
  display: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.context-collapsed .workbench-context {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 0;
  padding-top: 7px;
  padding-bottom: 7px;
}

body.context-collapsed .workbench-context .context-strip,
body.context-collapsed .workbench-context .context-library-button,
body.context-collapsed .context-heading .eyebrow {
  display: none;
}

body.context-collapsed .context-heading {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.context-collapsed .context-collapsed-summary {
  display: block;
}

/* Compact questionnaire density (default; "Comfortable view" restores the
   roomy layout). Scoped to the workbench page body class. */

body.density-compact .questionnaire-header {
  padding-top: 13px;
}

body.density-compact .questionnaire-header .eyebrow,
body.density-compact .questionnaire-title-row .step-label {
  display: none;
}

body.density-compact .questionnaire-title-row h1 {
  font-size: 21px;
}

body.density-compact .evaluation-toolbar {
  margin-top: 9px;
  padding: 5px 9px;
}

body.density-compact .evaluation-modes button {
  min-height: 26px;
  padding: 4px 9px;
}

body.density-compact .progress-grid {
  margin-top: 10px;
  gap: 13px;
}

body.density-compact .questionnaire-tools {
  margin-top: 9px;
}

body.density-compact .filter-tabs button {
  padding: 8px 8px 9px;
}

body.density-compact .section-summary {
  padding-top: 9px;
  padding-bottom: 9px;
}

body.density-compact .field-card {
  padding: 9px 15px 11px;
}

body.density-compact .field-head {
  margin-bottom: 0;
}

body.density-compact .field-title h3 {
  margin-bottom: 1px;
  font-size: 12px;
}

body.density-compact .field-title p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  font-size: 9.5px;
  line-height: 1.35;
}

body.density-compact .field-badge {
  padding: 3px 6px;
  font-size: 7.5px;
}

body.density-compact .choice-grid {
  gap: 5px;
  margin-top: 7px;
}

body.density-compact .choice-button {
  min-height: 29px;
  padding: 5px 8px;
  font-size: 10px;
}

body.density-compact .field-input {
  padding: 7px 10px;
  font-size: 11px;
}

body.density-compact textarea.field-input {
  min-height: 54px;
}

body.density-compact .evidence-row {
  margin-top: 7px;
  padding: 5px 8px;
  font-size: 9.5px;
}

body.density-compact .selected-details {
  margin-top: 7px;
}

body.density-compact .detail-card {
  padding: 8px 10px;
}

body.density-compact .field-actions {
  margin-top: 7px;
}

body.density-compact .field-actions .field-action {
  padding: 5px 8px;
}

.context-heading-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

body.context-collapsed .context-heading .context-heading-row {
  flex: 0 0 auto;
}

body.context-collapsed .context-heading .context-collapsed-summary {
  flex: 1;
}

/* Compact field summary rows: one line per field until expanded. */

.field-card.field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.density-compact .field-card.field-row {
  padding: 4px 15px 4px 15px;
}

.field-row-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}

.field-row-main .field-index {
  flex: 0 0 auto;
}

.field-row-main h3 {
  flex: 0 0 auto;
  margin: 0;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}

.field-values {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  align-items: center;
}

.value-chip {
  max-width: 320px;
  overflow: hidden;
  padding: 2px 7px;
  border: 1px solid #cbd8d0;
  border-radius: 6px;
  background: #eef4f0;
  color: #2f5a50;
  font-size: 9.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.value-chip.empty {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.field-row .field-badges {
  flex: 0 0 auto;
  margin-left: auto;
}

.field-row .field-action.confirm {
  flex: 0 0 auto;
  min-width: 62px;
}

/* Gold-standard status on the transcripts page */

.gold-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.gold-badge.set {
  border: 1px solid #cbb26a;
  background: #f6efd8;
  color: #7a5c14;
}

.gold-badge.unset {
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
}

.lab-detail-gold {
  display: grid;
  gap: 8px;
}

.gold-detail {
  display: grid;
  gap: 9px;
  justify-items: start;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.gold-detail.set {
  border-color: #e0cd94;
  background: #fbf7ea;
}

.gold-detail p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

/* Declared "creating gold standard" mode */

.gold-progress-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 18px;
  border: 1px solid #e0cd94;
  border-left: 4px solid #c6a94a;
  background: #fbf7ea;
}

.gold-mode-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}

.gold-mode-flag {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 6px;
  background: #c6a94a;
  color: #3d2f08;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gold-mode-banner strong {
  display: block;
  font-size: 12px;
  color: var(--ink);
}

.gold-mode-banner span {
  display: block;
  margin-top: 1px;
  color: #7a5c14;
  font-size: 9px;
}

.gold-progress-meta .eyebrow {
  margin-bottom: 2px;
}

.gold-progress-meta strong {
  font-size: 11px;
}

.gold-not-saved {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px;
  border: 1px solid #e3cba8;
  border-radius: 8px;
  background: #fdf3e2;
  color: #6f4e2e;
  font-size: 10px;
  font-weight: 700;
}

.gold-not-saved[hidden] {
  display: none;
}

.gold-not-saved .button {
  flex: 0 0 auto;
}

/* When gold mode is active, tint the questionnaire header so it is unmistakable
   the workbench is capturing truth, not reviewing a run. */
body.gold-mode-active .questionnaire-header {
  background: linear-gradient(180deg, #fdfaf0, var(--paper) 70px);
}

body.gold-mode-active .evaluation-modes button.active {
  background: #c6a94a;
  color: #3d2f08;
}

/* Run scoring against the gold standard */

.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.score-badge.high {
  border: 1px solid #b6d8b6;
  background: #e7f4e7;
  color: #2f6b3c;
}

.score-badge.mid {
  border: 1px solid #e3cba8;
  background: #fbf1e0;
  color: #8a5a1e;
}

.score-badge.low {
  border: 1px solid #e2b6b6;
  background: #f8e9e9;
  color: #9a3838;
}

.history-record-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.run-score {
  padding: 14px 25px 0;
}

.run-score-empty {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
}

.run-score-empty a {
  color: var(--teal);
  font-weight: 700;
}

.run-score-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.run-score-meta {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.run-score-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.score-count {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
}

.score-count.present,
.score-count.absent {
  border-color: #cbe0cd;
  background: #eef6ef;
  color: #3c6b4f;
}

.score-count.missed {
  border-color: #e2b6b6;
  background: #f8e9e9;
  color: #9a3838;
}

.score-count.false {
  border-color: #e3cba8;
  background: #fbf1e0;
  color: #8a5a1e;
}

.run-score-clean {
  margin: 0 0 4px;
  color: #3c6b4f;
  font-size: 11px;
  font-weight: 700;
}

.score-problem {
  margin-top: 8px;
}

.score-problem strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink);
}

.score-problem strong span {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--sand);
  font-size: 8px;
}

.score-problem ul {
  margin: 5px 0 0;
  padding-left: 16px;
}

.score-problem li {
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.5;
}

/* Run comparison dialog */

.comparison-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.comparison-dialog::backdrop {
  background: rgba(16, 26, 22, 0.4);
}

.comparison-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 25px;
  border-bottom: 1px solid var(--line);
}

.comparison-diff-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
}

.comparison-summary {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.comparison-empty {
  padding: 50px 25px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.comparison-table-wrap {
  overflow: auto;
  max-height: calc(90vh - 120px);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.comparison-table th,
.comparison-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #edefea;
  text-align: left;
  vertical-align: top;
}

.comparison-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f8f5;
  border-bottom: 1px solid var(--line);
}

.cmp-field-col {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 190px;
  max-width: 220px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.comparison-table thead .cmp-field-col {
  z-index: 3;
  background: #eef2ee;
}

.cmp-diff-row .cmp-field-col {
  background: #fbf7ea;
}

.cmp-run-col,
.cmp-gold-col {
  min-width: 150px;
}

.cmp-gold-col {
  background: #fbf7ea;
  color: #6f5a1e;
  font-weight: 700;
}

.cmp-run-head {
  display: grid;
  gap: 2px;
}

.cmp-run-head strong {
  font-size: 10.5px;
}

.cmp-run-head small {
  color: var(--muted);
  font-size: 8.5px;
}

.cmp-run-head .score-badge {
  justify-self: start;
  margin-top: 3px;
}

.cmp-correct {
  background: #eef6ef;
  color: #2f6b3c;
}

.cmp-bad {
  background: #f8e9e9;
  color: #9a3838;
  font-weight: 700;
}

.cmp-warn {
  background: #fbf1e0;
  color: #8a5a1e;
  font-weight: 700;
}

.cmp-expected {
  color: #2f6b3c;
  font-weight: 700;
}

.cmp-absent {
  color: var(--muted);
  font-style: italic;
}

.agent-usage {
  margin-bottom: 8px;
  padding: 6px 10px;
  border: 1px solid #cbd8d0;
  border-radius: 8px;
  background: #eef4f0;
  color: #2f5a50;
  font-size: 10px;
  font-weight: 700;
}

.agent-usage[hidden] {
  display: none;
}

.cmp-usage {
  color: #2f5a50 !important;
  font-weight: 700;
}
