:root {
  color-scheme: light;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-width: 232px;
  --content-width: 1440px;
  --color-canvas: #f7f7f8;
  --color-surface: #ffffff;
  --color-surface-subtle: #fafafa;
  --color-surface-raised: #ffffff;
  --color-sidebar: #19171d;
  --color-sidebar-raised: #242128;
  --color-text: #242229;
  --color-text-muted: #6f6b75;
  /* Meets WCAG AA contrast for normal text on the light canvas and white surfaces. */
  --color-text-subtle: #68646d;
  --color-border: #e6e4e8;
  --color-border-strong: #d7d4da;
  --color-accent: #6558d3;
  --color-accent-strong: #5548c4;
  --color-accent-soft: #f0eefe;
  --color-success: #087a55;
  --color-success-soft: #eaf8f2;
  --color-warning: #9a6500;
  --color-warning-soft: #fff7df;
  --color-danger: #c8374f;
  --color-danger-soft: #fff0f2;
  --color-info: #2869a8;
  --color-info-soft: #edf6ff;
  --shadow-sm: 0 1px 2px rgb(24 20 28 / 4%);
  --shadow-md: 0 8px 24px rgb(24 20 28 / 8%);
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 140ms ease;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-canvas);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--color-canvas);
  color: var(--color-text);
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--color-accent-strong);
  text-decoration: none;
}

a:hover {
  color: #463aa9;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid rgb(101 88 211 / 32%);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

[data-copy-value] {
  display: none;
}

.js [data-copy-value] {
  display: inline-flex;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.8rem;
  transform: translateY(-160%);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  font-weight: 650;
}

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

.app-sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 0.9rem 0.7rem;
  background: var(--color-sidebar);
  color: #efedf1;
}

.brand,
.mobile-brand {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand {
  gap: 0.7rem;
  min-height: 48px;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-md);
}

.brand:hover,
.mobile-brand:hover {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 9px;
  background: linear-gradient(145deg, #7a6de1, #5144bc);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 20%), 0 5px 14px rgb(0 0 0 / 25%);
  color: white;
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.brand-mark svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.brand-copy {
  display: grid;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: -0.05rem;
  color: #a9a4ae;
  font-size: 0.69rem;
}

.primary-nav {
  margin-top: 1.65rem;
}

.nav-label {
  margin: 0 0 0.4rem;
  padding: 0 0.6rem;
  color: #7f7a85;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: #bab6be;
  font-size: 0.82rem;
  font-weight: 520;
}

.nav-item + .nav-item {
  margin-top: 0.25rem;
}

.nav-item:hover {
  background: rgb(255 255 255 / 5%);
  color: #fff;
  text-decoration: none;
}

.nav-item.is-active {
  background: var(--color-sidebar-raised);
  color: #fff;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem 0.45rem 0.2rem;
  border-top: 1px solid rgb(255 255 255 / 8%);
}

.session-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.session-user {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 4%);
}

.session-user__avatar {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #7a6de1, #5144bc);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 750;
}

.session-user__identity {
  display: grid;
  min-width: 0;
}

.session-user__identity strong {
  overflow: hidden;
  color: #efedf1;
  font-size: 0.74rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-user__identity small {
  color: #817c86;
  font-size: 0.66rem;
}

.session-form__button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #bab6be;
  cursor: pointer;
  font-size: 0.72rem;
  text-align: left;
}

.session-form__button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.session-form__button:hover {
  border-color: rgb(255 255 255 / 22%);
  background: rgb(255 255 255 / 6%);
  color: #fff;
}

.mobile-header {
  display: none;
}

.app-main {
  --app-main-padding-top: 1.45rem;
  --app-main-padding-inline: clamp(1.25rem, 3vw, 3rem);
  --app-main-padding-bottom: 5rem;
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: var(--app-main-padding-top) var(--app-main-padding-inline) var(--app-main-padding-bottom);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 24px;
  margin: 0 0 1rem;
  color: var(--color-text-subtle);
  font-size: 0.75rem;
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

.breadcrumbs svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

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

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.title-row h1 {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--color-accent);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--color-text);
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  font-weight: 680;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 650;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 0.87rem;
  font-weight: 650;
}

.email-input-card {
  max-width: 820px;
}

.email-form {
  display: grid;
  gap: 1.15rem;
}

.email-field {
  display: grid;
  gap: 0.3rem;
}

.email-field label {
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 650;
}

.email-field input,
.email-field textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.email-field input[type="file"] {
  padding: 0.42rem 0.5rem;
}

.email-field textarea {
  min-height: 180px;
  resize: vertical;
}

.email-field input:focus,
.email-field textarea:focus {
  border-color: var(--color-accent);
  outline: 3px solid rgb(101 88 211 / 18%);
}

.email-field .has-error {
  border-color: var(--color-danger);
}

.field-error,
.field-help {
  margin: 0;
  font-size: 0.74rem;
}

.field-error {
  color: var(--color-danger);
}

.field-help {
  color: var(--color-text-muted);
}

.email-form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.login-page {
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 15% 15%, rgb(101 88 211 / 12%), transparent 32rem),
    var(--color-canvas);
}

.login-shell {
  width: min(100%, 430px);
}

.login-card {
  padding: clamp(1.5rem, 5vw, 2.6rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--color-text);
  text-decoration: none;
}

.login-brand:hover {
  color: var(--color-text);
  text-decoration: none;
}

.login-brand-copy {
  display: grid;
}

