/* Traceable data-analysis workbench. Global header and footer remain owned by site.css. */
body[data-page="data-analysis"] .studio-page { background: var(--paper); }

.analysis-anchor-alias { position: absolute; width: 1px; height: 1px; overflow: hidden; }

.analysis-guided-page {
  --guided-green: #24604f;
  --guided-green-rgb: 36, 96, 79;
  --guided-blue: #1457c4;
  --guided-blue-rgb: 20, 87, 196;
  --guided-rust: #b25f3a;
  --guided-warning: #d39b2f;
  --guided-danger: #ba4b43;
  --guided-muted: #64706b;
  --guided-line: color-mix(in srgb, var(--line-strong) 78%, transparent);
  --guided-soft: color-mix(in srgb, var(--surface-soft) 82%, var(--paper));
  padding: 18px 0 68px !important;
  border: 0;
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html[data-theme="dark"] .analysis-guided-page {
  --guided-green: #87cbb4;
  --guided-green-rgb: 135, 203, 180;
  --guided-blue: #7ba7ff;
  --guided-blue-rgb: 123, 167, 255;
  --guided-rust: #e29a79;
  --guided-warning: #e4b65a;
  --guided-danger: #ee8a7f;
  --guided-muted: #aab7b1;
}

.analysis-guided-page > .container {
  width: min(calc(100% - var(--site-width-sync-gutter, 64px)), var(--site-width-sync-max, 1368px)) !important;
  max-width: none !important;
  margin-inline: auto !important;
}

.analysis-guided-page :where(button, input, select, textarea, summary) { font: inherit; }
.analysis-guided-page button { color: inherit; }
.analysis-guided-page button:focus-visible,
.analysis-guided-page input:focus-visible,
.analysis-guided-page select:focus-visible,
.analysis-guided-page textarea:focus-visible,
.analysis-guided-page summary:focus-visible { outline: 2px solid var(--guided-blue); outline-offset: 2px; }
.analysis-guided-panel[hidden], .analysis-side-step[hidden], .analysis-result-panel[hidden] { display: none !important; }

/* Compact project toolbar */
.analysis-workbench-toolbar {
  display: grid;
  min-height: 62px;
  grid-template-columns: minmax(260px, .82fr) minmax(420px, 1.12fr) auto;
  align-items: stretch;
  border: 1px solid var(--guided-line);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(24, 37, 31, .045);
}
.analysis-workbench-toolbar > div { display: flex; min-width: 0; align-items: center; }
.analysis-toolbar-identity { gap: 20px; padding: 0 16px; }
.analysis-toolbar-identity h1 { margin: 0; color: var(--heading); font-size: 20px; font-weight: 760; letter-spacing: -.03em; }
.analysis-toolbar-identity h1::after { display: inline-block; width: 1px; height: 24px; margin-left: 20px; background: var(--guided-line); vertical-align: -7px; content: ""; }
.analysis-toolbar-identity span,
.analysis-toolbar-data span { overflow: hidden; color: var(--guided-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.analysis-toolbar-identity b,
.analysis-toolbar-data b { color: var(--heading); font-weight: 660; }
.analysis-toolbar-data { justify-content: center; }
.analysis-toolbar-data > span { display: flex; min-height: 100%; align-items: center; gap: 7px; border-left: 1px solid var(--guided-line); padding: 0 16px; }
.analysis-toolbar-data .analysis-local-state { color: var(--heading); }
.analysis-toolbar-data img { width: 15px; height: 15px; opacity: .76; }
.analysis-toolbar-actions { justify-content: flex-end; }
.analysis-toolbar-actions > button,
.analysis-toolbar-export > summary {
  display: flex;
  min-height: 100%;
  align-items: center;
  gap: 7px;
  border: 0;
  border-left: 1px solid var(--guided-line);
  padding: 0 14px;
  color: var(--heading);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}
.analysis-toolbar-actions img { width: 15px; height: 15px; opacity: .72; }
.analysis-save-state { display: flex; align-items: center; gap: 7px; padding: 0 14px; color: var(--guided-muted); font-size: 11px; white-space: nowrap; }
.analysis-save-state i { width: 8px; height: 8px; border: 1px solid var(--guided-green); border-radius: 50%; background: rgba(var(--guided-green-rgb), .13); }
.analysis-save-state b { font-weight: 560; }
.analysis-toolbar-export { position: relative; min-height: 100%; }
.analysis-toolbar-export > summary { list-style: none; }
.analysis-toolbar-export > summary::-webkit-details-marker { display: none; }
.analysis-toolbar-export > summary img:last-child { width: 12px; }
.analysis-toolbar-export > div {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 158px;
  border: 1px solid var(--guided-line);
  padding: 5px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(18, 31, 26, .12);
}
.analysis-toolbar-export > div button { border: 0; padding: 10px 11px; color: var(--heading); background: transparent; font-size: 12px; cursor: pointer; text-align: left; }
.analysis-toolbar-export > div button:hover { background: var(--guided-soft); }

/* Primary three-column workbench */
.analysis-workbench-grid {
  display: grid;
  min-height: 690px;
  grid-template-columns: 244px minmax(0, 1fr) 284px;
  margin-top: 14px;
  border: 1px solid var(--guided-line);
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(24, 37, 31, .055);
}
.analysis-data-sidebar,
.analysis-settings-sidebar,
.analysis-flow-canvas { min-width: 0; background: var(--surface); }
.analysis-data-sidebar { border-right: 1px solid var(--guided-line); }
.analysis-settings-sidebar { border-left: 1px solid var(--guided-line); }
.analysis-pane-heading {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--guided-line);
  padding: 0 14px;
}
.analysis-pane-heading h2 { margin: 0; color: var(--heading); font-size: 14px; font-weight: 730; letter-spacing: -.01em; }
.analysis-pane-heading h2 span,
.analysis-pane-heading small { color: var(--guided-muted); font-size: 10px; font-weight: 520; }
.analysis-pane-heading > button { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; border: 1px solid var(--guided-line); padding: 0 9px; color: var(--heading); background: transparent; font-size: 11px; cursor: pointer; }
.analysis-pane-heading > button img { width: 14px; height: 14px; }

/* Data source and variables */
.analysis-dataset-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 14px; border-bottom: 1px solid var(--guided-line); }
.analysis-dataset-icon { display: grid; width: 34px; height: 34px; place-items: center; background: rgba(var(--guided-green-rgb), .1); }
.analysis-dataset-icon img { width: 18px; height: 18px; filter: invert(31%) sepia(13%) saturate(1515%) hue-rotate(112deg) brightness(91%); }
.analysis-dataset-card strong,
.analysis-dataset-card span,
.analysis-dataset-card small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-dataset-card strong { color: var(--heading); font-size: 13px; font-weight: 690; }
.analysis-dataset-card span { margin-top: 4px; color: var(--guided-muted); font-size: 11px; }
.analysis-dataset-card small { margin-top: 5px; color: var(--guided-muted); font-size: 10px; }
.analysis-dataset-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 0 14px 12px; border-bottom: 1px solid var(--guided-line); }
.analysis-dataset-actions button { min-height: 31px; border: 1px solid var(--guided-line); color: var(--heading); background: transparent; font-size: 10px; cursor: pointer; }
.analysis-dataset-actions button:first-child { color: var(--guided-green); background: rgba(var(--guided-green-rgb), .045); }
.analysis-field-search { display: flex; height: 36px; align-items: center; gap: 8px; margin: 11px 12px 8px; border: 1px solid var(--guided-line); padding: 0 10px; background: var(--surface); }
.analysis-field-search img { width: 14px; opacity: .55; }
.analysis-field-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.analysis-field-list-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 13px 7px; color: var(--guided-muted); font-size: 10px; }
.analysis-field-list-head strong { color: var(--heading); font-size: 12px; }
.analysis-field-list-head strong span { color: var(--guided-muted); font-weight: 520; }
.analysis-field-list { max-height: 420px; overflow: auto; border-block: 1px solid var(--guided-line); scrollbar-width: thin; }
.analysis-field-row { display: grid; min-height: 38px; grid-template-columns: 23px minmax(0, 1fr) 34px 45px; align-items: center; gap: 6px; padding: 0 10px; border-bottom: 1px solid var(--line); }
.analysis-field-row:last-child { border-bottom: 0; }
.analysis-field-row.is-active { background: rgba(var(--guided-blue-rgb), .055); box-shadow: inset 2px 0 var(--guided-blue); }
.analysis-field-type { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid color-mix(in srgb, var(--guided-blue) 45%, var(--guided-line)); color: var(--guided-blue); font-size: 10px; font-weight: 730; }
.analysis-field-row strong { min-width: 0; overflow: hidden; color: var(--heading); font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.analysis-field-row > span:not(.analysis-field-type):not(.analysis-field-quality) { color: var(--guided-muted); font-size: 10px; text-align: right; }
.analysis-field-quality { display: flex; justify-content: flex-end; gap: 3px; }
.analysis-field-quality i,
.analysis-quality-legend i { width: 6px; height: 6px; border-radius: 50%; background: #aeb7b3; }
.analysis-field-quality .is-good,
.analysis-quality-legend .is-good { background: #4e9f72; }
.analysis-field-quality .is-warn,
.analysis-quality-legend .is-warn { background: var(--guided-warning); }
.analysis-field-quality .is-bad,
.analysis-quality-legend .is-bad { background: var(--guided-danger); }
.analysis-quality-legend { display: flex; flex-wrap: wrap; gap: 8px 10px; padding: 11px 12px; color: var(--guided-muted); font-size: 9px; }
.analysis-quality-legend span { display: inline-flex; align-items: center; gap: 4px; }
.analysis-quality-legend .is-empty { background: #aeb7b3; }

/* Traceable workflow canvas */
.analysis-flow-heading > div:first-child { min-width: 0; }
.analysis-flow-heading h2 { display: inline; }
.analysis-flow-heading small { display: inline; margin-left: 9px; }
.analysis-canvas-tools { display: flex; height: 30px; align-items: center; border: 1px solid var(--guided-line); }
.analysis-canvas-tools button { width: 28px; height: 28px; border: 0; color: var(--heading); background: transparent; cursor: pointer; }
.analysis-canvas-tools span { min-width: 42px; color: var(--guided-muted); font-size: 10px; text-align: center; }
.analysis-workflow-steps {
  display: grid;
  min-height: 190px;
  grid-template-columns: repeat(4, minmax(116px, 1fr));
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--guided-line);
  list-style: none;
  background: color-mix(in srgb, var(--guided-soft) 52%, transparent);
}
.analysis-workflow-steps li { position: relative; min-width: 0; }
.analysis-workflow-steps li:not(:last-child)::after { position: absolute; top: 50%; right: -24px; width: 18px; height: 18px; background: url("./icons/lucide/chevron-right.svg") center / 14px 14px no-repeat; content: ""; opacity: .45; transform: translateY(-50%); }
.analysis-workflow-steps button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 144px;
  grid-template-rows: 26px auto auto auto;
  justify-items: center;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--guided-line);
  padding: 17px 9px 12px;
  color: var(--guided-muted);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.analysis-workflow-steps button:hover { border-color: color-mix(in srgb, var(--guided-blue) 48%, var(--guided-line)); transform: translateY(-2px); }
.analysis-workflow-steps button > b { position: absolute; top: 8px; left: 8px; display: grid; width: 21px; height: 21px; place-items: center; border: 1px solid var(--guided-line); color: var(--guided-muted); font-size: 9px; }
.analysis-workflow-steps button > img { width: 27px; height: 27px; opacity: .72; }
.analysis-workflow-steps strong { color: var(--heading); font-size: 14px; font-weight: 690; }
.analysis-workflow-steps span { font-size: 11px; line-height: 1.45; }
.analysis-workflow-steps em { color: var(--guided-muted); font-size: 10px; font-style: normal; font-weight: 620; }
.analysis-workflow-steps li[data-state="done"] button { border-color: rgba(var(--guided-green-rgb), .38); }
.analysis-workflow-steps li[data-state="done"] button > b,
.analysis-workflow-steps li[data-state="done"] em { color: var(--guided-green); }
.analysis-workflow-steps li[data-state="done"] button > img { filter: invert(33%) sepia(13%) saturate(1509%) hue-rotate(112deg) brightness(92%); }
.analysis-workflow-steps li[data-state="current"] button { border: 2px solid var(--guided-blue); padding: 16px 8px 11px; box-shadow: 0 8px 24px rgba(var(--guided-blue-rgb), .12); }
.analysis-workflow-steps li[data-state="current"] button > b { border-color: var(--guided-blue); color: #fff; background: var(--guided-blue); }
.analysis-workflow-steps li[data-state="current"] em { color: var(--guided-blue); }

.analysis-canvas-stage { min-height: 436px; background: var(--surface); }
.analysis-guided-panel { min-height: 436px; }
.analysis-stage-heading,
.analysis-result-toolbar { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 16px; border-bottom: 1px solid var(--guided-line); }
.analysis-stage-heading > div > span,
.analysis-result-title > span { color: var(--guided-green); font: 730 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; }
.analysis-stage-heading h2,
.analysis-result-title h2 { margin: 4px 0 0; color: var(--heading); font-size: 17px; font-weight: 710; letter-spacing: -.02em; }
.analysis-stage-heading > p { max-width: 340px; margin: 0; color: var(--guided-muted); font-size: 10px; line-height: 1.55; text-align: right; }
.analysis-stage-heading > span { border: 1px solid rgba(var(--guided-green-rgb), .32); padding: 5px 8px; color: var(--guided-green); font-size: 9px; }

/* Import */
.analysis-import-layout { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr); gap: 14px; padding: 16px; }
.analysis-file-drop { display: grid; min-height: 280px; place-items: center; align-content: center; gap: 9px; border: 1px dashed var(--line-strong); padding: 18px; color: var(--guided-muted); background: var(--guided-soft); cursor: pointer; text-align: center; }
.analysis-file-drop:hover { border-color: var(--guided-blue); }
.analysis-file-drop img { width: 23px; height: 23px; opacity: .65; }
.analysis-file-drop strong { color: var(--heading); font-size: 13px; }
.analysis-file-drop span { font-size: 9px; }
.analysis-file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.analysis-source-editor { position: relative; display: grid; gap: 7px; }
.analysis-source-editor > span { color: var(--heading); font-size: 11px; font-weight: 650; }
.analysis-source-editor textarea { min-height: 255px; resize: vertical; border: 1px solid var(--guided-line); padding: 11px; color: var(--text); background: var(--surface); font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.analysis-source-editor small { position: absolute; right: 10px; bottom: 8px; color: var(--guided-muted); font-size: 9px; }

/* Validation */
.analysis-validation-summary { display: grid; min-height: 58px; grid-template-columns: 112px minmax(0, 1fr); border-bottom: 1px solid var(--guided-line); }
.analysis-validation-summary h2 { display: flex; align-items: center; margin: 0; padding: 0 15px; color: var(--heading); font-size: 12px; font-weight: 700; }
.analysis-validation-summary dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.analysis-validation-summary dl > div { display: flex; align-items: baseline; gap: 6px; padding: 18px 12px; border-left: 1px solid var(--guided-line); }
.analysis-validation-summary dt { color: var(--guided-muted); font-size: 9px; }
.analysis-validation-summary dd { margin: 0; color: var(--heading); font-size: 14px; font-weight: 680; }
.analysis-validation-issues { padding: 12px 14px 5px; }
.analysis-validation-issues h3,
.analysis-preview-heading h3 { margin: 0 0 8px; color: var(--heading); font-size: 11px; font-weight: 690; }
.analysis-validation-issues #analysisValidationIssues { border: 1px solid var(--guided-line); }
.analysis-validation-issue { display: grid; min-height: 36px; grid-template-columns: 8px 54px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--guided-line); color: var(--text); font-size: 10px; }
.analysis-validation-issue:last-child { border-bottom: 0; }
.analysis-validation-issue > i { width: 6px; height: 6px; border-radius: 50%; background: var(--guided-rust); }
.analysis-validation-issue > strong { color: var(--heading); font-size: 10px; }
.analysis-validation-issue > span { min-width: 0; overflow: hidden; color: var(--guided-muted); text-overflow: ellipsis; white-space: nowrap; }
.analysis-validation-issue > button,
.analysis-preview-heading > button { border: 0; padding: 5px; color: var(--guided-rust); background: transparent; font-size: 10px; font-weight: 650; cursor: pointer; }
.analysis-validation-empty { margin: 0; padding: 12px; color: var(--guided-green); font-size: 10px; }
.analysis-preview-heading { display: flex; min-height: 34px; align-items: center; justify-content: space-between; padding: 0 14px; }
.analysis-preview-heading h3 { margin: 0; }
.analysis-preview-heading h3 span { margin-left: 5px; color: var(--guided-muted); font-size: 9px; font-weight: 520; }
.analysis-preview-heading > button { color: var(--guided-green); }
.analysis-preview-table-wrap { margin: 0 14px 14px; border: 1px solid var(--guided-line); overflow: auto; }
.analysis-preview-table-wrap table { width: 100%; min-width: 720px; border-collapse: collapse; color: var(--text); font-size: 10px; }
.analysis-preview-table-wrap :where(th, td) { min-width: 82px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: center; white-space: nowrap; }
.analysis-preview-table-wrap :where(th, td):last-child { border-right: 0; }
.analysis-preview-table-wrap th { color: var(--heading); background: var(--guided-soft); font-weight: 660; }
.analysis-preview-table-wrap tr:last-child td { border-bottom: 0; }
.analysis-preview-table-wrap .is-missing,
.analysis-preview-table-wrap .is-anomaly { color: var(--guided-rust); background: rgba(178, 95, 58, .06); font-weight: 670; }

/* Method selector */
.analysis-method-toolbar { padding: 12px 14px 8px; }
.analysis-method-search { display: flex; height: 36px; align-items: center; gap: 8px; border: 1px solid var(--guided-line); padding: 0 10px; }
.analysis-method-search img { width: 14px; opacity: .58; }
.analysis-method-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }
.analysis-guided-page .analysis-category-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; padding: 0 14px 10px; }
.analysis-guided-page .analysis-category-tabs button { display: flex; min-height: 31px; align-items: center; justify-content: space-between; gap: 5px; border: 1px solid var(--guided-line); padding: 0 7px; color: var(--guided-muted); background: transparent; font-size: 10px; cursor: pointer; }
.analysis-guided-page .analysis-category-tabs button[aria-selected="true"] { border-color: var(--guided-blue); color: var(--guided-blue); background: rgba(var(--guided-blue-rgb), .045); }
.analysis-guided-page .analysis-category-tabs b { font-size: 8px; font-weight: 620; }
.analysis-guided-page .analysis-method-strip { display: grid; max-height: 270px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; overflow: auto; padding: 0 14px 14px; }
.analysis-guided-page .analysis-method-strip > button { display: grid; min-height: 76px; align-content: start; gap: 4px; border: 1px solid var(--guided-line); padding: 9px; color: var(--guided-muted); background: var(--surface); cursor: pointer; text-align: left; }
.analysis-guided-page .analysis-method-strip > button:hover { border-color: color-mix(in srgb, var(--guided-blue) 45%, var(--guided-line)); }
.analysis-guided-page .analysis-method-strip > button[aria-pressed="true"] { border-color: var(--guided-blue); box-shadow: inset 2px 0 var(--guided-blue); }
.analysis-guided-page .analysis-method-strip > button::after { content: none; }
.analysis-guided-page .analysis-method-strip span { color: var(--heading); font-size: 12px; font-weight: 670; }
.analysis-guided-page .analysis-method-strip small { min-height: 27px; font-size: 10px; line-height: 1.45; }
.analysis-guided-page .analysis-method-strip em { color: var(--guided-green); font-size: 9px; font-style: normal; }

