* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-950);
  background:
    radial-gradient(circle at 10% 0%, rgb(255 255 255 / 0.7), transparent 34rem),
    var(--stone-100);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open {
  overflow: hidden;
}

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.42);
  outline-offset: 3px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgb(174 136 56 / 0.38);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.18);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink-950);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-frame {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgb(23 23 19 / 0.1);
  background: rgb(251 250 247 / 0.94);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  min-height: var(--header-height);
  width: min(calc(100% - 32px), var(--page-width));
  margin: 0 auto;
  gap: 20px;
}

.brand-group,
.header-actions,
.local-status {
  display: flex;
  align-items: center;
}

.brand-group {
  min-width: 0;
  gap: 14px;
}

.wordmark {
  font-weight: 520;
  font-size: 19px;
  letter-spacing: 0.015em;
}

.project-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-700);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.local-status {
  justify-content: center;
  gap: 8px;
  color: var(--green-700);
  font-size: 12px;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.local-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.header-actions {
  justify-content: flex-end;
  gap: 6px;
}

.quiet-button,
.primary-button,
.secondary-button,
.stage-button,
.text-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.quiet-button,
.icon-button {
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: transparent;
  font-size: 13px;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
}

.quiet-button:hover,
.icon-button:hover {
  background: rgb(23 23 19 / 0.055);
}

.workflow-wrap {
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  background: rgb(245 241 232 / 0.88);
}

.workflow-nav {
  display: flex;
  width: min(calc(100% - 32px), var(--page-width));
  margin: 0 auto;
  gap: 6px;
}

.stage-button {
  position: relative;
  min-width: 96px;
  padding: 13px 16px 12px;
  color: var(--ink-700);
  background: transparent;
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
}

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

.stage-button[aria-current="step"] {
  color: var(--ink-950);
  font-weight: 540;
}

.stage-button[aria-current="step"]::after {
  position: absolute;
  right: 16px;
  bottom: -1px;
  left: 16px;
  height: 2px;
  background: var(--gold-700);
  content: "";
}

.app-main {
  width: min(calc(100% - 32px), var(--page-width));
  margin: 0 auto;
  padding: clamp(28px, 3.6vw, 46px) 0 42px;
}

.stage-intro {
  max-width: 720px;
  margin-bottom: 24px;
}

.stage-intro h1 {
  max-width: 710px;
  margin: 0 0 12px;
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 430;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.stage-intro p {
  max-width: 640px;
  margin: 0;
  color: var(--ink-700);
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.55;
}

.file-issue {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  border: 1px solid rgb(116 47 59 / 0.24);
  border-radius: var(--radius-md);
  padding: 17px 18px 17px 20px;
  gap: 24px;
  background: rgb(255 250 249 / 0.92);
}

.file-issue-copy {
  min-width: 0;
}

.file-issue h2 {
  margin: 0 0 4px;
  color: var(--burgundy-700);
  font-size: 16px;
  font-weight: 560;
}

.file-issue p {
  margin: 0;
  color: var(--ink-700);
  font-size: 14px;
}

.file-issue .file-issue-name {
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--ink-500);
  font-size: 12px;
}

.open-surface {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(290px, 0.72fr);
  min-height: 352px;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.1);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.drop-foundation {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  min-height: 352px;
  padding: clamp(30px, 5vw, 62px);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.74), transparent 58%),
    var(--stone-050);
  box-shadow: inset 0 0 0 0 transparent;
  transition:
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.drop-foundation.is-drag-active {
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.82), rgb(174 136 56 / 0.08)),
    var(--stone-050);
  box-shadow: inset 0 0 0 2px var(--gold-550);
}

.drop-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  margin-bottom: 22px;
  border: 1px solid var(--stone-250);
  border-radius: 50%;
  color: var(--gold-700);
  background: var(--white);
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.source-mark {
  color: var(--green-700);
  font-size: 22px;
}

.drop-foundation h2,
.empty-stage h2,
.dialog-panel h2 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 470;
  letter-spacing: -0.02em;
}

.drop-foundation h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.drop-foundation > p {
  max-width: 540px;
  margin: 0 0 22px;
  color: var(--ink-700);
}

.drop-foundation .drop-note {
  margin: 14px 0 0;
  color: var(--ink-500);
  font-size: 12px;
}

.file-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.file-input {
  position: fixed;
  top: -100px;
  left: -100px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.primary-button,
.secondary-button {
  border-radius: var(--radius-sm);
  padding: 11px 17px;
  font-size: 14px;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.primary-button {
  color: var(--white);
  background: var(--ink-950);
}

.secondary-button {
  border: 1px solid var(--stone-250);
  color: var(--ink-850);
  background: var(--white);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-float);
}

.secondary-button:hover:not(:disabled) {
  background: var(--stone-050);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  color: var(--ink-700);
  background: var(--stone-150);
  box-shadow: inset 0 0 0 1px var(--stone-250);
  opacity: 1;
}

.source-foundation {
  justify-content: flex-start;
  padding-top: clamp(24px, 3vw, 30px);
  padding-bottom: clamp(24px, 3vw, 30px);
}

.source-foundation .drop-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}

.source-foundation > p {
  margin-bottom: 16px;
}

.source-foundation .metadata-grid {
  margin-bottom: 16px;
}

.source-foundation .metadata-item {
  padding-top: 8px;
  padding-bottom: 8px;
}

.source-foundation .drop-note {
  margin-top: 10px;
}

.source-name {
  max-width: 680px;
  font-size: clamp(22px, 2.2vw, 30px) !important;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  width: min(100%, 620px);
  margin: 0 0 22px;
  border-top: 1px solid var(--stone-250);
  border-left: 1px solid var(--stone-250);
}

.metadata-item {
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
  padding: 11px 13px;
}

.metadata-item dt {
  margin-bottom: 2px;
  color: var(--ink-500);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.metadata-item dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-850);
  font-size: 13px;
}

.foundation-note {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 30px;
  color: var(--stone-100);
  background: var(--ink-950);
}

.foundation-note > div > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--white);
  font-size: 15px;
  font-weight: 520;
}

.foundation-note p {
  margin: 0 0 10px;
  color: rgb(245 241 232 / 0.72);
  font-size: 14px;
  line-height: 1.6;
}

.security-list {
  display: grid;
  margin: 22px 0 0;
  gap: 10px;
}

.security-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  color: rgb(245 241 232 / 0.75);
  font-size: 12px;
}

.security-row::before {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--green-700);
  content: "";
}

.security-row span {
  min-width: 0;
}

.security-row strong {
  margin: 0;
  color: var(--stone-100);
  font-size: 12px;
  font-weight: 520;
  text-align: right;
}

.build-status {
  padding-top: 28px;
  color: rgb(245 241 232 / 0.54);
  font-size: 12px;
}

.empty-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.45fr);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.1);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.empty-stage-copy {
  align-self: center;
  padding: clamp(34px, 6vw, 72px);
}

.empty-stage-copy h2 {
  overflow-wrap: anywhere;
}

.empty-stage-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--ink-700);
}

.stage-return-button {
  margin-top: 22px;
}

.stage-sequence {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgb(23 23 19 / 0.09);
  padding: 30px;
  background: var(--stone-150);
}

.stage-sequence span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-500);
  font-size: 12px;
}

.stage-sequence strong {
  font-size: 17px;
  font-weight: 500;
}

.stage-sequence p {
  margin: 9px 0 0;
  color: var(--ink-700);
  font-size: 13px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  gap: 20px;
  color: var(--ink-500);
  font-size: 12px;
}

.status-line p {
  margin: 0;
}

.text-button {
  padding: 0;
  color: var(--ink-700);
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: rgb(87 83 74 / 0.35);
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--ink-950);
  text-decoration-color: currentColor;
}

.dialog-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgb(23 23 19 / 0.32);
  animation: fade-in 140ms ease-out;
}

.dialog-panel {
  background: var(--stone-050);
  box-shadow: -18px 0 44px rgb(23 23 19 / 0.18);
}

.help-panel {
  width: min(460px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 28px;
  animation: slide-in 180ms ease-out;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.help-panel h3 {
  margin: 30px 0 7px;
  font-size: 14px;
  font-weight: 560;
}

.help-panel p,
.help-panel li {
  color: var(--ink-700);
  font-size: 14px;
  line-height: 1.6;
}

.help-panel ul {
  margin: 8px 0 0;
  padding-left: 19px;
}

.help-panel .qualification-copy {
  margin-top: 28px;
  border-top: 1px solid var(--stone-250);
  padding-top: 18px;
  color: var(--ink-500);
  font-size: 12px;
}

.security-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.security-table th,
.security-table td {
  border-bottom: 1px solid var(--stone-250);
  padding: 10px 0;
  text-align: left;
  vertical-align: top;
}

.security-table th {
  width: 38%;
  padding-right: 12px;
  color: var(--ink-950);
  font-weight: 520;
}

.security-table td {
  color: var(--ink-700);
}

.confirmation-backdrop {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.confirmation-dialog {
  width: min(500px, 100%);
  border: 1px solid rgb(23 23 19 / 0.12);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 24px 70px rgb(23 23 19 / 0.24);
  animation: dialog-rise 160ms ease-out;
}

.confirmation-dialog p {
  margin: 0 0 12px;
  color: var(--ink-700);
  overflow-wrap: anywhere;
}

.confirmation-dialog .confirmation-note {
  color: var(--ink-500);
  font-size: 13px;
}

.confirmation-dialog .dialog-actions {
  justify-content: flex-end;
  margin-top: 26px;
}

.notice {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  max-width: 390px;
  border: 1px solid rgb(23 23 19 / 0.12);
  border-radius: var(--radius-md);
  padding: 14px 42px 14px 16px;
  color: var(--stone-100);
  background: var(--ink-950);
  box-shadow: var(--shadow-float);
  font-size: 13px;
}

.notice .icon-button {
  position: absolute;
  top: 6px;
  right: 6px;
  color: var(--stone-100);
}

.noscript-message {
  max-width: 680px;
  margin: 80px auto;
  padding: 32px;
}


.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.data-preview-surface {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
  transition: box-shadow var(--transition-fast);
}

.data-preview-surface.is-drag-active {
  box-shadow:
    inset 0 0 0 2px var(--gold-550),
    var(--shadow-soft);
}

.data-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 26px 20px;
  gap: 24px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.86), transparent 66%),
    var(--stone-050);
}

.data-preview-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
}

.data-preview-title > div:last-child {
  min-width: 0;
}

.data-preview-title .drop-mark {
  width: 46px;
  height: 46px;
  margin: 0;
}

.data-preview-title h2 {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 470;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-preview-title p {
  margin: 0;
  color: var(--ink-700);
  font-size: 14px;
}

.warning-mark {
  border-color: rgb(143 109 34 / 0.34);
  color: var(--gold-700);
  background: #fffdf7;
  font-weight: 560;
}

.error-mark {
  border-color: rgb(116 47 59 / 0.28);
  color: var(--burgundy-700);
  background: #fffafa;
  font-weight: 560;
}

.data-preview-actions {
  flex: 0 0 auto;
}

.import-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
  background: rgb(238 232 220 / 0.46);
}

.import-fact {
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  padding: 11px 14px;
}

.import-fact:last-child {
  border-right: 0;
}

.import-fact dt {
  margin-bottom: 2px;
  color: var(--ink-500);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.import-fact dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-850);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-notes {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  border-bottom: 1px solid rgb(143 109 34 / 0.24);
  padding: 18px 24px;
  gap: 24px;
  background: rgb(255 252 244 / 0.88);
}

.import-notes-heading h3,
.preview-heading h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 560;
}

.import-notes-heading p,
.preview-heading p,
.preview-scope {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
}

.import-notes ul {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 10px;
  list-style: none;
}

.import-notes li {
  display: grid;
  grid-template-columns: minmax(190px, 0.45fr) minmax(0, 1fr);
  gap: 12px;
  color: var(--ink-700);
  font-size: 13px;
}

.import-notes li::before {
  display: none;
}

.import-notes li strong {
  color: var(--ink-850);
  font-weight: 540;
}

.import-notes li.is-error strong {
  color: var(--burgundy-700);
}

.import-notes-more {
  grid-column: 2;
  margin: 8px 0 0;
  color: var(--ink-500);
  font-size: 12px;
}

.preview-section {
  min-width: 0;
  padding: 22px 24px 24px;
}

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

.preview-scope {
  flex: 0 0 auto;
  text-align: right;
}

.preview-scroller {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  background: var(--white);
  overscroll-behavior-inline: contain;
}

.preview-scroller:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.36);
  outline-offset: 3px;
}

.data-preview-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink-850);
  font-family: var(--font-data);
  font-size: 12px;
}

.data-preview-table th,
.data-preview-table td {
  height: 38px;
  border-right: 1px solid var(--stone-150);
  border-bottom: 1px solid var(--stone-150);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.data-preview-table tr:last-child th,
.data-preview-table tr:last-child td {
  border-bottom: 0;
}

.data-preview-table th:last-child,
.data-preview-table td:last-child {
  border-right: 0;
}

.data-preview-table thead th {
  color: var(--ink-700);
  background: var(--stone-150);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 540;
  letter-spacing: 0.01em;
}

.data-preview-table .row-number-heading,
.data-preview-table .row-number {
  position: sticky;
  z-index: 1;
  left: 0;
  width: 54px;
  color: var(--ink-500);
  background: var(--stone-050);
  font-family: var(--font-ui);
  font-weight: 500;
}

.data-preview-table .row-number-heading {
  z-index: 2;
  background: var(--stone-150);
}

.preview-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-cell.is-blank {
  color: var(--ink-500);
  font-family: var(--font-ui);
}

.data-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--stone-250);
  padding: 13px 24px;
  gap: 20px;
  color: var(--ink-500);
  background: rgb(238 232 220 / 0.48);
  font-size: 11px;
}

.data-preview-footer p {
  margin: 0;
}

.parse-mark {
  color: var(--gold-700);
  font-size: 24px;
  letter-spacing: 0.08em;
}

.parse-progress {
  width: min(100%, 520px);
  height: 3px;
  overflow: hidden;
  margin-top: 2px;
  border-radius: 2px;
  background: var(--stone-150);
}

.parse-progress span {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--gold-550);
  animation: local-parse 1.2s ease-in-out infinite alternate;
}

.import-error-foundation > p {
  max-width: 620px;
}

.import-error-file {
  margin-top: -6px !important;
  overflow-wrap: anywhere;
  color: var(--ink-500) !important;
  font-size: 12px;
}

@keyframes local-parse {
  from { transform: translateX(-12%); }
  to { transform: translateX(176%); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes dialog-rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 920px) {
  .open-surface {
    grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.75fr);
  }

  .security-row {
    grid-template-columns: 10px 1fr;
  }

  .security-row strong {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 820px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .local-status {
    display: none;
  }

  .open-surface,
  .empty-stage {
    grid-template-columns: 1fr;
  }

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

  .import-fact:nth-child(3) {
    border-right: 0;
  }

  .import-fact:nth-child(-n + 3) {
    border-bottom: 1px solid var(--stone-250);
  }

  .foundation-note {
    min-height: 230px;
  }

  .stage-sequence {
    border-top: 1px solid rgb(23 23 19 / 0.09);
    border-left: 0;
  }

  .security-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }

  .security-row strong {
    grid-column: auto;
    text-align: right;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .workflow-nav,
  .app-main {
    width: min(calc(100% - 22px), var(--page-width));
  }

  .project-name,
  .header-actions .quiet-button:first-child {
    display: none;
  }

  .workflow-nav {
    justify-content: space-between;
    gap: 0;
  }

  .stage-button {
    min-width: 0;
    flex: 1;
    padding-right: 8px;
    padding-left: 8px;
  }

  .stage-button[aria-current="step"]::after {
    right: 8px;
    left: 8px;
  }

  .app-main {
    padding-top: 36px;
  }

  .stage-intro h1 {
    font-size: 34px;
  }

  .drop-foundation,
  .empty-stage-copy {
    padding: 34px 26px;
  }

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

  .data-preview-header,
  .data-preview-title,
  .preview-heading,
  .data-preview-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-preview-title h2 {
    max-width: calc(100vw - 110px);
  }

  .data-preview-actions,
  .data-preview-actions .secondary-button {
    width: 100%;
  }

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

  .import-fact,
  .import-fact:nth-child(3) {
    border-right: 1px solid var(--stone-250);
    border-bottom: 1px solid var(--stone-250);
  }

  .import-fact:nth-child(even) {
    border-right: 0;
  }

  .import-fact:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .import-notes {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .import-notes li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .import-notes-more {
    grid-column: 1;
  }

  .preview-scope {
    text-align: left;
  }

  .file-issue {
    flex-direction: column;
    gap: 8px;
  }

  .status-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .security-row {
    grid-template-columns: 10px 1fr;
  }

  .security-row strong {
    grid-column: 2;
    text-align: left;
  }

  .confirmation-dialog {
    padding: 24px;
  }

  .confirmation-dialog .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .confirmation-dialog .primary-button,
  .confirmation-dialog .secondary-button {
    width: 100%;
  }
}

@media print {
  .skip-link,
  .app-header,
  .workflow-wrap,
  .dialog-backdrop,
  .notice,
  .status-line {
    display: none !important;
  }

  body {
    background: var(--white);
  }

  .app-main {
    width: auto;
    padding: 0;
  }
}

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

@media (min-width: 821px) {
  .app-main.has-data-preview {
    padding-top: 30px;
    padding-bottom: 24px;
  }

  .has-data-preview .stage-intro {
    margin-bottom: 18px;
  }

  .has-data-preview .stage-intro h1 {
    margin-bottom: 8px;
    font-size: clamp(32px, 3.8vw, 48px);
  }

  .has-data-preview .stage-intro p {
    font-size: 18px;
  }

  .has-data-preview .status-line {
    margin-top: 12px;
  }

  .has-data-preview .data-preview-table th,
  .has-data-preview .data-preview-table td {
    height: 36px;
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

/* r005 workbook inspection and worksheet selection */
.xlsx-selection-stack {
  min-width: 0;
}

.xlsx-selection-stack > .import-notes {
  margin-top: 14px;
  border: 1px solid rgb(143 109 34 / 0.24);
  border-radius: var(--radius-md);
}

.sheet-selection-foundation {
  justify-content: center;
}

.sheet-selector {
  display: grid;
  width: min(100%, 580px);
  margin: 2px 0 20px;
  gap: 7px;
}

.sheet-selector label {
  color: var(--ink-850);
  font-size: 13px;
  font-weight: 540;
}

.sheet-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 9px 38px 9px 12px;
  color: var(--ink-950);
  background: var(--white);
  cursor: pointer;
}

.sheet-select:hover {
  border-color: rgb(143 109 34 / 0.46);
}

.sheet-select:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.36);
  outline-offset: 2px;
}

.sheet-choice-note {
  margin: 0 !important;
  color: var(--ink-500) !important;
  font-size: 12px;
}

.xlsx-preview-surface .data-preview-title p {
  max-width: 760px;
}


@media (max-width: 560px) {
  .sheet-selector {
    width: 100%;
  }

  .xlsx-selection-stack > .import-notes {
    margin-top: 12px;
  }
}

/* r005 progressive workbook notes */
.import-notes-more-details {
  grid-column: 2;
  color: var(--ink-700);
  font-size: 12px;
}

.import-notes-more-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--ink-700);
  text-decoration: underline;
  text-decoration-color: rgb(87 83 74 / 0.28);
  text-underline-offset: 3px;
}

