:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --ink: #182326;
  --muted: #607176;
  --line: #d8e0e3;
  --accent: #176b87;
  --accent-strong: #0e4f66;
  --teal: #157a6e;
  --amber: #a96316;
  --rose: #a13f4a;
  --shadow: 0 10px 28px rgba(30, 51, 58, 0.11);
  --sidebar-width: 390px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  cursor: default;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

body.is-starting {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  min-height: 34px;
  padding: 0 10px;
}

button:hover {
  border-color: #9fb5bd;
  background: #f8fbfc;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
}

input:focus,
select:focus,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(23, 107, 135, 0.24);
  outline-offset: 1px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 10px minmax(0, 1fr);
  min-height: 100vh;
  align-items: start;
}

body.is-starting .app-shell {
  filter: blur(4px) saturate(0.92);
}

.startup-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(245, 247, 248, 0.72);
  backdrop-filter: blur(10px);
  opacity: 1;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.startup-loader.is-dismissed {
  visibility: hidden;
  opacity: 0;
}

.startup-loader-card {
  width: min(420px, 100%);
  border: 1px solid rgba(157, 183, 190, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 46px rgba(30, 51, 58, 0.18);
  padding: 24px;
  text-align: center;
}

.startup-loader-mark {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
}

.startup-loader-mark span {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: rgba(23, 107, 135, 0.3);
  border-radius: 50%;
  animation: loader-spin 1.1s linear infinite;
}

.startup-loader-mark span:nth-child(2) {
  inset: 10px;
  border-top-color: var(--teal);
  animation-duration: 0.85s;
  animation-direction: reverse;
}

.startup-loader-mark span:nth-child(3) {
  inset: 22px;
  border-top-color: var(--amber);
  animation-duration: 1.45s;
}

.startup-loader-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.14;
}

.startup-loader-copy p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100vh;
  max-height: 100vh;
  background: #fbfcfc;
  min-width: 0;
}

.pane-resize-handle {
  position: sticky;
  top: 0;
  z-index: 12;
  width: 10px;
  height: 100vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #edf3f5;
  touch-action: none;
}

.pane-resize-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 48px;
  border-radius: 999px;
  background: #9fb5bd;
  transform: translate(-50%, -50%);
}

.pane-resize-handle:hover,
.pane-resize-handle:focus-visible,
body.is-resizing-panes .pane-resize-handle {
  background: #dfecef;
}

body.is-resizing-panes {
  user-select: none;
}

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

.sidebar-header h1,
.report-title h2,
.empty-state h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.eyebrow-link,
.eyebrow-link:visited,
.eyebrow-link:hover,
.eyebrow-link:active,
.eyebrow-link:focus {
  display: inline-block;
  color: var(--accent-strong);
  border-bottom: 0;
  text-decoration: none;
  text-decoration-line: none;
  text-transform: none;
}

.search-panel {
  display: grid;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.search-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.search-label-row #matchCount {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap input {
  padding-right: 38px;
}

.search-input-wrap input::-webkit-search-cancel-button {
  appearance: none;
}

.search-clear-button {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  min-height: 26px;
  padding: 0;
  border-color: transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transform: translateY(-50%);
}

.search-clear-button:hover,
.search-clear-button:focus-visible {
  border-color: #c8d8de;
  background: #eef5f7;
  color: var(--accent-strong);
}

.search-clear-button[hidden] {
  display: none;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
}

.control-field {
  display: grid;
  gap: 10px;
}

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

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar button.is-active,
.toolbar button[aria-pressed="true"] {
  border-color: #9bc6d3;
  background: #e7f4f7;
  color: var(--accent-strong);
  font-weight: 800;
}

.tree {
  overflow: auto;
  padding: 10px 8px 24px;
}

.tree-empty-state {
  display: grid;
  gap: 5px;
  margin: 6px 4px;
  padding: 14px;
  border: 1px dashed #c8d8de;
  border-radius: 8px;
  background: #f7fafb;
  color: var(--muted);
  line-height: 1.35;
}

.tree-empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.tree-empty-state span {
  font-size: 13px;
}

.tree ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.tree > ul {
  padding-left: 0;
}

.tree details > ul {
  position: relative;
  margin: 2px 0 4px 9px;
  padding-left: 9px;
}

.tree details > ul::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 9px;
  left: 0;
  border-left: 1px solid #d4e2e6;
}