.login-brand-copy strong {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-brand-copy small {
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.login-heading {
  margin-top: 2.4rem;
}

.login-heading h1 {
  margin-top: 0.15rem;
}

.login-heading .page-description {
  margin-top: 0.65rem;
}

.login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.7rem;
}

.login-field {
  display: grid;
  gap: 0.35rem;
}

.login-field label {
  font-size: 0.78rem;
  font-weight: 650;
}

.login-field input {
  width: 100%;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

.login-field input:focus {
  border-color: var(--color-accent);
  outline: 3px solid rgb(101 88 211 / 18%);
}

.login-submit {
  width: 100%;
  min-height: 40px;
  margin-top: 0.35rem;
  background: var(--color-accent);
  color: #fff;
}

.login-submit:hover {
  border-color: var(--color-accent-strong);
  background: var(--color-accent-strong);
  color: #fff;
}

.login-message {
  margin-top: 1.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.login-message--error {
  border-color: #f2c5cd;
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.login-message--success {
  border-color: #bfe8d6;
  background: var(--color-success-soft);
  color: var(--color-success);
}

.login-note {
  margin: 1.5rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  text-align: center;
}

.page-description,
.section-description,
.muted,
.caption {
  color: var(--color-text-muted);
}

.page-description {
  max-width: 720px;
  margin: 0;
  font-size: 0.88rem;
}

.section-description,
.caption {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
}

.page-actions,
.heading-row,
.section-heading,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-actions,
.heading-row,
.section-heading {
  justify-content: space-between;
}

.heading-row {
  align-items: flex-start;
}

.heading-row.compact {
  align-items: center;
}

.table-section-heading {
  margin-bottom: 0.75rem;
}

.identifier-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-top: 0.25rem;
}

.mono,
code,
pre {
  font-family: var(--font-mono);
}

.mono {
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.identifier {
  overflow: hidden;
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirmation-dialog {
  width: min(92vw, 440px);
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 28px 80px rgb(0 0 0 / 45%);
  color: var(--color-text);
}

.confirmation-dialog::backdrop {
  background: rgb(15 13 18 / 72%);
  backdrop-filter: blur(4px);
}

.confirmation-dialog-content {
  display: grid;
  gap: 0.8rem;
  padding: 1.25rem;
}

.confirmation-dialog-content h2,
.confirmation-dialog-content p {
  margin: 0;
}

.confirmation-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.link-arrow svg,
.copy-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tag,
.count {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  gap: 0.38rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #efedf1;
  color: #59545e;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag,
.count {
  border-color: var(--color-border);
  background: var(--color-surface-subtle);
  color: var(--color-text-muted);
}

.tag.imposition,
.tag.analysis-mode-tag {
  border-color: #d6d0fb;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}

.section-nav {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  gap: 0.15rem;
  margin: 0 -0.4rem 1.35rem;
  padding: 0.45rem;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-nav a {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.section-nav a:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text);
  text-decoration: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.job-overview .summary-grid {
  margin-bottom: 0;
}

.job-metric-card {
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.job-metric-label {
  display: block;
  margin-bottom: 0.38rem;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.job-metric-value {
  display: flex;
  min-height: 25px;
  align-items: center;
  color: var(--color-text);
  font-size: 1.12rem;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.job-metric-help {
  display: block;
  margin-top: 0.18rem;
  overflow: hidden;
  color: var(--color-text-subtle);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-overlay-section {
  margin-top: 0;
}

.analysis-tabs,
.job-tabs,
.result-detail-tabs {
  margin-top: 1.75rem;
}

.result-detail-tabs > .result-tab-list {
  margin-bottom: 1.5rem;
}

.analysis-tab-list,
.job-tab-list,
.result-tab-list {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.analysis-tab,
.job-tab,
.result-tab {
  flex: 0 0 auto;
  min-width: 9rem;
  padding: 0.68rem 1rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.result-review-count {
  margin-left: 0.4rem;
}

.analysis-tab:hover,
.analysis-tab:focus-visible,
.job-tab:hover,
.job-tab:focus-visible,
.result-tab:hover,
.result-tab:focus-visible {
  background: var(--color-surface-subtle);
  color: var(--color-text);
}

.analysis-tab.is-active,
.job-tab.is-active,
.result-tab.is-active {
  background: #efedf1;
  color: #59545e;
}

.result-summary-card {
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  background: var(--color-surface-subtle);
}

.result-detail-card {
  margin: 1.25rem 0;
}

.result-detail-table {
  grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1.55fr);
  column-gap: 1.5rem;
}

.result-detail-table dt,
.result-detail-table dd {
  padding: 0.7rem 0;
}

.result-detail-table dd {
  line-height: 1.45;
  text-align: left;
}

.result-summary-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.result-summary-card h2,
.result-summary-outcome {
  margin: 0;
}

.result-summary-outcome {
  display: block;
  margin-top: 1rem;
  font-size: 1.15rem;
}

.result-summary-card p {
  max-width: 70ch;
  margin-bottom: 0;
  color: var(--color-text-muted);
}

.analysis-tab-panel {
  margin-top: 1.25rem;
}

.job-tabs > .job-tab-content > .ui-section {
  margin-top: 1.25rem;
}

.compact-heading {
  margin-bottom: 0.75rem;
}

.job-outcome-card {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.review-filter {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.review-filter label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.76rem;
}

.review-filter select {
  min-height: 34px;
  padding: 0.4rem 1.8rem 0.4rem 0.55rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.76rem;
}

.review-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: flex-end;
  gap: 0.35rem;
  margin-left: auto;
}

.review-controls .ui-toolbar__meta {
  align-self: flex-end;
}

.ui-toolbar.jobs-triage {
  justify-content: flex-start;
  align-items: flex-end;
}

.jobs-triage .search-field {
  align-items: stretch;
  flex-direction: column;
  gap: 0.2rem;
}

.jobs-triage .search-field > span:first-child {
  color: var(--color-text-muted);
}

.search-input {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
}

.review-filter .filter-field,
.jobs-triage .filter-field {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.2rem;
}

.review-filter .filter-field > span,
.jobs-triage .filter-field span {
  color: var(--color-text-muted);
}

.jobs-triage .filter-field input {
  min-height: 34px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.jobs-triage > .ui-button {
  align-self: flex-end;
  height: 34px;
}

.jobs-triage > .ui-toolbar__meta {
  align-self: flex-start;
  margin-left: auto;
}

.ui-toolbar__meta strong {
  color: var(--color-text);
  font-weight: 750;
}

.drawing-sources {
  margin-bottom: 1rem;
}

.drawing-source-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.drawing-source-item {
  display: flex;
  min-width: min(100%, 250px);
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-subtle);
}

.drawing-connections {
  margin-top: 1rem;
}

.drawing-connections-table {
  min-width: 920px;
}

.drawing-connections-table th:first-child {
  width: 48%;
}

.drawing-connections-table th:nth-child(2) {
  width: 22%;
}

.drawing-connections-table th:nth-child(3) {
  width: 20%;
}

.drawing-connection-cell {
  min-width: 0;
}

.drawing-connection-flow {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.4rem;
}

.drawing-connection-node {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 0;
}

.drawing-connection-node > a {
  flex: 0 0 auto;
}

.drawing-connection-thumbnail {
  display: block;
  width: 56px;
  height: 44px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #f0eff2;
}

.drawing-connection-node-copy {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.drawing-connection-node-copy strong {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.drawing-connection-node-copy > span:not(.ui-badge) {
  overflow: hidden;
  color: var(--color-text);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawing-connection-node-copy .ui-badge {
  width: max-content;
  max-width: 100%;
  margin-top: 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawing-connection-arrow {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  color: var(--color-accent-strong);
  stroke: currentColor;
  stroke-width: 1.8;
}

.drawing-connection-empty {
  flex: 1 1 0;
  color: var(--color-text-subtle);
  font-size: 0.76rem;
  font-style: italic;
  text-align: center;
}

.drawing-set-inspector-table {
  min-width: 760px;
}

.drawing-set-connection-card .ui-card__header {
  align-items: flex-start;
}

.drawing-set-connection-card-flow {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.drawing-set-connection-card-flow .drawing-set-node {
  min-width: 0;
  flex: 1 1 0;
}

.drawing-set-connection-selected > td {
  background: var(--color-accent-soft);
}

.drawing-set-node {
  display: flex;
  min-width: 150px;
  align-items: center;
  gap: 0.45rem;
}

.drawing-set-node > a {
  flex: 0 0 auto;
}

.drawing-set-node > span {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.drawing-set-node > span > span:not(.ui-badge) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawing-set-node strong {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.drawing-set-node .ui-badge {
  width: max-content;
}

.drawing-set-target-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawing-set-target-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
}

.drawing-set-target-item:first-child {
  padding-top: 0;
}

.drawing-set-target-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.drawing-set-target-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
}

.drawing-set-target-heading > strong {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.drawing-set-target-preview {
  flex: 0 0 auto;
}

.drawing-set-target-details {
  margin-top: 0.65rem;
}

.drawing-set-thumbnail {
  display: block;
  width: 44px;
  height: 36px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #f0eff2;
}

.drawing-set-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.drawing-set-evidence-grid .ui-card__body {
  padding: 0.75rem 1rem;
}

.drawing-set-evidence-grid .plain-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.76rem;
}

.drawing-set-evidence-grid .plain-list li:last-child {
  border-bottom: 0;
}

.drawing-connection-reason {
  max-width: 26rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.drawing-evidence-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.drawing-evidence-badges .ui-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-queue-item {
  cursor: default;
}

.review-queue table {
  table-layout: fixed;
}

.review-queue th:nth-child(2) {
  width: 12%;
}

.review-queue th:nth-child(3) {
  width: 18%;
}

.review-queue th:nth-child(4) {
  width: 18%;
}

.review-queue th:nth-child(1) {
  width: 22%;
}

.review-queue th:nth-child(5) {
  width: 30%;
}

.review-queue td:nth-child(1) {
  min-width: 0;
}

.review-queue .resource-name {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: baseline;
  overflow: hidden;
  text-decoration: none;
}

.review-queue-item.is-selected > td {
  background: var(--color-surface-subtle);
}

.review-navigation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-navigation output {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.contextual-inspector-host {
  position: fixed;
  z-index: 40;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  right: 0;
  width: min(48rem, calc(100vw - var(--sidebar-width) - 2rem));
  height: 100vh;
  overflow: auto;
  border-left: 1px solid var(--color-border-strong);
  border-radius: 0;
  background: var(--color-canvas);
  box-shadow: none;
}

.job-collection-rail-header {
  display: none;
}

.job-workspace.is-comparing {
  display: grid;
  grid-template-columns: clamp(16rem, 26vw, 26rem) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.job-workspace.is-comparing.is-collection-rail-collapsed {
  grid-template-columns: 3.5rem minmax(0, 1fr);
}

.job-workspace.is-comparing .job-collection-rail {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.job-workspace.is-comparing .job-collection-rail-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.job-workspace.is-comparing .job-collection-rail [data-contextual-collection-content] {
  padding: 0 0.75rem 0.75rem;
}

.job-workspace.is-comparing .job-collection-rail #job-detail-content {
  min-width: 0;
}

.job-workspace.is-comparing.is-collection-rail-collapsed .job-collection-rail-header {
  justify-content: center;
  padding: 0.5rem;
}

.job-workspace.is-comparing.is-collection-rail-collapsed .job-collection-rail-header strong {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.job-workspace.is-comparing .contextual-inspector-host {
  position: sticky;
  z-index: 1;
  top: 1rem;
  right: auto;
  width: auto;
  height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.job-workspace.is-comparing .contextual-inspector-panes {
  min-height: calc(100vh - 8rem);
}

@media (max-width: 1280px) {
  .job-workspace.is-comparing {
    display: block;
  }
}

.job-workspace.is-inspector-open {
  --contextual-inspector-width: clamp(20rem, 32vw, 36rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, var(--contextual-inspector-width));
  align-items: start;
  gap: 0;
}

.job-workspace {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  margin: calc(-1 * var(--app-main-padding-top, 0px))
    calc(-1 * var(--app-main-padding-inline, 0px))
    calc(-1 * var(--app-main-padding-bottom, 0px));
}

.job-workspace > .job-collection-rail {
  height: 100vh;
  max-height: none;
  overflow: auto;
  padding: var(--app-main-padding-top, 0px)
    var(--app-main-padding-inline, 0px)
    var(--app-main-padding-bottom, 0px);
}

.job-workspace.is-inspector-open .job-collection-rail {
  position: relative;
  top: auto;
  min-width: 0;
  max-height: none;
}

.job-workspace.is-inspector-open .contextual-inspector-host {
  position: sticky;
  z-index: 1;
  top: 0;
  right: auto;
  width: auto;
  height: 100vh;
  margin-left: 1rem;
  overflow: hidden;
  border: 0;
  border-left: 1px solid var(--color-border-strong);
  border-radius: 0;
  box-shadow: none;
}

.contextual-inspector-resize {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: -6px;
  width: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: col-resize;
  touch-action: none;
}

.contextual-inspector-resize::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 2px;
  background: transparent;
  content: "";
}

.contextual-inspector-resize:hover::after,
.contextual-inspector-resize:focus-visible::after,
.is-resizing-contextual-inspector .contextual-inspector-resize::after {
  background: var(--color-accent);
}

.job-workspace.is-inspector-open .contextual-inspector-panes {
  min-height: 0;
}

.contextual-inspector-actions,
.contextual-inspector-pane-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.contextual-inspector-width-message {
  margin: 0;
  padding: 0.5rem 1rem;
  background: var(--color-warning-soft);
  color: var(--color-warning);
  font-weight: 650;
}

.contextual-inspector-panes {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
}

.contextual-inspector-host.is-comparing .contextual-inspector-panes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contextual-inspector-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.contextual-inspector-pane + .contextual-inspector-pane {
  border-left: 1px solid var(--color-border-strong);
}

.contextual-inspector-pane.is-active {
  box-shadow: inset 0 3px 0 var(--color-accent);
}

.contextual-inspector-pane-header {
  position: sticky;
  z-index: 1;
  top: 0;
  justify-content: space-between;
  min-height: 38px;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.contextual-inspector-pane[aria-busy="true"] .contextual-inspector-body {
  opacity: 0.55;
}

.contextual-inspector-skeleton,
.contextual-inspector-failure {
  padding: 1rem;
}

.contextual-inspector-skeleton-header {
  display: grid;
  gap: 0.45rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.contextual-inspector-skeleton-body {
  display: grid;
  gap: 0.65rem;
  padding-top: 1rem;
}

.contextual-inspector-skeleton-line {
  height: 0.9rem;
  border-radius: 0.25rem;
  background: var(--color-surface-subtle);
}

.contextual-inspector-skeleton-line:nth-child(2) { width: 78%; }
.contextual-inspector-skeleton-line:nth-child(3) { width: 58%; }

.contextual-inspector-failure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.contextual-inspector-host-header,
.contextual-inspector-toolbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.contextual-inspector-status {
  padding: 0.5rem 1rem;
  color: var(--color-text-muted);
}

.contextual-inspector-content > .app-main {
  width: 100%;
  min-height: auto;
  margin: 0;
  padding: 1rem;
}

.contextual-inspector-pane .contextual-inspector-content > .app-main {
  padding: 1rem;
}

.contextual-related-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin: 0.25rem 0 0.25rem 0.4rem;
}

.contextual-related-actions .ui-button {
  min-height: auto;
  padding: 0.15rem 0.3rem;
  font-size: 0.68rem;
}

.analysis-overlay-section .detail-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.section-heading {
  margin-bottom: 0.75rem;
}

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

.ui-accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.patch-card-grid {
  display: grid;
  gap: 1rem;
}

.target-patch-card-header {
  align-items: flex-start;
}

.target-patch-card-header h3 {
  overflow-wrap: anywhere;
}

.patches-table {
  min-width: 720px;
}

.patch-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.patch-color-sums {
  display: grid;
  gap: 0.35rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.patch-color-sums li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
}

.patch-area-total {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  text-align: right;
}

.patch-area-total strong {
  font-size: 1rem;
}

.search-field {
  position: relative;
  display: flex;
  width: min(360px, 100%);
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 0.68rem;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--color-text-subtle);
  stroke-linecap: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 34px;
  padding: 0.4rem 3rem 0.4rem 2rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.76rem;
}

.search-field input::placeholder {
  color: var(--color-text-subtle);
}

.shortcut-hint {
  position: absolute;
  right: 0.45rem;
  padding: 0.05rem 0.32rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface-subtle);
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

th,
td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--color-surface-subtle);
  color: var(--color-text-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: #fbfafc;
}

tbody tr:last-child td,
tfoot tr:last-child td,
tfoot tr:last-child th {
  border-bottom: 0;
}

.cell-primary {
  color: var(--color-text);
  font-weight: 620;
}

.cell-secondary {
  display: block;
  margin-top: 0.1rem;
  color: var(--color-text-subtle);
  font-size: 0.7rem;
}

.cell-numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-ref,
.resource-name {
  color: var(--color-text);
  font-weight: 640;
}

.job-ref:hover,
.resource-name:hover {
  color: var(--color-accent-strong);
}

.row-action {
  width: 38px;
  text-align: right;
}

.row-link {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-subtle);
}

.row-link:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  text-decoration: none;
}

.row-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.results-table .result-target-cell,
.results-table .result-summary-cell {
  min-width: 12rem;
}

.results-table {
  table-layout: fixed;
}

.results-column-target,
.results-column-source {
  width: 19%;
}

.results-column-outcome {
  width: 13%;
}

.results-column-coverage {
  width: 17%;
}

.results-column-review,
.results-column-confidence {
  width: 7%;
}

.results-column-created {
  width: 10%;
}

.results-column-action {
  width: 8%;
}

.results-table .result-target-cell,
.results-table .result-source-cell {
  min-width: 0;
  max-width: 0;
}

.artifact-name {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: baseline;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.artifact-name-base {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-name-extension {
  flex: 0 0 auto;
  white-space: nowrap;
}

.results-table .row-action {
  width: 1%;
  white-space: nowrap;
}

.results-table .cell-secondary {
  white-space: nowrap;
}

.result-finding-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  margin-top: 0;
  list-style: none;
}

.result-finding-list .result-finding-row {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.result-finding-list .result-finding-row:last-child {
  padding-bottom: 1rem;
}

.result-finding-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.68rem 0;
  border-bottom: 1px solid var(--color-border);
}

.result-finding-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.result-finding-icon {
  width: 18px;
  height: 18px;
  margin-top: 0.03rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.result-finding-copy {
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.result-finding-copy strong {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--color-text);
  font-size: 0.8rem;
}

.result-finding-stage {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--color-text-subtle);
  font-size: 0.62rem;
  font-weight: 730;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-finding-problem .result-finding-icon,
.result-finding-problem .result-finding-copy {
  color: var(--color-danger);
}

.result-finding-decision .result-finding-icon {
  color: var(--color-accent-strong);
}

.result-finding-reasoning .result-finding-icon,
.result-finding-information .result-finding-icon {
  color: var(--color-info);
}

.result-finding-type {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--color-text-subtle);
  font-size: 0.62rem;
  font-weight: 730;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-finding-problem .result-finding-type {
  color: var(--color-danger);
}

.result-finding-decision .result-finding-type {
  color: var(--color-accent-strong);
}

.result-finding-reasoning .result-finding-type {
  color: var(--color-info);
}

.result-finding-clear .result-finding-icon {
  color: var(--color-success);
}

.attention-accordion {
  border-color: #f0c2ca;
}

.attention-accordion > summary {
  background: var(--color-danger-soft);
}

.attention-list {
  background: var(--color-surface);
}

.attention-row {
  display: grid;
  grid-template-columns: 18px minmax(130px, 0.35fr) minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
}

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

.attention-row .ui-toast__icon {
  color: var(--color-danger);
}

.attention-row .issue-list {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.analysis-classification-card,
.analysis-classification-summary {
  padding: 0.85rem 1rem;
  border: 1px solid #d9d3fb;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f8f7ff, var(--color-accent-soft));
}

.analysis-classification-card {
  margin-bottom: 1.25rem;
}

.analysis-classification-summary {
  margin: 0.75rem 0;
}

.analysis-classification-kicker {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-accent-strong);
  font-size: 0.64rem;
  font-weight: 730;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.analysis-classification-value {
  color: #4136a1;
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.analysis-classification-reason {
  max-width: 900px;
  margin: 0.55rem 0 0;
  color: #55505f;
  font-size: 0.76rem;
}

.analysis-classification-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.65rem;
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.issues,
.issue-list {
  color: #8d293a;
}

.issues ul,
.issues ol,
.issue-list {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

.issues li + li,
.issue-list li + li {
  margin-top: 0.2rem;
}

.ok {
  color: var(--color-success);
}

.action-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-accent-strong);
  font-size: 0.7rem;
  font-weight: 650;
  white-space: nowrap;
}

.detail-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 0.9rem;
}

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

.analysis-findings-result-grid {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

.detail-grid > *,
.two-column > * {
  min-width: 0;
  margin: 0;
}

.image-panel,
.preview-panel {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.preview-panel {
  display: grid;
  width: 100%;
  min-height: 0;
  margin: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  aspect-ratio: 3 / 2;
}

.analysis-overlay-section .preview-panel {
  contain: none;
}

.preview-stage {
  display: grid;
  min-height: 0;
  height: auto;
  place-items: center;
  padding: 1rem;
  background-color: #f0eff2;
  background-image: linear-gradient(45deg, #e5e3e7 25%, transparent 25%),
    linear-gradient(-45deg, #e5e3e7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e3e7 75%),
    linear-gradient(-45deg, transparent 75%, #e5e3e7 75%);
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-size: 14px 14px;
}

.analysis-overlay-section .preview-stage {
  position: relative;
  min-height: 0;
}

.preview-stage img,
.image-panel img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  margin: auto;
  object-fit: contain;
}

.analysis-overlay-section .preview-image-frame {
  position: absolute;
  inset: 1rem;
  min-width: 0;
  min-height: 0;
}

.analysis-overlay-section .preview-stage .preview-image-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

.action-artifact-preview {
  width: 100%;
}

.action-artifact-preview .preview-panel {
  contain: none;
}

.action-artifact-preview .preview-stage {
  min-height: 0;
  height: auto;
}

.analysis-overlay-section .overlay-preview-trigger:hover .preview-image-frame img {
  transform: none;
}

@media (min-width: 861px) {
  .analysis-overlay-section .preview-stage {
    height: 100%;
  }

  .action-artifact-preview .preview-stage {
    height: auto;
  }
}

.preview-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.8rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.definition-list,
dl {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1.3fr);
  gap: 0;
  margin: 0;
}

.definition-list dt,
.definition-list dd,
dl dt,
dl dd {
  min-width: 0;
  padding: 0.52rem 0;
  border-bottom: 1px solid var(--color-border);
}

.definition-list dt:last-of-type,
.definition-list dd:last-of-type,
dl dt:last-of-type,
dl dd:last-of-type {
  border-bottom: 0;
}

.definition-list dt,
dl dt {
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.definition-list dd,
dl dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-size: 0.75rem;
  text-align: right;
}

.resource-links,
.plain-list,
.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.resource-links li,
.link-list li {
  border-bottom: 1px solid var(--color-border);
}

.resource-links li:last-child,
.link-list li:last-child {
  border-bottom: 0;
}

.resource-links a,
.link-list a {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 580;
}

.resource-links a:hover,
.link-list a:hover {
  color: var(--color-accent-strong);
  text-decoration: none;
}

.resource-link-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--color-text-subtle);
  stroke-width: 1.8;
}

.resource-link-content {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.75rem;
}

.resource-link-content > span {
  min-width: 0;
}

.resource-group + .resource-group {
  margin-top: 0.9rem;
}

.resource-group-heading {
  margin: 0.65rem 0 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.thumbnail {
  display: block;
  width: 70px;
  height: 52px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #f0eff2;
}

.ui-accordion {
  margin-top: 0.65rem;
  overflow: clip;
}

.ui-accordion > summary {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 640;
  list-style: none;
}

.ui-accordion > summary::-webkit-details-marker {
  display: none;
}

.ui-accordion[open] > summary {
  border-bottom: 1px solid var(--color-border);
}

.ui-accordion__content {
  padding: 1rem;
}

.ui-accordion__content--flush {
  padding: 0;
}

.summary-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.communication-message-card {
  padding: 0;
  overflow: hidden;
  background: #fffefd;
}

.communication-message-card + .communication-message-card {
  margin-top: 0.65rem;
}

.communication-subsection + .communication-subsection {
  margin-top: 1.5rem;
}

.communication-subsection > .heading-row {
  margin-bottom: 0.75rem;
}

.communication-subsection > .ui-card + .ui-card {
  margin-top: 0.65rem;
}

.attachment-table-wrap {
  max-height: 20rem;
  overflow: auto;
}

.attachment-table-wrap thead th {
  position: sticky;
  z-index: 1;
  top: 0;
}

.message-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, #faf8fc, #f5f4f8);
}

.message-subject {
  display: block;
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 680;
}

.message-addresses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  margin-top: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.message-address-label,
.message-processing-label {
  color: var(--color-text-subtle);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.message-content {
  padding: 1rem;
}

.message-processing {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.7rem;
  color: var(--color-text-muted);
  font-size: 0.7rem;
}

.message-processing .message-meta {
  margin-top: 0.35rem;
}

.message-attachments {
  border-top: 1px solid var(--color-border);
}

.message-attachments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

pre {
  max-height: 68vh;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: #1d1b21;
  color: #e9e6eb;
  font-size: 0.72rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  tab-size: 2;
  white-space: pre-wrap;
}

.body-copy {
  max-height: 18rem;
  padding: 0;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  line-height: 1.55;
}

.code-panel {
  overflow: hidden;
  border: 1px solid #302d34;
  border-radius: var(--radius-md);
  background: #1d1b21;
  box-shadow: var(--shadow-sm);
}

.code-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #35323a;
  color: #a9a4ae;
  font-size: 0.68rem;
  font-weight: 600;
}

.code-panel pre {
  border-radius: 0;
}

.cost-total th,
.cost-total td {
  border-top: 1px solid var(--color-border-strong);
  background: var(--color-surface-subtle);
  color: var(--color-text);
  font-size: 0.76rem;
  font-weight: 700;
}

.issue-count {
  color: var(--color-danger);
  font-size: 0.7rem;
  font-weight: 650;
  white-space: nowrap;
}

.overlay-preview-trigger {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  text-decoration: none;
}

.overlay-preview-trigger img {
  transition: filter var(--transition), transform var(--transition);
}

.overlay-preview-trigger:hover {
  text-decoration: none;
}

.overlay-preview-trigger:hover img {
  filter: brightness(0.78);
  transform: scale(1.01);
}

.preview-open-hint {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 999px;
  background: rgb(25 23 29 / 88%);
  box-shadow: var(--shadow-md);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 6px));
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}

.preview-open-hint svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.overlay-preview-trigger:hover .preview-open-hint,
.overlay-preview-trigger:focus-visible .preview-open-hint {
  opacity: 1;
  transform: translate(-50%, -50%);
}

body:has(.overlay-dialog[open]) {
  overflow: hidden;
}

.overlay-dialog {
  box-sizing: border-box;
  width: calc(100vw - 2rem);
  max-width: none;
  height: min(calc(94vh - 2rem), 1100px);
  max-height: none;
  margin: 1rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid #3a3740;
  border-radius: var(--radius-lg);
  background: #151319;
  box-shadow: 0 28px 80px rgb(0 0 0 / 45%);
  color: #efedf1;
}

.overlay-dialog::backdrop {
  background: rgb(15 13 18 / 72%);
  backdrop-filter: blur(4px);
}

.overlay-dialog-shell {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.overlay-dialog-header {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 0.9rem 0.75rem 1.1rem;
  border-bottom: 1px solid #35323a;
  background: #1d1b21;
}

.overlay-dialog-header > .inspector-header {
  flex: 1 1 auto;
}

.inspector-header {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.page-header > .inspector-header {
  flex: 1 1 auto;
}

.inspector-header .overlay-dialog-heading {
  display: grid;
  gap: 0.3rem;
}

.inspector-header .overlay-dialog-heading h1,
.inspector-header .overlay-dialog-heading h2 {
  margin: 0;
}

.inspector-header .identifier-line {
  margin: 0;
}

.inspector-header-actions,
.inspector-collection-navigation,
.inspector-header-sections,
.inspector-header-relations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.inspector-header-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.inspector-header-toolbar .inspector-header-actions {
  margin-left: auto;
}

.inspector-collection-navigation {
  font-size: 0.76rem;
}

.inspector-collection-navigation output {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.inspector-header-relations {
  list-style: none;
  font-size: 0.78rem;
}

.contextual-inspector-toolbar > .inspector-header {
  width: 100%;
}

.overlay-dialog-header .overlay-dialog-heading {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 0.05rem 0.7rem;
}

.overlay-dialog-header .overlay-dialog-heading .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  color: #9e94f1;
}

.overlay-dialog-header .overlay-dialog-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}

.overlay-dialog-dimensions {
  color: #8f8a94;
  font-size: 0.67rem;
}

.overlay-viewer-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.overlay-dialog-close {
  margin-left: 0.65rem;
}

.viewer-tool-button {
  box-sizing: border-box;
  display: inline-grid;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 1px solid #45414a;
  border-radius: var(--radius-sm);
  background: #26232a;
  color: #dcd8df;
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1;
  appearance: none;
  place-items: center;
}

.viewer-tool-button:hover {
  border-color: #625d68;
  background: #302d35;
  color: #fff;
}

.viewer-tool-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.overlay-zoom-value {
  width: 48px;
  color: #b6b1ba;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  text-align: center;
}

.overlay-tool-divider {
  width: 1px;
  height: 22px;
  margin: 0 0.2rem;
  background: #3d3942;
}

.overlay-dialog-body {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 460px;
}

.overlay-dialog-basic .overlay-dialog-body {
  grid-template-columns: minmax(0, 1fr);
}

.overlay-viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background-color: #0e0d11;
  background-image: linear-gradient(45deg, #151319 25%, transparent 25%),
    linear-gradient(-45deg, #151319 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #151319 75%),
    linear-gradient(-45deg, transparent 75%, #151319 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.overlay-viewport.is-panning,
.overlay-viewport.is-panning * {
  cursor: grabbing !important;
}

.overlay-canvas-space {
  display: grid;
  width: max-content;
  min-width: 100%;
  height: max-content;
  min-height: 100%;
  padding: 28px;
  place-items: center;
}

.overlay-canvas {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 42px rgb(0 0 0 / 55%);
}

.overlay-source-image,
.overlay-graphics {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.overlay-source-image {
  -webkit-user-drag: none;
  object-fit: fill;
  user-select: none;
}

.overlay-graphics {
  overflow: visible;
}

.overlay-shape {
  color: #6b7280;
  cursor: pointer;
  outline: none;
}

.overlay-shape rect {
  fill: currentColor;
  fill-opacity: 0.18;
  stroke: currentColor;
  stroke-width: 2;
  transition: fill-opacity var(--transition), filter var(--transition), stroke-width var(--transition);
}

.overlay-shape-dimension {
  color: #16a34a;
}

.overlay-shape-dimension[data-dimension-used="false"] {
  color: #dc2626;
}

.overlay-shape-dimension line {
  stroke: currentColor;
  stroke-width: 2.5;
  transition: filter var(--transition), stroke-width var(--transition);
}

.overlay-shape-dimension circle {
  fill: currentColor;
  stroke: #fff;
  stroke-width: 1.5;
  transition: filter var(--transition), r var(--transition);
}

.overlay-shape-dimension-description rect {
  fill-opacity: 0.08;
  stroke-dasharray: 5 3;
}

.overlay-dimension-value {
  fill: currentColor;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  paint-order: stroke;
  pointer-events: none;
  stroke: #fff;
  stroke-linejoin: round;
  stroke-width: 3px;
}

.comparison-value {
  color: var(--color-text-muted);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

.overlay-shape-outline {
  color: #2563eb;
}

.overlay-shape-outline rect {
  fill: none;
}

.overlay-shape-area[data-area-type="PANEL"] {
  color: #16a34a;
}

.overlay-shape-area[data-area-type="FLAP"] {
  color: #ea580c;
}

.overlay-shape-area[data-area-type="AREA"] {
  color: #9333ea;
}

.overlay-shape-area[data-area-type="IMPOSITION_ITEM"] {
  color: #0891b2;
}

.overlay-shape-content[data-content-type="GRAPHIC"] {
  color: #7c3aed;
}

.overlay-shape-content[data-content-type="ICON"] {
  color: #d97706;
}

.overlay-shape-content[data-content-type="TEXT"] {
  color: #2563eb;
}

.overlay-shape-content[data-content-type="BARCODE"] {
  color: #e11d48;
}

.overlay-shape-content[data-content-type="ARTWORK"] {
  color: #16a34a;
}

.overlay-shape-content[data-content-type="IMAGE"] {
  color: #0891b2;
}

.overlay-shape-content[data-content-type="BACKGROUND"] {
  color: #c026d3;
}

.overlay-shape-content[data-content-type="BACKGROUND"] rect {
  fill-opacity: 0.08;
}

.overlay-shape-cliche {
  color: #0f766e;
}

.overlay-shape-cliche rect {
  fill-opacity: 0.08;
  stroke-dasharray: 8 4;
}

.overlay-shape-cliche circle {
  fill: currentColor;
  stroke: #fff;
  stroke-width: 1.5;
}

.overlay-shape-color {
  color: #c026d3;
}

.overlay-shape-color rect {
  fill-opacity: 0.22;
  stroke-dasharray: 5 3;
}

.overlay-shape:hover rect,
.overlay-shape:focus rect,
.overlay-shape.is-selected rect {
  fill-opacity: 0.3;
  stroke-width: 4;
  filter: drop-shadow(0 0 4px rgb(255 255 255 / 90%));
}

.overlay-shape-dimension:hover line,
.overlay-shape-dimension:focus line,
.overlay-shape-dimension.is-selected line {
  stroke-width: 4;
  filter: drop-shadow(0 0 4px rgb(255 255 255 / 90%));
}

.overlay-shape-dimension:hover circle,
.overlay-shape-dimension:focus circle,
.overlay-shape-dimension.is-selected circle {
  r: 5;
  filter: drop-shadow(0 0 4px rgb(255 255 255 / 90%));
}

.overlay-inspector {
  display: grid;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid #35323a;
  background: #f8f7f9;
  color: var(--color-text);
  grid-template-rows: auto auto minmax(0, 1fr);
}

.overlay-layer-menu {
  margin: 0.75rem 0.85rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fbfafc;
}

.overlay-layer-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.56rem 0.65rem;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 650;
  list-style: none;
}

.overlay-layer-menu summary::-webkit-details-marker {
  display: none;
}

.overlay-layer-menu[open] summary {
  border-bottom: 1px solid var(--color-border);
}

.overlay-layer-menu-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-left: 0.1rem;
  transition: transform var(--transition);
}

.overlay-layer-menu[open] .overlay-layer-menu-icon {
  transform: rotate(180deg);
}

.overlay-layer-menu-summary {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: 0.64rem;
  font-weight: 500;
}

.overlay-layer-controls {
  display: grid;
  background: #fbfafc;
}

.overlay-layer-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: center;
  padding: 0.55rem 0.65rem;
}

.overlay-layer-control + .overlay-layer-control {
  border-top: 1px solid var(--color-border);
}

.overlay-layer-control-heading {
  display: grid;
  min-width: 0;
  gap: 0.16rem;
}

.overlay-layer-visibility {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.42rem;
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 650;
}

.overlay-layer-visibility input {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  accent-color: var(--color-accent);
}

.overlay-layer-visibility input:disabled {
  cursor: not-allowed;
}

.overlay-layer-visibility span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-layer-count {
  color: var(--color-text-muted);
  font-size: 0.65rem;
}

.overlay-layer-legend {
  margin: 0;
  color: var(--color-text-subtle);
  font-size: 0.61rem;
  line-height: 1.3;
}

.overlay-layer-unavailable {
  color: var(--color-text-muted);
}

.overlay-opacity-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 0.45rem;
  padding-right: 0.7rem;
}

.overlay-opacity-control input {
  width: 100%;
  accent-color: var(--color-accent);
  cursor: ew-resize;
}

.overlay-opacity-control input:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.overlay-opacity-control output {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-align: right;
}

.overlay-inspector-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0.75rem 0.85rem 0;
  padding: 0.25rem;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.overlay-inspector-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1 1 0;
  min-width: 0;
  padding: 0.68rem 1rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 650;
  text-align: center;
  transition: background-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.overlay-inspector-tab:hover,
.overlay-inspector-tab:focus-visible {
  background: var(--color-surface-subtle);
  color: var(--color-text);
}

.overlay-inspector-tab.is-active {
  background: #efedf1;
  color: #59545e;
}

.overlay-view-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.25rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: #eceaf2;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  line-height: 1;
}

.overlay-inspector-tab.is-active .overlay-view-count {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}

.overlay-inspector-panels {
  min-height: 0;
  padding: 0.85rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.overlay-inspector-panel {
  min-width: 0;
}

.overlay-findings-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.overlay-review-focus {
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #a79fec;
  border-radius: 0.35rem;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: 0.68rem;
}

.overlay-detected-toolbar p {
  margin: 0.2rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.67rem;
}

.overlay-finding-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.28rem;
}

.overlay-finding-visible-count {
  margin: 0.32rem 0 0;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.overlay-finding-filter {
  min-height: 1.7rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.62rem;
  white-space: nowrap;
}

.overlay-finding-filter:hover,
.overlay-finding-filter:focus-visible,
.overlay-finding-filter.is-active {
  border-color: #a79fec;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}

.overlay-finding-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.overlay-finding-row {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.65rem 0.1rem;
  border-bottom: 1px solid var(--color-border);
}

.overlay-finding-row[hidden] {
  display: none;
}

.overlay-finding-row.is-review-selected {
  border: 2px solid var(--color-accent-strong);
  border-radius: 0.35rem;
  background: var(--color-accent-soft);
  box-shadow: 0 0 0 3px rgb(167 159 236 / 28%);
}

.result-finding-row.is-review-selected {
  border: 2px solid var(--color-accent-strong);
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  box-shadow: 0 0 0 3px rgb(167 159 236 / 28%);
}

.overlay-finding-icon {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.06rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.overlay-finding-row.is-problem .overlay-finding-icon {
  color: var(--color-danger);
}

.overlay-finding-row.is-decision .overlay-finding-icon {
  color: var(--color-accent-strong);
}

.overlay-finding-row.is-reasoning .overlay-finding-icon,
.overlay-finding-row.is-information .overlay-finding-icon {
  color: var(--color-info);
}

.overlay-finding-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  color: var(--color-text);
  font-size: 0.72rem;
  line-height: 1.35;
}

.overlay-finding-copy strong {
  color: var(--color-text-muted);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overlay-finding-copy small {
  color: var(--color-text-subtle);
  font-size: 0.61rem;
}

.overlay-filter-empty {
  margin: 0.8rem 0;
  color: var(--color-text-muted);
  font-size: 0.7rem;
  text-align: center;
}

.overlay-empty-state {
  margin: 0.75rem 0;
  padding: 0.72rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.overlay-detected-toolbar {
  margin-bottom: 0.75rem;
}

.overlay-detected-filter {
  display: block;
}

.overlay-detected-filter span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}

.overlay-detected-filter select {
  width: 100%;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.7rem;
}

.overlay-detected-filter select:focus {
  border-color: var(--color-accent);
  outline: 2px solid rgb(101 88 211 / 16%);
  outline-offset: 1px;
}

.overlay-detected-list {
  display: grid;
  gap: 0.85rem;
}

.overlay-detected-group {
  display: grid;
}

.overlay-detected-group[hidden] {
  display: none;
}

.overlay-detected-group h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.2rem;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overlay-detected-group h3 span {
  color: var(--color-text-subtle);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

.overlay-detected-item {
  display: grid;
  gap: 0.13rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.67rem;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.overlay-detected-item:hover,
.overlay-detected-item:focus-visible,
.overlay-detected-item.is-selected {
  background: var(--color-surface);
  border-color: #a79fec;
  box-shadow: 0 0 0 2px rgb(101 88 211 / 10%);
}

.overlay-detected-item[hidden] {
  display: none;
}

.overlay-detected-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.overlay-detected-item-title strong {
  color: var(--color-text);
  font-size: 0.7rem;
}

.overlay-detected-item-technical {
  display: none;
  gap: 0.12rem;
  margin-top: 0.3rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.63rem;
}

.overlay-detected-item.is-selected .overlay-detected-item-technical {
  display: grid;
}

.overlay-detected-item-technical > strong {
  color: var(--color-text);
  font-size: 0.62rem;
}

.overlay-detected-item .mono {
  color: var(--color-text-subtle);
  font-size: 0.61rem;
}

.stack > * + * {
  margin-top: 0.65rem;
}

.mt-sm {
  margin-top: 0.75rem;
}

.mt-xs {
  margin-top: 0.25rem;
}

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

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

  .overlay-dialog-body {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}

@media (max-width: 860px) {
  .app-sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    z-index: 25;
    top: 0;
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid var(--color-border);
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(12px);
  }

  .mobile-brand {
    gap: 0.55rem;
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 650;
  }

  .mobile-brand .brand-mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border: 0;
    border-radius: 7px;
  }

  .app-main {
    --app-main-padding-top: 1.2rem;
    --app-main-padding-inline: 1rem;
    --app-main-padding-bottom: 4rem;
    width: 100%;
    margin-left: 0;
    padding: var(--app-main-padding-top) var(--app-main-padding-inline) var(--app-main-padding-bottom);
  }

  .section-nav {
    top: 64px;
  }

  .detail-grid,
  .two-column,
  .detail-grid-balanced,
  .analysis-findings-result-grid {
    grid-template-columns: 1fr;
  }

  .preview-stage {
    min-height: 0;
  }

  .analysis-overlay-section .preview-panel {
    display: block;
    contain: none;
  }

  .analysis-overlay-section .preview-stage {
    min-height: 0;
  }

  .action-artifact-preview .preview-panel,
  .action-artifact-preview .preview-stage {
    min-height: 0;
  }

  .analysis-overlay-section .preview-stage img {
    max-height: 72vh;
  }

  .overlay-dialog {
    margin: 0;
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .overlay-dialog-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 58%) minmax(0, 42%);
  }

  .overlay-dialog-basic .overlay-dialog-body {
    grid-template-rows: minmax(0, 1fr);
  }

  .overlay-inspector {
    border-top: 1px solid #35323a;
    border-left: 0;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .overlay-layer-menu {
    min-width: 148px;
  }

  .overlay-layer-menu[open] {
    grid-column: 1 / -1;
  }

  .overlay-layer-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .overlay-layer-control {
    grid-template-columns: minmax(0, 1fr) 112px;
  }

  .overlay-layer-control + .overlay-layer-control {
    border-top: 1px solid var(--color-border);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .page-header {
    display: block;
  }

  .page-actions {
    justify-content: flex-start;
    margin-top: 1rem;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .job-metric-card {
    padding: 0.75rem;
  }

  .search-field {
    width: 100%;
  }

  th,
  td {
    padding: 0.65rem 0.7rem;
  }

  .hide-small {
    display: none;
  }

  .preview-stage {
    min-height: 0;
    padding: 0.5rem;
  }

  .analysis-overlay-section .preview-stage {
    min-height: 0;
  }

  .action-artifact-preview .preview-panel,
  .action-artifact-preview .preview-stage {
    min-height: 0;
  }

  .analysis-overlay-section .preview-image-frame {
    inset: 0.5rem;
  }

  .overlay-dialog-header {
    min-height: 56px;
    gap: 0.5rem;
    padding: 0.55rem 0.6rem 0.55rem 0.75rem;
  }

  .overlay-dialog-header .overlay-dialog-heading {
    display: grid;
  }

  .overlay-dialog-dimensions,
  .overlay-tool-divider {
    display: none;
  }

  .overlay-dialog-header .overlay-dialog-heading h2 {
    font-size: 0.8rem;
  }

  .overlay-viewer-tools {
    gap: 0.22rem;
  }

  .overlay-dialog-close {
    margin-left: 0.45rem;
  }

  .viewer-tool-button {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .overlay-zoom-value {
    width: 40px;
    font-size: 0.61rem;
  }

  .overlay-dialog-body {
    grid-template-rows: minmax(220px, 55%) minmax(0, 45%);
  }

  .overlay-dialog-basic .overlay-dialog-body {
    grid-template-rows: minmax(0, 1fr);
  }

  .overlay-canvas-space {
    padding: 16px;
  }

  .overlay-layer-control {
    grid-template-columns: minmax(0, 1fr) 106px;
    padding: 0.48rem 0.55rem;
  }

  .overlay-opacity-control {
    grid-template-columns: minmax(0, 1fr) 31px;
    gap: 0.25rem;
    padding: 0;
  }

  .overlay-inspector-panels {
    padding: 0.65rem;
  }

  .overlay-layer-menu-summary {
    display: none;
  }

  .overlay-findings-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .overlay-finding-filters {
    justify-content: flex-start;
  }

  .definition-list,
  dl {
    grid-template-columns: 1fr;
  }

  .definition-list dt,
  dl dt {
    padding-bottom: 0.1rem;
    border-bottom: 0;
  }

  .definition-list dd,
  dl dd {
    padding-top: 0;
    text-align: left;
  }

  .attention-row {
    grid-template-columns: 18px 1fr;
  }

  .attention-row .issue-list {
    grid-column: 2;
  }
}

.workflow-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.workflow-intro h2 {
  margin-bottom: 0;
}

.workflow-graph {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(var(--color-surface-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-surface-subtle) 1px, transparent 1px),
    var(--color-canvas);
  background-size: 18px 18px;
  box-shadow: var(--shadow-sm);
}

.workflow-canvas {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--workflow-columns), minmax(190px, 1fr));
  grid-auto-rows: minmax(108px, auto);
  gap: 7rem 3rem;
  min-width: calc(var(--workflow-columns) * 300px);
  min-height: 360px;
  padding: 1.5rem;
}

.workflow-connections {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.workflow-connection-path {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}

.workflow-connection-label {
  fill: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-anchor: middle;
}

.workflow-connection-label-background {
  fill: var(--color-surface);
  stroke: var(--color-border-strong);
  stroke-width: 1;
}

.workflow-graph-node {
  z-index: 1;
  align-self: center;
  min-width: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.workflow-graph-node h3 {
  margin: 0.16rem 0 0;
  font-size: 0.82rem;
}

.workflow-graph-node p {
  margin: 0.48rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.workflow-graph-node--input {
  border-color: #d6d0fb;
  background: var(--color-accent-soft);
}

.workflow-graph-node--input .workflow-node-type {
  color: var(--color-accent-strong);
}

.workflow-graph-node--result {
  border-color: #bfe8d6;
  background: var(--color-success-soft);
}

.workflow-graph-node--result .workflow-node-type {
  color: var(--color-success);
}

.workflow-contract,
.workflow-handoff {
  display: grid;
  margin: 0;
}

.workflow-contract {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: min(100%, 490px);
  gap: 0;
}

.workflow-contract > div {
  min-width: 0;
  padding: 0 1rem;
  border-left: 1px solid var(--color-border);
}

.workflow-contract > div:first-child {
  border-left: 0;
}

.workflow-contract dt,
.workflow-handoff dt {
  margin-bottom: 0.16rem;
  color: var(--color-text-subtle);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.workflow-contract dd,
.workflow-handoff dd {
  min-width: 0;
  margin: 0;
  color: var(--color-text);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.workflow-path {
  width: min(100%, 920px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow-input,
.workflow-result {
  position: relative;
  display: grid;
  gap: 0.08rem;
  width: min(100%, 360px);
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface-subtle);
  box-shadow: var(--shadow-sm);
}

.workflow-input strong,
.workflow-result strong {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.workflow-input > span:last-child,
.workflow-result > span:last-child {
  color: var(--color-text-muted);
  font-size: 0.72rem;
}

.workflow-result {
  margin-top: 1.35rem;
  border-color: #bfe8d6;
  background: var(--color-success-soft);
}

.workflow-result .workflow-connector {
  top: -1.35rem;
}

.workflow-node-type {
  color: var(--color-accent);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.workflow-step {
  position: relative;
  padding-top: 1.35rem;
}

.workflow-connector {
  position: absolute;
  top: 0;
  left: 1.29rem;
  width: 3px;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--color-accent);
}

.workflow-card,
.workflow-exit {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.workflow-card {
  padding: 0.9rem 1rem;
}

.workflow-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

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

.workflow-card-heading .ui-badge {
  margin-left: auto;
}

.workflow-card h3,
.workflow-exit h3 {
  margin: 0.08rem 0 0;
  font-size: 0.9rem;
}

.workflow-index {
  display: inline-grid;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: 0.67rem;
  font-weight: 750;
}

.workflow-card > p,
.workflow-exit > p {
  margin: 0.65rem 0 0.8rem;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.workflow-handoff {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--color-border);
}

.workflow-exits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.workflow-exit {
  padding: 1rem;
}

.workflow-exit .workflow-handoff {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}

@media (max-width: 760px) {
  .workflow-intro {
    display: block;
  }

  .workflow-contract {
    margin-top: 1rem;
  }

  .workflow-exits {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .workflow-contract,
  .workflow-handoff,
  .workflow-exit .workflow-handoff {
    grid-template-columns: 1fr;
  }

  .workflow-contract > div {
    padding: 0.5rem 0;
    border-top: 1px solid var(--color-border);
    border-left: 0;
  }

  .workflow-contract > div:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .workflow-handoff > div + div {
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
  }
}

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

@media print {
  .app-sidebar,
  .mobile-header,
  .section-nav,
  .page-actions,
  .ui-toolbar,
  .row-action,
  .overlay-dialog {
    display: none !important;
  }

  .app-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .job-workspace {
    margin: 0;
  }

  .accordion {
    break-inside: avoid;
    box-shadow: none;
  }
}