.import-notes-more-details summary:hover {
  color: var(--ink-950);
  text-decoration-color: currentColor;
}

.import-notes-more-details[open] summary {
  margin-bottom: 10px;
}

@media (min-width: 821px) {
  .app-main.has-workbook-selection {
    padding-top: 30px;
    padding-bottom: 24px;
  }

  .has-workbook-selection .stage-intro {
    margin-bottom: 18px;
  }

  .has-workbook-selection .stage-intro h1 {
    margin-bottom: 8px;
    font-size: clamp(32px, 3.8vw, 48px);
  }

  .has-workbook-selection .stage-intro p {
    font-size: 18px;
  }

  .has-workbook-selection .open-surface,
  .has-workbook-selection .drop-foundation {
    min-height: 320px;
  }

  .has-workbook-selection .source-foundation,
  .has-workbook-selection .foundation-note {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .has-workbook-selection .xlsx-selection-stack > .import-notes {
    margin-top: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .has-workbook-selection .status-line {
    margin-top: 10px;
  }
}

@media (max-width: 560px) {
  .import-notes-more-details {
    grid-column: 1;
  }
}

/* r006 header and logical-table selection */
.table-selection-surface {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
  transition: box-shadow var(--transition-fast);
}

.table-selection-surface.is-drag-active {
  box-shadow:
    inset 0 0 0 2px var(--gold-550),
    var(--shadow-soft);
}

.table-selection-header .data-preview-title p {
  max-width: 720px;
}

.table-selection-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.42fr) minmax(0, 1fr);
  min-width: 0;
}

.table-selection-controls {
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  padding: 20px 22px 22px;
  background: rgb(238 232 220 / 0.34);
}

.table-controls-heading h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 560;
}

.table-controls-heading p {
  margin: 0;
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.45;
}

.header-candidates {
  display: grid;
  margin: 15px 0;
  gap: 7px;
}

.header-candidate {
  position: relative;
  display: grid;
  min-width: 0;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 8px 72px 8px 10px;
  color: var(--ink-850);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.header-candidate:hover {
  border-color: rgb(143 109 34 / 0.42);
  background: var(--stone-050);
}

.header-candidate.is-selected {
  border-color: rgb(143 109 34 / 0.56);
  background: rgb(255 252 244 / 0.94);
  box-shadow: inset 3px 0 0 var(--gold-550);
}

.candidate-row {
  font-size: 12px;
  font-weight: 560;
}

.candidate-excerpt {
  overflow: hidden;
  color: var(--ink-700);
  font-family: var(--font-data);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-note {
  position: absolute;
  top: 9px;
  right: 10px;
  color: var(--gold-700);
  font-size: 10px;
  font-weight: 560;
}

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

.table-range-fields label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--ink-850);
  font-size: 12px;
  font-weight: 540;
}

.table-range-fields input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  color: var(--ink-950);
  background: var(--white);
}

.table-range-fields input:hover {
  border-color: rgb(143 109 34 / 0.42);
}

.table-range-fields input:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.34);
  outline-offset: 2px;
}

.table-range-fields small {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 400;
}

.table-selection-issue {
  margin: 10px 0 0;
  border-left: 2px solid var(--burgundy-700);
  padding-left: 9px;
  color: var(--burgundy-700);
  font-size: 12px;
}

.table-heading-warnings {
  display: grid;
  margin-top: 12px;
  border-top: 1px solid rgb(143 109 34 / 0.2);
  padding-top: 10px;
  gap: 7px;
}

.table-confirmed-surface > .table-heading-warnings {
  margin: 0;
  border-top: 0;
  border-bottom: 1px solid rgb(143 109 34 / 0.2);
  padding: 13px 24px;
  background: rgb(255 252 244 / 0.74);
}

.table-heading-warning {
  display: grid;
  gap: 1px;
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.4;
}

.table-heading-warning strong {
  color: var(--gold-700);
  font-weight: 560;
}

.table-confirm-actions {
  display: flex;
  align-items: center;
  margin-top: 14px;
  gap: 10px;
}

.table-confirm-actions span {
  color: var(--ink-500);
  font-size: 11px;
}

.table-cancel-button {
  white-space: nowrap;
}

.table-selection-preview {
  min-width: 0;
  padding: 20px 22px 22px;
}

.table-context-preview {
  min-width: 760px;
}

.table-context-preview .row-role-heading,
.table-context-preview .row-role {
  width: 68px;
  color: var(--ink-500);
  background: var(--stone-050);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
}

.table-context-preview tr.is-outside td,
.table-context-preview tr.is-outside .row-number,
.table-context-preview tr.is-outside .row-role {
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.52);
}

.table-context-preview tr.is-header th,
.table-context-preview tr.is-header td {
  border-top-color: rgb(143 109 34 / 0.36);
  border-bottom-color: rgb(143 109 34 / 0.36);
  background: rgb(255 249 232 / 0.92);
}

.table-context-preview tr.is-header .row-number,
.table-context-preview tr.is-header .row-role {
  color: var(--gold-700);
  font-weight: 620;
}

.table-header-cell {
  color: var(--ink-950);
  font-weight: 620;
}

.preview-gap-row th,
.preview-gap-row td {
  height: 26px;
  color: var(--ink-500);
  background: var(--stone-100);
  text-align: center;
}

.table-selection-footer {
  flex-wrap: wrap;
}

.source-note-details {
  margin-left: auto;
  color: var(--ink-700);
}

.source-note-details summary {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgb(87 83 74 / 0.28);
  text-underline-offset: 3px;
}

.source-note-details ul {
  position: absolute;
  z-index: 8;
  right: 24px;
  width: min(520px, calc(100vw - 44px));
  margin: 8px 0 0;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--white);
  box-shadow: var(--shadow-float);
  list-style: none;
}

.source-note-details li {
  display: grid;
  gap: 2px;
  margin-bottom: 9px;
  font-size: 12px;
}

.source-note-details li:last-child {
  margin-bottom: 0;
}

.source-note-details li strong {
  color: var(--ink-850);
  font-weight: 560;
}

.selected-table-section {
  padding-top: 18px;
}

.selected-table-preview {
  min-width: 820px;
}

.selected-table-preview thead th:not(.row-number-heading) {
  color: var(--ink-950);
  background: rgb(255 249 232 / 0.9);
  font-weight: 620;
}

@media (min-width: 821px) {
  .app-main.has-table-selection {
    padding-top: 24px;
    padding-bottom: 20px;
  }

  .has-table-selection .stage-intro {
    margin-bottom: 14px;
  }

  .has-table-selection .stage-intro h1 {
    margin-bottom: 6px;
    font-size: clamp(31px, 3.5vw, 44px);
  }

  .has-table-selection .stage-intro p {
    max-width: 860px;
    font-size: 17px;
  }

  .has-table-selection .data-preview-header {
    padding-top: 18px;
    padding-bottom: 16px;
  }

  .has-table-selection .import-fact {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .has-table-selection .data-preview-table th,
  .has-table-selection .data-preview-table td {
    height: 32px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
}

@media (max-width: 940px) {
  .table-selection-layout {
    grid-template-columns: minmax(240px, 0.48fr) minmax(0, 1fr);
  }

  .table-selection-controls,
  .table-selection-preview {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 760px) {
  .missing-value-guides {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .table-selection-layout {
    grid-template-columns: 1fr;
  }

  .table-selection-controls {
    border-right: 0;
    border-bottom: 1px solid var(--stone-250);
  }

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

  .header-candidate {
    padding-right: 10px;
  }

  .candidate-note {
    position: static;
    margin-top: 2px;
  }
}

@media (max-width: 560px) {
  .header-candidates,
  .table-range-fields {
    grid-template-columns: 1fr;
  }

  .table-selection-controls,
  .table-selection-preview {
    padding: 18px 16px;
  }

  .table-confirm-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .table-confirm-actions .primary-button {
    width: 100%;
  }

  .source-note-details {
    margin-left: 0;
  }

  .source-note-details ul {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* r006 compact 13-inch table review */
@media (min-width: 821px) {
  .table-selection-controls {
    padding: 16px 18px 17px;
  }

  .table-controls-heading p {
    font-size: 11px;
    line-height: 1.35;
  }

  .header-candidates {
    margin: 10px 0;
    gap: 5px;
  }

  .header-candidate {
    padding: 6px 68px 6px 9px;
  }

  .candidate-row {
    font-size: 11px;
  }

  .candidate-excerpt,
  .candidate-note {
    font-size: 10px;
  }

  .candidate-note {
    top: 7px;
    right: 9px;
  }

  .table-range-fields input {
    height: 36px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .table-range-fields small {
    font-size: 9px;
    line-height: 1.2;
  }

  .table-confirm-actions {
    margin-top: 10px;
  }

  .table-confirm-actions .primary-button {
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

/* r008 column type interpretation */
.column-type-surface {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.column-type-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 26px 18px;
  gap: 24px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.86), transparent 66%),
    var(--stone-050);
}

.column-type-header > div {
  min-width: 0;
}

.column-type-header h2 {
  margin: 0 0 4px;
  font-size: clamp(22px, 2.2vw, 29px);
  font-weight: 470;
  letter-spacing: -0.02em;
}

.column-type-header p {
  max-width: 720px;
  margin: 0;
  color: var(--ink-700);
  font-size: 13px;
  line-height: 1.5;
}

.column-type-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
  background: rgb(238 232 220 / 0.46);
}

.column-type-fact {
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  padding: 9px 13px;
}

.column-type-fact:last-child {
  border-right: 0;
}

.column-type-fact dt {
  margin-bottom: 1px;
  color: var(--ink-500);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.column-type-fact dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-850);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-type-list-header,
.column-type-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(320px, 1.7fr) minmax(210px, 0.78fr);
  gap: 22px;
}

.column-type-list-header {
  border-bottom: 1px solid var(--stone-250);
  padding: 9px 24px;
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.62);
  font-size: 10px;
  font-weight: 560;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.column-type-row {
  align-items: start;
  border-bottom: 1px solid rgb(222 213 198 / 0.82);
  padding: 15px 24px;
  transition: background var(--transition-fast);
}

.column-type-row:last-child {
  border-bottom: 0;
}

.column-type-row:hover {
  background: rgb(255 255 255 / 0.58);
}

.column-type-row.is-manual {
  box-shadow: inset 3px 0 0 rgb(143 109 34 / 0.55);
}

.column-type-row.needs-review {
  background: rgb(255 252 244 / 0.5);
}

.column-type-source,
.column-type-evidence,
.column-type-choice {
  min-width: 0;
}

.column-type-source {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.column-type-source strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-type-source > span {
  color: var(--gold-700);
  font-size: 11px;
  font-weight: 560;
}

.column-type-source small {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-500);
  font-family: var(--font-data);
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.column-type-proposal {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 4px;
  gap: 8px;
}

.column-type-proposal strong {
  font-size: 13px;
  font-weight: 580;
}

.type-confidence {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 560;
  letter-spacing: 0.02em;
}

.type-confidence[data-confidence="medium"] {
  color: var(--gold-700);
}

.type-confidence[data-confidence="low"] {
  color: var(--burgundy-700);
}

.column-type-evidence p {
  margin: 0 0 4px;
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.42;
}

.column-type-evidence small {
  color: var(--ink-500);
  font-size: 10px;
}

.column-type-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.column-type-choice label {
  width: 100%;
}

.column-type-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 7px 34px 7px 10px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 12px;
}

.column-type-select:hover {
  border-color: rgb(143 109 34 / 0.5);
}

.column-choice-status {
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.35;
}

.column-type-reset {
  font-size: 10px;
}

.column-type-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--stone-250);
  padding: 12px 24px;
  gap: 20px;
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.46);
  font-size: 10px;
}

.column-type-footer p {
  margin: 0;
}

.column-type-footer span {
  flex: 0 0 auto;
  color: var(--ink-700);
}

.column-type-unavailable {
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-lg);
  padding: 34px;
  background: var(--stone-050);
}

.column-type-unavailable h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
}

.column-type-unavailable p {
  margin: 0;
  color: var(--ink-700);
}

@media (min-width: 821px) {
  .app-main.has-column-type-review {
    padding-top: 22px;
  }

  .has-column-type-review .stage-intro {
    margin-bottom: 16px;
  }

  .has-column-type-review .stage-intro h1 {
    font-size: clamp(30px, 3.3vw, 44px);
  }

  .has-column-type-review .stage-intro p {
    max-width: 760px;
    font-size: 15px;
  }
}

@media (max-width: 900px) {
  .column-type-list-header,
  .column-type-row {
    grid-template-columns: minmax(150px, 0.72fr) minmax(260px, 1.35fr) minmax(180px, 0.78fr);
    gap: 16px;
  }

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

  .column-type-fact:nth-child(3) {
    border-right: 0;
  }

  .column-type-fact:nth-child(-n + 3) {
    border-bottom: 1px solid var(--stone-250);
  }
}

@media (max-width: 700px) {
  .column-type-header {
    align-items: stretch;
    flex-direction: column;
    padding: 20px 18px 16px;
    gap: 14px;
  }

  .column-type-header .secondary-button {
    align-self: flex-start;
  }

  .column-type-list-header {
    display: none;
  }

  .column-type-row {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 13px;
  }

  .column-type-source strong {
    white-space: normal;
  }

  .column-type-choice {
    padding-top: 2px;
  }

  .column-type-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 13px 18px;
    gap: 4px;
  }
}

@media (max-width: 440px) {
  .column-type-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .column-type-fact:nth-child(2n) {
    border-right: 0;
  }

  .column-type-fact:nth-child(3) {
    border-right: 1px solid var(--stone-250);
  }

  .column-type-fact:nth-child(-n + 4) {
    border-bottom: 1px solid var(--stone-250);
  }
}

.column-type-select:focus,
.column-type-select:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5) !important;
  outline-offset: 2px;
  border-color: var(--gold-700);
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.2) !important;
}

/* Data-health overview */
.check-stage-stack {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.data-health-surface {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.data-health-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 21px 26px 17px;
  gap: 24px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.88), transparent 66%),
    var(--stone-050);
}

.data-health-header > div {
  min-width: 0;
}

.data-health-header h2 {
  margin: 0 0 4px;
  font-size: clamp(22px, 2.2vw, 29px);
  font-weight: 470;
  letter-spacing: -0.02em;
}

.data-health-header p {
  max-width: 730px;
  margin: 0;
  color: var(--ink-700);
  font-size: 13px;
  line-height: 1.5;
}

.health-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
  background: rgb(238 232 220 / 0.46);
}

.health-fact {
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  padding: 9px 13px;
}

.health-fact:last-child {
  border-right: 0;
}

.health-fact dt {
  margin-bottom: 1px;
  color: var(--ink-500);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.health-fact dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-850);
  font-size: 14px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-issues,
.health-columns,
.duplicate-candidates {
  padding: 18px 24px 0;
}

.health-columns,
.duplicate-candidates {
  border-top: 1px solid var(--stone-250);
  padding-top: 17px;
}

.health-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 24px;
}

.health-section-heading h3 {
  margin: 0;
  color: var(--ink-850);
  font-size: 15px;
  font-weight: 580;
}

.health-section-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.45;
  text-align: right;
}

.health-issue-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.health-issue {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  border-top: 1px solid rgb(222 213 198 / 0.75);
  padding: 11px 0;
  gap: 12px;
}

.health-issue:first-child {
  border-top: 0;
}

.health-issue-mark {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--ink-500);
}

.health-issue.is-attention .health-issue-mark {
  background: var(--burgundy-700);
}

.health-issue.is-review .health-issue-mark {
  background: var(--gold-700);
}

.health-issue.is-indicator .health-issue-mark,
.health-issue.is-clear .health-issue-mark {
  background: var(--green-700);
}

.health-issue-copy {
  min-width: 0;
}

.health-issue-copy > strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 590;
}

.health-issue-copy > p {
  max-width: 900px;
  margin: 0;
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.45;
}

.health-trace {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
  gap: 5px 8px;
  color: var(--ink-500);
  font-size: 9px;
}

.health-trace > span:first-child {
  color: var(--ink-700);
  font-weight: 560;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.health-trace strong {
  color: var(--ink-850);
  font-weight: 570;
}

.health-trace-button {
  border: 0;
  border-radius: 5px;
  padding: 2px 5px;
  color: var(--ink-700);
  background: rgb(238 232 220 / 0.72);
  cursor: pointer;
  font-size: 9px;
  text-decoration: underline;
  text-decoration-color: rgb(87 83 74 / 0.28);
  text-underline-offset: 2px;
}

.health-trace-button:hover {
  color: var(--ink-950);
  background: var(--stone-150);
}

.health-trace-button:focus-visible,
.column-type-disclosure > summary:focus-visible,
.health-table-scroll:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
}

.health-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
  overscroll-behavior-x: contain;
}

.health-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 11px;
}

.health-table th,
.health-table td {
  border-bottom: 1px solid rgb(222 213 198 / 0.72);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}

.health-table thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: var(--ink-500);
  background: var(--stone-150);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 580;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.health-table tbody tr:last-child th,
.health-table tbody tr:last-child td {
  border-bottom: 0;
}

.health-table tbody tr:hover,
.health-table tbody tr:focus {
  background: rgb(255 249 232 / 0.55);
}

.health-table tbody tr:focus {
  outline: 3px solid rgb(174 136 56 / 0.45);
  outline-offset: -3px;
}

.health-table tbody th {
  min-width: 190px;
  font-family: var(--font-ui);
  font-weight: 540;
}

.health-table tbody th strong,
.health-table tbody th span {
  display: block;
}