/* Step inspector */
.analysis-settings-sidebar > .analysis-pane-heading > span { border: 1px solid rgba(var(--guided-blue-rgb), .25); padding: 4px 6px; color: var(--guided-blue); font-size: 9px; }
.analysis-side-step { padding: 15px 13px 14px; }
.analysis-side-intro { padding-bottom: 13px; border-bottom: 1px solid var(--guided-line); }
.analysis-side-intro > span { color: var(--guided-muted); font-size: 10px; }
.analysis-side-intro > span b { display: inline-grid; width: 20px; height: 20px; place-items: center; margin-left: 5px; color: #fff; background: var(--guided-blue); font-size: 9px; }
.analysis-side-intro h3 { margin: 11px 0 6px; color: var(--heading); font-size: 15px; font-weight: 710; }
.analysis-side-intro p { margin: 0; color: var(--guided-muted); font-size: 11px; line-height: 1.55; }
.analysis-checklist { display: grid; gap: 9px; padding: 14px 2px; color: var(--heading); font-size: 10px; }
.analysis-checklist span { display: flex; align-items: center; gap: 8px; }
.analysis-checklist i { width: 8px; height: 8px; border: 2px solid var(--guided-green); border-radius: 50%; }
.analysis-side-status { min-height: 48px; margin: 0 0 12px; border-left: 2px solid var(--guided-warning); padding: 8px 9px; color: var(--guided-muted); background: var(--guided-soft); font-size: 9px; line-height: 1.55; }
.analysis-guided-page .button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 0; padding: 8px 13px; color: #fff; background: var(--guided-blue); font-size: 11px; font-weight: 660; cursor: pointer; }
.analysis-guided-page .button img { width: 14px; height: 14px; filter: brightness(0) invert(1); }
.analysis-guided-page .button-light { border-color: var(--guided-line); color: var(--heading); background: var(--surface); }
.analysis-side-primary,
.analysis-side-secondary { width: 100%; margin-top: 8px; }
.analysis-config-side { padding-top: 13px; }
.analysis-config-side .analysis-side-intro { padding-bottom: 11px; }
.analysis-guided-page .analysis-lab-field-grid { display: grid; gap: 9px; margin-top: 12px; }
.analysis-guided-page .analysis-lab-field { display: grid; gap: 5px; }
.analysis-guided-page .analysis-lab-field > span { color: var(--heading); font-size: 10px; font-weight: 650; }
.analysis-guided-page .analysis-lab-field :where(input, select) { width: 100%; min-height: 34px; border: 1px solid var(--guided-line); border-radius: 0; padding: 6px 8px; color: var(--text); background: var(--surface); font-size: 11px; }
.analysis-guided-page .analysis-lab-field select[multiple] { min-height: 92px; }
.analysis-guided-page .analysis-inspector-disclosure { margin-top: 11px; border-block: 1px solid var(--guided-line); }
.analysis-guided-page .analysis-inspector-disclosure > summary { display: flex; min-height: 38px; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.analysis-guided-page .analysis-inspector-disclosure > summary::-webkit-details-marker { display: none; }
.analysis-guided-page .analysis-inspector-disclosure > summary span { display: inline-flex; align-items: center; gap: 7px; color: var(--heading); font-size: 10px; font-weight: 640; }
.analysis-guided-page .analysis-inspector-disclosure > summary img { width: 13px; }
.analysis-guided-page .analysis-inspector-disclosure > summary b { color: var(--guided-muted); font-size: 8px; font-weight: 520; }
.analysis-guided-page .analysis-disclosure-body { max-height: 230px; overflow: auto; padding: 0 0 10px; }
.analysis-guided-page .analysis-disclosure-body .analysis-lab-field-grid { grid-template-columns: 1fr 1fr; }
.analysis-guided-page .analysis-design-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
.analysis-run-message { margin-top: 11px; padding: 9px; background: var(--guided-soft); }
.analysis-run-message p { margin: 0 0 3px; color: var(--text); font-size: 10px; line-height: 1.45; }
.analysis-feedback-link { color: var(--guided-green); font-size: 8px; }
.analysis-side-note { margin: 14px 0 0; color: var(--guided-muted); font-size: 9px; line-height: 1.55; }
.analysis-font-control { display: grid; grid-template-columns: 1fr repeat(3, 34px); align-items: center; margin: 16px 0 8px; border: 1px solid var(--guided-line); }
.analysis-font-control > span { padding-left: 9px; color: var(--guided-muted); font-size: 9px; }
.analysis-font-control button { min-height: 34px; border: 0; border-left: 1px solid var(--guided-line); color: var(--heading); background: transparent; font-size: 10px; cursor: pointer; }
.analysis-font-control button[aria-pressed="true"] { color: #fff; background: var(--guided-blue); }

/* Results */
.analysis-result-status { display: flex; align-items: center; gap: 12px; color: var(--guided-muted); font-size: 9px; }
.analysis-quality-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--guided-green); }
.analysis-quality-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--guided-green); }
.analysis-result-tabs { display: flex; min-height: 38px; border-bottom: 1px solid var(--guided-line); padding: 0 10px; overflow-x: auto; }
.analysis-result-tabs button { position: relative; min-width: 78px; border: 0; padding: 0 10px; color: var(--guided-muted); background: transparent; font-size: 9px; cursor: pointer; white-space: nowrap; }
.analysis-result-tabs button[aria-selected="true"] { color: var(--guided-blue); font-weight: 660; }
.analysis-result-tabs button[aria-selected="true"]::after { position: absolute; right: 9px; bottom: 0; left: 9px; height: 2px; background: var(--guided-blue); content: ""; }
.analysis-result-panel { min-height: 326px; padding: 12px; }
.analysis-result-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 10px; border: 1px solid var(--guided-line); }
.analysis-result-summary article { min-height: 58px; border-right: 1px solid var(--guided-line); padding: 9px 10px; }
.analysis-result-summary article:last-child { border-right: 0; }
.analysis-result-summary :where(span, strong, small) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-result-summary span { color: var(--guided-muted); font-size: 8px; }
.analysis-result-summary strong { margin-top: 4px; color: var(--heading); font-size: 15px; }
.analysis-result-summary small { margin-top: 2px; color: var(--guided-muted); font-size: 8px; }
.analysis-guided-page .analysis-table-wrap { max-height: 245px; border: 1px solid var(--guided-line); border-radius: 0; overflow: auto; }
.analysis-guided-page .analysis-table-wrap table { width: 100%; border-collapse: collapse; font-size: 9px; }
.analysis-guided-page .analysis-table-wrap :where(th, td) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 8px; white-space: nowrap; }
.analysis-guided-page .analysis-table-wrap th { color: var(--heading); background: var(--guided-soft); }
.analysis-chart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 10px; }
.analysis-guided-page .analysis-chart { min-height: 230px; border: 1px solid var(--guided-line); border-radius: 0; background: var(--surface); }
.analysis-guided-page .analysis-chart-guide { border: 1px solid var(--guided-line); border-radius: 0; padding: 10px; background: var(--guided-soft); }
.analysis-chart-guide div + div { margin-top: 14px; }
.analysis-chart-guide span { color: var(--heading); font-size: 9px; font-weight: 650; }
.analysis-chart-guide p { margin: 5px 0 0; color: var(--guided-muted); font-size: 8px; line-height: 1.55; }
.analysis-insight-preview { margin-top: 9px; border: 1px solid var(--guided-line); padding: 9px; }
.analysis-insight-preview h3 { margin: 3px 0 0; color: var(--heading); font-size: 11px; }
.analysis-insight-preview span { color: var(--guided-green); font-size: 7px; letter-spacing: .1em; }
.analysis-insight-preview p { margin: 6px 0 0; color: var(--guided-muted); font-size: 9px; line-height: 1.5; }
.analysis-interpretation { min-height: 290px; border: 1px solid var(--guided-line); border-radius: 0; padding: 16px; background: var(--guided-soft); }
.analysis-report-head { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--guided-muted); font-size: 8px; }
.analysis-report { min-height: 270px; max-height: 270px; margin: 0; border: 1px solid var(--guided-line); padding: 12px; overflow: auto; color: var(--text); background: var(--guided-soft); font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

/* Run history */
.analysis-run-history { margin-top: 14px; border: 1px solid var(--guided-line); background: var(--surface); box-shadow: 0 12px 34px rgba(24, 37, 31, .045); }
.analysis-run-history .analysis-pane-heading > div { display: flex; align-items: baseline; gap: 10px; }
.analysis-history-table-wrap { overflow: auto; }
.analysis-run-history table { width: 100%; min-width: 1040px; border-collapse: collapse; color: var(--text); font-size: 10px; }
.analysis-run-history :where(th, td) { height: 37px; border-bottom: 1px solid var(--guided-line); padding: 6px 14px; text-align: left; white-space: nowrap; }
.analysis-run-history th { color: var(--guided-muted); background: var(--guided-soft); font-size: 9px; font-weight: 600; }
.analysis-run-history tbody tr:last-child td { border-bottom: 0; }
.analysis-run-history td:nth-child(4) { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.analysis-run-history td span { display: inline-flex; align-items: center; gap: 6px; font-weight: 620; }
.analysis-run-history td span i { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; }
.analysis-run-history .is-success { color: #29845a; }
.analysis-run-history .is-pending { color: var(--guided-blue); }
.analysis-run-history .is-waiting { color: var(--guided-muted); }
.analysis-run-history td button { border: 0; padding: 3px 0; color: var(--guided-blue); background: transparent; font-size: 9px; cursor: pointer; }

/* Responsive layouts */
@media (max-width: 1180px) {
  .analysis-workbench-toolbar { grid-template-columns: minmax(260px, 1fr) auto; }
  .analysis-toolbar-data { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--guided-line); }
  .analysis-toolbar-data > span:first-child { border-left: 0; }
  .analysis-workbench-grid { grid-template-columns: 224px minmax(0, 1fr); }
  .analysis-settings-sidebar { grid-column: 1 / -1; border-top: 1px solid var(--guided-line); border-left: 0; }
  .analysis-settings-sidebar .analysis-side-step { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr) 190px; align-items: start; gap: 14px; }
  .analysis-settings-sidebar .analysis-side-step[hidden] { display: none !important; }
  .analysis-config-side .analysis-side-intro { grid-row: 1 / span 3; }
  .analysis-config-side .analysis-lab-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
  .analysis-config-side .analysis-inspector-disclosure,
  .analysis-config-side .analysis-run-message { margin-top: 0; }
  .analysis-config-side .analysis-side-primary,
  .analysis-config-side .analysis-side-secondary { grid-column: 3; }
}

@media (max-width: 820px) {
  .analysis-guided-page { padding-top: 12px !important; padding-bottom: 50px !important; }
  .analysis-workbench-toolbar { display: flex; flex-wrap: wrap; }
  .analysis-toolbar-identity { min-height: 54px; flex: 1 1 100%; border-bottom: 1px solid var(--guided-line); }
  .analysis-toolbar-data { display: flex; min-height: 42px; flex: 1 1 100%; order: 2; border-top: 0; overflow-x: auto; }
  .analysis-toolbar-data { scrollbar-width: none; }
  .analysis-toolbar-data::-webkit-scrollbar { display: none; }
  .analysis-toolbar-data > span { flex: 0 0 auto; min-height: 42px; }
  .analysis-toolbar-actions { min-height: 46px; flex: 1 1 100%; order: 3; border-top: 1px solid var(--guided-line); }
  .analysis-save-state { margin-right: auto; }
  .analysis-workbench-grid { grid-template-columns: 1fr; }
  .analysis-data-sidebar { grid-row: 2; border-top: 1px solid var(--guided-line); border-right: 0; }
  .analysis-flow-canvas { grid-row: 1; }
  .analysis-settings-sidebar { grid-row: 3; }
  .analysis-field-list { max-height: 260px; }
  .analysis-workflow-steps { grid-template-columns: repeat(4, 138px); min-height: 176px; gap: 24px; padding: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .analysis-workflow-steps::-webkit-scrollbar { display: none; }
  .analysis-workflow-steps li { scroll-snap-align: start; }
  .analysis-workflow-steps button { min-height: 132px; }
  .analysis-guided-page .analysis-category-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .analysis-guided-page .analysis-method-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-settings-sidebar .analysis-side-step { display: block; }
  .analysis-config-side .analysis-lab-field-grid { grid-template-columns: 1fr 1fr; margin-top: 12px; }
  .analysis-config-side .analysis-side-primary,
  .analysis-config-side .analysis-side-secondary { width: 100%; }
}

@media (max-width: 560px) {
  .analysis-guided-page > .container { width: min(calc(100% - 24px), var(--site-width-sync-max, 1368px)) !important; }
  .analysis-toolbar-identity { gap: 10px; padding-inline: 12px; }
  .analysis-toolbar-identity h1 { font-size: 18px; }
  .analysis-toolbar-identity h1::after { height: 20px; margin-left: 11px; }
  .analysis-toolbar-identity span { font-size: 10px; }
  .analysis-toolbar-data span { font-size: 10px; }
  .analysis-field-row strong { font-size: 12px; }
  .analysis-field-row > span:not(.analysis-field-type):not(.analysis-field-quality) { font-size: 10px; }
  .analysis-toolbar-actions > button { padding-inline: 10px; }
  .analysis-save-state { padding-inline: 10px; }
  .analysis-save-state b { font-size: 9px; }
  .analysis-flow-heading small { display: none; }
  .analysis-import-layout { grid-template-columns: 1fr; }
  .analysis-file-drop { min-height: 158px; }
  .analysis-validation-summary { grid-template-columns: 1fr; }
  .analysis-validation-summary h2 { min-height: 42px; border-bottom: 1px solid var(--guided-line); }
  .analysis-validation-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-validation-summary dl > div:nth-child(odd) { border-left: 0; }
  .analysis-validation-summary dl > div:nth-child(n+3) { border-top: 1px solid var(--guided-line); }
  .analysis-validation-issue { grid-template-columns: 7px 48px minmax(0, 1fr) auto; }
  .analysis-validation-issue > button:last-child { display: none; }
  .analysis-validation-issue > span { white-space: normal; line-height: 1.4; }
  .analysis-guided-page .analysis-category-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-guided-page .analysis-method-strip { grid-template-columns: 1fr; }
  .analysis-result-toolbar { align-items: flex-start; flex-direction: column; }
  .analysis-result-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-result-summary article:nth-child(2) { border-right: 0; }
  .analysis-result-summary article:nth-child(-n+2) { border-bottom: 1px solid var(--guided-line); }
  .analysis-chart-layout { grid-template-columns: 1fr; }
  .analysis-config-side .analysis-lab-field-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .analysis-guided-page *, .analysis-guided-page *::before, .analysis-guided-page *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Editorial single-focus layout — aligned with the news entry page. */
body[data-page="data-analysis"] .studio-page { background: var(--portal-paper, var(--paper)); }

.analysis-editorial-masthead .masthead-grid {
  grid-template-columns: minmax(300px, .9fr) minmax(390px, 1.12fr) minmax(210px, .58fr) !important;
  grid-template-rows: 1fr !important;
}
.analysis-editorial-masthead .masthead-title,
.analysis-editorial-masthead .masthead-intro,
.analysis-editorial-masthead .masthead-date {
  grid-column: auto !important;
  grid-row: auto !important;
}
.analysis-editorial-masthead .masthead-title { align-self: center !important; }
.analysis-editorial-masthead .masthead-intro { align-self: center !important; margin: 34px 0 0 !important; }
.analysis-editorial-masthead .masthead-date { align-self: end !important; margin-bottom: 5px !important; }

.analysis-guided-page {
  --guided-green: #285643;
  --guided-green-rgb: 40, 86, 67;
  --guided-blue: #285643;
  --guided-blue-rgb: 40, 86, 67;
  --guided-rust: #c55334;
  padding: 30px 0 66px !important;
  background: var(--portal-paper, var(--paper));
}

.analysis-guided-page > .container {
  width: min(calc(100% - var(--site-width-sync-gutter, 64px)), var(--site-width-sync-max, 1368px)) !important;
  max-width: none !important;
}

/* Project strip */
.analysis-workbench-toolbar {
  min-height: 56px;
  grid-template-columns: minmax(240px, .82fr) minmax(360px, 1.18fr) auto;
  border-color: var(--portal-line-strong, var(--guided-line));
  box-shadow: none;
}
.analysis-toolbar-identity { gap: 13px; padding-inline: 18px; }
.analysis-toolbar-identity .analysis-project-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--portal-rust, var(--guided-rust));
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.analysis-toolbar-identity .analysis-project-label::before { width: 3px; height: 15px; background: currentColor; content: ""; }
.analysis-toolbar-identity span:last-child { font-size: 13px; }
.analysis-toolbar-data { justify-content: flex-start; }
.analysis-toolbar-data > span { border-left: 0; padding-inline: 13px; }
.analysis-toolbar-data > span + span { position: relative; }
.analysis-toolbar-data > span + span::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--portal-line-strong, var(--guided-line));
  content: "";
}
.analysis-toolbar-actions > button,
.analysis-toolbar-export > summary { min-height: 56px; padding-inline: 12px; }