.tree-node {
  position: relative;
  margin: 1px 0;
}

.tree details > ul > .tree-node::before,
.tree details > ul > .occupation-item::before {
  content: "";
  position: absolute;
  top: 15px;
  left: -9px;
  width: 8px;
  border-top: 1px solid #d4e2e6;
}

.occupation-item {
  position: relative;
}

.tree-summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--ink);
}

.tree-summary:hover,
.occupation-link:hover {
  background: #edf5f7;
}

.tree-summary.is-selected {
  border: 1px solid #79b7c9;
  background: #dfeff3;
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px #79b7c9;
}

.twisty {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.tree-summary.depth-0 {
  min-height: 34px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 850;
}

.tree-summary.depth-1 {
  font-size: 13.5px;
  font-weight: 780;
}

.tree-summary.depth-2 {
  color: #24383d;
  font-size: 13px;
  font-weight: 720;
}

.tree-summary.depth-3,
.tree-summary.depth-4 {
  color: #34494f;
  font-size: 12.5px;
  font-weight: 650;
}

.tree-summary.depth-0 .twisty {
  color: var(--accent);
}

.node-label,
.occupation-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.occupation-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 4px 6px 4px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #2c4147;
  font-size: 12.5px;
  text-align: left;
}

.occupation-link.is-marked {
  border-color: #9fcfb7;
  background: #f4faf7;
  box-shadow: inset 0 0 0 1px #c7e5d6;
}

.occupation-link.is-marked .occupation-label {
  font-weight: 700;
}

.occupation-link.is-selected.is-marked,
.occupation-link.is-selected {
  border-color: #79b7c9;
  background: #dfeff3;
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #79b7c9;
}

.occupation-code {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.report-shell {
  min-width: 0;
  overflow: visible;
  padding: 22px;
}

.workspace-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1180px;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 252, 0.96);
  padding: 8px;
}