.health-table tbody th strong {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-table tbody th span {
  margin-top: 1px;
  color: var(--gold-700);
  font-size: 9px;
}

.health-table td:nth-child(3),
.health-table td:nth-child(4),
.health-table td:nth-child(5) {
  width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.health-table td:last-child {
  min-width: 150px;
  color: var(--ink-700);
  font-family: var(--font-ui);
  font-size: 10px;
}

.duplicate-list {
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.duplicate-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(300px, 1.4fr) minmax(150px, 0.55fr);
  align-items: center;
  border-bottom: 1px solid rgb(222 213 198 / 0.72);
  padding: 10px 12px;
  gap: 16px;
}

.duplicate-row:last-child {
  border-bottom: 0;
}

.duplicate-row > div strong,
.duplicate-row > div span {
  display: block;
}

.duplicate-row > div strong {
  font-size: 11px;
  font-weight: 590;
}

.duplicate-row > div span,
.duplicate-source-rows span {
  color: var(--ink-500);
  font-size: 9px;
}

.duplicate-row > p {
  margin: 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.4;
}

.duplicate-source-rows {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  text-align: right;
}

.duplicate-source-rows strong {
  color: var(--ink-850);
  font-size: 11px;
  font-weight: 590;
}

.data-health-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  border-top: 1px solid var(--stone-250);
  padding: 12px 24px;
  gap: 20px;
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.46);
  font-size: 10px;
}

.data-health-footer p {
  margin: 0;
}

.data-health-footer span {
  flex: 0 0 auto;
  color: var(--ink-700);
}

.column-type-disclosure {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.column-type-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 15px 22px;
  gap: 22px;
  cursor: pointer;
  list-style: none;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.78), transparent 68%),
    var(--stone-050);
}

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

.column-type-disclosure > summary::after {
  flex: 0 0 auto;
  color: var(--gold-700);
  content: "+";
  font-size: 22px;
  font-weight: 300;
}

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

.column-type-disclosure > summary > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.column-type-disclosure > summary strong {
  font-size: 16px;
  font-weight: 570;
}

.column-type-disclosure > summary small,
.column-type-disclosure-meta {
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.4;
}

.column-type-disclosure-meta {
  margin-left: auto;
  color: var(--ink-700);
  text-align: right;
}

.column-type-surface.is-embedded {
  border: 0;
  border-top: 1px solid var(--stone-250);
  border-radius: 0;
  box-shadow: none;
}

.health-unavailable {
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-lg);
  padding: 34px;
  background: var(--stone-050);
}

.health-unavailable h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
}

.health-unavailable p {
  margin: 0;
  color: var(--ink-700);
}

@media (min-width: 821px) {
  .app-main.has-data-health-review {
    padding-top: 22px;
  }

  .has-data-health-review .stage-intro {
    margin-bottom: 15px;
  }

  .has-data-health-review .stage-intro h1 {
    font-size: clamp(30px, 3.3vw, 44px);
  }

  .has-data-health-review .stage-intro p {
    max-width: 880px;
    font-size: 15px;
  }
}

@media (max-width: 900px) {
  .health-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .health-fact:nth-child(3) {
    border-right: 0;
  }

  .health-fact:nth-child(-n + 3) {
    border-bottom: 1px solid var(--stone-250);
  }

  .duplicate-row {
    grid-template-columns: minmax(140px, 0.55fr) minmax(260px, 1.25fr) minmax(130px, 0.5fr);
  }
}

@media (max-width: 700px) {
  .data-health-header {
    align-items: stretch;
    flex-direction: column;
    padding: 19px 18px 15px;
    gap: 13px;
  }

  .data-health-header .secondary-button {
    align-self: flex-start;
  }

  .health-issues,
  .health-columns,
  .duplicate-candidates {
    padding-right: 18px;
    padding-left: 18px;
  }

  .health-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .health-section-heading p {
    text-align: left;
  }

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

  .duplicate-source-rows {
    justify-content: flex-start;
    text-align: left;
  }

  .data-health-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
    gap: 4px;
  }

  .column-type-disclosure > summary {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px 18px;
    gap: 6px 14px;
  }

  .column-type-disclosure-meta {
    width: calc(100% - 32px);
    margin-left: 0;
    text-align: left;
  }
}

@media (max-width: 440px) {
  .health-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-fact:nth-child(2n) {
    border-right: 0;
  }

  .health-fact:nth-child(3) {
    border-right: 1px solid var(--stone-250);
  }

  .health-fact:nth-child(-n + 4) {
    border-bottom: 1px solid var(--stone-250);
  }

  .health-table {
    min-width: 760px;
  }
}

/* Missing-value interpretation */
.missing-value-surface {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.missing-value-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  gap: 24px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.85), transparent 68%),
    var(--stone-050);
}

.missing-value-header > div:first-child {
  min-width: 0;
}

.missing-value-header h2 {
  margin: 0 0 4px;
  font-size: clamp(22px, 2.2vw, 29px);
  font-weight: 470;
  letter-spacing: -0.02em;
}

.missing-value-header p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-700);
  font-size: 13px;
  line-height: 1.5;
}

.missing-meaning-guide {
  flex: 0 0 210px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 0.72);
}

.missing-meaning-guide > summary {
  padding: 8px 11px;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 11px;
  font-weight: 560;
}

.missing-meaning-guide dl {
  margin: 0;
  border-top: 1px solid var(--stone-250);
  padding: 8px 11px 10px;
}

.missing-meaning-guide dl > div {
  margin-top: 7px;
}

.missing-meaning-guide dl > div:first-child {
  margin-top: 0;
}

.missing-meaning-guide dt {
  color: var(--ink-850);
  font-size: 10px;
  font-weight: 590;
}

.missing-meaning-guide dd {
  margin: 1px 0 0;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.4;
}


.missing-value-guides {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
}

.missing-denominator-guide {
  position: relative;
}

.missing-denominator-guide > summary {
  min-width: 150px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  cursor: pointer;
  color: var(--ink-700);
  background: var(--stone-050);
  font-size: 10px;
  font-weight: 540;
  list-style-position: inside;
}

.missing-denominator-guide[open] {
  width: min(330px, 100%);
}

.missing-denominator-guide p {
  margin: 12px 0 7px;
  color: var(--ink-700);
  font-size: 10px;
}

.missing-denominator-guide ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.6;
}

.missing-denominator-guide > summary:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
}

.missing-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
  background: rgb(238 232 220 / 0.46);
}

.missing-fact {
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  padding: 9px 13px;
}

.missing-fact:last-child {
  border-right: 0;
}

.missing-fact dt {
  margin-bottom: 1px;
  color: var(--ink-500);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.missing-fact dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-850);
  font-size: 14px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.missing-columns {
  padding: 16px 22px 4px;
}

.missing-column {
  border-top: 1px solid rgb(222 213 198 / 0.82);
}

.missing-column:first-child {
  border-top: 0;
}

.missing-column > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 10px 4px;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.missing-column > summary::-webkit-details-marker {
  display: none;
}

.missing-column > summary::after {
  flex: 0 0 auto;
  color: var(--gold-700);
  content: "+";
  font-size: 18px;
  font-weight: 300;
}

.missing-column[open] > summary::after {
  content: "−";
}

.missing-column > summary > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.missing-column > summary strong {
  max-width: 520px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.missing-column > summary small,
.missing-column-meta {
  color: var(--ink-500);
  font-size: 9px;
}

.missing-column-meta {
  margin-left: auto;
  color: var(--ink-700);
  text-align: right;
}

.missing-candidate-list {
  overflow: hidden;
  margin: 0 0 12px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
}

.missing-candidate {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(260px, 1.2fr) minmax(250px, 0.9fr);
  align-items: center;
  border-bottom: 1px solid rgb(222 213 198 / 0.72);
  padding: 10px 12px;
  gap: 16px;
}

.missing-candidate:last-child {
  border-bottom: 0;
}

.missing-candidate.is-manual {
  background: rgb(255 249 232 / 0.52);
}

.missing-candidate-value,
.missing-candidate-note,
.missing-candidate-choice {
  min-width: 0;
}

.missing-candidate-value strong,
.missing-candidate-value span {
  display: block;
}

.missing-candidate-value strong {
  overflow: hidden;
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.missing-candidate-value span,
.missing-candidate-note span {
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.4;
}

.missing-candidate-note span {
  color: var(--ink-700);
}

.missing-candidate-choice {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.missing-meaning-select {
  width: min(100%, 210px);
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 7px 27px 7px 9px;
  color: var(--ink-850);
  background: var(--white);
  font-size: 10px;
}

.missing-meaning-select:hover {
  border-color: rgb(143 109 34 / 0.52);
}

.missing-meaning-select:focus,
.missing-meaning-select:focus-visible,
.missing-column > summary:focus-visible,
.missing-meaning-guide > summary:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5) !important;
  outline-offset: 2px;
  border-color: var(--gold-700);
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.16) !important;
}

.missing-reset {
  flex: 0 0 auto;
  white-space: nowrap;
}

.missing-empty {
  padding: 24px;
}

.missing-empty strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.missing-empty p {
  margin: 0;
  color: var(--ink-700);
  font-size: 11px;
}

.missing-value-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--stone-250);
  padding: 12px 24px;
  gap: 20px;
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.46);
  font-size: 10px;
}

.missing-value-footer p {
  margin: 0;
}

.missing-value-footer span {
  flex: 0 0 auto;
  color: var(--ink-700);
}

.missing-unavailable {
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-lg);
  padding: 34px;
  background: var(--stone-050);
}

.missing-unavailable h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 500;
}

.missing-unavailable p {
  margin: 0;
  color: var(--ink-700);
}

@media (max-width: 900px) {
  .missing-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .missing-fact:nth-child(3) {
    border-right: 0;
  }

  .missing-fact:nth-child(-n + 3) {
    border-bottom: 1px solid var(--stone-250);
  }

  .missing-candidate {
    grid-template-columns: minmax(170px, 0.75fr) minmax(220px, 1fr) minmax(220px, 0.9fr);
  }
}

@media (max-width: 700px) {
  .missing-value-header {
    flex-direction: column;
    padding: 18px 18px 14px;
    gap: 12px;
  }

  .missing-meaning-guide {
    width: 100%;
    flex-basis: auto;
  }

  .missing-columns {
    padding: 12px 18px 2px;
  }

  .missing-column > summary {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .missing-column-meta {
    width: calc(100% - 28px);
    margin-left: 0;
    text-align: left;
  }

  .missing-candidate {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .missing-candidate-choice {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .missing-meaning-select {
    width: min(100%, 280px);
  }

  .missing-value-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
    gap: 4px;
  }
}

@media (max-width: 440px) {
  .missing-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .missing-fact:nth-child(2n) {
    border-right: 0;
  }

  .missing-fact:nth-child(3) {
    border-right: 1px solid var(--stone-250);
  }

  .missing-fact:nth-child(-n + 4) {
    border-bottom: 1px solid var(--stone-250);
  }
}

/* r012 question configuration */
.question-config-surface {
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.question-config-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 26px 24px;
}

.question-config-header > div:first-child {
  min-width: 0;
}

.question-config-header h2 {
  margin: 0 0 7px;
  font-size: 27px;
  font-weight: 460;
  letter-spacing: -0.025em;
}

.question-config-header p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-700);
  font-size: 14px;
  line-height: 1.55;
}

.question-config-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid rgb(23 23 19 / 0.09);
  border-bottom: 1px solid rgb(23 23 19 / 0.09);
  background: rgb(238 232 220 / 0.5);
}

.question-config-fact {
  min-width: 0;
  padding: 12px 13px;
  border-right: 1px solid rgb(23 23 19 / 0.09);
}

.question-config-fact:last-child {
  border-right: 0;
}

.question-config-fact dt {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-config-fact dd {
  margin: 3px 0 0;
  font-family: var(--font-data);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.question-config-list {
  padding: 0 24px;
}

.question-config-row {
  border-bottom: 1px solid rgb(23 23 19 / 0.1);
}

.question-config-row:last-child {
  border-bottom: 0;
}

.question-config-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  min-height: 66px;
  padding: 13px 36px 13px 0;
  cursor: pointer;
  list-style: none;
  position: relative;
}

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

.question-config-row > summary::after {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 18px;
  transform: translateY(-50%);
  color: var(--ink-500);
  content: "+";
  font-size: 21px;
  font-weight: 300;
  text-align: center;
}

.question-config-row[open] > summary::after {
  content: "−";
}

.question-config-row > summary:hover .question-config-source strong {
  color: var(--ink-950);
}

.question-config-row > summary:focus-visible,
.question-name-input:focus-visible,
.question-type-select:focus-visible,
.question-inclusion-control input:focus-visible,
.question-category-move:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.42);
  outline-offset: 3px;
}

.question-config-source {
  min-width: 0;
}

.question-config-source strong,
.question-config-source small {
  display: block;
}

.question-config-source strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-config-source small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-config-summary-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--ink-700);
  font-size: 12px;
  white-space: nowrap;
}

.question-inclusion-status {
  min-width: 72px;
  border-left: 1px solid rgb(23 23 19 / 0.12);
  padding-left: 12px;
  color: var(--ink-500);
}

.question-inclusion-status.is-included {
  color: var(--green-700);
}

.question-config-row.is-ignored > summary {
  opacity: 0.72;
}

.question-config-row.needs-type > summary {
  box-shadow: inset 3px 0 0 var(--burgundy-700);
  padding-left: 12px;
}

.question-config-body {
  margin: 0 -24px;
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 22px 24px 25px;
  background: rgb(245 241 232 / 0.56);
}

.question-config-fields {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(210px, 0.8fr) minmax(230px, 0.8fr);
  gap: 22px;
}

.question-config-field {
  min-width: 0;
}

.question-config-field > label:not(.question-inclusion-control),
.question-config-field > label:not(.question-inclusion-control) > span,
.question-config-field > small {
  display: block;
}

.question-config-field > label:not(.question-inclusion-control) > span {
  margin-bottom: 6px;
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 560;
}

.question-config-field > small {
  margin-top: 6px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.45;
}

.question-name-input,
.question-type-select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 13px;
}

.question-name-input:hover,
.question-type-select:hover {
  border-color: rgb(143 109 34 / 0.58);
}

.question-reset-name,
.question-config-field > .text-button {
  margin-top: 8px;
}

.question-inclusion-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.question-inclusion-control {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.question-inclusion-control input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--green-700);
}

.question-inclusion-control span,
.question-inclusion-control strong,
.question-inclusion-control small {
  display: block;
}

.question-inclusion-control strong {
  font-size: 13px;
  font-weight: 560;
}

.question-inclusion-control small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.45;
}

.question-config-warning {
  margin: 0;
  border-left: 3px solid var(--burgundy-700);
  padding: 10px 13px;
  color: var(--burgundy-700);
  background: rgb(116 47 59 / 0.055);
  font-size: 12px;
  line-height: 1.5;
}

.question-config-surface > .question-config-warning {
  margin: 18px 24px 0;
}

.question-config-body > .question-config-warning {
  margin-top: 18px;
}

.question-order {
  margin-top: 22px;
  border-top: 1px solid rgb(23 23 19 / 0.1);
  padding-top: 19px;
}

.question-order-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.question-order-header h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 570;
}

.question-order-header p,
.question-order-empty,
.question-order-warning {
  margin: 0;
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.5;
}

.question-order-warning {
  margin-top: 10px;
  color: var(--burgundy-700);
}

.question-category-list {
  margin: 14px 0 0;
  padding: 0;
  border: 1px solid rgb(23 23 19 / 0.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  list-style: none;
  background: var(--white);
}

.question-category {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  padding: 7px 9px;
}

.question-category:last-child {
  border-bottom: 0;
}

.question-category-position {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--ink-700);
  background: var(--stone-150);
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.question-category-label {
  min-width: 0;
}

.question-category-label strong,
.question-category-label small {
  display: block;
}

.question-category-label strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-category-label small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 10px;
}

.question-category-actions {
  display: flex;
  gap: 2px;
}

.question-category-move {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
}

.question-category-move:disabled {
  cursor: default;
  opacity: 0.28;
}

.question-config-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-top: 1px solid rgb(23 23 19 / 0.1);
  padding: 16px 24px;
  background: rgb(238 232 220 / 0.36);
}

.question-config-footer p {
  margin: 0;
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.5;
}

.question-config-footer span {
  flex: none;
  color: var(--green-700);
  font-size: 11px;
  white-space: nowrap;
}

.question-config-unavailable {
  border: 1px solid rgb(23 23 19 / 0.1);
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--stone-050);
}

.question-config-unavailable h2 {
  margin: 0 0 7px;
  font-size: 22px;
  font-weight: 500;
}

.question-config-unavailable p {
  margin: 0;
  color: var(--ink-700);
}

.column-type-current {
  display: block;
  font-size: 13px;
  font-weight: 560;
}

@media (max-width: 960px) {
  .question-config-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .question-config-fact:nth-child(3) {
    border-right: 0;
  }

  .question-config-fact:nth-child(-n + 3) {
    border-bottom: 1px solid rgb(23 23 19 / 0.09);
  }

  .question-config-fields {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 0.8fr);
  }

  .question-inclusion-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .question-config-header {
    display: block;
    padding: 24px 20px 20px;
  }

  .question-config-header .secondary-button {
    width: 100%;
    margin-top: 18px;
  }

  .question-config-list {
    padding: 0 18px;
  }

  .question-config-row > summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .question-config-summary-meta {
    justify-content: flex-start;
    gap: 9px;
    font-size: 11px;
  }

  .question-inclusion-status {
    min-width: 0;
  }

  .question-config-body {
    margin: 0 -18px;
    padding: 20px 18px 23px;
  }

  .question-config-fields {
    grid-template-columns: 1fr;
  }

  .question-inclusion-field {
    grid-column: auto;
  }

  .question-config-footer {
    display: block;
    padding: 15px 18px;
  }

  .question-config-footer span {
    display: block;
    margin-top: 8px;
  }
}