/* One primary stage plus one contextual panel. */
.analysis-workbench-grid {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 294px;
  gap: 18px;
  margin-top: 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.analysis-flow-canvas,
.analysis-settings-sidebar {
  border: 1px solid var(--portal-line-strong, var(--guided-line));
  background: var(--surface);
  box-shadow: 0 14px 36px rgba(27, 43, 35, .045);
}
.analysis-settings-sidebar { border-left: 1px solid var(--portal-line-strong, var(--guided-line)); }
.analysis-pane-heading { min-height: 54px; padding-inline: 18px; }
.analysis-pane-heading h2 { font-size: 15px; }
.analysis-pane-heading h2 span,
.analysis-pane-heading small { margin-left: 8px; font-size: 11px; }

/* Compact progress rail */
.analysis-workflow-steps {
  min-height: 72px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  background: color-mix(in srgb, var(--portal-paper, var(--guided-soft)) 64%, var(--surface));
}
.analysis-workflow-steps li:not(:last-child)::after { display: none; }
.analysis-workflow-steps button {
  display: grid;
  min-height: 72px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: start;
  align-content: center;
  gap: 10px;
  border: 0;
  border-right: 1px solid var(--guided-line);
  padding: 0 14px;
  background: transparent;
  text-align: left;
  scale: 1;
}
.analysis-workflow-steps li:last-child button { border-right: 0; }
.analysis-workflow-steps button:hover { background: color-mix(in srgb, var(--guided-green) 5%, transparent); transform: none; }
.analysis-workflow-steps button > b {
  position: static;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 10px;
}
.analysis-workflow-steps button > img,
.analysis-workflow-steps button > span { display: none; }
.analysis-workflow-steps strong { font-size: 13px; font-weight: 700; }
.analysis-workflow-steps em { justify-self: end; font-size: 9px; }
.analysis-workflow-steps li[data-state="current"] button {
  border: 0;
  border-right: 1px solid var(--guided-line);
  padding: 0 14px;
  background: var(--surface);
  box-shadow: inset 0 -3px var(--guided-green);
}
.analysis-workflow-steps li[data-state="current"] button > b { border-color: var(--guided-green); background: var(--guided-green); }
.analysis-workflow-steps li[data-state="current"] em { color: var(--guided-green); }

.analysis-canvas-stage,
.analysis-guided-panel { min-height: 462px; }
.analysis-stage-heading,
.analysis-result-toolbar { min-height: 76px; padding: 15px 20px; }
.analysis-stage-heading > div > span,
.analysis-result-title > span { font-size: 10px; }
.analysis-stage-heading h2,
.analysis-result-title h2 { margin-top: 5px; font-size: 20px; }
.analysis-stage-heading > p { max-width: 320px; font-size: 12px; line-height: 1.65; }
.analysis-stage-heading > span { padding: 6px 9px; font-size: 10px; }

/* Import and current dataset */
.analysis-current-dataset {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 18px 20px 0;
  border: 1px solid var(--guided-line);
  padding: 13px 14px;
  background: color-mix(in srgb, var(--guided-soft) 56%, var(--surface));
}
.analysis-current-dataset strong,
.analysis-current-dataset span,
.analysis-current-dataset small { display: block; }
.analysis-current-dataset strong { color: var(--heading); font-size: 13px; }
.analysis-current-dataset span { margin-top: 2px; color: var(--guided-muted); font-size: 11px; }
.analysis-current-dataset small { margin-top: 2px; color: var(--guided-muted); font-size: 10px; }
.analysis-current-dataset button {
  min-height: 34px;
  border: 1px solid var(--guided-green);
  padding: 0 13px;
  color: var(--guided-green);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.analysis-import-layout { grid-template-columns: 1fr; gap: 10px; padding: 16px 20px 20px; }
.analysis-file-drop { min-height: 146px; }
.analysis-file-drop strong { font-size: 14px; }
.analysis-file-drop span { font-size: 11px; }
.analysis-source-editor > span { font-size: 12px; }
.analysis-source-editor textarea { min-height: 214px; font-size: 11px; }
.analysis-source-disclosure { border: 1px solid var(--guided-line); background: var(--surface); }
.analysis-source-disclosure > summary {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
}
.analysis-source-disclosure > summary::-webkit-details-marker { display: none; }
.analysis-source-disclosure > summary span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.analysis-source-disclosure > summary img { width: 15px; height: 15px; opacity: .72; }
.analysis-source-disclosure > summary small { color: var(--guided-muted); font-size: 10px; }
.analysis-source-disclosure[open] > summary { border-bottom: 1px solid var(--guided-line); }
.analysis-source-disclosure .analysis-source-editor { padding: 12px; }
.analysis-source-disclosure .analysis-source-editor textarea { width: 100%; }

/* Validation */
.analysis-validation-summary { min-height: 74px; grid-template-columns: 128px minmax(0, 1fr); }
.analysis-validation-summary h2 { padding-inline: 20px; font-size: 14px; }
.analysis-validation-summary dl > div { padding: 20px 16px; }
.analysis-validation-summary dt { font-size: 10px; }
.analysis-validation-summary dd { font-size: 17px; }
.analysis-validation-issues { padding: 18px 20px 8px; }
.analysis-validation-issues h3,
.analysis-preview-heading h3 { font-size: 12px; }
.analysis-validation-issue { min-height: 42px; grid-template-columns: 8px 60px minmax(0, 1fr) auto auto; gap: 10px; padding: 7px 12px; font-size: 11px; }
.analysis-validation-issue > strong,
.analysis-validation-issue > button { font-size: 11px; }
.analysis-preview-heading { min-height: 42px; padding-inline: 20px; }
.analysis-preview-table-wrap { margin: 0 20px 18px; }
.analysis-preview-table-wrap table { font-size: 11px; }
.analysis-preview-table-wrap :where(th, td) { padding: 8px 10px; }

.analysis-field-disclosure { margin: 0 20px 20px; border: 1px solid var(--guided-line); }
.analysis-field-disclosure > summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  color: var(--heading);
  cursor: pointer;
  list-style: none;
}
.analysis-field-disclosure > summary::-webkit-details-marker { display: none; }
.analysis-field-disclosure > summary span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.analysis-field-disclosure > summary img { width: 15px; height: 15px; }
.analysis-field-disclosure > summary small { color: var(--guided-muted); font-size: 10px; }
.analysis-field-disclosure > summary b { color: inherit; }
.analysis-field-disclosure[open] > summary { border-bottom: 1px solid var(--guided-line); }
.analysis-field-disclosure-body { padding: 4px 10px 0; }
.analysis-field-search { height: 40px; margin: 10px 0 8px; }
.analysis-field-list-head { padding-inline: 2px; }
.analysis-field-list { display: grid; max-height: 252px; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--guided-line); }
.analysis-field-row { min-height: 40px; }
.analysis-field-row:nth-child(odd) { border-right: 1px solid var(--guided-line); }
.analysis-quality-legend { padding-inline: 2px; font-size: 10px; }

