: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(240px, 1fr) minmax(280px, 520px) minmax(370px, 1fr);
  align-items: center;
  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;
}

.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;
}

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

.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 {
  display: block;
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 650;
}

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

.privacy-banner {
  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;
}

.privacy-banner p {
  margin: 0;
}

.privacy-banner 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-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: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 15px;
}

.pipeline-control-row label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pipeline-control-row select {
  min-width: 0;
  padding: 7px 30px 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #edf5f3;
  font-size: 10px;
  font-weight: 750;
}

.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-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: auto 1fr auto;
  }

  .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: 10px;
  }

  .case-name-field {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .header-actions .button.ghost {
    display: none;
  }

  .privacy-banner {
    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,
  .header-actions .button.dark {
    display: none;
  }

  .privacy-banner {
    font-size: 10px;
  }

  .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;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  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 {
    grid-template-columns: auto 1fr auto;
  }

  .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;
    grid-template-columns: 1fr auto;
  }

  .page-switcher {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
  }

  .page-switcher a {
    flex: 1;
    text-align: center;
  }

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

  .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;
  }

  .pipeline-app-header .button.dark {
    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;
}

.lab-body .app-header {
  grid-template-columns: minmax(240px, 1fr) auto;
}

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

.lab-main {
  display: grid;
  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;
}

/* 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;
}