@media (max-width: 480px) {
  .question-config-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-config-fact:nth-child(3) {
    border-right: 1px solid rgb(23 23 19 / 0.09);
  }

  .question-config-fact:nth-child(2n) {
    border-right: 0;
  }

  .question-config-fact:nth-child(-n + 4) {
    border-bottom: 1px solid rgb(23 23 19 / 0.09);
  }

  .question-category {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .question-category-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .question-order-header {
    display: block;
  }

  .question-order-header .text-button {
    margin-top: 8px;
  }
}

/* r013 single-choice analysis */
.single-choice-analysis,
.rating-analysis,
.numeric-analysis,
.date-analysis,
.text-analysis {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.analysis-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(230px, 1fr) minmax(190px, 0.75fr);
  gap: 16px;
  border-bottom: 1px solid rgb(23 23 19 / 0.1);
  padding: 18px 24px;
  background: rgb(238 232 220 / 0.4);
}

.analysis-control {
  min-width: 0;
}

.analysis-control > span,
.analysis-control > small {
  display: block;
}

.analysis-control > span {
  margin-bottom: 6px;
  color: var(--ink-700);
  font-size: 11px;
  font-weight: 580;
  letter-spacing: 0.02em;
}

.analysis-control select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 8px 34px 8px 11px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 13px;
}

.analysis-control select:hover {
  border-color: rgb(143 109 34 / 0.42);
}

.analysis-control select:focus,
.analysis-control select:focus-visible,
.analysis-source-button:focus-visible,
.analysis-table-scroll:focus-visible,
.analysis-source-table-scroll:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.18);
}

.analysis-control > small {
  min-height: 30px;
  margin-top: 6px;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.45;
}

.analysis-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 24px 17px;
}

.analysis-heading > div {
  min-width: 0;
}

.analysis-heading h2 {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 480;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.analysis-heading p {
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.analysis-heading .secondary-button {
  flex: none;
  padding: 9px 13px;
  font-size: 12px;
}

.analysis-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 24px;
  overflow: hidden;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
}

.analysis-fact {
  border-right: 1px solid rgb(23 23 19 / 0.09);
  padding: 12px 14px;
}

.analysis-fact:last-child {
  border-right: 0;
}

.analysis-fact dt {
  margin-bottom: 3px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 580;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.analysis-fact dd {
  margin: 0;
  color: var(--ink-950);
  font-family: var(--font-data);
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  font-weight: 590;
}

.analysis-denominator-note,
.analysis-status-note,
.analysis-rounding-note {
  margin-right: 24px;
  margin-left: 24px;
  font-size: 11px;
  line-height: 1.5;
}

.analysis-denominator-note {
  margin-top: 12px;
  margin-bottom: 12px;
  color: var(--ink-700);
}

.analysis-status-note {
  margin-top: 0;
  margin-bottom: 12px;
  border-left: 3px solid var(--gold-550);
  padding: 8px 10px;
  color: var(--ink-700);
  background: rgb(255 249 232 / 0.52);
}

.analysis-rounding-note {
  margin-top: 9px;
  margin-bottom: 0;
  color: var(--ink-500);
}

.analysis-table-scroll,
.analysis-source-table-scroll {
  max-width: calc(100% - 48px);
  margin: 0 24px;
  overflow-x: auto;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
  overscroll-behavior-x: contain;
}

.analysis-table,
.analysis-source-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 12px;
}

.analysis-table {
  min-width: 640px;
}

.analysis-source-table {
  min-width: 560px;
}

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

.analysis-table th,
.analysis-table td,
.analysis-source-table th,
.analysis-source-table td {
  border-bottom: 1px solid rgb(222 213 198 / 0.72);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

.analysis-table thead th,
.analysis-source-table thead th {
  color: var(--ink-500);
  background: var(--stone-150);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 590;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.analysis-table tbody tr:last-child th,
.analysis-table tbody tr:last-child td,
.analysis-source-table tbody tr:last-child th,
.analysis-source-table tbody tr:last-child td {
  border-bottom: 0;
}

.analysis-table tbody tr.is-selected {
  background: rgb(255 249 232 / 0.72);
  box-shadow: inset 3px 0 0 var(--gold-550);
}

.analysis-table tbody tr:not(.analysis-section-row):not(.analysis-empty-table-row):hover {
  background: rgb(255 249 232 / 0.45);
}

.analysis-table tbody th {
  min-width: 230px;
  font-family: var(--font-ui);
  font-weight: 540;
}

.analysis-table tbody th strong,
.analysis-table tbody th span {
  display: block;
}

.analysis-table tbody th strong {
  max-width: 430px;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 560;
}

.analysis-table tbody th span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
}

.analysis-table td:nth-child(2),
.analysis-table td:nth-child(3) {
  width: 110px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.analysis-table td:last-child {
  width: 160px;
  text-align: right;
}

.analysis-percentage-excluded {
  color: var(--ink-500);
  font-family: var(--font-ui);
  font-size: 10px;
}

.analysis-source-button {
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink-700);
  background: rgb(238 232 220 / 0.66);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 10px;
  text-decoration: underline;
  text-decoration-color: rgb(87 83 74 / 0.28);
  text-underline-offset: 2px;
}

.analysis-source-button:hover {
  color: var(--ink-950);
  background: var(--stone-150);
}

.analysis-section-row th {
  border-top: 1px solid var(--stone-250);
  padding-top: 9px;
  padding-bottom: 9px;
  color: var(--ink-700);
  background: rgb(238 232 220 / 0.56);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 590;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.analysis-missing-row th strong {
  color: var(--ink-700);
}

.analysis-empty-table-row td {
  padding: 22px 14px;
  color: var(--ink-700);
  font-family: var(--font-ui);
  text-align: center;
}

.analysis-source-rows {
  margin: 18px 24px 0;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgb(245 241 232 / 0.48);
}

.analysis-source-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 20px;
}

.analysis-source-header h3 {
  margin: 0 0 3px;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 570;
}

.analysis-source-header p {
  margin: 0;
  color: var(--ink-700);
  font-size: 10px;
}

.analysis-source-table-scroll {
  max-width: 100%;
  margin: 0;
}

.analysis-source-table tbody th {
  width: 110px;
  font-variant-numeric: tabular-nums;
  font-weight: 560;
}

.analysis-source-table td:last-child {
  color: var(--ink-700);
  font-family: var(--font-ui);
  font-size: 10px;
}

.analysis-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  border-top: 1px solid rgb(23 23 19 / 0.1);
  padding: 14px 24px;
  gap: 22px;
  color: var(--ink-500);
  background: rgb(238 232 220 / 0.35);
  font-size: 10px;
}

.analysis-footer p {
  margin: 0;
  line-height: 1.5;
}

.analysis-footer span {
  flex: none;
  color: var(--ink-700);
  white-space: nowrap;
}

.analysis-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 54px);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.analysis-empty h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 480;
}

.analysis-empty p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-700);
}

@media (min-width: 900px) and (max-height: 840px) {
  .has-single-choice-analysis {
    padding-top: 22px;
  }

  .has-single-choice-analysis .stage-intro {
    margin-bottom: 16px;
  }

  .has-single-choice-analysis .stage-intro h1 {
    margin-bottom: 7px;
    font-size: 38px;
  }

  .has-single-choice-analysis .stage-intro p {
    font-size: 15px;
  }

  .analysis-controls {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .analysis-heading {
    padding-top: 18px;
    padding-bottom: 13px;
  }

  .analysis-fact {
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .analysis-table th,
  .analysis-table td {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (max-width: 900px) {
  .analysis-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .analysis-question-control {
    grid-column: 1 / -1;
  }

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

  .analysis-fact:nth-child(2) {
    border-right: 0;
  }

  .analysis-fact:nth-child(-n + 2) {
    border-bottom: 1px solid rgb(23 23 19 / 0.09);
  }
}

@media (max-width: 640px) {
  .analysis-controls {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .analysis-question-control {
    grid-column: auto;
  }

  .analysis-control > small {
    min-height: 0;
  }

  .analysis-heading {
    display: block;
    padding: 21px 18px 15px;
  }

  .analysis-heading .secondary-button {
    width: 100%;
    margin-top: 15px;
  }

  .analysis-facts,
  .analysis-denominator-note,
  .analysis-status-note,
  .analysis-rounding-note,
  .analysis-source-rows {
    margin-right: 18px;
    margin-left: 18px;
  }

  .analysis-table-scroll {
    max-width: calc(100% - 36px);
    margin-right: 18px;
    margin-left: 18px;
  }

  .analysis-source-header,
  .analysis-footer,
  .analysis-empty {
    display: block;
  }

  .analysis-source-header .text-button {
    margin-top: 9px;
  }

  .analysis-footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .analysis-footer span {
    display: block;
    margin-top: 7px;
  }

  .analysis-empty .secondary-button {
    width: 100%;
    margin-top: 18px;
  }
}

@media (max-width: 430px) {
  .analysis-facts {
    grid-template-columns: 1fr 1fr;
  }

  .analysis-fact {
    padding: 10px 11px;
  }

  .analysis-fact dd {
    font-size: 17px;
  }
}

/* r014 rating and ordinal analysis */
.rating-analysis-facts {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.rating-analysis-facts .analysis-fact:nth-child(4),
.rating-analysis-facts .analysis-fact:nth-child(5) {
  min-width: 0;
}

.rating-median-fact dd,
.rating-mean-fact dd {
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 560;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-mean-control {
  display: flex;
  align-items: flex-start;
  max-width: calc(100% - 48px);
  margin: 0 24px 14px;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  gap: 11px;
  color: var(--ink-700);
  background: rgb(245 241 232 / 0.54);
  cursor: pointer;
}

.rating-mean-control.is-accepted {
  border-color: rgb(49 95 75 / 0.34);
  background: rgb(236 246 240 / 0.6);
}

.rating-mean-control.is-unavailable {
  display: block;
  cursor: default;
}

.rating-mean-control input {
  width: 17px;
  height: 17px;
  flex: none;
  margin: 2px 0 0;
  accent-color: var(--green-700);
}

.rating-mean-control input:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.18);
}

.rating-mean-control span,
.rating-mean-control strong,
.rating-mean-control small,
.rating-mean-control p {
  display: block;
}

.rating-mean-control strong {
  color: var(--ink-950);
  font-size: 12px;
  font-weight: 590;
}

.rating-mean-control small,
.rating-mean-control p {
  margin: 3px 0 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.5;
}

.rating-distribution {
  max-width: calc(100% - 48px);
  margin: 0 24px 16px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  padding: 15px 16px 16px;
  background: var(--white);
}

.rating-distribution-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 13px;
  gap: 20px;
}

.rating-distribution-heading h3 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 580;
}

.rating-distribution-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.5;
}

.rating-distribution-heading > span {
  flex: none;
  color: var(--ink-500);
  font-size: 9px;
  white-space: nowrap;
}

.rating-ordered-list,
.rating-diverging-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rating-ordered-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.52fr) minmax(180px, 1fr) 108px;
  align-items: center;
  min-height: 38px;
  border-top: 1px solid rgb(222 213 198 / 0.62);
  gap: 14px;
}

.rating-ordered-row:first-child,
.rating-diverging-row:first-child {
  border-top: 0;
}

.rating-distribution-label {
  min-width: 0;
}

.rating-distribution-label strong,
.rating-distribution-label small {
  display: block;
}

.rating-distribution-label strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-distribution-label small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 8px;
}

.rating-progress,
.rating-diverging-progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: var(--stone-150);
}

.rating-progress::-webkit-progress-bar,
.rating-diverging-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--stone-150);
}

.rating-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--ink-700);
}

.rating-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--ink-700);
}

.rating-distribution-value {
  color: var(--ink-700);
  font-family: var(--font-data);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.rating-diverging-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.52fr) minmax(260px, 1fr) 108px;
  align-items: center;
  min-height: 42px;
  border-top: 1px solid rgb(222 213 198 / 0.62);
  gap: 14px;
}

.rating-diverging-label {
  min-width: 0;
}

.rating-diverging-label strong,
.rating-diverging-label small {
  display: block;
}

.rating-diverging-label strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rating-diverging-label small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 8px;
}

.rating-diverging-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.rating-diverging-half {
  display: flex;
  align-items: center;
  min-width: 0;
}

.rating-diverging-half.is-left {
  justify-content: flex-end;
}

.rating-diverging-axis {
  align-self: stretch;
  min-height: 18px;
  background: rgb(23 23 19 / 0.28);
}

.rating-diverging-progress {
  height: 12px;
}

.rating-diverging-lower {
  transform: scaleX(-1);
  transform-origin: center;
}

.rating-diverging-row.is-lower .rating-diverging-lower::-webkit-progress-value {
  background: var(--burgundy-700);
}

.rating-diverging-row.is-lower .rating-diverging-lower::-moz-progress-bar {
  background: var(--burgundy-700);
}

.rating-diverging-row.is-upper .rating-diverging-upper::-webkit-progress-value {
  background: var(--green-700);
}

.rating-diverging-row.is-upper .rating-diverging-upper::-moz-progress-bar {
  background: var(--green-700);
}

.rating-diverging-row.is-neutral .rating-diverging-progress::-webkit-progress-value {
  background: var(--gold-550);
}

.rating-diverging-row.is-neutral .rating-diverging-progress::-moz-progress-bar {
  background: var(--gold-550);
}

.rating-distribution-empty {
  margin: 0;
  padding: 16px 0 2px;
  color: var(--ink-700);
  font-size: 11px;
  text-align: center;
}

.rating-median-marker {
  display: inline-block;
  margin-top: 4px;
  border: 1px solid rgb(143 109 34 / 0.28);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--gold-700);
  background: rgb(255 249 232 / 0.55);
  font-family: var(--font-ui);
  font-size: 8px;
  font-style: normal;
  font-weight: 580;
  letter-spacing: 0.02em;
}

@media (min-width: 900px) and (max-height: 840px) {
  .rating-distribution {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .rating-ordered-row,
  .rating-diverging-row {
    min-height: 34px;
  }

  .rating-mean-control {
    padding-top: 9px;
    padding-bottom: 9px;
  }
}

@media (max-width: 1040px) {
  .rating-analysis-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rating-analysis-facts .analysis-fact:nth-child(3) {
    border-right: 0;
  }

  .rating-analysis-facts .analysis-fact:nth-child(-n + 3) {
    border-bottom: 1px solid rgb(23 23 19 / 0.09);
  }
}

@media (max-width: 760px) {
  .rating-ordered-row,
  .rating-diverging-row {
    grid-template-columns: minmax(120px, 0.7fr) minmax(190px, 1fr) 96px;
  }
}

@media (max-width: 640px) {
  .rating-mean-control,
  .rating-distribution {
    max-width: calc(100% - 36px);
    margin-right: 18px;
    margin-left: 18px;
  }

  .rating-distribution {
    overflow-x: auto;
  }

  .rating-distribution-heading {
    display: block;
    min-width: 560px;
  }

  .rating-distribution-heading > span {
    display: block;
    margin-top: 6px;
  }

  .rating-ordered-list,
  .rating-diverging-list {
    min-width: 560px;
  }

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

  .rating-analysis-facts .analysis-fact {
    border-right: 1px solid rgb(23 23 19 / 0.09);
    border-bottom: 1px solid rgb(23 23 19 / 0.09);
  }

  .rating-analysis-facts .analysis-fact:nth-child(even) {
    border-right: 0;
  }

  .rating-analysis-facts .analysis-fact:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 0;
  }
}

/* r015 numeric, date and open-text baseline */
.numeric-analysis .analysis-controls,
.date-analysis .analysis-controls {
  grid-template-columns: minmax(280px, 520px);
}

.baseline-statistics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: calc(100% - 48px);
  margin: 0 24px 16px;
  overflow: hidden;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
}

.baseline-statistic {
  min-width: 0;
  border-right: 1px solid rgb(23 23 19 / 0.09);
  padding: 15px 16px;
}

.baseline-statistic:last-child {
  border-right: 0;
}

.baseline-statistic dt {
  margin-bottom: 5px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 590;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.baseline-statistic dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-950);
  font-family: var(--font-data);
  font-size: clamp(20px, 2.2vw, 28px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.baseline-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 11px;
  gap: 18px;
}

.baseline-section-heading h3 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 580;
}

.baseline-section-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.5;
}

.numeric-basis-table,
.date-distribution-table {
  min-width: 610px;
}

.date-range-summary,
.date-distribution,
.date-exceptions,
.text-comments,
.text-missing-rows {
  max-width: calc(100% - 48px);
  margin: 0 24px 16px;
}

.date-range-summary {
  overflow: hidden;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
}

.date-range-heading {
  padding: 14px 16px 9px;
}

.date-range-heading h3 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 580;
}

.date-range-heading p {
  margin: 0;
  color: var(--ink-700);
  font-size: 10px;
}

.date-range-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid rgb(23 23 19 / 0.09);
}

.date-range-values > div {
  min-width: 0;
  padding: 13px 16px;
}

.date-range-values > div:first-child {
  border-right: 1px solid rgb(23 23 19 / 0.09);
}

.date-range-values dt {
  margin-bottom: 4px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 590;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.date-range-values dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  margin: 0;
  gap: 12px;
}

.date-range-values dd > span {
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-data);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-distribution,
.date-exceptions,
.text-comments,
.text-missing-rows {
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  padding: 15px 16px 16px;
  background: var(--white);
}

.date-distribution .analysis-table-scroll,
.date-exceptions .analysis-table-scroll,
.text-missing-rows .analysis-table-scroll {
  max-width: 100%;
  margin: 0;
}

.analysis-caution-note {
  border-left-color: var(--burgundy-700);
  background: rgb(250 239 241 / 0.55);
}

.text-analysis-controls {
  grid-template-columns: minmax(240px, 0.9fr) minmax(330px, 1.35fr) minmax(220px, 0.85fr);
}

.text-search-row {
  display: flex;
  align-items: stretch;
  min-width: 0;
  gap: 7px;
}

.text-search-row input {
  min-width: 0;
  min-height: 42px;
  flex: 1 1 170px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--ink-950);
  background: var(--white);
  font-family: var(--font-ui);
  font-size: 13px;
}

.text-search-row input:hover {
  border-color: rgb(143 109 34 / 0.42);
}

.text-search-row input:focus,
.text-search-row input:focus-visible,
.analysis-checkbox-row input:focus-visible,
.text-comment button:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.18);
}

.text-search-row .compact-button {
  flex: none;
  padding-right: 12px;
  padding-left: 12px;
}

.text-search-row .text-button {
  flex: none;
  align-self: center;
}

.analysis-checkbox-row {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-950);
  font-size: 12px;
  line-height: 1.4;
}

.analysis-checkbox-row input {
  width: 17px;
  height: 17px;
  flex: none;
  margin: 0;
  accent-color: var(--green-700);
}

.text-analysis-boundary {
  max-width: calc(100% - 48px);
  margin: 0 24px 16px;
  border-left: 3px solid var(--green-700);
  padding: 9px 11px;
  color: var(--ink-700);
  background: rgb(236 246 240 / 0.48);
  font-size: 11px;
  line-height: 1.55;
}