/* Method selection is visible only in its step and no longer reads as a dashboard. */
.analysis-method-toolbar { padding: 18px 20px 10px; }
.analysis-method-search { height: 44px; padding-inline: 13px; }
.analysis-method-search input { font-size: 12px; }
body[data-page="data-analysis"] .analysis-guided-page .analysis-category-tabs {
  display: flex;
  flex-wrap: nowrap;
  grid-template-columns: none;
  gap: 7px;
  margin: 0;
  padding: 0 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
body[data-page="data-analysis"] .analysis-guided-page .analysis-category-tabs::-webkit-scrollbar { display: none; }
body[data-page="data-analysis"] .analysis-guided-page .analysis-category-tabs button { min-width: 104px; min-height: 36px; flex: 1 0 auto; padding-inline: 10px; font-size: 11px; }
.analysis-guided-page .analysis-method-strip { max-height: 330px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 20px 20px; }
.analysis-guided-page .analysis-method-strip > button { min-height: 82px; padding: 12px; }
.analysis-guided-page .analysis-method-strip span { font-size: 13px; }
.analysis-guided-page .analysis-method-strip small { font-size: 11px; }

/* Contextual sidebar */
.analysis-side-step { padding: 20px 18px 18px; }
.analysis-side-intro { padding-bottom: 17px; }
.analysis-side-intro > span { font-size: 11px; }
.analysis-side-intro h3 { margin-top: 13px; font-size: 17px; }
.analysis-side-intro p { font-size: 12px; line-height: 1.7; }
.analysis-checklist { gap: 11px; padding-block: 18px; font-size: 11px; }
.analysis-side-status { min-height: 54px; margin-bottom: 15px; padding: 10px 11px; font-size: 10px; }
.analysis-guided-page .button { min-height: 42px; background: var(--guided-green); font-size: 12px; }
.analysis-guided-page .button-light { color: var(--heading); background: var(--surface); }
.analysis-guided-page .analysis-lab-field > span { font-size: 11px; }
.analysis-guided-page .analysis-lab-field :where(input, select) { min-height: 38px; font-size: 12px; }
.analysis-run-message p { font-size: 11px; }

/* Results */
.analysis-result-tabs { min-height: 44px; padding-inline: 14px; }
.analysis-result-tabs button { min-width: 96px; font-size: 11px; }
.analysis-result-panel { min-height: 340px; padding: 18px 20px 20px; }
.analysis-result-summary article { min-height: 68px; padding: 11px 12px; }
.analysis-result-summary span,
.analysis-result-summary small { font-size: 9px; }
.analysis-result-summary strong { font-size: 17px; }
.analysis-guided-page .analysis-table-wrap table { font-size: 11px; }

/* History is quiet by default and expands only when requested. */
.analysis-run-history { margin-top: 18px; box-shadow: none; }
.analysis-run-history > summary { list-style: none; }
.analysis-run-history > summary::-webkit-details-marker { display: none; }
.analysis-history-summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  cursor: pointer;
}
.analysis-history-summary > span { display: flex; align-items: center; gap: 9px; }
.analysis-history-summary img { width: 16px; height: 16px; opacity: .7; }
.analysis-history-summary strong { color: var(--heading); font-size: 13px; }
.analysis-history-summary small { color: var(--guided-muted); font-size: 10px; }
.analysis-history-summary em { color: var(--guided-green); font-size: 11px; font-style: normal; font-weight: 650; }
.analysis-run-history[open] .analysis-history-summary { border-bottom: 1px solid var(--guided-line); }
.analysis-history-actions { display: flex; min-height: 46px; align-items: center; justify-content: flex-end; padding: 0 14px; border-bottom: 1px solid var(--guided-line); }
.analysis-history-actions button { display: inline-flex; min-height: 31px; align-items: center; gap: 6px; border: 1px solid var(--guided-line); padding: 0 10px; color: var(--heading); background: transparent; font-size: 10px; cursor: pointer; }
.analysis-history-actions img { width: 14px; height: 14px; }