.workspace-tab {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.workspace-tab.is-active {
  border-color: #9bc6d3;
  background: #e7f4f7;
  color: var(--accent-strong);
}

.workspace-tab.account-tab {
  color: #0f5f4b;
}

.workspace-tab.account-tab.is-active {
  border-color: #afd0c3;
  background: #e9f7f0;
  color: #0f5f4b;
}

.workspace-view {
  display: none;
  max-width: 1180px;
  margin: 0 auto;
}

.workspace-view.is-active {
  display: block;
}

.guide-panel {
  max-width: 1180px;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.guide-title {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.guide-title h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.guide-title p:last-child {
  max-width: 900px;
  margin: 8px 0 0;
  color: #31464d;
  line-height: 1.5;
}

.guide-rails {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #f6f8f8;
}

.guide-rail {
  border: 1px solid #d8e3e6;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.guide-rail summary {
  padding: 13px 15px;
  color: #18343d;
  font-size: 15px;
  font-weight: 800;
  list-style-position: inside;
}

.guide-rail[open] summary {
  border-bottom: 1px solid #e2eaed;
  background: #f9fbfb;
}

.guide-body {
  padding: 14px 16px 16px;
}

.guide-body p {
  margin: 0;
  color: #31464d;
  line-height: 1.5;
}

.guide-body p + p {
  margin-top: 10px;
}

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

.guide-cards > div,
.definition-grid > div,
.source-grid > a {
  min-width: 0;
  border: 1px solid #dde8eb;
  border-radius: 8px;
  background: #fbfcfc;
  padding: 11px 12px;
}

.guide-cards strong,
.definition-grid strong,
.source-grid strong {
  display: block;
  margin-bottom: 4px;
  color: #17323a;
  font-size: 13px;
}

.guide-cards span,
.definition-grid span,
.source-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.source-grid > a {
  color: inherit;
  text-decoration: none;
}

.source-grid > a:hover,
.source-grid > a:focus-visible {
  border-color: #9bc6d3;
  background: #f6fbfc;
}

.definition-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-steps,
.guide-list {
  margin: 0;
  padding-left: 22px;
  color: #31464d;
  line-height: 1.55;
}

.guide-steps li + li,
.guide-list li + li {
  margin-top: 6px;
}

.open-notice {
  max-width: 1180px;
  margin: 0 auto 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 14px 18px;
}

.open-notice p {
  margin: 0;
  color: #2a3c41;
  line-height: 1.45;
}

.open-notice p + p {
  margin-top: 6px;
}

.report-panel,
.workbench-panel,
.filter-panel,
.analysis-panel,
.voc-tsa-panel {
  max-width: 1180px;
  margin: 0 auto;
}

.filter-panel,
.voc-tsa-panel {
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workbench-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.workbench-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.voc-tsa-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.voc-tsa-header h2 {
  margin: 0;
  font-size: 22px;
}

.voc-tsa-header p:last-child {
  margin: 8px 0 0;
  max-width: 76ch;
  color: var(--muted);
  line-height: 1.5;
}

.voc-tsa-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.voc-tsa-upload {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfc;
}

.voc-tsa-upload textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.voc-tsa-dropzone {
  display: grid;
  justify-items: center;
  gap: 7px;
  border: 1px dashed #9bbac2;
  border-radius: 8px;
  background: #f6fbfc;
  padding: 18px 14px;
  color: #2a3c41;
  text-align: center;
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.voc-tsa-dropzone:hover,
.voc-tsa-dropzone.is-dragover {
  border-color: var(--accent);
  background: #eaf6f8;
  box-shadow: 0 10px 24px rgba(23, 107, 135, 0.14);
  transform: translateY(-1px);
}

.voc-tsa-dropzone.has-file {
  border-style: solid;
  border-color: #afd0c3;
  background: #eef9f4;
}

.voc-tsa-dropzone.has-error {
  border-color: #d7a0a7;
  background: #fff5f6;
}

.voc-tsa-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.dropzone-kicker {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.voc-tsa-dropzone strong {
  font-size: 15px;
}

.voc-tsa-dropzone em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.dropzone-file {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.voc-tsa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.voc-tsa-consent {
  align-items: start;
  line-height: 1.4;
}

.voc-tsa-output {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.voc-tsa-results {
  display: grid;
  gap: 12px;
  max-height: 720px;
  overflow: auto;
  padding: 16px;
}

.empty-state.compact {
  padding: 20px;
}

.empty-state.compact h2 {
  font-size: 20px;
}

.voc-tsa-section-text {
  white-space: pre-wrap;
  color: #263b40;
  font-size: 14px;
  line-height: 1.6;
}

.text-preview {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
  color: #2a3c41;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.workbench-body[hidden] {
  display: none;
}

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

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

.filter-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.filter-header p:last-child {
  max-width: 760px;
  margin: 7px 0 0;
  color: #31464d;
  line-height: 1.45;
}

.workbench-header h2,
.box-title h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.workbench-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.workbench-actions button.is-active,
.workbench-actions button[aria-pressed="true"] {
  border-color: #9bc6d3;
  background: #e7f4f7;
  color: var(--accent-strong);
  font-weight: 800;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.filter-topbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px);
  gap: 10px;
  align-items: end;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.filter-rails {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.filter-rail,
.filter-subrail,
.filter-group-rail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: visible;
}

.filter-rail > summary,
.filter-subrail > summary,
.filter-group-rail > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  list-style: none;
  padding: 12px 14px;
  color: var(--ink);
}

.filter-rail > summary::-webkit-details-marker,
.filter-subrail > summary::-webkit-details-marker,
.filter-group-rail > summary::-webkit-details-marker {
  display: none;
}

.filter-rail > summary::before,
.filter-subrail > summary::before,
.filter-group-rail > summary::before {
  content: "+";
  width: 18px;
  color: var(--muted);
}

.filter-rail[open] > summary::before,
.filter-subrail[open] > summary::before,
.filter-group-rail[open] > summary::before {
  content: "-";
}

.filter-rail > summary span,
.filter-subrail > summary span,
.filter-group-rail > summary span {
  flex: 1 1 auto;
  font-weight: 700;
}

.filter-rail > summary em,
.filter-subrail > summary em,
.filter-group-rail > summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.rail-summary-actions {
  display: inline-flex;
  flex: 0 0 auto !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-weight: 400;
  margin-left: auto;
  text-align: right;
}

.rail-summary-actions button {
  min-height: 28px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.rail-summary-actions button:disabled {
  opacity: 0.45;
}

.filter-rail-body,
.filter-subrail-body,
.filter-group-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.filter-subrail {
  background: #fcfdfd;
}

.filter-group-rail {
  background: #ffffff;
}

.filter-group-rail > summary {
  padding: 10px 12px;
}

.filter-group-rail > summary span {
  font-size: 13px;
}

.filter-row-card {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(112px, 130px) minmax(104px, 122px) minmax(130px, 160px);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid #e0e8eb;
  border-radius: 7px;
  background: #ffffff;
}

.filter-row-card.is-group-row {
  grid-template-columns: minmax(170px, 1fr) minmax(112px, 130px) minmax(104px, 122px);
}

.filter-row-card select {
  min-width: 0;
  padding-inline: 8px;
}

.filter-operator-with-help {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.filter-factor-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.filter-factor-text strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.filter-factor-text strong.has-inline-help {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.filter-factor-text span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.scale-help {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 17px;
  min-height: 17px;
  padding: 0;
  border-radius: 50%;
  border-color: #c8d8de;
  color: #31515b;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
}

.scale-help::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 50;
  width: min(390px, calc(100vw - 32px));
  padding: 8px 9px;
  border: 1px solid #b9cbd1;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(18, 32, 38, 0.16);
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  white-space: pre-line;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.scale-help:hover::after,
.scale-help:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

body.uses-floating-tooltips [data-tooltip]::after {
  display: none;
}

.floating-tooltip {
  position: fixed;
  z-index: 1000;
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 8px 9px;
  border: 1px solid #b9cbd1;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(18, 32, 38, 0.16);
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  white-space: pre-line;
  pointer-events: none;
}

.interest-help::after {
  width: min(430px, calc(100vw - 32px));
}

.interest-rank-help::after {
  left: auto;
  right: 0;
  width: min(440px, calc(100vw - 32px));
}

.search-mode-help::after {
  width: min(460px, calc(100vw - 32px));
}

.interest-help {
  flex: 0 0 auto;
  margin-left: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 12px;
  padding: 14px 18px;
}

.profile-grid label,
.profile-grid .profile-control {
  display: grid;
  gap: 10px;
  align-content: start;
}

.workbench-help::after {
  left: 50%;
  right: auto;
  width: min(360px, calc(100vw - 48px));
  transform: translateX(-50%);
}

.inventory-weighting-help::after {
  left: auto;
  right: 0;
  transform: none;
}

.scenario-guidance {
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--line);
}

.scenario-guidance > div {
  display: grid;
  grid-template-columns: minmax(160px, 0.4fr) minmax(0, 1fr);
  gap: 10px;
  border: 1px solid #d9e8ed;
  border-radius: 8px;
  background: #f3f9fb;
  padding: 10px 12px;
}

.scenario-guidance strong {
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.3;
}

.scenario-guidance span {
  color: #31474d;
  font-size: 13px;
  line-height: 1.4;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
}

.workbench-box {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.box-title span,
.inventory-panel summary span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.source-tray,
.limitation-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  width: 100%;
  min-height: 116px;
  max-height: 398px;
  box-sizing: border-box;
  overflow: auto;
  padding: 10px;
}

.limitation-layer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.limitation-layer summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
}

.limitation-layer summary strong {
  display: block;
  color: #23383e;
  font-size: 13px;
  line-height: 1.25;
}

.limitation-layer summary small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.limitation-layer summary em {
  border: 1px solid #d0e2e7;
  border-radius: 999px;
  background: #f3f9fb;
  color: var(--accent-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 2px 7px;
}

.limitation-layer-body {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  background: #fbfcfc;
  padding: 8px;
}

.source-item,
.limitation-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.source-item.is-dragging {
  opacity: 0.56;
}

.source-item.is-drop-target {
  border-color: #79b7c9;
  background: #eef8fb;
}

.drag-handle {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 1px;
}

.source-item strong,
.limitation-item strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-item span,
.limitation-item span {
  color: var(--muted);
  font-size: 12px;
}

.source-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.source-item button {
  width: auto;
  min-width: 32px;
  min-height: 30px;
  padding: 0 8px;
}

.source-item button[data-remove-source] {
  width: 32px;
  padding: 0;
}

.limitation-item {
  grid-template-columns: 18px minmax(0, 1fr);
}

.limitation-item input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.inventory-panel {
  background: #fbfcfc;
}

.analysis-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.analysis-header h3 {
  margin: 0;
  font-size: 18px;
}

.analysis-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.analysis-actions select {
  width: auto;
  min-width: 162px;
  max-width: 230px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.inline-check input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.draft-warning {
  padding: 9px 18px;
  border-bottom: 1px solid #efd7a1;
  background: #fff7e6;
  color: #70460b;
  font-size: 13px;
}

.analysis-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.summary-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
}

.summary-stat strong {
  display: block;
  font-size: 20px;
}

.summary-stat span {
  color: var(--muted);
  font-size: 12px;
}

.analysis-results {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding: 14px 18px 18px;
}

.workbench-results-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.workbench-results-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.workbench-results-header span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: right;
}

.workbench-results-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 14px 18px 18px;
}

.workbench-results-list[hidden] {
  display: none;
}

.workbench-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px 12px;
}

.workbench-result-row h4 {
  margin: 0;
  font-size: 14px;
  line-height: 1.25;
}

.workbench-result-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workbench-result-fit {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 170px;
}

.workbench-result-fit strong {
  color: var(--accent-strong);
  font-size: 17px;
}

.filter-audit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.filter-review-panel {
  border: 1px solid #d6e1e4;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.filter-review-panel.has-warning {
  border-color: #e0b45d;
  background: #fffaf0;
}

.filter-review-panel.has-warning .summary-stat {
  border-color: #eed6a6;
  background: #fffdf6;
}

.filter-review-panel.is-clear {
  border-color: #c8d9d1;
}

.filter-audit-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.filter-audit-title h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.filter-audit-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-audit-panel .analysis-summary {
  border-bottom: 0;
  padding-top: 12px;
}

.result-list-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.result-list-footer button {
  min-height: 30px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  overflow: hidden;
}

.result-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
}

.result-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.result-main h4 {
  margin: 0 0 7px;
  font-size: 16px;
}

.band {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.band.strong {
  background: #e7f4ef;
  color: #116044;
}

.band.moderate {
  background: #e8f2fb;
  color: #174f75;
}

.band.review {
  background: #fff2d8;
  color: #70460b;
}

.band.not {
  background: #fae8eb;
  color: #8a2433;
}

.component-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  gap: 8px;
  padding: 12px;
}

.result-math {
  border-top: 1px solid var(--line);
  background: #fbfcfc;
}

.result-math summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #263b41;
  font-size: 13px;
  font-weight: 800;
}

.result-math summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.report-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.report-toggle input {
  width: 14px;
  min-height: 14px;
  padding: 0;
}

.report-toggle.is-included {
  border-color: #9fcfb7;
  background: #eef8f2;
  color: #116044;
}

.report-toggle.is-excluded {
  border-color: #e5b4bb;
  background: #fff2f3;
  color: #8a2433;
}

.component {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 8px;
}

.component strong {
  display: block;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

.component span {
  color: var(--muted);
  font-size: 11px;
}

.explanation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: var(--surface);
}

.explanation-grid h5,
.detail-block h5 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
}

.result-detail {
  border-top: 1px solid var(--line);
  background: #fbfcfc;
}

.result-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: #263b41;
  font-size: 13px;
  font-weight: 800;
}

.result-detail summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.result-detail-body {
  border-top: 1px solid var(--line);
  padding: 12px;
}

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

.detail-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.detail-block textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.mini-list {
  margin: 0;
  padding-left: 16px;
  color: #2a3c41;
  font-size: 12px;
  line-height: 1.4;
}

.inventory-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  font-weight: 800;
}

.inventory-body {
  border-top: 1px solid var(--line);
  padding: 14px 18px 18px;
}

.inventory-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.inventory-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.inventory-column h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.inventory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  font-size: 13px;
}