.text-comments-heading {
  align-items: center;
}

.text-comment-list {
  display: grid;
  gap: 8px;
}

.text-comment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-top: 1px solid rgb(222 213 198 / 0.72);
  padding: 11px 0;
  column-gap: 18px;
}

.text-comment:first-child {
  border-top: 0;
  padding-top: 0;
}

.text-comment:last-child {
  padding-bottom: 0;
}

.text-comment.is-selected {
  margin-right: -8px;
  margin-left: -8px;
  border-radius: var(--radius-sm);
  padding-right: 8px;
  padding-left: 8px;
  background: rgb(255 249 232 / 0.66);
  box-shadow: inset 3px 0 0 var(--gold-550);
}

.text-comment-meta {
  display: flex;
  grid-column: 1;
  align-items: center;
  margin-bottom: 4px;
  gap: 9px;
  color: var(--ink-500);
  font-size: 9px;
}

.text-comment-meta span + span::before {
  margin-right: 9px;
  content: "·";
}

.text-comment-body {
  grid-column: 1;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-950);
  font-family: var(--font-data);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.text-comment > button {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  white-space: nowrap;
}

.text-empty {
  box-shadow: none;
}

@media (min-width: 900px) and (max-height: 840px) {
  .baseline-statistics {
    margin-bottom: 12px;
  }

  .baseline-statistic {
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .date-range-summary,
  .date-distribution,
  .date-exceptions,
  .text-comments,
  .text-missing-rows {
    margin-bottom: 12px;
  }

  .text-comment {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (max-width: 980px) {
  .text-analysis-controls {
    grid-template-columns: minmax(230px, 1fr) minmax(300px, 1.25fr);
  }

  .text-nonresponse-control {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .baseline-statistics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .baseline-statistic:nth-child(2) {
    border-right: 0;
  }

  .baseline-statistic:nth-child(-n + 2) {
    border-bottom: 1px solid rgb(23 23 19 / 0.09);
  }

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

  .text-nonresponse-control {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .baseline-statistics,
  .date-range-summary,
  .date-distribution,
  .date-exceptions,
  .text-comments,
  .text-missing-rows,
  .text-analysis-boundary {
    max-width: calc(100% - 36px);
    margin-right: 18px;
    margin-left: 18px;
  }

  .date-range-values {
    grid-template-columns: 1fr;
  }

  .date-range-values > div:first-child {
    border-right: 0;
    border-bottom: 1px solid rgb(23 23 19 / 0.09);
  }

  .baseline-section-heading,
  .date-range-values dd,
  .text-comments-heading {
    display: block;
  }

  .date-range-values dd .analysis-source-button,
  .text-comments-heading > .text-button {
    margin-top: 8px;
  }

  .text-search-row {
    flex-wrap: wrap;
  }

  .text-search-row input {
    flex-basis: 100%;
  }

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

  .text-comment > button {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
    margin-top: 8px;
  }
}

@media (max-width: 430px) {
  .baseline-statistic {
    padding: 11px 12px;
  }

  .baseline-statistic dd {
    font-size: 19px;
  }
}

/* r016 Explore stage composition */
.has-question-analysis .stage-intro {
  max-width: 820px;
  margin-bottom: 18px;
}

.has-question-analysis .stage-intro h1 {
  font-size: clamp(30px, 3.5vw, 46px);
}

.has-question-analysis .stage-intro p {
  max-width: 760px;
  font-size: clamp(15px, 1.45vw, 17px);
}

.explore-workspace {
  display: grid;
  grid-template-columns: minmax(218px, 248px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.explore-question-panel {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  min-width: 0;
}

.explore-question-panel > summary {
  display: none;
}

.explore-question-panel-body {
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: rgb(251 250 247 / 0.9);
  box-shadow: 0 10px 28px rgb(32 28 20 / 0.055);
}

.explore-question-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  padding: 16px 16px 13px;
  gap: 12px;
}

.explore-question-panel-heading h2 {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 570;
  letter-spacing: -0.01em;
}

.explore-question-panel-heading p {
  margin: 0;
  color: var(--ink-500);
  font-size: 10px;
}

.explore-question-position {
  flex: none;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--ink-700);
  background: var(--stone-150);
  font-family: var(--font-data);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.explore-question-search {
  display: block;
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  padding: 12px 14px;
}

.explore-question-search > span,
.explore-question-search > small {
  display: block;
}

.explore-question-search > span {
  margin-bottom: 5px;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 580;
}

.explore-question-search input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 12px;
}

.explore-question-search input:focus,
.explore-question-search input:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px rgb(174 136 56 / 0.11);
}


.explore-question-search > small {
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 9px;
}

.explore-question-nav {
  padding: 7px;
}

.explore-question-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 2px;
  list-style: none;
}

.explore-question-item[hidden],
.explore-question-search-empty[hidden] {
  display: none;
}

.explore-question-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  padding: 9px 9px 9px 7px;
  gap: 8px;
  color: var(--ink-700);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.explore-question-button:hover {
  color: var(--ink-950);
  background: rgb(238 232 220 / 0.5);
}

.explore-question-button.is-active {
  color: var(--ink-950);
  background: var(--white);
  box-shadow:
    inset 2px 0 0 var(--gold-550),
    0 4px 12px rgb(32 28 20 / 0.055);
}

.explore-question-number {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--ink-500);
  background: var(--stone-150);
  font-family: var(--font-data);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.explore-question-button.is-active .explore-question-number {
  color: var(--white);
  background: var(--ink-950);
}

.explore-question-copy {
  min-width: 0;
}

.explore-question-copy strong,
.explore-question-copy small {
  display: block;
  min-width: 0;
}

.explore-question-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 570;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-question-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-question-search-empty {
  margin: 0;
  padding: 18px 12px;
  color: var(--ink-500);
  font-size: 11px;
  text-align: center;
}

.explore-question-window-controls {
  display: flex;
  justify-content: center;
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 9px 12px 11px;
}

.explore-question-window-controls:has(button[hidden]) {
  display: none;
}

.explore-question-window-controls .text-button {
  font-size: 10px;
}

.explore-analysis-column {
  min-width: 0;
}

.explore-context-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  margin: 0 3px 10px;
  border-bottom: 1px solid rgb(23 23 19 / 0.09);
  gap: 18px;
}

.explore-question-sequence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 40px;
  gap: 18px;
}

.explore-question-sequence p {
  display: flex;
  min-width: 0;
  margin: 0;
  gap: 9px;
  color: var(--ink-500);
  font-size: 10px;
}

.explore-question-sequence p span,
.explore-question-sequence p strong {
  display: block;
  min-width: 0;
}

.explore-question-sequence p strong {
  overflow: hidden;
  color: var(--ink-700);
  font-weight: 540;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-sequence-actions {
  display: flex;
  flex: none;
  gap: 13px;
}

.explore-sequence-actions .text-button {
  font-size: 11px;
}

.explore-sequence-actions .text-button:disabled {
  cursor: not-allowed;
  opacity: 0.34;
  text-decoration: none;
}

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

.text-analysis-controls.analysis-controls-contextual {
  grid-template-columns: minmax(300px, 1.4fr) minmax(220px, 0.75fr);
}

@media (min-width: 1000px) and (max-height: 840px) {
  .has-question-analysis.app-main {
    padding-top: 22px;
  }

  .has-question-analysis .stage-intro {
    margin-bottom: 12px;
  }

  .has-question-analysis .stage-intro h1 {
    margin-bottom: 7px;
  }

  .explore-question-panel-heading {
    padding-top: 13px;
    padding-bottom: 11px;
  }

  .explore-question-search {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .explore-question-button {
    padding-top: 7px;
    padding-bottom: 7px;
  }
}

@media (max-width: 1060px) {
  .explore-workspace {
    grid-template-columns: minmax(205px, 226px) minmax(0, 1fr);
    gap: 14px;
  }

  .analysis-controls-contextual {
    padding-right: 18px;
    padding-left: 18px;
    gap: 12px;
  }
}

@media (max-width: 860px) {
  .explore-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .explore-question-panel {
    position: static;
  }

  .explore-question-panel > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    border: 1px solid rgb(23 23 19 / 0.11);
    border-radius: var(--radius-md);
    padding: 11px 13px;
    gap: 12px;
    background: var(--stone-050);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    list-style: none;
  }

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

  .explore-question-panel > summary::after {
    justify-self: end;
    color: var(--ink-500);
    content: "+";
    font-size: 18px;
    font-weight: 320;
    line-height: 1;
  }

  .explore-question-panel[open] > summary::after {
    content: "−";
  }

  .explore-question-summary span,
  .explore-question-summary strong {
    display: block;
    min-width: 0;
  }

  .explore-question-summary span {
    color: var(--ink-500);
    font-size: 10px;
  }

  .explore-question-summary strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 560;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .explore-question-panel[open] > summary {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: none;
  }

  .explore-question-panel-body {
    border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-soft);
  }

  .explore-question-panel-heading {
    display: none;
  }

  .explore-question-nav {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .analysis-controls-contextual,
  .text-analysis-controls.analysis-controls-contextual {
    grid-template-columns: 1fr;
  }

  .explore-context-bar {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    border-bottom: 0;
    gap: 5px;
  }

  .explore-question-sequence {
    align-items: flex-start;
    border-bottom: 1px solid rgb(23 23 19 / 0.08);
  }

  .explore-question-sequence p {
    display: block;
  }

  .explore-question-sequence p strong {
    margin-top: 2px;
  }
}

@media (max-width: 480px) {
  .explore-context-bar {
    margin-right: 1px;
    margin-left: 1px;
  }

  .explore-question-sequence p strong {
    max-width: 190px;
  }

  .explore-sequence-actions {
    gap: 10px;
  }
}

/* r020 — consolidated recommended-view control */
.view-recommendation {
  position: relative;
  min-width: 168px;
  color: var(--ink-700);
}

.view-recommendation > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  transition: background var(--transition-fast);
}

.view-recommendation > summary::-webkit-details-marker {
  display: none;
}

.view-recommendation > summary:hover {
  background: rgb(238 232 220 / 0.48);
}

.view-recommendation > summary:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.13);
}

.view-recommendation-label,
.view-recommendation-why {
  color: var(--ink-500);
  font-size: 9px;
}

.view-recommendation > summary strong {
  overflow: hidden;
  color: var(--ink-850);
  font-size: 11px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-recommendation-why {
  text-decoration: underline;
  text-decoration-color: rgb(87 83 74 / 0.32);
  text-underline-offset: 3px;
}

.view-recommendation.is-chart::before,
.view-recommendation.is-non-chart::before {
  position: absolute;
  top: 10px;
  left: -3px;
  width: 2px;
  height: 18px;
  background: var(--data-primary);
  content: "";
}

.view-recommendation.is-non-chart::before {
  background: var(--data-neutral);
}

.view-recommendation-details {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  width: min(460px, calc(100vw - 34px));
  border: 1px solid rgb(23 23 19 / 0.13);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--stone-050);
  box-shadow: var(--shadow-float);
}

.view-recommendation-details p,
.view-recommendation-details dl,
.view-recommendation-details dd {
  margin: 0;
}

.view-recommendation-reason {
  color: var(--ink-850);
  font-size: 12px;
  line-height: 1.5;
}

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

.view-recommendation-details dt {
  margin-bottom: 2px;
  color: var(--ink-500);
  font-size: 10px;
}

.view-recommendation-details dd {
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.45;
}

.view-recommendation-boundary {
  margin-top: 12px !important;
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding-top: 10px;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .view-recommendation {
    min-width: 0;
  }

  .view-recommendation > summary {
    width: 100%;
  }

  .view-recommendation-details {
    position: static;
    width: 100%;
    margin-top: 4px;
    box-shadow: var(--shadow-soft);
  }
}

/* r018 — chart and table parity */
.analysis-chart-panel {
  max-width: calc(100% - 48px);
  margin: 0 24px 16px;
  overflow: hidden;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
}

.analysis-chart-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgb(23 23 19 / 0.09);
  padding: 14px 16px 12px;
  gap: 18px;
}

.analysis-chart-heading h3,
.analysis-chart-heading p {
  margin: 0;
}

.analysis-chart-heading h3 {
  font-size: 15px;
  font-weight: 580;
}

.analysis-chart-heading p {
  max-width: 700px;
  margin-top: 3px;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.5;
}

.chart-table-link {
  flex: none;
  margin-top: 1px;
  font-size: 11px;
  white-space: nowrap;
}

.analysis-chart-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px 14px 4px;
  background: var(--stone-050);
  overscroll-behavior-x: contain;
}

.analysis-chart-scroll:focus-visible,
.chart-table-link:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 3px rgb(174 136 56 / 0.12);
}

.analysis-chart-svg {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
  background: var(--stone-050);
}

.chart-mark {
  cursor: pointer;
}

.chart-mark.is-empty {
  cursor: default;
}

.chart-mark:hover:not(.is-empty) rect:not(.chart-mark-focus),
.chart-mark:hover:not(.is-empty) circle {
  opacity: 0.82;
}

.chart-mark:focus {
  outline: none;
}

.chart-mark:focus-visible .chart-mark-focus {
  stroke: var(--gold-550) !important;
  stroke-width: 3 !important;
}

.chart-mark.is-selected .chart-mark-focus {
  stroke: var(--gold-700) !important;
}

.analysis-chart-keyboard-hint {
  margin: 0;
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 8px 16px 10px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
}

.single-choice-analysis > .chart-table-alternative,
.rating-analysis > .chart-table-alternative,
.numeric-analysis > .chart-table-alternative {
  max-width: calc(100% - 48px);
  margin: 0 24px 16px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  padding: 15px 16px 16px;
  background: var(--white);
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.chart-table-alternative > .analysis-table-scroll {
  max-width: 100%;
  margin: 0;
}

.numeric-histogram-table {
  min-width: 690px;
}

.analysis-no-source-rows {
  color: var(--ink-500);
  font-size: 10px;
}

@media (max-width: 640px) {
  .analysis-chart-panel,
  .single-choice-analysis > .chart-table-alternative,
  .rating-analysis > .chart-table-alternative,
  .numeric-analysis > .chart-table-alternative {
    max-width: calc(100% - 36px);
    margin-right: 18px;
    margin-left: 18px;
  }

  .analysis-chart-heading {
    display: block;
  }

  .chart-table-link {
    display: inline-block;
    margin-top: 8px;
  }

  .analysis-chart-scroll {
    padding-right: 10px;
    padding-left: 10px;
  }

  .analysis-chart-svg {
    min-width: 620px;
  }

  .analysis-chart-keyboard-hint {
    display: none;
  }
}

@media print {
  .analysis-chart-panel,
  .chart-table-alternative {
    break-inside: avoid;
    box-shadow: none !important;
  }

  .analysis-chart-scroll {
    overflow: visible;
    padding: 8px 0;
  }

  .analysis-chart-svg {
    width: 100%;
    min-width: 0;
    max-height: 178mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .analysis-chart-keyboard-hint,
  .chart-table-link,
  .chart-mark-focus {
    display: none;
  }
}

/* r019 — shared source-row inspection */
.source-row-inspector {
  min-width: 0;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.14);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.source-inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 17px;
  gap: 24px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.84), transparent 68%),
    var(--stone-050);
}

.source-inspector-header > div {
  min-width: 0;
}

.source-inspector-context {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-500);
  font-size: 10px;
}

.source-inspector-header h3 {
  margin: 0 0 5px;
  font-size: clamp(21px, 2.2vw, 28px);
  font-weight: 470;
  letter-spacing: -0.02em;
}

.source-inspector-header p {
  max-width: 760px;
  margin: 0;
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.5;
}

.source-inspector-header .secondary-button {
  flex: none;
}

.source-inspector-basis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
  background: rgb(238 232 220 / 0.42);
}

.source-inspector-basis > div {
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  padding: 10px 14px;
}

.source-inspector-basis > div:last-child {
  border-right: 0;
}

.source-inspector-basis dt {
  margin-bottom: 2px;
  color: var(--ink-500);
  font-size: 9px;
}

.source-inspector-basis dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-850);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.45;
}

.source-inspector-controls {
  border-bottom: 1px solid var(--stone-250);
  background: rgb(251 250 247 / 0.74);
}

.source-inspector-controls > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 24px;
  gap: 20px;
  cursor: pointer;
  list-style-position: inside;
}

.source-inspector-controls > summary strong {
  font-size: 12px;
  font-weight: 570;
}

.source-inspector-controls > summary span {
  color: var(--ink-500);
  font-size: 10px;
}

.source-inspector-controls > summary:focus-visible,
.source-inspector-toggle input:focus-visible,
.source-inspector-context-choice input:focus-visible,
.source-inspector-sensitive-choice input:focus-visible,
.source-inspector-table-scroll:focus-visible,
.source-inspector-header button:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.14);
}

.source-inspector-controls-body {
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 18px 24px 20px;
}

.source-inspector-controls-body > p {
  max-width: 840px;
  margin: 0 0 14px;
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.55;
}

.source-inspector-reveal-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.source-inspector-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  padding: 12px 14px;
  gap: 9px;
}

.source-inspector-toggle + .source-inspector-toggle {
  border-left: 1px solid var(--stone-250);
}

.source-inspector-toggle input,
.source-inspector-context-choice input,
.source-inspector-sensitive-choice input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--green-700);
}

.source-inspector-toggle strong,
.source-inspector-toggle small {
  display: block;
}

.source-inspector-toggle strong {
  font-size: 11px;
  font-weight: 570;
}

.source-inspector-toggle small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
}

.source-inspector-toggle:has(input:disabled) {
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.42);
}

.source-inspector-column-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--stone-250);
  list-style: none;
}

.source-inspector-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid rgb(222 213 198 / 0.76);
  padding: 10px 0;
  gap: 18px;
}

.source-inspector-column:last-child {
  border-bottom: 0;
}

.source-inspector-column.is-active {
  box-shadow: inset 2px 0 0 var(--gold-550);
}

.source-inspector-column-main {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  padding-left: 10px;
  gap: 12px;
}

.source-inspector-context-choice,
.source-inspector-sensitive-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-700);
  font-size: 10px;
  white-space: nowrap;
}

.source-inspector-context-choice:has(input:disabled) {
  opacity: 0.48;
}

.source-inspector-always-shown {
  color: var(--ink-500);
  font-size: 10px;
}

.source-inspector-column-copy {
  min-width: 0;
}