@media (max-width: 1040px) {
  .analysis-editorial-masthead .masthead-grid {
    grid-template-columns: minmax(260px, .82fr) minmax(320px, 1.18fr) !important;
  }
  .analysis-editorial-masthead .masthead-date { display: none; }
  .analysis-workbench-toolbar { grid-template-columns: minmax(240px, 1fr) auto; }
  .analysis-toolbar-data { grid-column: 1 / -1; grid-row: 2; min-height: 42px; border-top: 1px solid var(--guided-line); }
  .analysis-workbench-grid { grid-template-columns: minmax(0, 1fr) 272px; }
  .analysis-settings-sidebar { grid-column: auto; border-top: 0; }
  .analysis-settings-sidebar .analysis-side-step { display: block; }
  .analysis-settings-sidebar .analysis-side-step[hidden] { display: none !important; }
}

@media (max-width: 820px) {
  .analysis-editorial-masthead .masthead-grid { grid-template-columns: 1fr !important; }
  .analysis-editorial-masthead .masthead-intro { margin-top: 8px !important; }
  .analysis-guided-page { padding-top: 22px !important; }
  .analysis-guided-page > .container { width: min(calc(100% - var(--site-width-sync-gutter, 36px)), var(--site-width-sync-max, 1368px)) !important; }
  .analysis-workbench-grid { grid-template-columns: 1fr; gap: 14px; }
  .analysis-flow-canvas { grid-row: 1; }
  .analysis-settings-sidebar { grid-row: 2; }
  .analysis-settings-sidebar .analysis-side-step { display: block; }
  .analysis-settings-sidebar .analysis-side-step[hidden] { display: none !important; }
  .analysis-workflow-steps { min-height: 66px; }
  .analysis-workflow-steps button,
  .analysis-workflow-steps li[data-state="current"] button { min-height: 66px; padding-inline: 10px; }
  .analysis-workflow-steps em { display: none; }
  .analysis-settings-sidebar { border-left: 1px solid var(--portal-line-strong, var(--guided-line)); }
}