.inventory-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-score {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.empty-state,
.report-card,
.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.empty-state {
  padding: 34px;
  max-width: 680px;
}

.empty-state p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.report-card {
  padding: 22px;
  margin-bottom: 16px;
}

.report-title {
  display: grid;
  gap: 10px;
}

.code-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
}

.pill.accent {
  color: var(--accent-strong);
  border-color: #b5d5de;
  background: #e9f5f8;
}

.lead {
  margin: 12px 0 0;
  max-width: 88ch;
  color: #2a3c41;
  line-height: 1.55;
}

.group-synthesis {
  margin: 14px 0 0;
  max-width: 96ch;
  color: #263b40;
  font-size: 14px;
  line-height: 1.55;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
}

.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.section {
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: none;
}

.section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 800;
}

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

.section-body {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}

.text-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.text-list li + li {
  margin-top: 6px;
}

.compact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px 16px;
}

.rating {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 9px;
  align-items: center;
}

.rating-name {
  min-width: 0;
  overflow: hidden;
  color: #2a3c41;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar {
  position: relative;
  height: 7px;
  background: #e5ecef;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value);
  background: var(--accent);
  border-radius: inherit;
}

.rating-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

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

.subcard {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfc;
}

.subcard h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.source-note {
  color: var(--muted);
  font-size: 12px;
}