.source-inspector-column-copy strong,
.source-inspector-column-copy small {
  display: block;
  min-width: 0;
}

.source-inspector-column-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-inspector-column-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-inspector-column-flags {
  display: flex;
  align-items: center;
  padding-right: 10px;
  gap: 13px;
}

.source-inspector-flag {
  color: var(--burgundy-700);
  font-size: 9px;
  font-weight: 570;
}

.source-inspector-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.source-inspector-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  color: var(--ink-850);
  font-family: var(--font-data);
  font-size: 11px;
}

.source-inspector-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.source-inspector-table th,
.source-inspector-table td {
  max-width: 300px;
  border-right: 1px solid rgb(222 213 198 / 0.66);
  border-bottom: 1px solid rgb(222 213 198 / 0.76);
  padding: 10px 12px;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.source-inspector-table th:last-child,
.source-inspector-table td:last-child {
  border-right: 0;
}

.source-inspector-table thead th {
  color: var(--ink-700);
  background: var(--stone-150);
  font-size: 9px;
  font-weight: 570;
}

.source-inspector-table thead th strong,
.source-inspector-table thead th span,
.source-inspector-table tbody th strong,
.source-inspector-table tbody th span,
.source-inspector-table td strong,
.source-inspector-table td span {
  display: block;
}

.source-inspector-table thead th span,
.source-inspector-table tbody th span,
.source-inspector-table td span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 400;
}

.source-inspector-table tbody tr:last-child th,
.source-inspector-table tbody tr:last-child td {
  border-bottom: 0;
}

.source-value-hidden {
  background: rgb(245 241 232 / 0.55);
}

.source-hidden-mark {
  color: var(--burgundy-700) !important;
  font-size: 8px !important;
  font-weight: 600 !important;
}

.source-inspector-progressive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--stone-250);
  padding: 12px 24px;
  gap: 18px;
  background: rgb(245 241 232 / 0.34);
}

.source-inspector-progressive p {
  margin: 0;
  color: var(--ink-700);
  font-size: 10px;
}

.source-inspector-limit-note {
  margin: 0 24px 14px;
}

.source-inspector-footnote {
  margin: 0;
  border-top: 1px solid var(--stone-250);
  padding: 10px 24px 12px;
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.46);
  font-size: 9px;
  line-height: 1.5;
}

.text-comment-actions {
  display: flex;
  grid-row: 1 / span 2;
  grid-column: 2;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .source-inspector-basis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-inspector-basis > div:nth-child(2) {
    border-right: 0;
  }

  .source-inspector-basis > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--stone-250);
  }

  .source-inspector-reveal-controls {
    grid-template-columns: 1fr;
  }

  .source-inspector-toggle + .source-inspector-toggle {
    border-top: 1px solid var(--stone-250);
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .source-inspector-header {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
    gap: 13px;
  }

  .source-inspector-header .secondary-button {
    align-self: flex-start;
  }

  .source-inspector-controls > summary,
  .source-inspector-controls-body,
  .source-inspector-footnote {
    padding-right: 18px;
    padding-left: 18px;
  }

  .source-inspector-controls > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .source-inspector-column {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .source-inspector-column-main {
    grid-template-columns: 104px minmax(0, 1fr);
    padding-right: 10px;
  }

  .source-inspector-column-flags {
    justify-content: flex-start;
    padding-right: 10px;
    padding-left: 10px;
  }

  .source-inspector-table {
    min-width: 720px;
  }

  .text-comment-actions {
    grid-row: auto;
    grid-column: 1;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 8px;
  }

  .source-inspector-progressive {
    align-items: stretch;
    flex-direction: column;
    padding-right: 18px;
    padding-left: 18px;
    gap: 9px;
  }

  .source-inspector-progressive .secondary-button {
    align-self: flex-start;
  }

  .source-inspector-limit-note {
    margin-right: 18px;
    margin-left: 18px;
  }
}

@media print {
  .source-row-inspector {
    display: none !important;
  }
}

/* r021 — one coherent Explore filter set */
.explore-filter-panel {
  margin: 0 3px 14px;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-md);
  background: rgb(251 250 247 / 0.88);
  box-shadow: 0 8px 24px rgb(32 28 20 / 0.045);
}

.explore-filter-panel.has-active-filters {
  border-color: rgb(49 95 75 / 0.28);
  box-shadow:
    inset 3px 0 0 var(--green-700),
    0 8px 24px rgb(32 28 20 / 0.045);
}

.explore-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 14px;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.explore-filter-summary::-webkit-details-marker {
  display: none;
}

.explore-filter-summary::after {
  flex: none;
  color: var(--ink-500);
  content: "+";
  font-size: 18px;
  font-weight: 300;
}

.explore-filter-panel[open] > .explore-filter-summary::after {
  content: "−";
}

.explore-filter-summary > span:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 9px;
}

.explore-filter-summary strong,
.explore-filter-summary small {
  display: block;
  min-width: 0;
}

.explore-filter-summary strong {
  color: var(--ink-850);
  font-size: 12px;
  font-weight: 580;
}

.explore-filter-summary small {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explore-filter-count {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 50%;
  color: var(--ink-700);
  background: var(--stone-150);
  font-family: var(--font-data);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.has-active-filters .explore-filter-count {
  color: var(--white);
  background: var(--green-700);
}

.explore-filter-body {
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 16px 18px 17px;
}

.filter-active-empty,
.filter-active-summary {
  margin-bottom: 14px;
}

.filter-active-empty p,
.filter-unavailable,
.filter-result-note,
.filter-range-note {
  margin: 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.55;
}

.filter-active-empty {
  border-left: 2px solid var(--stone-250);
  padding: 2px 0 2px 11px;
}

.filter-active-heading,
.filter-editor-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.filter-active-heading {
  margin-bottom: 8px;
}

.filter-active-heading h3,
.filter-editor-heading h3 {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 580;
}

.filter-active-heading p,
.filter-editor-heading p {
  margin: 0;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.5;
}

.filter-active-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 1px;
  list-style: none;
}

.filter-active-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  border-top: 1px solid rgb(222 213 198 / 0.62);
  padding: 8px 0;
  gap: 16px;
}

.filter-active-list li > div {
  min-width: 0;
}

.filter-active-list strong,
.filter-active-list span {
  display: block;
}

.filter-active-list strong {
  font-size: 10px;
  font-weight: 570;
}

.filter-active-list span {
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-builder {
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.filter-question-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--stone-250);
  padding: 10px 12px;
  gap: 12px;
  background: rgb(245 241 232 / 0.5);
}

.filter-question-control > span {
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 570;
}

.filter-question-control select {
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 6px 30px 6px 9px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 11px;
}

.explore-filter-summary:focus-visible,
.filter-question-control select:focus-visible,
.filter-category-option input:focus-visible,
.filter-range-controls input:focus-visible,
.filter-active-list button:focus-visible,
.filter-editor-heading button:focus-visible,
.filter-range-controls button:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.12);
}

.filter-editor {
  padding: 14px 14px 15px;
}

.filter-editor-heading {
  margin-bottom: 12px;
}

.filter-editor-heading > div {
  min-width: 0;
}

.filter-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--stone-250);
}

.filter-category-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  border-right: 1px solid rgb(222 213 198 / 0.72);
  border-bottom: 1px solid rgb(222 213 198 / 0.72);
  padding: 10px;
  gap: 8px;
  cursor: pointer;
}

.filter-category-option:nth-child(even) {
  border-right: 0;
}

.filter-category-option input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--green-700);
}

.filter-category-option strong,
.filter-category-option small {
  display: block;
  min-width: 0;
}

.filter-category-option strong {
  overflow-wrap: anywhere;
  font-size: 10px;
  font-weight: 570;
}

.filter-category-option small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 8px;
  line-height: 1.45;
}

.filter-category-option.is-missing {
  background: rgb(245 241 232 / 0.5);
}

.filter-range-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.filter-range-controls label {
  display: block;
}

.filter-range-controls label > span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 570;
}

.filter-range-controls input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  color: var(--ink-950);
  background: var(--white);
  font-family: var(--font-data);
  font-size: 11px;
}

.filter-range-controls .primary-button {
  min-height: 38px;
  white-space: nowrap;
}

.filter-range-note {
  margin-top: 9px;
  color: var(--burgundy-700);
}

.filter-result-note {
  margin-top: 12px;
}

.filter-result-note.is-zero {
  border-left: 2px solid var(--burgundy-700);
  padding-left: 10px;
  color: var(--burgundy-700);
  font-weight: 540;
}

@media (max-width: 760px) {
  .filter-category-grid {
    grid-template-columns: 1fr;
  }

  .filter-category-option,
  .filter-category-option:nth-child(even) {
    border-right: 0;
  }

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

  .filter-range-controls .primary-button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .explore-filter-panel {
    margin-right: 0;
    margin-left: 0;
  }

  .explore-filter-summary {
    padding-right: 12px;
    padding-left: 12px;
  }

  .explore-filter-summary > span:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .explore-filter-summary small {
    max-width: 250px;
  }

  .explore-filter-body {
    padding: 14px 12px 15px;
  }

  .filter-active-heading,
  .filter-editor-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .filter-question-control {
    grid-template-columns: 1fr;
    gap: 5px;
  }

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

  .filter-range-controls .primary-button {
    grid-column: auto;
  }
}

@media print {
  .explore-filter-panel {
    display: none !important;
  }
}

/* r022 — controlled two-group comparison */
.trust-warning-panel {
  margin: 10px 3px 14px;
  border: 1px solid rgb(143 109 34 / 0.2);
  border-left: 3px solid var(--gold-700);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: rgb(255 253 247 / 0.88);
}

.trust-warning-panel.is-comparison,
.trust-warning-panel.is-cross-tab {
  margin-right: 0;
  margin-left: 0;
}

.trust-warning-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trust-warning-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid rgb(143 109 34 / 0.35);
  border-radius: 50%;
  color: var(--gold-700);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
}

.trust-warning-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.trust-warning-heading strong {
  font-size: 13px;
  font-weight: 580;
}

.trust-warning-heading span:last-child {
  color: var(--ink-500);
  font-size: 11px;
}

.trust-warning-list {
  margin: 10px 0 0 33px;
  padding: 0;
  list-style: none;
}

.trust-warning-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
  padding: 7px 0;
  gap: 14px;
}

.trust-warning-item + .trust-warning-item {
  border-top: 1px solid rgb(143 109 34 / 0.14);
}

.trust-warning-item strong {
  color: var(--ink-850);
  font-size: 12px;
  font-weight: 570;
}

.trust-warning-item span {
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.55;
}

.trust-warning-boundary {
  margin: 7px 0 0 33px;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .trust-warning-panel {
    margin-right: 0;
    margin-left: 0;
    padding: 12px;
  }

  .trust-warning-list,
  .trust-warning-boundary {
    margin-left: 0;
  }

  .trust-warning-item {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media print {
  .trust-warning-panel {
    break-inside: avoid;
    box-shadow: none;
    background: transparent;
  }
}

.explore-comparison-panel {
  margin: 0 3px 14px;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-md);
  background: rgb(251 250 247 / 0.88);
  box-shadow: 0 8px 24px rgb(32 28 20 / 0.045);
}

.explore-comparison-panel.is-ready {
  border-color: rgb(143 109 34 / 0.24);
}

.explore-comparison-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 14px;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.explore-comparison-summary::-webkit-details-marker {
  display: none;
}

.explore-comparison-summary::after {
  flex: none;
  color: var(--ink-500);
  content: "+";
  font-size: 18px;
  font-weight: 300;
}

.explore-comparison-panel[open] > .explore-comparison-summary::after {
  content: "−";
}

.explore-comparison-summary > span:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 9px;
}

.explore-comparison-summary strong,
.explore-comparison-summary small {
  display: block;
  min-width: 0;
}

.explore-comparison-summary strong {
  color: var(--ink-850);
  font-size: 12px;
  font-weight: 580;
}

.explore-comparison-summary small {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-summary-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 50%;
  color: var(--gold-700);
  background: rgb(174 136 56 / 0.12);
  font-family: var(--font-data);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.explore-comparison-body {
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 16px 18px 18px;
}

.comparison-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(0, 1fr));
  align-items: end;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.comparison-controls label {
  display: block;
  min-width: 0;
  padding: 11px 12px 12px;
}

.comparison-controls label + label {
  border-left: 1px solid var(--stone-250);
}

.comparison-controls label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 570;
}

.comparison-controls select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 7px 30px 7px 9px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 10px;
}

.explore-comparison-summary:focus-visible,
.comparison-controls select:focus-visible,
.comparison-source-button:focus-visible,
.comparison-table-scroll:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.12);
}

.comparison-basis {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  margin: 12px 0;
  border-left: 2px solid var(--stone-250);
  padding-left: 11px;
  gap: 16px;
}

.comparison-basis p,
.comparison-unavailable {
  margin: 0;
  color: var(--ink-700);
  font-size: 9px;
  line-height: 1.55;
}

.comparison-group-summaries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.comparison-group-summary {
  min-width: 0;
  padding: 14px;
}

.comparison-group-summary + .comparison-group-summary {
  border-left: 1px solid var(--stone-250);
}

.comparison-group-heading {
  margin-bottom: 10px;
}

.comparison-group-key {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.comparison-group-heading h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 520;
  letter-spacing: -0.015em;
}

.comparison-group-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 10px;
  gap: 8px;
}

.comparison-group-facts div {
  min-width: 0;
}

.comparison-group-facts dt,
.comparison-group-facts dd {
  margin: 0;
}

.comparison-group-facts dt {
  color: var(--ink-500);
  font-size: 8px;
  line-height: 1.3;
}

.comparison-group-facts dd {
  margin-top: 2px;
  font-family: var(--font-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 580;
}

.comparison-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
  scrollbar-width: thin;
}

.comparison-table {
  width: 100%;
  min-width: 690px;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: var(--font-data);
  font-size: 10px;
}

.comparison-table caption {
  padding: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  position: absolute;
}

.comparison-table th,
.comparison-table td {
  border-bottom: 1px solid rgb(222 213 198 / 0.72);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.comparison-table thead th {
  color: var(--ink-700);
  background: rgb(245 241 232 / 0.62);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 570;
}

.comparison-table thead th:first-child {
  width: 34%;
}

.comparison-table thead strong,
.comparison-table thead span {
  display: block;
}

.comparison-table thead span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 430;
}

.comparison-table tbody th {
  overflow-wrap: anywhere;
  font-family: var(--font-ui);
  font-weight: 530;
}

.comparison-table tbody tr:last-child > * {
  border-bottom: 0;
}

.comparison-result-cell {
  min-width: 0;
}

.comparison-cell-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.comparison-cell-value strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.comparison-cell-value span {
  color: var(--ink-500);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.comparison-bar-track {
  display: block;
  width: 100%;
  height: 6px;
  margin: 6px 0 5px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--stone-150);
  appearance: none;
}

.comparison-bar-track::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--stone-150);
}

.is-group-a .comparison-bar-track::-webkit-progress-value {
  border-radius: 999px;
  background: var(--green-700);
}

.is-group-b .comparison-bar-track::-webkit-progress-value {
  border-radius: 999px;
  background: var(--gold-700);
}

.is-group-a .comparison-bar-track::-moz-progress-bar {
  border-radius: 999px;
  background: var(--green-700);
}

.is-group-b .comparison-bar-track::-moz-progress-bar {
  border-radius: 999px;
  background: var(--gold-700);
}

.comparison-source-button {
  font-size: 8px;
}

.comparison-source-button:disabled {
  color: var(--ink-500);
  cursor: default;
  opacity: 0.62;
  text-decoration: none;
}

@media (max-width: 860px) {
  .comparison-controls {
    grid-template-columns: 1fr 1fr;
  }

  .comparison-controls label:first-child {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--stone-250);
  }

  .comparison-controls label:nth-child(2) {
    border-left: 0;
  }

  .comparison-basis {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

@media (max-width: 560px) {
  .explore-comparison-panel {
    margin-right: 0;
    margin-left: 0;
  }

  .explore-comparison-summary {
    padding-right: 12px;
    padding-left: 12px;
  }

  .explore-comparison-summary > span:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .explore-comparison-summary small {
    max-width: 250px;
  }

  .explore-comparison-body {
    padding: 14px 12px 15px;
  }

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

  .comparison-controls label:first-child,
  .comparison-controls label:nth-child(2),
  .comparison-controls label:nth-child(3) {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid var(--stone-250);
    border-left: 0;
  }

  .comparison-controls label:last-child {
    border-bottom: 0;
  }

  .comparison-group-summaries {
    grid-template-columns: 1fr;
  }

  .comparison-group-summary + .comparison-group-summary {
    border-top: 1px solid var(--stone-250);
    border-left: 0;
  }

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

  .comparison-table {
    min-width: 640px;
  }
}

@media print {
  .comparison-controls,
  .comparison-source-button,
  .explore-comparison-summary::after,
  .comparison-summary-mark {
    display: none !important;
  }

  .explore-comparison-panel {
    border: 0;
    box-shadow: none;
  }

  .explore-comparison-body {
    padding: 0;
  }
}

/* r023 — controlled cross-tabulation */
.explore-crosstab-panel {
  margin: 0 3px 14px;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-md);
  background: rgb(251 250 247 / 0.88);
  box-shadow: 0 8px 24px rgb(32 28 20 / 0.045);
}

.explore-crosstab-panel.is-ready {
  border-color: rgb(49 95 75 / 0.24);
}

.explore-crosstab-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 14px;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.explore-crosstab-summary::-webkit-details-marker {
  display: none;
}

.explore-crosstab-summary::after {
  flex: none;
  color: var(--ink-500);
  content: "+";
  font-size: 18px;
  font-weight: 300;
}

.explore-crosstab-panel[open] > .explore-crosstab-summary::after {
  content: "−";
}

.explore-crosstab-summary > span:first-child {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 9px;
}

.explore-crosstab-summary strong,
.explore-crosstab-summary small {
  display: block;
  min-width: 0;
}

.explore-crosstab-summary strong {
  color: var(--ink-850);
  font-size: 12px;
  font-weight: 580;
}

.explore-crosstab-summary small {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crosstab-summary-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 50%;
  color: var(--green-700);
  background: rgb(49 95 75 / 0.11);
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
}

.explore-crosstab-body {
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 16px 18px 18px;
}

.crosstab-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.25fr) repeat(2, minmax(150px, 1fr));
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
}

.crosstab-controls > * {
  min-width: 0;
  padding: 11px 12px 12px;
}

.crosstab-controls > * + * {
  border-left: 1px solid var(--stone-250);
}