@media (max-width: 560px) {
  .analysis-editorial-masthead { min-height: 164px; }
  .analysis-editorial-masthead .masthead-grid { min-height: 164px; padding-block: 22px !important; }
  .analysis-editorial-masthead .masthead-title h1 { font-size: 38px; }
  .analysis-editorial-masthead .portal-kicker { margin-bottom: 10px; font-size: 11px; }
  .analysis-editorial-masthead .masthead-intro { font-size: 13px; line-height: 1.65; }
  .analysis-guided-page > .container { width: min(calc(100% - var(--site-width-sync-gutter, 28px)), var(--site-width-sync-max, 1368px)) !important; }
  .analysis-toolbar-identity { min-height: 50px; padding-inline: 12px; }
  .analysis-toolbar-identity .analysis-project-label { font-size: 9px; }
  .analysis-toolbar-identity span:last-child { font-size: 11px; }
  .analysis-toolbar-actions { min-height: 44px; }
  .analysis-save-state { padding-inline: 8px; }
  .analysis-toolbar-actions > button,
  .analysis-toolbar-export > summary { min-height: 44px; padding-inline: 8px; font-size: 10px; }
  .analysis-toolbar-data > span { padding-inline: 10px; }
  .analysis-workflow-steps { grid-template-columns: repeat(4, minmax(76px, 1fr)); overflow: visible; }
  .analysis-workflow-steps button,
  .analysis-workflow-steps li[data-state="current"] button { grid-template-columns: 24px minmax(0, 1fr); gap: 6px; padding-inline: 7px; }
  .analysis-workflow-steps button > b { width: 23px; height: 23px; }
  .analysis-workflow-steps strong { font-size: 11px; }
  .analysis-stage-heading,
  .analysis-result-toolbar { align-items: flex-start; flex-direction: column; min-height: 0; padding: 16px; }
  .analysis-stage-heading h2,
  .analysis-result-title h2 { font-size: 18px; }
  .analysis-stage-heading > p { font-size: 11px; text-align: left; }
  .analysis-current-dataset { grid-template-columns: 34px minmax(0, 1fr); margin: 14px 14px 0; }
  .analysis-current-dataset button { grid-column: 1 / -1; width: 100%; }
  .analysis-import-layout { grid-template-columns: 1fr; padding: 14px; }
  .analysis-file-drop { min-height: 150px; }
  .analysis-validation-summary { grid-template-columns: 1fr; }
  .analysis-validation-summary h2 { min-height: 46px; padding-inline: 14px; }
  .analysis-validation-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-validation-issues { padding: 14px 14px 6px; }
  .analysis-preview-heading { padding-inline: 14px; }
  .analysis-preview-table-wrap { margin-inline: 14px; }
  .analysis-field-disclosure { margin-inline: 14px; }
  .analysis-field-list { grid-template-columns: 1fr; }
  .analysis-field-row:nth-child(odd) { border-right: 0; }
  .analysis-field-disclosure > summary small { font-size: 9px; }
  .analysis-method-toolbar { padding-inline: 14px; }
  .analysis-guided-page .analysis-category-tabs { padding-inline: 14px; }
  .analysis-guided-page .analysis-method-strip { grid-template-columns: 1fr; padding-inline: 14px; }
  .analysis-result-panel { padding-inline: 14px; }
  .analysis-history-summary { padding-inline: 14px; }
  .analysis-history-summary small { display: none; }
}