.tsa-report {
  max-width: 1180px;
  margin: 0 auto 16px;
}

.tsa-report-rail {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.tsa-report-rail h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.tsa-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 8px;
}

.tsa-report-actions span {
  color: var(--muted);
  font-size: 12px;
}

.tsa-report-body {
  margin-top: 10px;
}

.print-report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.print-report-title {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.print-report-title h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.report-section {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.report-section:last-child {
  border-bottom: 0;
}

.report-section h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.report-section h4 {
  margin: 14px 0 8px;
  color: var(--accent-strong);
  font-size: 14px;
}

.report-section p {
  max-width: 92ch;
  line-height: 1.55;
}

.report-section > .source-note {
  color: #405459;
  font-size: 14px;
  line-height: 1.6;
}

.report-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.report-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
}

.report-metric strong {
  display: block;
  font-size: 19px;
  line-height: 1.15;
}

.report-metric span {
  color: var(--muted);
  font-size: 12px;
}

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

.report-subgrid .report-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.report-table-wrap {
  width: 100%;
  overflow: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.report-table th,
.report-table td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  background: #eef3f5;
  color: #2a3c41;
  font-weight: 800;
}

.report-table td span {
  color: var(--muted);
}

.report-table code {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.report-table a {
  color: var(--accent-strong);
  overflow-wrap: anywhere;
}

.appendix {
  background: #fbfcfc;
}

.primary-action {
  border-color: #9bc6d3;
  background: #e7f4f7;
  color: var(--accent-strong);
  font-weight: 800;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    position: static;
    grid-template-rows: auto auto auto;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: 0;
  }

  .pane-resize-handle {
    display: none;
  }

  .tree {
    max-height: 38vh;
  }

  .report-shell {
    overflow: visible;
    padding: 14px;
  }

  .workspace-tabs {
    top: 0;
    align-self: start;
    max-height: none;
    overflow: visible;
  }

  .metric-grid,
  .two-column,
  .profile-grid,
  .scenario-guidance > div,
  .workbench-grid,
  .filter-topbar,
  .filter-row-card,
  .guide-cards,
  .definition-grid,
  .definition-grid.compact,
  .source-grid,
  .workbench-result-row,
  .inventory-columns,
  .report-metric-grid,
  .report-subgrid,
  .analysis-summary,
  .result-main,
  .component-grid,
  .explanation-grid,
  .result-detail-grid {
    grid-template-columns: 1fr;
  }

  .workbench-result-fit {
    justify-content: start;
    min-width: 0;
  }
}

@media print {
  .sidebar,
  .pane-resize-handle,
  .search-panel,
  .workspace-tabs,
  .workbench-panel,
  .report-panel,
  .guide-panel,
  .filter-panel,
  .analysis-panel,
  .workbench-actions,
  .filter-actions,
  .analysis-actions,
  .source-item button {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  .app-shell {
    display: block;
    height: auto;
    overflow: visible;
  }

  .report-shell {
    padding: 0;
    overflow: visible;
  }

  .workspace-view {
    display: none !important;
    max-width: none;
    margin: 0;
  }

  #reportView {
    display: block !important;
  }

  .tsa-report {
    max-width: none;
    margin: 0;
  }

  .tsa-report-rail {
    display: none;
  }

  .workbench-panel,
  .print-report-card,
  .report-card,
  .section,
  .result-card,
  .empty-state {
    box-shadow: none;
    break-inside: avoid;
  }

  .print-report-card {
    border: 0;
  }

  .print-report-title,
  .report-section {
    padding: 14px 0;
  }

  .report-section {
    break-inside: avoid;
  }

  .report-table-wrap {
    overflow: visible;
  }

  .open-edition .report-panel {
    display: block !important;
  }

  .open-edition .open-notice {
    display: none;
  }
}