.crosstab-controls label > span,
.crosstab-fixed-question > span {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 570;
}

.crosstab-fixed-question strong,
.crosstab-fixed-question small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crosstab-fixed-question strong {
  color: var(--ink-950);
  font-size: 10px;
  font-weight: 570;
}

.crosstab-fixed-question small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 8px;
}

.crosstab-controls select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 7px 30px 7px 9px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 10px;
}

.explore-crosstab-summary:focus-visible,
.crosstab-controls select:focus-visible,
.crosstab-source-button:focus-visible,
.crosstab-table-scroll:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.12);
}

.crosstab-basis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 0;
  border-left: 2px solid var(--stone-250);
  padding-left: 11px;
  gap: 4px 18px;
}

.crosstab-basis p,
.crosstab-unavailable,
.crosstab-footnote {
  margin: 0;
  color: var(--ink-700);
  font-size: 9px;
  line-height: 1.55;
}

.crosstab-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
  scrollbar-width: thin;
}

.crosstab-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 10px;
}

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

.crosstab-table th,
.crosstab-table td {
  min-width: 118px;
  border-right: 1px solid rgb(222 213 198 / 0.58);
  border-bottom: 1px solid rgb(222 213 198 / 0.72);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.crosstab-table th:first-child {
  position: sticky;
  z-index: 1;
  left: 0;
  min-width: 170px;
  max-width: 230px;
  background: var(--stone-050);
}

.crosstab-table thead th {
  color: var(--ink-700);
  background: rgb(245 241 232 / 0.76);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 570;
}

.crosstab-table thead th:first-child {
  z-index: 2;
  background: var(--stone-150);
}

.crosstab-table th strong,
.crosstab-table th span {
  display: block;
}

.crosstab-table th span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 430;
}

.crosstab-table tbody th {
  overflow-wrap: anywhere;
  color: var(--ink-850);
  font-family: var(--font-ui);
  font-weight: 540;
}

.crosstab-table tfoot th,
.crosstab-table tfoot td,
.crosstab-total-cell,
.crosstab-total-heading {
  background: rgb(245 241 232 / 0.62);
  font-weight: 570;
}

.crosstab-table tr:last-child > * {
  border-bottom: 0;
}

.crosstab-table tr > *:last-child {
  border-right: 0;
}

.crosstab-cell-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.crosstab-cell-value strong,
.crosstab-total-cell > strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.crosstab-cell-value span {
  color: var(--ink-500);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.crosstab-cell.is-zero {
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.24);
}

.crosstab-source-button {
  display: block;
  margin-top: 5px;
  font-size: 8px;
}

.crosstab-source-button:disabled {
  color: var(--ink-500);
  cursor: default;
  opacity: 0.62;
  text-decoration: none;
}

.crosstab-footnote {
  margin-top: 8px;
}

@media (max-width: 980px) {
  .crosstab-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crosstab-controls > *:nth-child(3) {
    border-top: 1px solid var(--stone-250);
    border-left: 0;
  }

  .crosstab-controls > *:nth-child(4) {
    border-top: 1px solid var(--stone-250);
  }
}

@media (max-width: 560px) {
  .explore-crosstab-panel {
    margin-right: 0;
    margin-left: 0;
  }

  .explore-crosstab-summary {
    padding-right: 12px;
    padding-left: 12px;
  }

  .explore-crosstab-summary > span:first-child {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .explore-crosstab-summary small {
    max-width: 250px;
  }

  .explore-crosstab-body {
    padding: 14px 12px 15px;
  }

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

  .crosstab-controls > * + * {
    border-top: 1px solid var(--stone-250);
    border-left: 0;
  }

  .crosstab-controls > *:nth-child(3),
  .crosstab-controls > *:nth-child(4) {
    border-left: 0;
  }

  .crosstab-basis {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .crosstab-table th,
  .crosstab-table td {
    min-width: 110px;
  }

  .crosstab-table th:first-child {
    min-width: 150px;
  }
}

@media print {
  .crosstab-controls,
  .crosstab-source-button,
  .explore-crosstab-summary::after,
  .crosstab-summary-mark {
    display: none !important;
  }

  .explore-crosstab-panel {
    border: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .explore-crosstab-body {
    padding: 0;
  }

  .crosstab-table-scroll {
    overflow: visible;
    border-radius: 0;
  }

  .crosstab-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 7pt;
  }

  .crosstab-table th,
  .crosstab-table td,
  .crosstab-table th:first-child {
    position: static;
    min-width: 0;
    max-width: none;
    padding: 4pt;
  }
}

/* r025 — pinned finding model and report-stage foundation */
.explore-context-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 7px;
}

.pin-finding-button {
  flex: none;
  border: 1px solid rgb(23 23 19 / 0.14);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--ink-850);
  background: var(--stone-050);
  font-size: 10px;
  font-weight: 560;
  white-space: nowrap;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.pin-finding-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgb(143 109 34 / 0.46);
  background: var(--white);
  box-shadow: 0 6px 16px rgb(32 28 20 / 0.07);
}

.pin-finding-button:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.12);
}

.pin-finding-button.is-pinned,
.pin-finding-button:disabled {
  cursor: default;
  opacity: 0.72;
  transform: none;
  color: var(--green-700);
  background: rgb(236 246 240 / 0.56);
  box-shadow: none;
}

.pin-finding-button.is-stale {
  border-color: rgb(143 109 34 / 0.34);
  color: var(--gold-700);
  background: rgb(255 249 232 / 0.66);
}

.finding-pin-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 24px 14px;
}

.has-report-stage .stage-intro {
  max-width: 850px;
  margin-bottom: 18px;
}

.has-report-stage .stage-intro h1 {
  font-size: clamp(30px, 3.6vw, 47px);
}

.has-report-stage .stage-intro p {
  max-width: 760px;
  font-size: clamp(15px, 1.45vw, 17px);
}

.report-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 230px;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 48px);
  gap: 28px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.72), transparent 66%),
    var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.report-empty h2,
.report-workspace-header h2,
.report-finding-header h2 {
  margin: 0;
  letter-spacing: -0.015em;
}

.report-empty h2 {
  margin-bottom: 7px;
  font-size: 23px;
  font-weight: 500;
}

.report-empty p {
  max-width: 650px;
  margin: 0;
  color: var(--ink-700);
  line-height: 1.55;
}

.report-workspace {
  min-width: 0;
}

.report-workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid rgb(23 23 19 / 0.1);
  padding: 0 3px 13px;
  gap: 24px;
}

.report-workspace-header h2 {
  margin-bottom: 3px;
  font-size: 20px;
  font-weight: 540;
}

.report-workspace-header p {
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.report-finding-list {
  display: grid;
  gap: 18px;
}

.report-finding {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.report-finding.is-stale {
  border-color: rgb(143 109 34 / 0.3);
  box-shadow:
    inset 3px 0 0 var(--gold-550),
    var(--shadow-soft);
}

.report-finding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  padding: 18px 22px 15px;
  gap: 24px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.68), transparent 66%),
    var(--stone-050);
}

.report-finding-header > div {
  min-width: 0;
}

.report-finding-header h2 {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 21px;
  font-weight: 520;
}

.report-finding-header p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 10px;
}

.report-finding-status {
  display: inline-block;
  color: var(--green-700);
  font-size: 9px;
  font-weight: 620;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.report-finding-status.is-stale {
  color: var(--gold-700);
}

.report-remove-button {
  flex: none;
  color: var(--ink-500);
  font-size: 11px;
}

.report-stale-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(143 109 34 / 0.2);
  padding: 13px 22px;
  gap: 22px;
  background: rgb(255 249 232 / 0.7);
}

.report-stale-warning > div {
  min-width: 0;
}

.report-stale-warning strong {
  color: var(--gold-700);
  font-size: 12px;
  font-weight: 620;
}

.report-stale-warning p {
  margin: 2px 0 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.45;
}

.report-stale-warning .primary-button {
  flex: none;
  padding: 9px 12px;
  font-size: 10px;
}

.report-update-unavailable {
  max-width: 260px;
  color: var(--ink-500);
  font-size: 10px;
  text-align: right;
}

.report-finding-edit {
  display: grid;
  grid-template-columns: minmax(230px, 0.75fr) minmax(320px, 1.25fr);
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  background: rgb(245 241 232 / 0.36);
}

.report-finding-edit label {
  display: grid;
  min-width: 0;
  padding: 14px 18px 15px;
  gap: 5px;
}

.report-finding-edit label + label {
  border-left: 1px solid rgb(23 23 19 / 0.08);
}

.report-finding-edit label > span {
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 600;
}

.report-finding-edit input,
.report-finding-edit textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 12px;
  line-height: 1.45;
}

.report-finding-edit input {
  min-height: 39px;
}

.report-finding-edit textarea {
  min-height: 74px;
  resize: vertical;
}

.report-finding-edit input:hover,
.report-finding-edit textarea:hover {
  border-color: rgb(143 109 34 / 0.42);
}

.report-finding-edit input:focus,
.report-finding-edit input:focus-visible,
.report-finding-edit textarea:focus,
.report-finding-edit textarea:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.46);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.1);
}

.report-source-count-note {
  margin: 0;
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  padding: 11px 22px;
  color: var(--ink-700);
  background: rgb(255 255 255 / 0.48);
  font-size: 10px;
  line-height: 1.45;
}

.report-snapshot {
  min-width: 0;
  padding: 18px 22px 20px;
}

.report-snapshot-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin: 0 0 14px;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}

.report-snapshot-summary > div {
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  padding: 10px 12px;
}

.report-snapshot-summary > div:last-child {
  border-right: 0;
}

.report-snapshot-summary dt,
.report-snapshot-summary dd {
  margin: 0;
}

.report-snapshot-summary dt {
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.report-snapshot-summary dd {
  margin-top: 2px;
  color: var(--ink-950);
  font-family: var(--font-data);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.report-snapshot-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  background: var(--white);
}

.report-snapshot-table {
  width: 100%;
  min-width: 530px;
  border-collapse: collapse;
  font-family: var(--font-data);
  font-size: 10px;
}

.report-snapshot-table caption {
  padding: 9px 11px;
  color: var(--ink-500);
  font-family: var(--font-ui);
  font-size: 9px;
  text-align: left;
}

.report-snapshot-table th,
.report-snapshot-table td {
  border-top: 1px solid rgb(222 213 198 / 0.72);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.report-snapshot-table thead th {
  border-top: 0;
  color: var(--ink-700);
  background: rgb(245 241 232 / 0.72);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 570;
}

.report-snapshot-table td:not(:first-child),
.report-snapshot-table th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-snapshot-table .report-missing-row th,
.report-snapshot-table .report-missing-row td {
  color: var(--ink-500);
  background: rgb(245 241 232 / 0.26);
}

.report-definition {
  border-top: 1px solid rgb(23 23 19 / 0.08);
  background: rgb(245 241 232 / 0.34);
}

.report-definition-output > h3 {
  margin: 0;
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  padding: 12px 22px;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 620;
}

.report-definition > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 10px;
  list-style: none;
}

.report-definition > summary::-webkit-details-marker {
  display: none;
}

.report-definition > summary::after {
  color: var(--gold-700);
  content: "+";
  font-size: 17px;
  font-weight: 320;
}

.report-definition[open] > summary::after {
  content: "−";
}

.report-definition > summary:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.46);
  outline-offset: -3px;
}

.report-definition dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 14px 22px 16px;
  gap: 12px 24px;
}

.report-definition dl > div {
  min-width: 0;
}

.report-definition dt,
.report-definition dd {
  margin: 0;
}

.report-definition dt {
  color: var(--ink-500);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.report-definition dd {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.45;
}


@media (min-width: 1000px) and (max-height: 840px) {
  .has-report-stage.app-main {
    padding-top: 22px;
  }

  .has-report-stage .stage-intro {
    margin-bottom: 12px;
  }

  .report-finding-header {
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .report-finding-edit label {
    padding-top: 11px;
    padding-bottom: 12px;
  }

  .report-snapshot {
    padding-top: 14px;
  }
}

@media (max-width: 760px) {
  .explore-context-actions {
    justify-content: stretch;
    border-bottom: 1px solid rgb(23 23 19 / 0.08);
    padding: 4px 0 8px;
  }

  .explore-context-actions > * {
    min-width: 0;
  }

  .explore-context-actions .view-recommendation {
    flex: 1 1 auto;
  }

  .pin-finding-button {
    align-self: center;
  }

  .report-empty,
  .report-workspace-header,
  .report-stale-warning {
    align-items: stretch;
    flex-direction: column;
  }

  .report-empty {
    min-height: 0;
    padding: 28px 24px;
  }

  .report-empty .primary-button,
  .report-empty .secondary-button,
  .report-workspace-header .secondary-button,
  .report-stale-warning .primary-button {
    align-self: flex-start;
  }

  .report-finding-edit {
    grid-template-columns: 1fr;
  }

  .report-finding-edit label + label {
    border-top: 1px solid rgb(23 23 19 / 0.08);
    border-left: 0;
  }

  .report-definition dl {
    grid-template-columns: 1fr;
  }

  .report-update-unavailable {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .finding-pin-row {
    justify-content: stretch;
    margin-right: 18px;
    margin-left: 18px;
  }

  .finding-pin-row .pin-finding-button {
    width: 100%;
  }

  .report-finding-header,
  .report-stale-warning,
  .report-source-count-note,
  .report-snapshot,
  .report-definition > summary,
  .report-definition dl {
    padding-right: 16px;
    padding-left: 16px;
  }

  .report-finding-header {
    flex-direction: column;
    gap: 9px;
  }

  .report-remove-button {
    align-self: flex-start;
    padding-left: 0;
  }

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

  .report-snapshot-summary > div:nth-child(even) {
    border-right: 0;
  }

  .report-snapshot-summary > div:nth-child(n + 3) {
    border-top: 1px solid var(--stone-250);
  }
}

@media print {
  .header-actions,
  .workflow-wrap,
  .stage-intro,
  .report-workspace-header .secondary-button,
  .report-finding-edit,
  .report-remove-button,
  .report-stale-warning .primary-button,
  .report-definition > summary {
    display: none !important;
  }

  .has-report-stage.app-main {
    width: auto;
    padding: 0;
  }

  .report-workspace-header {
    margin-bottom: 12pt;
  }

  .report-finding-list {
    gap: 14pt;
  }

  .report-finding {
    overflow: visible;
    border: 1px solid #bbb;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .report-finding-header,
  .report-source-count-note,
  .report-snapshot,
  .report-definition dl {
    padding-right: 10pt;
    padding-left: 10pt;
  }

  .report-stale-warning {
    border: 1px solid #999;
    border-right: 0;
    border-left: 0;
    background: transparent;
  }

  .report-snapshot-table-wrap {
    overflow: visible;
    border-radius: 0;
  }

  .report-snapshot-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 7.5pt;
  }

  .report-definition {
    display: block;
    border-top: 1px solid #bbb;
    background: transparent;
  }

  .report-definition dl {
    display: grid !important;
  }
}

/* r026 — structured report composer */
.report-workspace-actions,
.report-empty-actions,
.report-finding-actions,
.report-heading-actions,
.report-block-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-workspace-actions {
  flex: none;
}

.report-document {
  min-width: 0;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-lg);
  padding: clamp(26px, 4.4vw, 54px);
  background:
    linear-gradient(145deg, rgb(255 255 255 / 0.7), transparent 54%),
    var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.report-document-header {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 24px;
}

.report-document-title-editor,
.report-context-editor,
.report-basis-note-editor {
  display: grid;
  gap: 6px;
}

.report-document-title-editor > span,
.report-context-editor > span,
.report-basis-note-editor > span {
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.report-document-title-editor input,
.report-context-editor textarea,
.report-basis-note-editor textarea,
.report-section-heading-edit input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  color: var(--ink-950);
  background: rgb(255 255 255 / 0.74);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.report-document-title-editor input {
  padding: 10px 12px;
  font-size: clamp(25px, 3.1vw, 38px);
  font-weight: 440;
  line-height: 1.1;
  letter-spacing: -0.027em;
}

.report-context-editor {
  margin-top: 14px;
}

.report-context-editor textarea,
.report-basis-note-editor textarea {
  min-height: 76px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

.report-document-title-editor input:hover,
.report-context-editor textarea:hover,
.report-basis-note-editor textarea:hover,
.report-section-heading-edit input:hover {
  border-color: rgb(143 109 34 / 0.42);
  background: var(--white);
}

.report-document-title-editor input:focus,
.report-document-title-editor input:focus-visible,
.report-context-editor textarea:focus,
.report-context-editor textarea:focus-visible,
.report-basis-note-editor textarea:focus,
.report-basis-note-editor textarea:focus-visible,
.report-section-heading-edit input:focus,
.report-section-heading-edit input:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.46);
  outline-offset: 2px;
  border-color: rgb(143 109 34 / 0.52);
  background: var(--white);
  box-shadow: 0 0 0 3px rgb(174 136 56 / 0.1);
}

.report-analysis-basis {
  max-width: 900px;
  margin: 0 auto 28px;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.11);
  border-radius: var(--radius-md);
  background: rgb(245 241 232 / 0.45);
}

.report-analysis-basis-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  padding: 15px 17px 13px;
  gap: 24px;
}

.report-analysis-basis-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.report-analysis-basis-header p {
  margin: 3px 0 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.45;
}

.report-analysis-basis-header > span {
  flex: none;
  color: var(--green-700);
  font-size: 10px;
  font-weight: 570;
  white-space: nowrap;
}

.report-analysis-basis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.report-analysis-basis-grid > div {
  min-width: 0;
  border-right: 1px solid rgb(23 23 19 / 0.08);
  border-bottom: 1px solid rgb(23 23 19 / 0.08);
  padding: 11px 13px;
}

.report-analysis-basis-grid > div:nth-child(3n) {
  border-right: 0;
}

.report-analysis-basis-grid > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.report-analysis-basis-grid dt,
.report-analysis-basis-grid dd {
  margin: 0;
}

.report-analysis-basis-grid dt {
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.report-analysis-basis-grid dd {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink-850);
  font-size: 10px;
  line-height: 1.45;
}

.report-basis-note-editor {
  border-top: 1px solid rgb(23 23 19 / 0.08);
  padding: 13px 16px 15px;
}

.report-composition-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  min-height: 170px;
  margin: 0 auto;
  border-top: 1px solid rgb(23 23 19 / 0.1);
  border-bottom: 1px solid rgb(23 23 19 / 0.1);
  padding: 28px 0;
  gap: 24px;
}