/* Refined method picker: compact professional navigation and content-led height. */
body[data-page="data-analysis"] #analysisLab[data-current-step="3"] .analysis-workbench-grid {
  align-items: start;
}

body[data-page="data-analysis"] #analysisLab[data-current-step="3"] :is(.analysis-canvas-stage, .analysis-configure-panel) {
  min-height: 0;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-toolbar {
  padding: 18px 20px 12px;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-toolbar input {
  min-height: 46px;
  border: 1px solid var(--portal-line-strong, var(--guided-line));
  border-radius: 3px;
  background: color-mix(in srgb, var(--surface) 92%, var(--guided-green) 8%);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-toolbar input:focus {
  border-color: var(--guided-green);
  outline: 0;
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--guided-green) 12%, transparent);
}

body[data-page="data-analysis"] #analysisLab .analysis-category-tabs {
  display: flex;
  min-height: 46px;
  margin: 0 20px 14px;
  padding: 0;
  gap: 0;
  border-bottom: 1px solid var(--portal-line-strong, var(--guided-line));
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-page="data-analysis"] #analysisLab .analysis-category-tabs::-webkit-scrollbar {
  display: none;
}

body[data-page="data-analysis"] #analysisLab .analysis-category-tabs > button {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 45px;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  padding: 0 8px;
  color: var(--guided-muted);
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease;
}