.report-composition-empty h2 {
  margin: 0 0 5px;
  font-size: 19px;
  font-weight: 520;
}

.report-composition-empty p {
  max-width: 620px;
  margin: 0;
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.55;
}

.report-finding-list {
  max-width: 900px;
  margin: 0 auto;
}

.report-section-heading {
  min-width: 0;
  border-top: 1px solid rgb(23 23 19 / 0.16);
  padding: 20px 2px 4px;
}

.report-section-heading-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.report-section-heading-edit input {
  padding: 8px 10px;
  font-size: 19px;
  font-weight: 540;
  letter-spacing: -0.015em;
}

.report-heading-actions,
.report-finding-actions {
  flex: none;
}

.report-order-button {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  font-size: 14px;
}

.report-order-button:disabled {
  cursor: default;
  opacity: 0.28;
}

.report-finding-header {
  gap: 16px;
}

.report-finding-heading {
  flex: 1 1 auto;
}

.report-finding-actions {
  align-items: flex-start;
}

.report-commentary-output,
.report-document-title-output,
.report-context-output,
.report-basis-note-output,
.report-section-heading-output {
  display: none;
  white-space: pre-wrap;
}

.report-comment-snapshot {
  display: grid;
  gap: 12px;
}

.report-comment-boundary {
  margin: 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.5;
}

.report-comment-list {
  display: grid;
  gap: 9px;
}

.report-comment-list blockquote {
  margin: 0;
  border-left: 2px solid var(--gold-550);
  padding: 10px 13px;
  background: rgb(255 255 255 / 0.66);
}

.report-comment-list blockquote p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink-850);
  font-family: var(--font-data);
  font-size: 11px;
  line-height: 1.55;
}

.report-snapshot-table.is-cross-tab td span {
  display: block;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 8px;
}

.report-snapshot-total-row th,
.report-snapshot-total-row td,
.report-snapshot-total {
  font-weight: 650;
  background: rgb(245 241 232 / 0.52);
}

.report-r026-boundary {
  margin: 17px 2px 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .report-analysis-basis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-analysis-basis-grid > div:nth-child(3n) {
    border-right: 1px solid rgb(23 23 19 / 0.08);
  }

  .report-analysis-basis-grid > div:nth-child(2n) {
    border-right: 0;
  }

  .report-analysis-basis-grid > div:nth-last-child(-n + 3) {
    border-bottom: 1px solid rgb(23 23 19 / 0.08);
  }

  .report-analysis-basis-grid > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .report-workspace-actions,
  .report-empty-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .report-workspace-actions .secondary-button,
  .report-empty-actions .primary-button,
  .report-empty-actions .secondary-button {
    width: 100%;
  }

  .report-document {
    padding: 25px 20px;
  }

  .report-analysis-basis-header,
  .report-composition-empty {
    align-items: stretch;
    flex-direction: column;
  }

  .report-analysis-basis-header > span {
    white-space: normal;
  }

  .report-section-heading-edit {
    grid-template-columns: 1fr;
  }

  .report-heading-actions {
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  .report-document {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding-right: 14px;
    padding-left: 14px;
    box-shadow: none;
  }

  .report-analysis-basis-grid {
    grid-template-columns: 1fr;
  }

  .report-analysis-basis-grid > div,
  .report-analysis-basis-grid > div:nth-child(2n),
  .report-analysis-basis-grid > div:nth-child(3n),
  .report-analysis-basis-grid > div:nth-last-child(-n + 2),
  .report-analysis-basis-grid > div:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid rgb(23 23 19 / 0.08);
  }

  .report-analysis-basis-grid > div:last-child {
    border-bottom: 0;
  }

  .report-finding-actions {
    width: 100%;
    justify-content: space-between;
  }

  .report-finding-actions .report-remove-button {
    align-self: center;
  }
}

@media print {
  .composer-only,
    .report-block-controls,
  .report-heading-actions,
  .report-finding-actions,
  .report-empty-actions {
    display: none !important;
  }

  .report-workspace {
    margin: 0;
  }

  .report-document {
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: #fff;
  }

  .report-document-title-output,
  .report-section-heading-output {
    display: block;
    margin: 0;
    color: #111;
  }

  .report-document-title-output {
    font-size: 24pt;
    font-weight: 500;
    line-height: 1.1;
  }

  .report-context-output,
  .report-basis-note-output,
  .report-commentary-output {
    display: block;
    margin: 7pt 0 0;
    white-space: pre-wrap;
    color: #333;
    font-size: 9pt;
    line-height: 1.5;
  }

  .report-analysis-basis {
    max-width: none;
    border-radius: 0;
    break-inside: avoid;
  }

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

  .report-section-heading {
    break-after: avoid;
    break-inside: avoid;
    padding-top: 12pt;
  }

  .report-section-heading-output {
    border-bottom: 1px solid #999;
    padding-bottom: 4pt;
    font-size: 15pt;
    font-weight: 600;
  }

  .report-comment-snapshot blockquote {
    break-inside: avoid;
  }
}

/* r027 — report preview and browser PDF export */
.export-output-only {
  display: none;
}

.report-preview-toolbar {
  position: sticky;
  z-index: 12;
  top: calc(var(--header-height) + 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1040px;
  margin: 0 auto 18px;
  border: 1px solid rgb(23 23 19 / 0.14);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  gap: 24px;
  background: rgb(251 250 247 / 0.96);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(16px);
}

.report-preview-toolbar-copy {
  min-width: 0;
}

.report-preview-toolbar-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 620;
}

.report-preview-toolbar-copy p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.45;
}

.report-export-status.is-error {
  color: var(--burgundy-700);
}

.report-export-status.is-complete {
  color: var(--green-700);
}

.report-preview-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.report-page-break-button {
  width: auto;
  min-width: 86px;
  padding-right: 9px;
  padding-left: 9px;
  font-size: 9px;
  white-space: nowrap;
}

.report-page-break-button.is-active {
  color: var(--gold-700);
  background: rgb(174 136 56 / 0.1);
}

.report-chart {
  margin: 0 0 16px;
  break-inside: avoid;
}

.report-chart-scroll {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgb(23 23 19 / 0.09);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: rgb(255 255 255 / 0.74);
}

.report-chart-svg {
  display: block;
  width: 100%;
  min-width: 520px;
  height: auto;
}

.report-chart figcaption {
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
}

.report-export-footer {
  max-width: 900px;
  margin: 30px auto 0;
  border-top: 1px solid rgb(23 23 19 / 0.14);
  padding-top: 12px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.5;
}

.report-export-footer p {
  margin: 0;
}

.report-export-footer p + p {
  margin-top: 4px;
}

.report-data-audit-boundary {
  margin: 17px 2px 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.5;
}

.is-report-preview .composer-only {
  display: none !important;
}

.is-report-preview .report-document-title-output,
.is-report-preview .report-context-output,
.is-report-preview .report-basis-note-output,
.is-report-preview .report-section-heading-output,
.is-report-preview .report-commentary-output,
.is-report-preview .export-output-only {
  display: block;
}

.is-report-preview .report-document-title-output {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 440;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.is-report-preview .report-context-output,
.is-report-preview .report-basis-note-output,
.is-report-preview .report-commentary-output {
  margin: 9px 0 0;
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.55;
}

.is-report-preview [data-report-page-break-before="true"] {
  position: relative;
  margin-top: 52px;
}

.is-report-preview [data-report-page-break-before="true"]::before {
  position: absolute;
  right: 0;
  bottom: calc(100% + 15px);
  left: 0;
  border-top: 1px dashed rgb(87 83 74 / 0.42);
  padding-top: 4px;
  color: var(--ink-500);
  content: "New PDF page";
  font-size: 8px;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .report-preview-toolbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .report-preview-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .report-preview-actions .secondary-button,
  .report-preview-actions .primary-button {
    width: 100%;
  }

  .report-chart-svg {
    min-width: 610px;
  }
}

@page {
  size: A4 portrait;
  margin: 14mm 13mm 16mm;
}

@media print {
  html,
  body {
    min-width: 0 !important;
    background: #fff !important;
  }

  .app-header,
  .workflow-wrap,
  .stage-intro,
  .report-preview-toolbar,
  .notice,
  .help-backdrop,
  .no-print,
  .report-data-audit-boundary {
    display: none !important;
  }

  .app-main,
  .has-report-stage.app-main {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .report-workspace,
  .report-document,
  .report-finding-list,
  .report-document-header,
  .report-analysis-basis,
  .report-export-footer {
    max-width: none !important;
  }

  .export-output-only {
    display: block !important;
  }

  [data-report-page-break-before="true"] {
    break-before: page;
    page-break-before: always;
  }

  [data-report-page-break-before="true"]::before {
    content: none !important;
  }

  .report-document-header,
  .report-analysis-basis,
  .report-section-heading,
  .report-chart,
  .report-snapshot-summary,
  .report-comment-list blockquote,
  .report-export-footer {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .report-section-heading {
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .report-finding {
    break-inside: avoid-page;
    page-break-inside: avoid;
    orphans: 3;
    widows: 3;
  }

  .report-snapshot-table {
    width: 100% !important;
    table-layout: auto;
  }

  .report-snapshot-table thead {
    display: table-header-group;
  }

  .report-snapshot-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-snapshot-table-wrap,
  .report-chart-scroll {
    overflow: visible !important;
    border-color: #bbb;
    box-shadow: none;
  }

  .report-chart-svg {
    width: 100% !important;
    min-width: 0 !important;
    max-height: 118mm;
  }

  .report-chart figcaption {
    color: #444;
    font-size: 7.5pt;
  }

  .report-export-footer {
    display: block;
    color: #555;
    font-size: 7.5pt;
  }
}

@media print {
  .report-chart-scroll {
    padding: 4pt;
  }

  .report-chart-svg {
    min-width: 0 !important;
    max-height: 165pt;
  }

  .report-definition-output {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .report-definition-output > h3 {
    padding: 6pt 10pt;
    font-size: 8pt;
  }

  .report-definition-output dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6pt 10pt 7pt;
    gap: 4pt 12pt;
  }

  .report-definition-output dt {
    font-size: 6.5pt;
  }

  .report-definition-output dd {
    font-size: 8pt;
    line-height: 1.3;
  }
}

/* r028 — reversible row exclusions and local data/audit exports */
.source-row-status {
  min-width: 150px;
  font-family: var(--font-ui);
}

.source-row-status > strong,
.source-row-status > span {
  display: block;
}

.source-row-status > strong {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 620;
}

.source-row-status > span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.4;
}

.source-row-status.is-excluded > strong {
  color: var(--burgundy-700);
}

.source-row-status.is-excluded .text-button {
  margin-top: 6px;
}

.source-row-status.is-included > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.source-row-status.is-included > summary::-webkit-details-marker {
  display: none;
}

.source-row-status.is-included > summary strong {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 620;
}

.source-row-status.is-included > summary span {
  color: var(--ink-500);
  font-size: 9px;
  text-decoration: underline;
  text-decoration-color: rgb(87 83 74 / 0.3);
  text-underline-offset: 2px;
}

.source-row-status.is-included > summary:focus-visible,
.source-row-exclusion-editor input:focus-visible {
  outline: 3px solid rgb(174 136 56 / 0.5);
  outline-offset: 2px;
}

.source-row-exclusion-editor {
  display: grid;
  margin-top: 9px;
  gap: 7px;
}

.source-row-exclusion-editor label > span {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 560;
}

.source-row-exclusion-editor input {
  width: 100%;
  min-width: 170px;
  border: 1px solid var(--stone-250);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--ink-950);
  background: var(--white);
  font-size: 10px;
}

.excluded-source-rows {
  border-top: 1px solid var(--stone-250);
  padding: 18px 24px 4px;
}

.excluded-source-row-list {
  margin: 12px 0 0;
  padding: 0;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  list-style: none;
}

.excluded-source-row-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgb(222 213 198 / 0.72);
  padding: 10px 12px;
  gap: 18px;
}

.excluded-source-row-list li:last-child {
  border-bottom: 0;
}

.excluded-source-row-list strong,
.excluded-source-row-list span {
  display: block;
}

.excluded-source-row-list strong {
  font-size: 11px;
  font-weight: 590;
}

.excluded-source-row-list span {
  margin-top: 2px;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.45;
}

.data-audit-export-surface {
  max-width: 1180px;
  margin: 18px auto 0;
  overflow: hidden;
  border: 1px solid rgb(23 23 19 / 0.12);
  border-radius: var(--radius-lg);
  background: var(--stone-050);
  box-shadow: var(--shadow-soft);
}

.data-audit-export-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 17px;
  gap: 22px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.78), transparent 68%),
    var(--stone-050);
}

.data-audit-export-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 540;
  letter-spacing: -0.015em;
}

.data-audit-export-header p {
  max-width: 720px;
  margin: 0;
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.5;
}

.data-audit-export-header > span {
  flex: none;
  color: var(--green-700);
  font-size: 10px;
  font-weight: 600;
}

.data-audit-export-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
  background: rgb(238 232 220 / 0.38);
}

.data-audit-export-facts > div {
  border-right: 1px solid var(--stone-250);
  padding: 10px 14px;
}

.data-audit-export-facts > div:last-child {
  border-right: 0;
}

.data-audit-export-facts dt {
  color: var(--ink-500);
  font-size: 9px;
}

.data-audit-export-facts dd {
  margin: 1px 0 0;
  color: var(--ink-950);
  font-size: 15px;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.data-audit-export-primary,
.data-audit-supporting-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.data-audit-export-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  border-right: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
  padding: 15px 18px;
  gap: 18px;
}

.data-audit-export-choice:nth-child(even),
.data-audit-supporting-list .data-audit-export-choice:last-child {
  border-right: 0;
}

.data-audit-export-choice strong {
  display: block;
  font-size: 12px;
  font-weight: 590;
}

.data-audit-export-choice p {
  margin: 3px 0 0;
  color: var(--ink-700);
  font-size: 10px;
  line-height: 1.45;
}

.data-audit-supporting-exports {
  border-bottom: 1px solid var(--stone-250);
}

.data-audit-supporting-exports > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 18px;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.data-audit-supporting-exports > summary::-webkit-details-marker {
  display: none;
}

.data-audit-supporting-exports > summary::after {
  color: var(--gold-700);
  content: "+";
  font-size: 20px;
  font-weight: 300;
}

.data-audit-supporting-exports[open] > summary::after {
  content: "−";
}

.data-audit-supporting-exports > summary strong {
  font-size: 11px;
  font-weight: 590;
}

.data-audit-supporting-exports > summary span {
  margin-left: auto;
  color: var(--ink-500);
  font-size: 9px;
}

.data-audit-supporting-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--stone-250);
}

.data-audit-supporting-list .data-audit-export-choice {
  grid-template-columns: minmax(0, 1fr);
  align-content: space-between;
}

.data-audit-supporting-list .data-audit-export-choice:nth-child(2) {
  border-right: 1px solid var(--stone-250);
}

.data-audit-supporting-list .data-audit-export-choice button {
  justify-self: start;
  margin-top: 8px;
}

.data-audit-export-safety {
  padding: 14px 18px;
  color: var(--ink-700);
  background: rgb(245 241 232 / 0.48);
}

.data-audit-export-safety strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-850);
  font-size: 10px;
  font-weight: 600;
}

.data-audit-export-safety p {
  margin: 0;
  font-size: 9px;
  line-height: 1.5;
}

.data-audit-export-safety p + p {
  margin-top: 4px;
}

.data-audit-export-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--stone-250);
  padding: 12px 18px;
  gap: 18px;
  background: rgb(49 95 75 / 0.07);
}

.data-audit-export-status.is-error {
  background: rgb(116 47 59 / 0.08);
}

.data-audit-export-status strong,
.data-audit-export-status p {
  display: block;
}

.data-audit-export-status strong {
  color: var(--green-700);
  font-size: 10px;
  font-weight: 620;
}

.data-audit-export-status.is-error strong {
  color: var(--burgundy-700);
}

.data-audit-export-status p {
  margin: 2px 0 0;
  color: var(--ink-700);
  font-size: 9px;
  line-height: 1.45;
}

.report-data-audit-boundary {
  margin: 17px 2px 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .excluded-source-row-list li,
  .data-audit-export-header,
  .data-audit-export-status {
    align-items: stretch;
    flex-direction: column;
  }

  .data-audit-export-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-audit-export-facts > div:nth-child(2) {
    border-right: 0;
  }

  .data-audit-export-facts > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--stone-250);
  }

  .data-audit-export-primary,
  .data-audit-supporting-list {
    grid-template-columns: 1fr;
  }

  .data-audit-export-choice,
  .data-audit-supporting-list .data-audit-export-choice,
  .data-audit-supporting-list .data-audit-export-choice:nth-child(2) {
    border-right: 0;
  }

  .data-audit-export-choice {
    grid-template-columns: minmax(0, 1fr);
  }

  .data-audit-export-choice button {
    justify-self: start;
  }

  .data-audit-supporting-exports > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .data-audit-supporting-exports > summary span {
    margin-left: 0;
  }
}

@media print {
  .data-audit-export-surface,
  .report-data-audit-boundary {
    display: none !important;
  }
}

/* r030 — owner-test candidate checkpoint */
.parse-progress-note {
  max-width: 520px;
  margin: 8px 0 2px !important;
  color: var(--ink-500) !important;
  font-size: 11px;
  line-height: 1.45;
}

.large-file-dialog {
  width: min(520px, calc(100% - 28px));
}

.large-file-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid var(--stone-250);
  border-radius: var(--radius-sm);
  background: var(--stone-100);
}

.large-file-facts > div {
  min-width: 0;
  padding: 11px 13px;
  border-right: 1px solid var(--stone-250);
  border-bottom: 1px solid var(--stone-250);
}

.large-file-facts > div:nth-child(2n) {
  border-right: 0;
}

.large-file-facts > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.large-file-facts dt,
.large-file-facts dd {
  margin: 0;
}

.large-file-facts dt {
  color: var(--ink-500);
  font-size: 10px;
}

.large-file-facts dd {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink-950);
  font-size: 13px;
  font-weight: 520;
}

@media (max-width: 520px) {
  .large-file-facts {
    grid-template-columns: 1fr;
  }

  .large-file-facts > div,
  .large-file-facts > div:nth-child(2n),
  .large-file-facts > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--stone-250);
  }

  .large-file-facts > div:last-child {
    border-bottom: 0;
  }
}

@media print {
  .large-file-dialog,
  .parse-progress-note {
    display: none !important;
  }
}