body[data-page="data-analysis"] #analysisLab .analysis-category-tabs > button::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  background: transparent;
  content: "";
}

body[data-page="data-analysis"] #analysisLab .analysis-category-tabs > button:hover {
  color: var(--heading);
  background: color-mix(in srgb, var(--guided-green) 5%, transparent);
}

body[data-page="data-analysis"] #analysisLab .analysis-category-tabs > button[aria-selected="true"] {
  color: var(--guided-green);
  background: transparent;
  font-weight: 720;
}

body[data-page="data-analysis"] #analysisLab .analysis-category-tabs > button[aria-selected="true"]::after {
  background: var(--guided-green);
}

body[data-page="data-analysis"] #analysisLab .analysis-category-tabs b {
  display: inline-flex;
  min-width: 21px;
  height: 19px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  border-radius: 999px;
  padding: 0 5px;
  color: inherit;
  background: transparent;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9px;
  font-weight: 650;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-strip {
  display: grid;
  max-height: 302px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 0;
  padding: 0 20px 20px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-strip > button {
  position: relative;
  display: grid;
  min-height: 78px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  border: 1px solid var(--portal-line-strong, var(--guided-line));
  border-radius: 3px;
  padding: 13px 14px;
  color: var(--guided-muted);
  background: var(--surface);
  box-shadow: none;
  text-align: left;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-strip > button::before,
body[data-page="data-analysis"] #analysisLab .analysis-method-strip > button::after {
  display: none;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-strip > button:hover {
  border-color: color-mix(in srgb, var(--guided-green) 48%, var(--guided-line));
  padding-left: 14px;
  color: var(--guided-muted);
  background: color-mix(in srgb, var(--guided-green) 3%, var(--surface));
  transform: translateY(-1px);
}

body[data-page="data-analysis"] #analysisLab .analysis-method-strip > button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--guided-green) 55%, var(--guided-line));
  border-left: 3px solid var(--guided-green);
  padding-left: 12px;
  color: var(--guided-muted);
  background: color-mix(in srgb, var(--guided-green) 7%, var(--surface));
  box-shadow: none;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-order {
  display: flex;
  min-height: 40px;
  grid-column: 1;
  grid-row: 1 / 3;
  align-items: center;
  border-right: 1px solid var(--guided-line);
  color: var(--portal-rust, #aa6548);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-strip span {
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  color: var(--heading);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.35;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-strip small {
  min-width: 0;
  min-height: 0;
  grid-column: 2 / 4;
  grid-row: 2;
  margin: 0;
  overflow: hidden;
  color: var(--guided-muted);
  font-size: 10.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="data-analysis"] #analysisLab .analysis-method-strip em {
  grid-column: 3;
  grid-row: 1;
  color: var(--guided-green);
  font-size: 9px;
  font-style: normal;
  font-weight: 650;
  white-space: nowrap;
}

@media (max-width: 1040px) {
  body[data-page="data-analysis"] #analysisLab .analysis-method-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body[data-page="data-analysis"] #analysisLab .analysis-category-tabs {
    margin-inline: 14px;
  }

  body[data-page="data-analysis"] #analysisLab .analysis-category-tabs > button {
    min-width: 86px;
    flex: 0 0 86px;
  }

  body[data-page="data-analysis"] #analysisLab .analysis-method-strip {
    max-height: 360px;
    padding: 0 14px 14px;
  }

  body[data-page="data-analysis"] #analysisLab .analysis-method-strip > button {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  body[data-page="data-analysis"] #analysisLab .analysis-method-strip small {
    grid-column: 2;
  }

  body[data-page="data-analysis"] #analysisLab .analysis-method-strip em {
    display: none;
  }
}
