/* UX/UI audit 5.4.1: responsive layout, readability and touch accessibility. */
body { min-width: 0; }
.bg-grid {
  -webkit-mask-image: linear-gradient(180deg, black 0%, rgba(0, 0, 0, .65) 48%, transparent 100%);
}
/* Long organizational names and imported values must remain inside their containers. */
.modal-header h2, .modal-header p, .panel-header h2, .panel-header p, .finder-copy h2, .finder-copy p, .position-main strong, .position-main small, .unit-position-main strong, .unit-position-main small, .relation-card strong, .relation-card small, .current-position-card strong, .info-section p, dd, .notice, .form-notice, .help-steps span, .unit-picker-row strong, .unit-picker-row small, .backend-member-row strong, .backend-member-row small{
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Readable secondary text and a consistent minimum control size. */
.eyebrow,
.section-kicker { font-size: 11px; }
.user-chip, .icon-btn, .unit-position-open{ min-height: var(--touch-target); }
.icon-btn,
.unit-position-open { min-width: var(--touch-target); width: var(--touch-target); height: var(--touch-target); }

.user-chip { min-height: var(--touch-target); }

.guide-card > .icon-btn { width: var(--touch-target); height: var(--touch-target); }
.tree-toggle { width: var(--touch-target); min-height: var(--touch-target); }
.tree-label { min-height: var(--touch-target); }
.branch-toggle { min-height: var(--touch-target); }


.summary-item span, .summary-item small, .tree-help, .list-caption, .tree-name, .panel-header p, .modal-header p, .relation-card small, .current-position-card span, .current-position-card small, .position-facts small, .quality-card span, .quality-card small, .form-notice, .login-sso-note, .privacy-note, .field-help, .voice-input-status, .picker-meta, .unit-picker-row small, .unit-picker-row em, .process-stage small, .process-events b, .process-events em{
  font-size: 11px;
  line-height: 1.42;
}

.chip, .status-label, .assignment-badge, .level-label, dt, .factor-code-hint, .factor-code-hint strong, .expert-preview-metrics span{
  font-size: 10px;
  line-height: 1.35;
}

.quality-table-wrap td strong { font-size: 13px; }
.quality-table-wrap td small { font-size: 11px; line-height: 1.4; }
.quality-table-wrap th { font-size: 11px; line-height: 1.3; }
.modal-form label,
.login-form label,
.expert-factor-grid label { font-size: 12px; }
.modal-form input,
.modal-form textarea,
.modal-form select,
.login-form input { min-height: var(--control-height); }
.modal-form textarea { min-height: 112px; line-height: 1.5; }

/* Prevent fixed feedback from hiding controls or leaving the viewport. */
.global-error,
.toast {
  max-width: min(620px, calc(100vw - 32px));
  overflow-wrap: anywhere;
}

/* More stable intermediate layout before the mobile breakpoint. */
@media (max-width: 1080px) {
  .topbar { gap: 14px; }
  .top-actions { min-width: 0; }
  
}

@media (max-width: 720px) {
  :root { --touch-target: 44px; }

  .page { padding: 10px; }
  .topbar {
    min-width: 0;
    padding: 12px;
    column-gap: var(--space-2);
    row-gap: 10px;
  }
  .brand { min-width: 0; gap: 10px; }
  .brand-light > div { min-width: 0; }
  .brand-light strong {
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-mark { width: 42px; height: 42px; }
  .top-actions { gap: 7px; }
  
  .icon-btn.light { width: var(--touch-target); height: var(--touch-target); }

  /* Three navigation items always fit the viewport without page-level horizontal scrolling. */
  .topnav {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-1);
  }
  .nav-btn {
    min-width: 0;
    
    padding: 8px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    overflow-wrap: anywhere;
    text-align: center;
    
    font-size: 12px;
    line-height: 1.25;
  }
  .nav-count { flex: 0 0 auto; margin-left: 1px; }

  .guide-card { padding: 18px 18px 16px; }
  .guide-card > .icon-btn { top: 10px; right: 10px; }
  .guide-card h1 { padding-right: 38px; font-size: clamp(21px, 7vw, 26px); line-height: 1.18; }
  .guide-card p { font-size: 13px; line-height: 1.48; }
  .guide-steps span { font-size: 11px; line-height: 1.3; }

  /* Summary cards are visible as a grid instead of a hidden horizontal carousel. */
  .summary-strip {
    
    
    
    
    scroll-snap-type: none;
  }
  .summary-item{
    min-width: 0;
    width: auto;
    scroll-snap-align: none;
  }
  
  .summary-item { min-height: 116px; }

  .finder-card { min-width: 0; }
  .finder-search,
  .unit-picker-button { min-width: 0; }
  .finder-search input,
  .modal-form input,
  .modal-form textarea,
  .modal-form select,
  .login-form input {
    font-size: 16px;
  }

  /* Specificity-safe full-screen dialogs on phones. */
  .modal-backdrop {
    padding: 0;
    overflow: hidden;
    place-items: stretch;
  }
  .modal,
  .modal.medium,
  .modal.small {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .modal-header {
    flex: 0 0 auto;
    padding: 18px 62px 16px 18px;
    gap: var(--space-3);
  }
  .modal-header h2 { font-size: clamp(22px, 7vw, 28px); }
  .modal-close { top: 10px; right: 10px; }
  .modal-body,
  .modal-form,
  .help-content,
  .picker-content,
  .expert-line-form,
  .process-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .modal-toolbar { flex: 0 0 auto; }
  .modal-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-tab { min-height: 48px; font-size: 12px; }

  .toolbar-actions .btn,
  .form-actions .btn,
  .picker-actions .btn { min-height: 48px; }
  .form-actions { flex-wrap: wrap; }

  .quality-grid {
    display: grid;
    
    overflow: visible;
  }
  

  .toast {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    max-width: none;
  }
  .global-error {
    top: 82px;
    left: 10px;
    right: 10px;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .login-page { padding: 10px; }
  .login-card { padding: 24px 20px; border-radius: var(--radius-dialog); }
  .login-card h1 { font-size: 27px; }
  .login-card .lead { font-size: 13px; line-height: 1.5; }
  .login-sso-note,
  .privacy-note { font-size: 11px; }

  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item { padding: 12px; }
  .summary-item strong { font-size: 23px; }
  .modal-tabs { grid-template-columns: 1fr 1fr; }
  .relation-grid { grid-template-columns: 1fr; }
  .position-facts { grid-template-columns: 1fr; }
  .position-facts .status-label { grid-column: auto; }
}

@media (forced-colors: active) {
  .btn, .icon-btn, .nav-btn, .panel, .modal, .summary-item{ border: 1px solid CanvasText; }
  .nav-btn.active,
  .btn.primary { forced-color-adjust: none; }
}

/* Final readability corrections from the responsive browser pass. */
.skip-link { min-height: var(--control-height); display: inline-flex; align-items: center; }
.tree-label em, .unit-hierarchy-meta, .hierarchy-column-label, .unit-position-main small, .unit-picker-button small, .backend-member-row small{ font-size: 11px; line-height: 1.4; }
.unit-position-marker { font-size: 10px; }
.position-title-line { max-width: 100%; }
.position-title-line > strong { min-width: 0; max-width: 100%; }
.unit-position-main .position-title-line { width: 100%; display: flex; }
.unit-position-main strong {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
@media (max-width: 720px) {
  
  .unit-position-main small { white-space: normal; overflow-wrap: anywhere; }
}

/* Dialog form and assessment usability. */
.quality-table-wrap .btn.compact { min-height: 40px; }
.voice-input-button { width: 36px; height: 36px; right: 6px; }
.voice-field-shell > input,
.voice-field-shell > textarea { padding-right: 50px; }

@media (max-width: 720px) {
  .quality-table-wrap .btn.compact { min-height: var(--control-height); }
  .voice-input-button {   right: 6px; }
  .voice-field-shell.is-textarea .voice-input-button { top: 7px; }
  .voice-field-shell > input,
  .voice-field-shell > textarea { padding-right: 54px; }

  .assessment-header,
  .assessment-result-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .assessment-header > div:first-child,
  .assessment-result-header > div:first-child { min-width: 0; }
  .assessment-header .grade-box,
  .assessment-result-header .grade-box {
    width: 100%;
    min-height: 62px;
    flex-direction: row;
    justify-content: space-between;
  }
  .assessment-section-title h3 { font-size: 18px; line-height: 1.3; }
  .assessment-section-title p { font-size: 13px; line-height: 1.5; }
  .assessment-form textarea,
  .assessment-form input[type="text"],
  .assessment-form select { font-size: 16px; }

  /* Primary actions remain reachable in long edit forms. */
  .modal-form > .form-actions {
    position: sticky;
    z-index: 4;
    bottom: -24px;
    margin: 0 -23px -24px;
    padding: 12px 18px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -10px 24px rgba(7, 28, 51, .08);
  }
  .modal-form > .form-actions .btn { flex: 1 1 140px; min-height: 48px; }
  .assessment-footer {
    position: sticky;
    z-index: 4;
    bottom: 0;
    padding: 14px 16px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 24px rgba(7, 28, 51, .08);
  }
  .assessment-footer .btn { min-height: 48px; }
}

/* 5.5.0: deterministic assessment report, review workspace and Excel import. */
.assessment-workspace-tabs {
  flex: 0 0 auto;
  padding: 0 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.assessment-workspace-tabs button {
  min-width: 0;
  min-height: 52px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--steel);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}
.assessment-workspace-tabs button:hover { color: var(--blue); background: var(--soft); }
.assessment-workspace-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.assessment-workspace-tabs button span {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--surface);
  background: var(--blue);
  font-size: 11px;
}
.assessment-workspace-panel { display: grid; gap: 18px; }
.workspace-section-heading {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
}
.workspace-section-heading > div { min-width: 0; }
.workspace-section-heading span, .fixed-report-summary span, .context-placement-card > span, .context-manager-card > div > span, .position-workspace-hero span{
  color: var(--blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.workspace-section-heading h3{ margin: 3px 0 0; color: var(--dark); font-size: 20px; }
.workspace-section-heading p{ max-width: 520px; margin: 0; color: var(--steel); font-size: 12px; line-height: 1.5; }

.fixed-report-summary, .fixed-factor-report, .fixed-context-block, .fixed-critic-block, .review-conflicts-section, .position-workspace-grid{
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.report-summary-metrics {
  display: grid;
  
  gap: 10px;
}
.report-summary-metrics > div {
  min-width: 0;
  padding: 16px;
  border-radius: var(--radius-md);
  color: var(--surface);
  background: linear-gradient(135deg, var(--blue), #123f72);
}
.report-summary-metrics span,
.report-summary-metrics strong { display: block; }
.report-summary-metrics span { color: rgba(255, 255, 255, .72); }
.report-summary-metrics strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 23px; }
.assessment-line-block {
  margin-top: 12px;
  padding: 15px 17px;
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(0, 2fr);
  gap: 18px;
  align-items: start;
  border-radius: var(--radius-md);
  background: var(--soft);
}
.assessment-line-block strong { display: block; margin-top: 4px; }
.assessment-line-block ul { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.assessment-line-block li { overflow-wrap: anywhere; line-height: 1.45; }
.fixed-factor-list { display: grid; gap: 14px; }
.fixed-factor-card {
  position: relative;
  padding: 18px;
  display: grid;
  
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.fixed-factor-card.factor-card-orange {
  border-left-color: var(--orange);
  background: #fffcf5;
}
.assessment-warnings-banner {
  margin-bottom: 12px;
}
.fixed-factor-card > header {
  
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.fixed-factor-card > header span { color: var(--blue); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.fixed-factor-card h3 { margin: 3px 0 0; font-size: 19px; }
.fixed-factor-card h4,
.critic-reason h4,
.position-workspace-grid h4 { margin: 0 0 7px; color: var(--blue); font-size: 12px; }
.fixed-factor-card section {
  min-width: 0;
  padding: 13px;
  border-radius: 10px;
  background: var(--soft);
}
.fixed-factor-card section p { margin: 0; white-space: pre-line; line-height: 1.58; }
.factor-score { min-width: 120px; text-align: right; }
.factor-score strong,
.factor-score small { display: block; }
.factor-score strong { color: var(--blue); font-size: 22px; }
.factor-score small { margin-top: 3px; color: var(--steel); }


.report-evidence-list,
.report-analysis-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.report-evidence-list li,
.report-analysis-steps li { line-height: 1.5; }
.report-quotes { display: grid; gap: var(--space-2); }
.report-quotes blockquote {
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid var(--blue);
  border-radius: 0 9px 9px 0;
  color: #24384f;
  background: var(--surface);
  line-height: 1.55;
}
.report-empty-copy { margin: 0; color: var(--steel); font-size: 12px; line-height: 1.5; }

.fixed-context-block,
.fixed-critic-block { background: linear-gradient(180deg, var(--color-surface-alt), var(--surface)); }
.context-placement-card, .context-manager-card, .review-intro, .position-workspace-hero{
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.context-placement-card strong,
.context-manager-card strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.reporting-chain { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.reporting-chain span { padding: 6px 8px; border-radius: var(--radius-sm); color: var(--ink); background: var(--soft); font-size: 11px; }
.reporting-chain i { color: var(--steel); font-style: normal; }
.context-manager-card { margin-top: 11px; }
.context-manager-card small { display: block; margin-top: 3px; color: var(--steel); }
.context-manager-card p { margin: 10px 0 0; line-height: 1.55; }
.context-groups-grid { margin-top: 11px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.context-role-section { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.context-role-section > header > div { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.context-role-section > header span { color: var(--steel); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.context-role-section > header strong { color: var(--blue); font-size: 23px; }
.context-role-list { margin-top: 10px; display: grid; gap: var(--space-2); }
.context-role-list article { padding: 11px; border-radius: 10px; background: var(--soft); }
.context-role-list strong,
.context-role-list small { display: block; }
.context-role-list small { margin-top: 3px; color: var(--steel); }
.context-role-list details { margin-top: 8px; }
.context-role-list summary { color: var(--blue); font-size: 11px; font-weight: 800; cursor: pointer; }
.context-role-list details .report-evidence-list { margin-top: 8px; }
.critic-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.critic-summary-grid > div { padding: 13px; border-radius: 10px; background: var(--soft); }
.critic-summary-grid span,
.critic-summary-grid strong { display: block; }
.critic-summary-grid span { color: var(--steel); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.critic-summary-grid strong { margin-top: 4px; overflow-wrap: anywhere; }
.critic-reason { margin-top: 11px; padding: 14px; border-radius: 11px; background: var(--soft); }
.critic-reason p { margin: 0; white-space: pre-line; line-height: 1.6; }

.review-workspace { gap: 14px; }
.review-intro { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.review-intro.attention { border-left: 4px solid #d38a00; background: var(--color-warning-surface); }
.review-intro.clear { border-left: 4px solid var(--green); background: #f4fbf7; }
.review-intro span { color: var(--steel); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.review-intro h3 { margin: 4px 0; }
.review-intro p { margin: 0; color: var(--steel); line-height: 1.5; }
.review-intro > strong { min-width: 84px; color: var(--blue); font-size: 26px; text-align: right; }


.review-conflict-list,
.review-question-list { display: grid; gap: 10px; }
.review-conflict-list article { padding: 14px; border-left: 4px solid #d38a00; border-radius: 10px; background: var(--color-warning-surface); }
.review-conflict-list article > div { display: flex; align-items: center; gap: var(--space-2); }
.review-conflict-list span { color: var(--color-warning-strong); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.review-conflict-list b { padding: 3px 6px; border-radius: var(--radius-pill); color: var(--surface); background: var(--blue); font-size: 9px; }
.review-conflict-list p { margin: 7px 0 0; line-height: 1.55; }
.review-question-card { padding: 14px; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.review-question-card .question-number { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--surface); background: var(--blue); font-size: 11px; font-weight: 900; }
.review-question-card .question-content { min-width: 0; display: grid; gap: 7px; }
.review-question-card small { color: var(--steel); line-height: 1.45; }
.review-question-card textarea {
  width: 100%;
  min-height: 96px;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  line-height: 1.5;
}
.review-question-card textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 47, 108, .08); outline: none; }


.position-workspace-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); }
.position-workspace-hero h3 { margin: 4px 0; font-size: 24px; }
.position-workspace-hero p { margin: 0; color: var(--steel); }
.position-workspace-hero > div:last-child { min-width: 150px; text-align: right; }
.position-workspace-hero strong,
.position-workspace-hero small { display: block; }
.position-workspace-hero strong { margin-top: 4px; font-size: 20px; }
.position-workspace-hero small { margin-top: 3px; color: var(--steel); }
.position-workspace-grid {  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.position-workspace-grid section { min-width: 0; padding: 14px; border-radius: 10px; background: var(--soft); }
.position-workspace-grid p { margin: 0; white-space: pre-line; line-height: 1.58; }
.position-context-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.position-workspace-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }

@media (max-width: 900px) {
  .report-summary-metrics,
  .critic-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fixed-factor-card { grid-template-columns: 1fr; }
  .fixed-factor-card > header { grid-column: auto; }
  .context-groups-grid,
  .position-workspace-grid { grid-template-columns: 1fr; }
  
}

@media (max-width: 720px) {
  .assessment-workspace-tabs { padding: 0 8px; grid-template-columns: 1fr; gap: 0; }
  .assessment-workspace-tabs button { min-height: var(--control-height); justify-content: flex-start; border-bottom-width: 1px; }
  .assessment-workspace-tabs button.active { border-bottom-width: 3px; }
  .assessment-result-body { padding: 14px; }
  .workspace-section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .report-summary-metrics,
  .critic-summary-grid,
  .position-context-strip { grid-template-columns: 1fr; }
  .assessment-line-block { grid-template-columns: 1fr; gap: 10px; }
  .fixed-report-summary, .fixed-factor-report, .fixed-context-block, .fixed-critic-block, .review-conflicts-section, .position-workspace-grid{ padding: 14px; }
  .fixed-factor-card { padding: 14px; }
  
  .context-groups-grid { grid-template-columns: 1fr; }
  .review-intro, .position-workspace-hero{ align-items: stretch; flex-direction: column; }
  .review-intro > strong,
  .position-workspace-hero > div:last-child { min-width: 0; text-align: left; }
  .review-question-card { grid-template-columns: 26px minmax(0, 1fr); padding: 12px; }
  .position-workspace-actions { display: grid; grid-template-columns: 1fr; }
  .position-workspace-actions .btn{ width: 100%; }
}

/* 5.5.1: compact icon language and final UX/UI density audit. */
.ui-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
}

/* Tooltips use the native title bubble: it stays viewport-safe and adds no layout overflow. */

.topbar { gap: 18px; }
.topnav { min-width: 0; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.nav-btn .ui-icon { width: 16px; height: 16px; opacity: .86; }
.nav-btn.active .ui-icon,
.nav-btn:hover .ui-icon { opacity: 1; }
.top-actions { flex: 0 0 auto; }
.compact-user {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .19);
  border-radius: 11px;
}
.compact-user .ui-icon { width: 19px; height: 19px; }
.brand-title-short { display: none; }

.finder-card { grid-template-columns: minmax(280px, .7fr) minmax(360px, 1.35fr) minmax(220px, .5fr); }
.finder-copy { min-width: 0; }
.finder-kicker-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.snapshot-inline {
  min-height: 26px;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 47, 108, .14);
  border-radius: var(--radius-pill);
  color: var(--blue);
  background: var(--color-brand-muted);
}
.snapshot-inline .ui-icon { width: 14px; height: 14px; }
.snapshot-inline strong { font-size: 10px; line-height: 1; }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  overflow: visible;
}
.summary-item.compact-summary {
  min-width: 0;
  min-height: 76px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 11px;
  scroll-snap-align: none;
}
.summary-item.compact-summary.warning { border-left-width: 4px; }
.summary-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--blue);
  background: #edf4fb;
}
.summary-item.warning .summary-icon { color: var(--color-warning-strong); background: var(--color-warning-soft); }
.summary-icon .ui-icon { width: 19px; height: 19px; }
.summary-copy { min-width: 0; display: flex; flex-direction: column; }
.summary-item.compact-summary .summary-copy strong {
  margin: 0;
  color: var(--blue);
  font-size: 23px;
  line-height: 1.05;
}
.summary-item.compact-summary .summary-copy small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--steel);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
}

.panel-actions { align-items: center; }
.icon-btn.panel-icon{
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}
.icon-btn.danger-icon { color: #a02029; border-color: rgba(227, 6, 19, .22); background: var(--color-danger-soft); }
.structure-hint-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--steel);
  background: var(--soft);
}
.structure-hint-icon .ui-icon { width: 17px; height: 17px; }
.tree-help,
.list-caption { padding-top: 8px; padding-bottom: 8px; }
.tree-source-marker {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 47, 108, .15);
  border-radius: 7px;
  color: var(--blue);
  background: var(--surface);
}
.tree-source-marker.warning { color: #825409; border-color: rgba(178, 106, 0, .2); background: #fff8e9; }
.tree-source-marker .ui-icon { width: 13px; height: 13px; }

.icon-metric,
.icon-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 47, 108, .12);
  border-radius: 10px;
  color: var(--blue);
  background: var(--soft);
}
.icon-metric { min-width: 46px; padding: 5px 8px; gap: 5px; }
.icon-status { width: 34px; min-width: 34px; padding: 0; }
.icon-metric .ui-icon,
.icon-status .ui-icon { width: 15px; height: 15px; }
.icon-metric strong { color: currentColor; font-size: 12px; line-height: 1; }
.icon-metric.warning,
.icon-status.warning { color: var(--color-warning-strong); border-color: rgba(178, 106, 0, .2); background: var(--color-warning-soft); }
.icon-status.success,
.icon-metric.success { color: var(--green); border-color: rgba(31, 122, 77, .18); background: #edf8f2; }
.icon-status.modified,
.icon-metric.modified { color: #7048a0; border-color: rgba(112, 72, 160, .18); background: #f5effb; }
.icon-status.context { color: #526273; border-style: dashed; border-color: #a6b4c0; background: #f4f6f8; }
.icon-status.grouped { color: var(--blue); background: var(--color-brand-soft); }

.position-facts { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.position-open {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  justify-self: end;
  border-radius: 10px;
  color: var(--blue);
  background: var(--color-brand-soft);
}
.position-open .ui-icon { width: 17px; height: 17px; }

.unit-hierarchy-meta {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.unit-hierarchy-meta .icon-metric,
.unit-hierarchy-meta .icon-status { min-height: 32px; }
.hierarchy-column-label {
  min-height: 34px;
  margin: 0 0 6px 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hierarchy-column-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hierarchy-column-label .icon-metric { min-height: 30px; }
.unit-position-card {
  grid-template-columns: 24px minmax(210px, 1fr) auto 38px auto 40px;
  gap: var(--space-2);
}
.unit-position-card > .icon-metric,
.unit-position-card > .icon-status { justify-self: center; }
.icon-branch-toggle {
  min-width: 54px;
  min-height: 34px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
}
.icon-branch-toggle .ui-icon { width: 15px; height: 15px; }
.icon-branch-toggle span { line-height: 1; }
.unit-position-open { display: grid; place-items: center; }
.unit-position-open .ui-icon { width: 17px; height: 17px; }
.backend-member-row { min-height: 52px; }
.backend-member-row > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 1 1 auto; }
.backend-member-meta { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.backend-member-meta .icon-metric { min-height: 30px; min-width: 42px; padding: 4px 7px; }
.backend-member-row em { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; }
.backend-member-row em .ui-icon { width: 16px; height: 16px; }

.quality-grid {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: var(--space-2);
  overflow: visible;
}
.quality-card {
  min-width: 0;
  min-height: 88px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: center;
  gap: 4px 8px;
}


.quality-card strong { align-self: end; font-size: 21px; line-height: 1; }
.quality-card-label {
  min-width: 0;
  align-self: start;
  overflow-wrap: anywhere;
  color: var(--steel);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}


.result-row { grid-template-columns: minmax(0, 1fr) auto 42px; }
.result-row em { width: 40px; height: 40px; display: grid; place-items: center; }
.result-row em .ui-icon { width: 18px; height: 18px; }

.assessment-readiness {
  grid-template-columns: 36px minmax(0, 1fr);
  min-width: 0;
  padding: 12px 14px;
}
.assessment-readiness > div:last-child { min-width: 0; }
.assessment-readiness strong { line-height: 1.35; }
.readiness-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}
.readiness-icon .ui-icon { width: 18px; height: 18px; }
.assessment-readiness.success .readiness-icon { color: var(--green); background: var(--surface); }
.assessment-readiness.warning .readiness-icon { color: var(--color-warning-strong); background: var(--surface); }
.toolbar-actions { align-items: center; }
.toolbar-actions .btn.primary { white-space: nowrap; }

@media (max-width: 1180px) {
  .finder-card { grid-template-columns: minmax(250px, .8fr) minmax(320px, 1.3fr); }
  .unit-picker-button { grid-column: 1 / -1; }
  .unit-position-card { grid-template-columns: 22px minmax(170px, 1fr) auto 38px auto 40px; }
}

@media (max-width: 980px) {
  .finder-card { grid-template-columns: 1fr; }
  .finder-copy { display: block; }
  .finder-copy h2,
  .finder-copy p { display: none; }
  .finder-kicker-row { justify-content: space-between; }
  .summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { gap: var(--space-2); }
  .brand-light strong { max-width: 205px; }
  .top-actions { margin-left: auto; }
  .compact-user { display: inline-grid; width: 44px; min-width: 44px; height: 44px; min-height: var(--control-height); }
  .nav-btn { min-height: 46px; gap: 5px; white-space: nowrap; }
  .nav-btn .ui-icon { width: 15px; height: 15px; }

  .finder-card { padding: 10px; }
  .finder-copy { grid-row: 1; }
  .finder-kicker-row .section-kicker { font-size: 10px; }
  .snapshot-inline { min-height: 28px; }

  .summary-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    overflow: visible;
  }
  .summary-item.compact-summary {
    width: auto;
    min-width: 0;
    min-height: 74px;
    padding: 11px;
  }
  .summary-icon { width: 32px; height: 32px; }
  .summary-item.compact-summary .summary-copy strong { font-size: 21px; }
  .summary-item.compact-summary .summary-copy small { font-size: 10px; }

  .panel-header { align-items: flex-start; }
  .panel-actions { width: auto; align-self: flex-end; flex-direction: row; }
  .panel-header .panel-actions .icon-btn { width: 44px; min-width: 44px; height: 44px; }

  .unit-hierarchy { padding: 8px; }
  .unit-hierarchy-meta { align-items: center; flex-direction: row; gap: 5px; }
  .hierarchy-column-label { align-items: center; flex-direction: row; }
  .unit-position-card {
    grid-template-columns: 22px minmax(0, 1fr) 44px;
    grid-template-areas:
      "level title open"
      ". count status"
      ". branch branch";
    align-items: center;
    gap: 7px;
  }
  .unit-position-marker { grid-area: level; }
  .unit-position-main { grid-area: title; }
  .unit-position-card > .position-count { grid-area: count; justify-self: start; }
  .unit-position-card > .position-status { grid-area: status; justify-self: end; }
  .unit-position-card > .icon-branch-toggle { grid-area: branch; justify-self: start; }
  .unit-position-card > .branch-spacer { display: none; }
  .unit-position-open { grid-area: open; width: 44px; height: 44px; }
  .icon-branch-toggle { min-height: 36px; }
  .backend-member-row > span { align-items: flex-start; flex-direction: column; gap: 6px; }

  .position-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .position-main { grid-column: 1; }
  .position-open { grid-row: 1; grid-column: 2; width: 44px; height: 44px; }
  .position-facts { grid-column: 1 / -1; display: flex; justify-content: flex-start; flex-wrap: wrap; }

  .quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-card { min-width: 0; }
  

  .toolbar-actions {
    display: grid;
    
    gap: 7px;
  }
  .toolbar-actions .btn.primary { width: 100%; }
  

  .result-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .result-row-metrics { grid-column: 1; text-align: left; }
  .result-row em { grid-row: 1 / 3; grid-column: 2; align-self: center; }
}

@media (max-width: 420px) {
  .brand-light strong { max-width: 160px; }
  .brand-title-full { display: none; }
  .brand-title-short { display: inline; }
  .nav-btn { padding-left: 4px; padding-right: 4px; font-size: 11px; }
  .nav-btn .ui-icon { display: none; }
  .summary-item.compact-summary { gap: var(--space-2); }
  .summary-icon { width: 30px; height: 30px; }
  .quality-card { min-height: 82px; }
}


/* 5.5.1 finishing pass: touch targets, notices and compact relationship actions. */
.relation-card em {
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  justify-self: end;
  color: var(--blue);
  border-radius: 9px;
  background: var(--color-brand-soft);
  text-align: center;
}
.relation-card em .ui-icon { width: 16px; height: 16px; }
.icon-btn.light .ui-icon { width: 18px; height: 18px; }
.storage-warning strong { flex: 0 0 auto; }
.storage-warning span { min-width: 0; flex: 1 1 auto; }

@media (max-width: 720px) {
  .notice { flex-direction: column; }
  .btn.compact { min-height: var(--control-height); }
  .voice-input-button { width: 44px; min-width: 44px; height: 44px; min-height: var(--control-height); }
  .relation-card { grid-template-columns: 38px minmax(0, 1fr) 36px; }
  .relation-card em { grid-column: 3; grid-row: 1; min-width: 32px; text-align: center; }
}

/* 5.5.1 compact picker counters and report summary. */
.compact-picker-meta {
  width: max-content;
  min-height: 30px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--blue);
  background: var(--soft);
}
.compact-picker-meta .ui-icon { width: 15px; height: 15px; }
.compact-picker-meta strong { font-size: 12px; line-height: 1; }
.unit-picker-row .unit-picker-count {
  min-width: 46px;
  min-height: 32px;
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(0, 47, 108, .12);
  border-radius: 9px;
  color: var(--blue);
  background: var(--soft);
}
.unit-picker-count .ui-icon { width: 14px; height: 14px; }
.unit-picker-count strong { display: inline; color: currentColor; font-size: 11px; }
.report-summary-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 720px) {
  .report-summary-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-summary-metrics > div { min-height: 92px; padding: 13px; }
  .report-summary-metrics > div:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 78px; }
  .report-summary-metrics strong { font-size: 21px; }
}

/* 2026-07: controlled position editor, layers and delegated deletion. */
.access-page { display: flex; flex-direction: column; gap: 18px; }
.access-hero {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
}
.access-hero h1 { margin: 4px 0 6px; font-size: 25px; }
.access-hero p { max-width: 760px; margin: 0; color: var(--steel); }
.access-hero-icon { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; color: var(--blue); background: var(--color-brand-soft); }
.access-hero-icon .ui-icon { width: 24px; height: 24px; }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.access-card { padding: 20px; min-width: 0; }
.access-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: 16px; }
.access-card h2 { margin: 3px 0 0; font-size: 19px; }
.delegation-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--soft); }
.delegation-form label { display: flex; flex-direction: column; gap: 6px; color: var(--color-text-secondary); font-size: 11px; font-weight: 750; }
.delegation-form input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.delegation-list { display: flex; flex-direction: column; gap: var(--space-2); }
.delegation-row { min-height: 62px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.delegation-row > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.delegation-row strong { overflow-wrap: anywhere; }
.delegation-row span { color: var(--steel); font-size: 11px; }
.delegation-row.read-only > .ui-icon { width: 18px; color: var(--green); }

.form-mode-switch, .layer-switch { display: inline-flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #eef3f7; }
.form-mode-switch { align-self: flex-start; }
.form-mode-switch button, .layer-switch button { min-height: 34px; padding: 7px 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: var(--radius-sm); color: #536174; background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.form-mode-switch button.active, .layer-switch button.active { color: var(--blue); background: var(--surface); box-shadow: 0 3px 10px rgba(7, 28, 51, .08); }
.form-mode-switch .ui-icon { width: 15px; height: 15px; }
.layer-switch { white-space: nowrap; }

.position-document-input, .position-extraction-preview, .structure-form-card, .form-section-card { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--soft); }
.position-document-input { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.document-input-grid { width: 100%; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr); gap: var(--space-3); }
.compact-file { min-height: 100%; }
.compact-file > span { min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; text-align: center; }
.compact-file .ui-icon { width: 23px; height: 23px; color: var(--blue); }
.position-extraction-preview { display: flex; flex-direction: column; gap: var(--space-3); }
.extraction-field-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }

.structure-form-card { display: flex; flex-direction: column; gap: var(--space-3); }
.structure-form-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.structure-form-heading h3 { margin: 3px 0 0; font-size: 16px; }
.modal-form .top-position-toggle { padding: 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.modal-form .top-position-toggle input { width: 18px; min-height: 18px; margin-top: 2px; }
.top-position-toggle span { display: flex; flex-direction: column; gap: 2px; }
.top-position-toggle strong { color: var(--ink); font-size: 12px; }
.top-position-toggle small { color: var(--steel); font-weight: 500; }
.manager-picker { display: flex; flex-direction: column; gap: 9px; }
.manager-picker.disabled { opacity: .55; }
.selected-manager { min-height: 58px; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid rgba(0, 47, 108, .18); border-radius: 10px; background: var(--color-brand-soft); }
.selected-manager > div { min-width: 0; display: flex; align-items: center; gap: 9px; }
.selected-manager .ui-icon { width: 19px; flex: 0 0 auto; color: var(--blue); }
.selected-manager span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.selected-manager strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.selected-manager small { color: var(--steel); }
.manager-search-results { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
.manager-result-row { width: 100%; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: inherit; text-align: left; cursor: pointer; }
.manager-result-row:hover { border-color: rgba(0, 47, 108, .35); background: var(--soft); }
.manager-result-row span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.manager-result-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.manager-result-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--steel); font-size: 10px; }
.manager-result-row em { flex: 0 0 auto; color: var(--blue); font-size: 10px; font-style: normal; }
.manager-search-status { padding: 10px; color: var(--steel); text-align: center; font-size: 11px; }
.manager-search-status.error { color: var(--red); }
.form-section-card { display: flex; flex-direction: column; gap: var(--space-3); }
.field-context { min-height: 64px; padding: 10px 11px; display: flex; flex-direction: column; justify-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.field-context span { color: var(--steel); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.field-context strong { overflow-wrap: anywhere; font-size: 12px; }

.info-section.field-changed { position: relative; border-color: rgba(0, 47, 108, .25); }
.changed-field-icon { width: 25px; height: 25px; display: inline-grid; place-items: center; margin-left: 7px; border-radius: 7px; color: var(--blue); background: var(--color-brand-soft); vertical-align: middle; }
.changed-field-icon .ui-icon { width: 13px; height: 13px; }
.empty-relation.top-relation { border-color: rgba(31, 122, 77, .25); background: var(--color-success-soft); }
.top-relation strong { color: var(--green); }
button[aria-busy="true"] { cursor: wait; }
button[aria-busy="true"]::after { content: ""; width: 13px; height: 13px; margin-left: 7px; display: inline-block; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pending-spin .75s linear infinite; vertical-align: -2px; }
@keyframes pending-spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .access-grid { grid-template-columns: 1fr; }
  .delegation-form { grid-template-columns: 1fr 1fr; }
  .delegation-form .btn { grid-column: 1 / -1; }
  .document-input-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .access-hero { padding: 17px; align-items: flex-start; }
  .access-hero-icon { width: 44px; height: 44px; }
  .delegation-form { grid-template-columns: 1fr; }
  .delegation-form .btn { grid-column: auto; width: 100%; }
  .form-mode-switch, .layer-switch { width: 100%; }
  .form-mode-switch button, .layer-switch button { flex: 1 1 0; }
  .extraction-field-list { grid-template-columns: 1fr; }
  .toolbar-actions .layer-switch { grid-column: 1 / -1; }
  .toolbar-actions { grid-template-columns: minmax(0, 1fr) 44px 44px; }
}

/* 5.6.0: clear source-layer markers and safe base-layer reset from the editor. */
.changed-field-icon.inline {
  display: inline-flex;
  margin-left: .35rem;
  vertical-align: middle;
}
.changed-field-icon.inline svg { width: .9rem; height: .9rem; }
.form-actions-spread {
  justify-content: space-between;
  gap: 1rem;
}
.form-actions-spread > div { display: flex; gap: .65rem; align-items: center; }
.btn.danger.ghost { background: transparent; }
@media (max-width: 720px) {
  .form-actions-spread, .form-actions-spread > div { width: 100%; flex-direction: column; align-items: stretch; }
}

/* Semantic hard grade range and production refinements. */
.reference-selection-section { display: grid;  }
.reference-policy-strip {
  display: grid;
  grid-template-columns: minmax(0, .45fr) minmax(0, 1fr);
  gap: 10px;
}
.reference-policy-strip > div {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}
.reference-policy-strip strong,
.reference-policy-strip small { display: block; }
.reference-policy-strip strong { font-size: 14px; }
.reference-policy-strip small { margin-top: 3px; color: var(--steel); line-height: 1.4; }
.reference-policy-strip .ok { border-left: 4px solid var(--green); background: #f4fbf7; }
.reference-policy-strip .warning { border-left: 4px solid #d38a00; background: var(--color-warning-surface); }
.reference-search-field { display: grid; gap: 6px; font-weight: 800; }
.reference-search-field input {
  width: 100%;
  
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}
.reference-search-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 47, 108, .08); outline: none; }
.reference-search-field small,
.reference-search-status { color: var(--steel); font-size: 11px; font-weight: 500; }

.reference-picker { max-height: 430px; }
.reference-option {
  
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  cursor: default;
}
.reference-option.selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px rgba(0, 47, 108, .14); }
.reference-check { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; cursor: pointer; }
.reference-check input { margin-top: 2px; }
.reference-check span { min-width: 0; }
.reference-badge { align-self: start; padding: 4px 7px; border-radius: var(--radius-pill); font-size: 9px; font-weight: 900; }
.reference-badge.benchmark { color: #5c3b00; background: #fff0c7; }
.reference-badge.lower { color: #00603c; background: #dcf6ea; }
.reference-badges { grid-column: 2; display: inline-flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px; }
.reference-badge.external { color: var(--color-text-secondary); background: var(--color-surface-soft); border: 1px solid var(--color-border); }
.reference-type-field { display: grid; grid-template-columns: minmax(32px, auto) minmax(0, 1fr); align-items: center; gap: 10px; }
.reference-type-field > span { color: var(--steel); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.reference-type-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
}
.reference-type-field select:disabled { opacity: .55; background: var(--soft); }
.reference-confirmation {
  padding: 14px 15px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}
.reference-confirmation input { width: 18px; height: 18px; margin-top: 1px; }
.reference-confirmation strong,
.reference-confirmation small { display: block; }
.reference-confirmation small { margin-top: 3px; color: var(--steel); line-height: 1.45; }
.benchmark-chip { color: #5c3b00; border-color: #efc96d; background: #fff3d3; }

.grade-expectation-review {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  background: #f7faff;
}
.grade-expectation-review > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.grade-expectation-review span { color: var(--steel); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.grade-expectation-review p { margin: 8px 0 0; color: var(--steel); line-height: 1.5; }

.grade-preassessment-report {
  margin: 0 0 16px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  background: #f7faff;
}
.grade-preassessment-report > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.grade-preassessment-report span { color: var(--steel); font-size: 10px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.grade-preassessment-report strong { color: var(--ink); font-size: 13px; font-weight: 800; }
.grade-preassessment-report .factor-info-mark { cursor: help; }
.grade-preassessment-report p { margin: 0; color: var(--steel); font-size: 10px; line-height: 1.45; text-align: right; }

.review-path-card {
  min-width: 0;
  padding: 17px;
  display: grid;
  gap: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.review-path-card.primary-path { border-top: 4px solid var(--blue); }
.review-path-card.manual-path { border-top: 4px solid var(--dark); }
.review-path-card > header { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; align-items: start; }
.review-path-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--surface);
  background: var(--blue);
  font-size: 14px;
  font-weight: 900;
}
.manual-path .review-path-number { background: var(--dark); }
.review-path-card header strong { color: var(--steel); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.review-path-card header h3 { margin: 3px 0 5px; font-size: 18px; }
.review-path-card header p { margin: 0; color: var(--steel); line-height: 1.48; }
.review-path-card .review-question-card { padding: 12px; }
.review-path-card .review-question-card textarea { min-height: 78px; }
.review-path-action {
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border-top: 1px solid var(--line);
}
.review-path-action > span { color: var(--steel); font-size: 11px; line-height: 1.4; }
.review-path-action .btn[disabled] { opacity: .55; cursor: not-allowed; }
.manual-path-preview { display: grid; gap: 9px; }
.manual-path-preview > div { padding: 13px; border-radius: 10px; background: var(--soft); }
.manual-path-preview span,
.manual-path-preview strong,
.manual-path-preview small { display: block; }
.manual-path-preview span { color: var(--steel); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.manual-path-preview strong { margin-top: 4px; }
.manual-path-preview small { margin-top: 2px; color: var(--steel); }

@media (max-width: 860px) {
  .reference-policy-strip{ grid-template-columns: 1fr; }
  .reference-type-field { grid-template-columns: 1fr; gap: 5px; }
  .review-path-action { align-items: stretch; flex-direction: column; }
  .review-path-action .btn { width: 100%; }
}

/* 5.7 assessment workflow refinements */
.active-assessment-stack {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: min(46vw, 620px);
  overflow-x: auto;
  scrollbar-width: thin;
}
.active-assessment-chip {
  min-width: 0;
  max-width: 190px;
}
.active-assessment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-assessment-chip small {
  display: block;
  font-size: 9px;
  opacity: .72;
}

@keyframes assessment-attention {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 184, 0, 0); }
  50% { box-shadow: 0 0 0 5px rgba(255, 184, 0, .26); }
}
.reference-type-field > .reference-role-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  background: var(--surface);
  font-size: 11px;
  font-weight: 900;
  text-transform: none;
}
.reference-confirmation.needs-confirmation { border-color: #d38a00; background: var(--color-warning-surface); }
.reference-confirmation-warning {
  margin-top: -6px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #774b00;
  background: #fff1cf;
  font-size: 12px;
  font-weight: 750;
}
.previous-assessment-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.previous-assessment-options label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}
.previous-assessment-options strong,
.previous-assessment-options small { display: block; }
.previous-assessment-options small { margin-top: 3px; color: var(--steel); }
.position-existing-input {
  
  
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}
.position-existing-input label { display: grid; gap: 6px; font-weight: 800; }
.position-existing-input input { min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.position-source-results { max-height: 310px; overflow: auto; }
.extraction-actions { display: flex; gap: 5px; }
.extraction-actions label { cursor: pointer; }
.extraction-actions input { position: absolute; opacity: 0; pointer-events: none; }
.extraction-actions span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 900;
}
.extraction-actions input:checked + span { color: var(--surface); border-color: var(--blue); background: var(--blue); }
.review-choice-stack { display: grid; gap: 14px; }
.review-choice-stack .manual-path { margin-top: 2px; }
.position-workspace-grid {
  display: block;
  column-count: 2;
  column-gap: 14px;
}
.position-workspace-grid > section {
  break-inside: avoid;
  margin: 0 0 14px;
}
.assessment-footer .btn[disabled] { opacity: .48; cursor: not-allowed; }
@media (max-width: 900px) {
  .active-assessment-stack { max-width: 42vw; }
  .previous-assessment-options { grid-template-columns: 1fr; }
  .position-workspace-grid { column-count: 1; }
}
@media (max-width: 1120px) and (min-width: 760px) {
  .active-assessment-stack .active-assessment-chip {
    width: auto;
    max-width: 145px;
    padding: 6px 9px;
    justify-content: flex-start;
  }
  .active-assessment-stack .active-assessment-chip span { display: block; }
  .active-assessment-stack .active-assessment-chip small { display: none; }
}

/* 5.6.0: focused structure workspace, assessment preflight and accessible queues. */
.structure-page { padding-top: 14px; }
.compact-finder { margin-bottom: 12px; align-items: start; }
.finder-search-stack { min-width: 0; display: grid; gap: 7px; }
.visible-org-path { max-width: 900px; overflow-wrap: anywhere; white-space: normal; }
.compact-summary-strip { margin-top: 12px; }
.workspace { min-height: 560px; height: clamp(560px, 70vh, 780px); }
.tree-panel { display: flex; flex-direction: column; }
.tree-scroll { flex: 1; min-height: 0; }

.quality-controls { margin-bottom: 12px; padding: 12px; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(180px, .35fr) auto; gap: var(--space-3); align-items: end; }
.quality-controls > label:not(.search-box) { display: grid; gap: 5px; color: var(--steel); font-size: 13px; font-weight: 800; }
.quality-controls select { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 14px; }
.quality-controls > span { padding: 10px 12px; border-radius: 9px; color: var(--steel); background: var(--soft); font-size: 13px; }
.compact-quality-filters { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

.quality-issue-stack { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quality-unit-path { display: block; max-width: 420px; overflow-wrap: anywhere; line-height: 1.45; }

.assessment-wizard { display: flex; flex-direction: column; min-height: 0; }
.assessment-wizard > .assessment-section { flex: 1; overflow: auto; }
.assessment-step-progress { width: min(220px, 24vw); height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: #dce7f3; }
.assessment-step-progress span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .2s ease; }
.assessment-preflight{ margin-bottom: 13px; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--soft); }
.assessment-preflight > div{ min-width: 0; display: grid; gap: 3px; }
.assessment-preflight span{ color: var(--steel); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.assessment-preflight strong{ color: var(--ink); font-size: 16px; }
.assessment-preflight small{ color: var(--steel); font-size: 13px; line-height: 1.45; }
.assessment-preflight.blocked{ border-color: rgba(196, 121, 0, .35); background: #fff8e9; }
.assessment-preflight.success{ border-color: rgba(31, 122, 77, .25); background: var(--color-success-soft); }
.assessment-preflight details { max-width: 45%; color: var(--steel); font-size: 13px; }
.assessment-preflight details p { margin: 6px 0 0; }
.selected-reference-summary { padding: 10px 12px; display: flex;  gap: 7px; align-items: center; border-radius: 10px; background: #edf5fd; }
.selected-reference-summary span { padding: 5px 8px; border-radius: var(--radius-pill); color: var(--blue); background: var(--surface); font-size: 12px; font-weight: 800; }
.compact-reference-picker { max-height: 340px; }
.wizard-footer { position: sticky; bottom: 0; z-index: 3; }

.simplified-actions { position: relative; }
.position-more-wrap { position: relative; isolation: isolate; }
.position-more-menu { width: min(360px, 88vw); position: absolute; top: calc(100% + 7px); right: 0; z-index: 60; padding: 6px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow); }
.position-more-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 9px; background: transparent; }
.position-more-menu button { min-height: 44px; padding: 10px 11px; display: grid; gap: 3px; border: 0; border-radius: var(--radius-sm); color: var(--ink); background: transparent; text-align: left; cursor: pointer; touch-action: manipulation; }
.position-more-menu button:hover, .position-more-menu button:focus-visible { background: var(--soft); }
.position-more-menu button:disabled { opacity: .55; cursor: not-allowed; }
.position-more-menu strong { font-size: 14px; }
.position-more-menu small { color: var(--steel); font-size: 12px; line-height: 1.35; }

/* Readability: critical information must not depend on hover or 10px text. */
body, button, input, textarea, select { font-size: 14px; }
small, .field-help, .tree-help, .list-caption, .panel-header p, .modal-header p, .quality-intro p, .finder-copy p, .notice, .empty-state p { font-size: 12px; line-height: 1.45; }
.tree-name, .position-main strong, td strong, .relation-card strong, .info-section p, .modal-tab, .btn.compact { font-size: 14px; }
.quality-table-wrap th, .section-kicker, .summary-item small, .unit-picker-button small, .status-label, .chip { font-size: 12px; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(0, 92, 185, .42); outline-offset: 2px; }

@media (max-width: 900px) {
  .workspace { height: auto; grid-template-columns: 1fr; }
  .tree-panel { max-height: 48vh; }
  .quality-controls { grid-template-columns: 1fr; }
  .assessment-header { align-items: stretch; }
  .assessment-step-progress { width: 100%; }
  .assessment-preflight{ align-items: stretch; flex-direction: column; }
  .assessment-preflight details { max-width: none; }
  .toolbar-actions.simplified-actions { display: grid; grid-template-columns: 1fr; }
  .position-more-menu { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); top: auto; width: auto; max-height: min(70dvh, 560px); overflow-y: auto; overscroll-behavior: contain; }
  .position-more-menu::before { display: none; }
}

@media (min-resolution: 1dppx) {
  @supports (zoom: 2) {
    body { min-width: 320px; }
  }
}
.reference-category { display: grid; gap: 7px; }
.reference-category + .reference-category { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.reference-category h4 { margin: 0; color: var(--blue); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

/* Keep the existing-position search visually stable while asynchronous results change. */
.position-existing-input { display: grid; gap: var(--space-2); }
.position-source-results {
  min-height: 48px;
  scrollbar-gutter: stable;
  overflow-anchor: none;
  contain: layout paint;
}
.position-source-results .manager-search-status { min-height: 46px; display: grid; place-items: center; }

/* Import conflict decisions: show the result before applying it. */
.position-extraction-preview .extraction-field-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.position-extraction-preview .extraction-field-card {
  min-width: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: default;
}
.extraction-field-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.extraction-field-heading > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.extraction-field-heading strong { font-size: 14px; }
.extraction-field-heading em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  color: var(--blue);
  background: var(--color-brand-soft);
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
}
.extraction-field-heading small {
  color: var(--steel);
  font-size: 12px;
  line-height: 1.45;
}
.extraction-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}
.extraction-comparison section {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
}
.extraction-comparison span,
.extraction-final-preview > span {
  display: block;
  margin-bottom: 5px;
  color: var(--steel);
  font-size: 12px;
  font-weight: 800;
}
.extraction-comparison p,
.extraction-final-preview p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.extraction-comparison p {
  max-height: 112px;
  overflow: auto;
}
.extraction-comparison p.empty,
.extraction-final-preview p.empty {
  color: var(--steel);
  font-style: italic;
}
.position-extraction-preview .extraction-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.position-extraction-preview .extraction-actions label {
  min-width: 0;
  cursor: pointer;
}
.position-extraction-preview .extraction-actions input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.position-extraction-preview .extraction-actions span {
  width: auto;
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--color-text-secondary);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.position-extraction-preview .extraction-actions input:focus-visible + span {
  outline: 3px solid rgba(0, 95, 170, .22);
  outline-offset: 2px;
}
.position-extraction-preview .extraction-actions input:checked + span {
  color: var(--surface);
  border-color: var(--blue);
  background: var(--blue);
}
.extraction-custom-input {
  display: grid;
  gap: 6px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 800;
}
.extraction-custom-input[hidden] { display: none; }
.extraction-custom-input textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.extraction-final-preview {
  padding: 10px 11px;
  border: 1px solid rgba(0, 95, 170, .24);
  border-radius: 10px;
  background: #f2f8fd;
}
.extraction-final-preview > span {
  color: var(--blue);
}
.extraction-final-preview p {
  max-height: 150px;
  overflow: auto;
}
@media (max-width: 980px) {
  .position-extraction-preview .extraction-field-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .extraction-comparison,
  .position-extraction-preview .extraction-actions { grid-template-columns: 1fr; }
}

/* 5.6.3: align the main search focus ring and prevent quality labels from overlapping. */
.finder-search {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.finder-search input,
.finder-search button {
  box-sizing: border-box;
}
.finder-search input:focus,
.finder-search input:focus-visible,
.finder-search button:focus,
.finder-search button:focus-visible {
  outline: none;
  outline-offset: 0;
}
.finder-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 47, 108, .12);
}

/* Keep quality summary cards readable: no seven-column squeeze or text collision. */
.quality-grid.compact-quality-filters,
.compact-quality-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
}
.compact-quality-filters .quality-card {
  min-width: 0;
  min-height: 92px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-2);
  overflow: hidden;
}
.compact-quality-filters .quality-card strong {
  width: 100%;
  min-width: 0;
  display: block;
  font-size: 22px;
  line-height: 1.05;
  white-space: nowrap;
}
.compact-quality-filters .quality-card-label {
  width: 100%;
  min-width: 0;
  display: block;
  overflow: visible;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
  font-size: 12px;
  line-height: 1.3;
}

@media (max-width: 1050px) {
  .quality-grid.compact-quality-filters,
  .compact-quality-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .quality-grid.compact-quality-filters,
  .compact-quality-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .quality-grid.compact-quality-filters,
  .compact-quality-filters {
    grid-template-columns: 1fr;
  }
  .compact-quality-filters .quality-card {
    min-height: 78px;
  }
}


/* 5.6.4: focused position editing and compact creation actions. */

.position-transfer-modal .position-existing-input { grid-template-columns: minmax(280px, .36fr) minmax(0, .64fr); align-items: start; }
.position-transfer-modal .position-existing-input > label { position: sticky; top: 0; }
.position-transfer-modal .position-source-results { max-height: 420px; }
.position-transfer-modal .position-extraction-preview .extraction-field-list { grid-template-columns: 1fr; }
.position-transfer-modal .position-extraction-preview .extraction-field-card { padding: 16px; }
.position-transfer-modal .extraction-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.empty-relation-action { width: 100%; display: grid; place-items: center; gap: 7px; border-color: rgba(0, 47, 108, .24); color: var(--steel); cursor: pointer; text-align: center; }
.empty-relation-action:hover, .empty-relation-action:focus-visible { border-color: var(--blue); color: var(--blue); background: var(--color-brand-soft); }
.empty-relation-action strong { color: var(--blue); }
.empty-relation-plus { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--surface); background: var(--blue); }
.empty-relation-plus .ui-icon { width: 18px; height: 18px; }
.manager-locked-card { border-color: rgba(0, 47, 108, .25); background: var(--color-brand-subtle); }
.selected-manager.locked > .ui-icon { width: 18px; height: 18px; flex: 0 0 auto; color: var(--blue); }

.quality-issue-stack.detailed { display: grid; gap: var(--space-2); }
.quality-issue-detail { padding: 11px 12px; display: grid; gap: 5px; border-left: 4px solid var(--orange); border-radius: 9px; color: #79500c; background: #fff7e6; }
.quality-issue-detail strong { color: #684407; font-size: 14px; }
.quality-issue-detail span { color: #79500c; font-size: 13px; line-height: 1.45; }
.quality-issue-detail.compact { min-width: 240px; padding: 9px 10px; }
.quality-issue-detail.compact strong { font-size: 13px; }
.quality-issue-detail.compact span { font-size: 12px; }

.icon-action-with-note { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--steel); }
.icon-action-with-note > small { max-width: 86px; font-size: 11px; font-weight: 800; line-height: 1.2; }
.icon-action { width: 42px; height: 42px; position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 11px; color: var(--blue); background: var(--surface); cursor: pointer; }
.icon-action:hover, .icon-action:focus-visible { border-color: rgba(0, 47, 108, .42); background: var(--color-brand-soft); }
.icon-action:disabled { opacity: .42; cursor: not-allowed; }
.icon-action .ui-icon { width: 19px; height: 19px; }
.add-action-mark { width: 16px; height: 16px; position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; border: 2px solid var(--surface); border-radius: 50%; color: var(--surface); background: var(--blue); font-size: 12px; font-weight: 900; line-height: 1; }
.icon-action::after { content: attr(data-note); width: max-content; max-width: 280px; position: absolute; right: 0; top: calc(100% + 9px); z-index: 40; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--surface); background: var(--dark); box-shadow: var(--shadow-soft); opacity: 0; pointer-events: none; transform: translateY(-3px); transition: opacity .14s ease, transform .14s ease; font-size: 12px; font-weight: 700; line-height: 1.35; text-align: left; }
.icon-action:hover::after, .icon-action:focus-visible::after { opacity: 1; transform: none; }
.primary-icon-action { color: var(--surface); border-color: var(--blue); background: var(--blue); }
.primary-icon-action:hover, .primary-icon-action:focus-visible { color: var(--surface); background: #004783; }
.primary-icon-action .add-action-mark { color: var(--blue); border-color: var(--blue); background: var(--surface); }

/* Локальный отчёт по структуре */
.report-action-wrap { position: relative; }
.report-action-wrap > small { max-width: 120px; }
.report-action.is-ready { color: var(--surface); border-color: var(--blue); background: var(--blue); }
.report-action.is-ready:hover, .report-action.is-ready:focus-visible { color: var(--surface); background: #004783; }
.report-action.is-busy { color: var(--blue); }
.report-spinner { width: 16px; height: 16px; position: absolute; border: 2px solid rgba(0, 47, 108, .25); border-top-color: var(--blue); border-radius: 50%; animation: report-spin .8s linear infinite; }
@keyframes report-spin { to { transform: rotate(360deg); } }
.report-truncation-hint { max-width: 200px; color: var(--steel); font-size: 10px; font-weight: 600; line-height: 1.3; }

@media (max-width: 900px) {
  .position-transfer-modal .position-existing-input { grid-template-columns: 1fr; }
  .position-transfer-modal .position-existing-input > label { position: static; }
  .position-transfer-modal .extraction-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-issue-detail.compact { min-width: 0; }
}

/* 5.9.0: stable interactions, completed assessment notice and full-width report sections. */
.reference-option {
  
  align-content: start;
  overflow-anchor: none;
}

.peer-picker { overflow-anchor: none; scrollbar-gutter: stable; }
.selected-reference-summary[hidden],
.reference-confirmation-warning[hidden] { display: none; }

.active-assessment-chip.attention { animation: none; border-color: rgba(211, 138, 0, .75); background: rgba(255, 248, 233, .16); }
.active-assessment-chip.completed {
  border-color: rgba(116, 220, 160, .7);
  background: rgba(116, 220, 160, .16);
}
.active-assessment-chip.completed i {
  background: #74dca0;
  box-shadow: 0 0 0 4px rgba(116, 220, 160, .14);
}

.fixed-factor-card { grid-template-columns: minmax(0, 1fr); }
.fixed-factor-card > header { grid-column: auto; }

/* Keep the comparable-role list anchored while the selection summary changes. */
.selected-reference-summary {
  min-height: 48px;
  height: 48px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}
.selected-reference-summary[hidden] {
  display: flex;
  visibility: hidden;
}
.selected-reference-summary strong,
.selected-reference-summary span { flex: 0 0 auto; }

/* Assessment confirmation and consistent secondary position data */
.form-details.secondary-position-fields > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.form-details.secondary-position-fields > summary em { padding: 3px 8px; border-radius: var(--radius-pill); color: var(--steel); background: #eef3f7; font-size: 11px; font-style: normal; font-weight: 700; text-transform: none; }
.secondary-fields-note { grid-column: 1 / -1; padding: 13px 14px; display: grid; gap: var(--space-1); border: 1px solid #cfddeb; border-radius: 10px; background: #f5f9fd; }
.secondary-fields-note strong { color: var(--blue); }
.secondary-fields-note span { color: var(--steel); font-size: 13px; line-height: 1.45; }
.optional-mark { margin-left: 5px; color: var(--steel); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

.assessment-finalization { margin-top: 18px; padding: 18px; display: grid; gap: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.assessment-finalization.pending { border-color: #b9cfe3; background: linear-gradient(180deg, #f6faff, var(--surface)); }
.assessment-finalization.applied { border-color: #a9d4bd; background: linear-gradient(180deg, #f4fbf7, var(--surface)); }
.assessment-finalization.not-applied { border-color: #d4dbe3; background: linear-gradient(180deg, #f8fafc, var(--surface)); }
.assessment-finalization-heading { display: flex; align-items: flex-start; gap: var(--space-3); }
.assessment-finalization-heading > span { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: #e8f1fa; }
.assessment-finalization.applied .assessment-finalization-heading > span { color: #17633a; background: #dff2e7; }
.assessment-finalization-heading .ui-icon { width: 20px; height: 20px; }
.assessment-finalization-heading strong { display: block; color: var(--ink); font-size: 17px; }
.assessment-finalization-heading p { margin: 5px 0 0; color: var(--steel); line-height: 1.5; }
.assessment-apply-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.assessment-apply-preview > div { padding: 11px 12px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.assessment-apply-preview span { color: var(--steel); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.assessment-apply-preview strong { color: var(--blue); font-size: 18px; }
.assessment-benchmark-choice { padding: 13px 14px; display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; }
.assessment-benchmark-choice input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.assessment-benchmark-choice span { display: grid; gap: 3px; }
.assessment-benchmark-choice strong { color: var(--ink); }
.assessment-benchmark-choice small { color: var(--steel); font-size: 13px; line-height: 1.45; }
.assessment-finalization-note { padding: 12px 13px; display: grid; gap: var(--space-1); border-left: 3px solid #8fb4d5; background: #f5f8fb; }
.assessment-finalization-note span { color: var(--steel); font-size: 13px; line-height: 1.45; }
.assessment-finalization-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.applied-assessment-chip { color: #17633a; background: #e2f4e9; }
.grade-box.assessed-grade { border-color: #9fcbb2; background: var(--color-success-soft); }
.grade-box small { margin-top: 5px; color: var(--steel); font-size: 11px; font-weight: 700; }

@media (max-width: 760px) {
  .assessment-apply-preview { grid-template-columns: 1fr; }
  .assessment-finalization-actions { display: grid; grid-template-columns: 1fr; }
  .assessment-finalization-actions .btn { width: 100%; }
  .form-details.secondary-position-fields > summary { align-items: flex-start; }
}

/* 5.12.1: compact two-column calibration role picker. */
.compact-reference-picker {
  display: block;
}
.compact-reference-picker .reference-category {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  align-items: stretch;
}
.compact-reference-picker .reference-category > h4 {
  grid-column: 1 / -1;
}
.compact-reference-picker .reference-option {
  min-width: 0;
  height: 100%;
}
@media (max-width: 760px) {
  .compact-reference-picker .reference-category {
    grid-template-columns: 1fr;
  }
}

/* 5.12.2: compact calibration overview above the role picker. */
.reference-selection-section {
  gap: var(--space-2);
  padding-top: 16px;
}
.reference-selection-section .assessment-section-title {
  margin-bottom: 0;
  gap: 10px;
  align-items: center;
}
.reference-selection-section .assessment-section-title > span {
  width: 27px;
  height: 27px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.reference-selection-section .assessment-section-title h3 {
  margin-bottom: 1px;
  font-size: 17px;
}
.reference-selection-section .assessment-section-title p {
  font-size: 11px;
  line-height: 1.3;
}
.reference-selection-section .reference-policy-strip {
  display: grid;
  grid-template-columns: minmax(0, .45fr) minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
}
.reference-selection-section .reference-policy-strip > div {
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 9px;
}
.reference-selection-section .reference-policy-strip strong,
.reference-selection-section .reference-policy-strip small {
  display: inline;
  margin: 0;
  line-height: 1.25;
}
.reference-selection-section .reference-policy-strip strong {
  min-width: 0;
  font-size: 12px;
}
.reference-selection-section .reference-policy-strip small {
  min-width: 0;
  color: var(--steel);
  font-size: 10.5px;
  overflow-wrap: anywhere;
  white-space: normal;
}
.reference-selection-section .selected-reference-summary {
  min-height: 34px;
  height: 34px;
  padding: 4px 7px;
  gap: 5px;
  border-radius: 9px;
}
.reference-selection-section .selected-reference-summary strong {
  font-size: 11px;
}
.reference-selection-section .selected-reference-summary span {
  max-width: min(360px, 42vw);
  padding: 3px 7px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .reference-selection-section .reference-policy-strip {
    display: grid;
    grid-template-columns: 1fr;
  }
  .reference-selection-section .reference-policy-strip > div {
    min-height: 34px;
  }
  .reference-selection-section .selected-reference-summary span {
    max-width: 76vw;
  }
}

/* 5.11.0: clearer comparable-role search and quiet storage health indicator. */
.assessment-section { position: relative; }
.assessment-storage-alert {
  width: 30px;
  height: 30px;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(184, 36, 36, .32);
  border-radius: 50%;
  color: #b82424;
  background: #fff4f4;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(184, 36, 36, .08);
}
.assessment-storage-alert:hover,
.assessment-storage-alert:focus-visible {
  border-color: #b82424;
  background: #ffe7e7;
  outline: none;
  box-shadow: 0 0 0 3px rgba(184, 36, 36, .10);
}
.assessment-storage-alert .ui-icon { width: 16px; height: 16px; }

.reference-search-field input { min-height: 46px; }
.reference-search-status { min-height: 16px; }
.reference-option {
  min-height: 116px;
  grid-template-rows: minmax(70px, auto) 40px;
}
.reference-check { align-items: start; }
.reference-card-copy { display: grid; gap: 6px; min-width: 0; }
.reference-card-copy > strong { line-height: 1.25; }
.reference-location {
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 7px;
  color: #123f69;
  background: #eaf3fb;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}
.reference-location .ui-icon { width: 13px; height: 13px; flex: 0 0 auto; }
.reference-location b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-location-count {
  flex: 0 0 auto;
  color: #52718d;
  font-size: 10px;
  white-space: nowrap;
}
.reference-type-field { grid-column: 1; grid-row: 2; }
.reference-type-field.is-inactive {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 700px) {
  .reference-location { max-width: calc(100vw - 150px); }
}
.reference-empty-search {
  grid-column: 1 / -1;
  min-height: 110px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--steel);
  text-align: center;
}
.reference-empty-search strong { color: var(--ink); }
.reference-empty-search small { font-size: 12px; }
.assessment-storage-alert.is-checking .ui-icon { animation: storage-check-spin .8s linear infinite; }
@keyframes storage-check-spin { to { transform: rotate(360deg); } }

/* Overlay synchronization status and diagnostics. */
.overlay-warning {
  margin: 12px 18px 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.overlay-warning-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.overlay-warning-copy strong { color: #684204; }
.overlay-warning-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}
.overlay-diagnostics {
  padding: 20px 23px 24px;
  display: grid;
  gap: var(--space-4);
  overflow: auto;
}
.diagnostic-status {
  padding: 13px 15px;
  display: grid;
  gap: var(--space-1);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: var(--soft);
}
.diagnostic-status.stale {
  border-left-color: var(--orange);
  color: #684204;
  background: #fff8e8;
}
.diagnostic-status.unavailable {
  border-left-color: var(--red);
  color: #8e1820;
  background: #fff2f1;
}
.diagnostic-status span { font-size: 12px; }
.diagnostic-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.diagnostic-grid > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.diagnostic-grid dt,
.diagnostic-message > span,
.diagnostic-response > span {
  margin: 0 0 4px;
  color: var(--steel);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.diagnostic-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.diagnostic-message,
.diagnostic-response {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.diagnostic-message p { margin: 4px 0 0; line-height: 1.5; }
.diagnostic-response pre {
  max-height: 250px;
  margin: 6px 0 0;
  padding: 12px;
  overflow: auto;
  border-radius: var(--radius-sm);
  color: #23384e;
  background: #f4f7fa;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }

@media (max-width: 700px) {
  .overlay-warning { margin: 10px 10px 0; align-items: stretch; }
  .overlay-warning-actions { justify-content: stretch; }
  .overlay-warning-actions .btn { flex: 1 1 180px; }
  .diagnostic-grid { grid-template-columns: 1fr; }
}

/* Corrective reassessment: final state after all review questions are answered. */
.finalized-review-workspace { gap: var(--space-4); }
.review-finalized-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 16px;
  background: #f4fbf7;
}
.review-finalized-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--surface);
  font-size: 24px;
  font-weight: 900;
}
.review-finalized-card span {
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.review-finalized-card h3 { margin: 5px 0 6px; }
.review-finalized-card p { margin: 0; color: var(--steel); line-height: 1.55; }
.review-finalized-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.review-finalized-metrics > div {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.review-finalized-metrics span { color: var(--steel); font-size: 11px; }
.review-finalized-metrics strong { overflow-wrap: anywhere; }
.reassessment-plan-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.reassessment-plan-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reassessment-plan-card > header span {
  color: var(--steel);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.reassessment-plan-card > p { margin: 0; line-height: 1.55; }
.reassessment-effect-list { display: grid; gap: 8px; }
.reassessment-effect-list article {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.reassessment-effect-list article > div { display: flex; align-items: center; gap: 8px; }
.reassessment-effect-list article span { color: var(--steel); font-size: 12px; }
.reassessment-effect-list article p { margin: 0; color: var(--steel); line-height: 1.45; }
@media (max-width: 900px) {
  .review-finalized-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .review-finalized-card { align-items: flex-start; }
  .review-finalized-metrics { grid-template-columns: 1fr; }
}

/* Grading UX refinements: full-width position editor and explicit top-role context. */
.modal.fullscreen-editor {
  width: calc(100vw - 24px);
  max-width: none;
  min-height: calc(100vh - 44px);
  min-height: calc(100dvh - 44px);
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px);
}
.modal.fullscreen-editor .modal-form {
  max-height: calc(100vh - 118px);
  max-height: calc(100dvh - 118px);
  overflow: auto;
}
.top-responsibility-banner {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid rgba(37, 99, 235, .28);
  border-radius: 14px;
  background: rgba(37, 99, 235, .07);
}
.top-responsibility-banner strong { font-size: 14px; }
.top-responsibility-banner span { color: var(--muted, #5f6b7a); font-size: 13px; text-align: right; }
@media (max-width: 720px) {
  .modal.fullscreen-editor {
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .top-responsibility-banner { align-items: flex-start; flex-direction: column; }
  .top-responsibility-banner span { text-align: left; }
}

/* 5.16.0 UX checklist corrections */
.assessment-stepper { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.assessment-step { min-height: 44px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; color: var(--steel); background: var(--surface); text-align: left; }
.assessment-step span { width: 26px; height: 26px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--blue); background: var(--color-brand-soft); font-weight: 900; }
.assessment-step.current { border-color: var(--blue); color: var(--ink); box-shadow: 0 0 0 3px rgba(0, 92, 185, .08); }
.assessment-step.completed { color: var(--ink); }
.assessment-step.future { opacity: .65; }
.assessment-step b { font-size: 12px; }
.assessment-draft-restored, .assessment-auto-step { margin: 12px 24px 0; align-items: center; }
.assessment-draft-restored .btn, .assessment-auto-step .btn { margin-left: auto; }
.help-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.user-chip.compact-user { max-width: 310px; gap: 7px; }
.user-chip.compact-user .user-chip-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.user-chip.compact-user b { font-size: 11px; }
.reference-confirmation-warning[hidden] { display: none; }

@media (max-width: 900px) {
  .desktop-tree-panel { display: none !important; }
  .workspace { grid-template-columns: 1fr; }
  .list-panel { order: -1; }
  .assessment-stepper { overflow-x: auto; grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .assessment-draft-restored, .assessment-auto-step { margin-inline: 14px; align-items: stretch; flex-direction: column; }
  .assessment-draft-restored .btn, .assessment-auto-step .btn { margin-left: 0; }
}

@media (max-width: 720px) {
  .topnav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nav-btn { min-height: 48px; padding: 6px 3px; gap: 3px; flex-direction: column; font-size: 10px; line-height: 1.1; }
  .nav-btn .nav-count { position: absolute; margin: -24px 0 0 22px; }
  .user-chip.compact-user .user-chip-email { display: none; }
  .user-chip.compact-user b { display: inline; }
  button, [role="button"], input[type="checkbox"], input[type="radio"], select { min-height: 44px; }
  .quality-table-wrap tr { margin: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .quality-table-wrap td { padding: 7px 0; border: 0; }
  .quality-table-wrap td:last-child .btn { width: 100%; }
  .assessment-stepper { margin: 0 -4px; }
  .assessment-step b { white-space: nowrap; }
}
.position-draft-status { position: sticky; top: 0; z-index: 5; padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(8px); }
.position-draft-status span { color: var(--steel); font-size: 12px; }
.position-draft-status .btn { margin-left: auto; }
.position-editor-form { gap: 18px; }
.position-editor-form .is-required-empty {
  border-color: var(--red) !important;
  background: #fffafa;
  box-shadow: 0 0 0 1px rgba(227, 6, 19, .12) !important;
  transition: none !important;
}
.field-context small { display: block; margin-top: 3px; color: var(--steel); }
@media (max-width: 720px) {
  .position-draft-status { align-items: flex-start; flex-wrap: wrap; }
  .position-draft-status .btn { margin-left: 0; width: 100%; }
}
.card-text-search { grid-column: 1 / -1; }
.position-text-list { margin: 0; padding-left: 22px; display: grid; gap: 7px; line-height: 1.55; }
.position-long-text summary { width: max-content; margin-bottom: 10px; color: var(--blue); cursor: pointer; font-weight: 800; }
.info-section p, .position-text-list { max-width: 78ch; }

/* Auth context: keep account and entry method visible without exposing technical headers. */
.current-user-summary {
  display: grid;
  gap: 1px;
  max-width: 240px;
  text-align: right;
}
.current-user-summary span {
  font-size: .68rem;
  opacity: .72;
}
.current-user-summary strong {
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1024px) {
  .current-user-summary { display: none; }
}


/* 5.16.2: compact account action and search controls aligned with the shared control language. */
.logout-icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border-color: rgba(255, 255, 255, .2);
  color: var(--surface);
  background: rgba(255, 255, 255, .08);
}
.logout-icon-btn:hover { background: rgba(255, 255, 255, .16); }
.logout-icon-btn .ui-icon { width: 19px; height: 19px; }

 .search-scope-summary {
  min-height: 44px;
  padding: 8px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.search-scope-summary > span { grid-row: 1 / 3; color: var(--blue); display: inline-flex; }
.search-scope-summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.search-scope-summary small { color: var(--steel); font-size: 11px; }
@media (max-width: 720px) {
  .search-scope-summary { align-items: start; }
  .logout-icon-btn { width: 44px; min-width: 44px; height: 44px; }
}

/* 5.16.3: required position fields use stateful borders instead of inline badges. */


/* 5.17 compact and observable background processes */
.active-assessment-stack { max-width: min(62vw, 760px); gap: 5px; }
.active-assessment-chip { min-height: 30px; max-width: 168px; padding: 5px 9px; gap: 6px; }
.active-assessment-stack .active-assessment-chip small { display: none; }
.active-assessment-chip i {
  width: 16px; height: 16px; flex: 0 0 16px; display: inline-grid; place-items: center;
  font-style: normal; font-size: 10px; line-height: 1; color: #fff; box-shadow: none;
}
.active-assessment-chip.running i { animation: process-dot-pulse 1.2s ease-in-out infinite; }
.active-assessment-chip.completed i { background: #42b86b; }
.active-assessment-chip.failed i { background: #e30613; }
.active-assessment-chip.cancelled i { background: #7b8794; }
@keyframes process-dot-pulse { 50% { opacity: .45; transform: scale(.86); } }
.process-timing { display: block; margin-top: 5px; color: var(--steel); font-size: 10px; font-weight: 650; }
.process-timing.is-stale { color: #9a6400; }
.process-stale-notice[hidden] { display: none; }

/* 5.18.0: unified controls for the Quality workspace. */
.quality-count-note { margin: 0; }

.quality-select {
  width: 100%;
  min-height: var(--control-height, 42px);
  padding: 9px 38px 9px 12px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 9px);
  color: var(--dark);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23002F6C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  box-shadow: 0 1px 2px rgba(0, 47, 108, .04);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.quality-select:hover { border-color: rgba(0, 47, 108, .45); background-color: #fbfdff; }
.quality-select:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 47, 108, .13);
}
.quality-select:disabled { color: var(--steel); background-color: var(--soft); cursor: not-allowed; opacity: .8; }
.quality-controls select.quality-select { padding-right: 38px; }

/* Assessment history actions remain separate controls; no nested buttons. */
.result-row-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: stretch;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.result-row-shell .result-row { width: 100%; border-top: 0; }
.result-row-shell:hover { background: var(--soft); }
.result-row-shell:hover .result-row { background: transparent; }
.result-delete {
  align-self: center;
  justify-self: center;
  color: #9b2f2f;
  border-color: transparent;
  background: transparent;
}
.result-delete:hover,
.result-delete:focus-visible { color: #7d1f1f; border-color: rgba(164, 59, 59, .24); background: #fff0f0; }
@media (max-width: 720px) {
  .result-row-shell { grid-template-columns: minmax(0, 1fr) 44px; }
  .result-row-shell .result-row { padding-right: 8px; }
}

/* n8n LLM retry diagnostics shown after an assessment failure. */
.assessment-error-diagnostics { margin: 0; }
.assessment-error-diagnostics-body {
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #fbfcfe;
}
.assessment-error-attempts { display: grid; gap: 8px; }
.assessment-error-attempt {
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.assessment-error-attempt > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.assessment-error-attempt span,
.assessment-error-attempt small { color: var(--steel); font-size: 11px; }
.assessment-error-response {
  padding: 7px 8px;
  border-radius: 7px;
  background: #f4f7fa;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}


.position-more-menu .danger-menu-item strong {
  color: var(--red);
}

.position-more-menu .danger-menu-item:not(:disabled):hover {
  background: color-mix(in srgb, var(--red) 8%, transparent);
}


/* 5.22.2: contextual LLM assistance in the position editor. */
.position-ai-input {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(0, 47, 108, .16);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 47, 108, .045), rgba(255, 255, 255, .96));
}
.position-ai-input > label { display: grid; gap: 7px; font-weight: 700; }
.position-ai-input > .btn { justify-self: start; }
.position-ai-intro {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.position-ai-intro > .ui-icon {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 11px;
  color: var(--blue);
  background: rgba(0, 47, 108, .09);
}
.position-ai-intro > div { display: grid; gap: 4px; }
.position-ai-intro strong { color: var(--dark); }
.position-ai-intro span { color: var(--steel); font-size: 13px; line-height: 1.45; }
.position-ai-field { display: grid; gap: 7px; }
.position-field-heading {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.position-field-heading > label { font-weight: 700; }
.field-ai-button {
  min-height: 30px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(0, 47, 108, .2);
  border-radius: 9px;
  color: var(--blue);
  background: rgba(0, 47, 108, .045);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.field-ai-button:hover { border-color: rgba(0, 47, 108, .45); background: rgba(0, 47, 108, .09); }
.field-ai-button:focus-visible { outline: 3px solid rgba(0, 47, 108, .16); outline-offset: 2px; }
.field-ai-button:disabled { cursor: wait; opacity: .7; }
.field-ai-button .ui-icon { width: 15px; height: 15px; }
.position-ai-field.is-ai-generated textarea { border-color: rgba(0, 47, 108, .36); background: #fbfdff; }
.ai-generated-note { color: var(--blue); font-size: 11px; font-weight: 650; }
@media (max-width: 720px) {
  .position-ai-input > .btn { width: 100%; }
  .position-field-heading { align-items: flex-start; }
  .field-ai-button { min-height: 36px; }
  .field-ai-button span { display: none; }
}

/* 5.22.4: focused UX improvements for position editing and assessment completion. */
.position-editor-actions {
  position: sticky;
  z-index: 8;
  bottom: -24px;
  margin: 4px -23px -24px;
  padding: 13px 23px max(13px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -10px 26px rgba(7, 28, 51, .10);
  backdrop-filter: blur(10px);
}
.position-editor-action-left {
  min-width: min(520px, 50%);
  display: flex;
  align-items: center;
  gap: 12px;
}
.position-required-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 10px;
}
.position-required-summary strong,
.position-required-summary small { display: block; }
.position-required-summary strong { color: #8a4d00; font-size: 13px; }
.position-required-summary small { grid-column: 1 / 2; color: var(--steel); font-size: 11px; }
.position-required-summary .btn { grid-column: 2; grid-row: 1 / 3; }
.position-required-summary.is-ready strong { color: var(--green); }
.position-required-summary.is-ready small { color: var(--steel); }
.position-main-grid { align-items: stretch; }
.position-grade-readonly {
  min-height: 76px;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  border: 1px solid rgba(0, 47, 108, .16);
  border-radius: 11px;
  color: var(--blue);
  background: var(--color-brand-subtle);
}
.position-grade-readonly span { font-size: 11px; font-weight: 800; }
.position-grade-readonly strong { grid-row: 1 / 3; grid-column: 2; font-size: 28px; line-height: 1; }
.position-grade-readonly small { color: var(--steel); font-size: 11px; }
.position-prefill-section,
.position-description-section {
  padding: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.position-prefill-section { background: linear-gradient(180deg, #f8fbfe, var(--surface)); }
.position-prefill-heading,
.position-description-heading { display: grid; gap: 4px; }
.position-prefill-heading h3,
.position-description-heading h3 { margin: 0; color: var(--ink); font-size: 18px; }
.position-prefill-heading p,
.position-description-heading p { margin: 0; color: var(--steel); line-height: 1.45; }
.sap-duties-source { border-left: 4px solid #7f9bb6; }
.sap-source-copy {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}
.sap-source-copy.modified { border-left: 4px solid var(--blue); background: var(--color-brand-subtle); }
.sap-source-copy span { display: block; margin-bottom: 6px; color: var(--steel); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.sap-source-copy p { margin: 0; white-space: pre-wrap; color: var(--ink); line-height: 1.55; }
.structure-form-card.manager-unresolved {
  border-color: rgba(211, 138, 0, .55);
  background: #fffaf0;
}
.selected-manager.unresolved { border-color: rgba(211, 138, 0, .55); background: #fff7e6; }
.selected-manager.unresolved strong { color: #8a4d00; }
.unresolved-manager-relation { display: grid; justify-items: center; gap: 8px; }

.reference-selection-section .selected-reference-summary {
  padding: 13px;
  display: grid;
  gap: 10px;
  overflow: visible;
  border: 1px solid rgba(0, 47, 108, .14);
  background: #edf5fd;
}
.selected-reference-summary-heading { display: grid; gap: 2px; }
.selected-reference-summary-heading strong { color: var(--ink); font-size: 14px; }
.selected-reference-summary-heading small { color: var(--steel); font-size: 11px; }
.selected-reference-summary-list { display: grid; gap: 7px; }
.selected-reference-item {
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .42fr) 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.selected-reference-focus {
  padding: 5px 7px;
  display: grid;
  gap: 2px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.selected-reference-focus:hover,
.selected-reference-focus:focus-visible { background: var(--soft); }
.selected-reference-focus strong,
.selected-reference-focus small { display: block; }
.selected-reference-focus small { color: var(--steel); font-size: 11px; }
.selected-reference-item label { display: grid; gap: 3px; color: var(--steel); font-size: 10px; font-weight: 800; }
.selected-reference-item select { min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.selected-reference-remove { color: var(--red); }
.compact-reference-picker,
.peer-picker.compact-reference-picker { max-height: none; overflow: visible; padding-right: 0; }

.review-path-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.review-path-selector-card {
  min-height: 144px;
  padding: 14px;
  position: relative;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.review-path-selector-card:hover:not(:disabled) { border-color: rgba(0, 47, 108, .4); background: var(--soft); }
.review-path-selector-card.active { border-color: var(--blue); box-shadow: inset 0 0 0 1px rgba(0, 47, 108, .12); background: var(--color-brand-subtle); }
.review-path-selector-card:disabled { opacity: .55; cursor: not-allowed; }
.review-path-selector-card > span { color: var(--blue); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.review-path-selector-card > strong { font-size: 15px; }
.review-path-selector-card > small { color: var(--steel); line-height: 1.45; }
.review-path-selector-card > em { width: max-content; margin-top: 4px; padding: 3px 7px; border-radius: var(--radius-pill); color: #17633a; background: #dff2e7; font-size: 10px; font-style: normal; font-weight: 850; }
.review-selected-path {
  padding: 18px;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbfe, var(--surface));
}
.review-selected-path > div:first-child > span { color: var(--blue); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.review-selected-path h3 { margin: 4px 0; }
.review-selected-path p { margin: 0; color: var(--steel); line-height: 1.5; }
.review-selected-path > .btn { justify-self: end; }
.questions-path .review-path-action { margin-top: 0; }

.modal.assessment-modal .assessment-result-body { flex: 1 1 auto; min-height: 0; }
.assessment-finalization-bar {
  flex: 0 0 auto;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #b9cfe3;
  background: rgba(246, 250, 255, .98);
  box-shadow: 0 -10px 26px rgba(7, 28, 51, .10);
  backdrop-filter: blur(10px);
}
.assessment-finalization-bar > div:first-child { display: grid; gap: 2px; }
.assessment-finalization-bar span { color: var(--blue); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.assessment-finalization-bar strong { font-size: 18px; }
.assessment-finalization-bar small { color: var(--steel); }
.assessment-finalization-bar-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.unsaved-choice-actions { flex-wrap: wrap; }

@media (max-width: 900px) {
  .position-editor-actions,
  .position-editor-action-left { width: auto; min-width: 0; align-items: stretch; flex-direction: column; }
  .position-editor-actions > div:last-child { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .position-required-summary { width: 100%; }
  .selected-reference-item { grid-template-columns: minmax(0, 1fr) 40px; }
  .selected-reference-item label { grid-column: 1 / -1; grid-row: 2; }
  .selected-reference-remove { grid-column: 2; grid-row: 1; }
  .review-path-selector { grid-template-columns: 1fr; }
  .review-path-selector-card { min-height: 0; }
  .assessment-finalization-bar { align-items: stretch; flex-direction: column; }
  .assessment-finalization-bar-actions { display: grid; grid-template-columns: 1fr; }
  .assessment-finalization-bar-actions .btn { width: 100%; }
}

@media (max-width: 620px) {
  .position-editor-actions { bottom: -24px; }
  .position-editor-actions > div:last-child { grid-template-columns: 1fr; }
  .position-required-summary { grid-template-columns: 1fr; }
  .position-required-summary .btn { grid-column: 1; grid-row: auto; width: 100%; }
  .position-grade-readonly { grid-template-columns: 1fr auto; }
}

/* 5.22.4: selected calibration roles grow with their content. */
.reference-selection-section .selected-reference-summary {
  min-height: 0;
  height: auto;
}
.reference-selection-section .selected-reference-summary[hidden] {
  display: none;
  visibility: visible;
}
.assessment-wizard > .assessment-section.reference-selection-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.reference-selection-section .selected-reference-summary { flex: 0 0 auto; }
.position-card-sap-duties,
.position-workspace-sap-duties {
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid #7f9bb6;
  border-radius: 12px;
  background: var(--surface);
}
.position-card-sap-duties > summary,
.position-workspace-sap-duties > summary {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.position-card-sap-duties > summary::-webkit-details-marker,
.position-workspace-sap-duties > summary::-webkit-details-marker { display: none; }
.position-card-sap-duties > summary::after,
.position-workspace-sap-duties > summary::after { content: '⌄'; color: var(--blue); font-weight: 900; }
.position-card-sap-duties[open] > summary::after,
.position-workspace-sap-duties[open] > summary::after { content: '⌃'; }
.position-card-sap-duties > summary > span,
.position-workspace-sap-duties > summary > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 850; }
.position-card-sap-duties > summary > small,
.position-workspace-sap-duties > summary > small { margin-left: auto; color: var(--steel); font-size: 11px; font-weight: 750; }
.position-card-sap-duties-content,
.position-workspace-sap-duties > div { padding: 0 16px 16px; }
.position-card-sap-duties-content > .muted,
.position-workspace-sap-duties > div > p:first-child { margin: 0 0 10px; color: var(--steel); font-size: 12px; }
.position-workspace-sap-duties { margin-top: 14px; }

/* 5.22.5 — unified position card, corporate switches and top-level tooltips */
.app-tooltip-layer {
  position: fixed;
  z-index: 100000;
  width: max-content;
  max-width: min(360px, calc(100vw - 20px));
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  color: #fff;
  background: rgba(9, 27, 49, .98);
  box-shadow: 0 14px 34px rgba(5, 24, 50, .28);
  pointer-events: none;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}
.app-tooltip-layer[hidden] { display: none; }
/* Local pseudo-tooltips are disabled: the portal above cannot be clipped by modals/cards. */
.icon-action::after { display: none; }

/* Corporate switch used by every checkbox in the application. */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 42px;
  min-width: 42px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  border: 1px solid #9eacba;
  border-radius: 999px;
  background: #dce3e9;
  background-image: radial-gradient(circle at 11px 50%, #fff 0 8px, transparent 8.5px);
  box-shadow: inset 0 1px 2px rgba(14, 36, 60, .12), 0 1px 1px rgba(14, 36, 60, .08);
  cursor: pointer;
  flex: 0 0 42px;
  vertical-align: middle;
  transition: background-color .18s ease, border-color .18s ease, background-position .18s ease, box-shadow .18s ease;
}
input[type="checkbox"]:checked {
  border-color: var(--blue);
  background-color: var(--blue);
  background-image: radial-gradient(circle at 30px 50%, #fff 0 8px, transparent 8.5px);
}
input[type="checkbox"]:hover:not(:disabled) { border-color: var(--blue); }
input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(0, 85, 184, .22);
  outline-offset: 3px;
}
input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
.switch-row,
.reference-check,
.context-confirm,
.top-position-toggle,
.manager-scope-switch { align-items: center; }
.switch-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; cursor: pointer; }
.switch-row > span { min-width: 0; }
.context-toggle > input { top: 14px; right: 14px; }
.reference-check { grid-template-columns: 42px minmax(0, 1fr); }
.modal-form .top-position-toggle { grid-template-columns: 42px minmax(0, 1fr); align-items: center; }
.modal-form .top-position-toggle input { width: 42px; min-height: 24px; margin-top: 0; }

.position-description-grid { grid-template-columns: minmax(0, 1fr); }
.position-description-grid > *,
.position-description-grid .info-section,
.info-section p,
.position-text-list,
.position-text-content { width: 100%; max-width: none; min-width: 0; }
.info-section p,
.position-text-list,
.position-text-preview,
.position-text-full { overflow-wrap: anywhere; word-break: normal; }
.position-text-expandable { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: start; gap: 8px; width: 100%; }
.position-text-toggle {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--blue);
  background: var(--surface);
  cursor: pointer;
}
.position-text-toggle .ui-icon { width: 18px; height: 18px; transform: rotate(180deg); transition: transform .16s ease; }
.position-text-toggle[aria-expanded="true"] .ui-icon { transform: rotate(0deg); }
.position-text-toggle:hover { border-color: rgba(0,47,108,.36); background: var(--color-brand-soft); }
.position-text-toggle:focus-visible { outline: 3px solid rgba(0,85,184,.2); outline-offset: 2px; }
.position-card-sap-duties h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.position-card-sap-duties h3 small { padding: 3px 7px; border-radius: 999px; color: #526272; background: #eef2f5; font-size: 10px; }
.sap-duty-note { margin-bottom: 10px; }

.position-draft-status {
  position: static;
  z-index: auto;
  margin: 0 24px 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fb;
  backdrop-filter: none;
}
.position-draft-status .draft-status-icon { width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--green); background: rgba(31,122,77,.1); }
.position-draft-status .draft-status-icon .ui-icon { width: 14px; height: 14px; }

.position-identity-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f9fafb; }
.position-identity-summary { display: grid; grid-template-columns: minmax(260px, 1.5fr) minmax(190px, .8fr) minmax(220px, 1fr); gap: 12px; align-items: end; }
.position-grade-readonly,
.position-identity-summary .field-context { min-height: 66px; padding: 9px 11px; display: flex; flex-direction: column; justify-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.position-grade-readonly > span,
.position-identity-summary .field-context > span { color: var(--steel); font-size: 11px; font-weight: 700; }
.position-grade-readonly small,
.position-identity-summary .field-context small { color: var(--steel); font-size: 10px; line-height: 1.35; }
.position-identity-card .structure-form-card { margin: 0; padding: 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.manager-search-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.manager-scope-switch { max-width: 430px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.manager-scope-switch b,
.manager-scope-switch small { display: block; }
.manager-scope-switch b { color: var(--ink); font-size: 11px; }
.manager-scope-switch small { margin-top: 2px; color: var(--steel); font-size: 10px; line-height: 1.3; }

.unified-position-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.unified-position-fields .position-ai-field { width: 100%; }
.position-editor-sap-reference { padding: 12px; border: 1px dashed #98a8b8; border-radius: 10px; background: #f4f7f9; }
.position-editor-sap-reference .sap-values-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.position-editor-sap-reference .sap-value { padding: 10px; border-radius: 8px; background: #fff; }
.position-ai-all-button { width: 42px; min-width: 42px; min-height: 42px; padding: 0; display: inline-grid; place-items: center; }
.position-ai-all-button .ui-icon { width: 20px; height: 20px; }
.position-ai-all-button.is-loading .ui-icon { animation: position-ai-spin 1s linear infinite; }
@keyframes position-ai-spin { to { transform: rotate(360deg); } }

.compact-data-layout { gap: 10px; }
.compact-source-card { padding: 14px; }
.compact-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.data-status-icons { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.data-status-icon,
.quality-ok-icon,
.danger-status-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--blue); background: var(--surface); cursor: help; }
.data-status-icon .ui-icon,
.quality-ok-icon .ui-icon,
.danger-status-icon .ui-icon { width: 17px; height: 17px; }
.data-status-icon small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.data-status-icon.modified { color: #9b5a00; background: #fff8e8; }
.data-status-icon.success,
.quality-ok-icon { color: var(--green); background: #eef9f3; }
.quality-compact-row { min-height: 38px; display: flex; align-items: center; gap: 9px; color: var(--steel); }
.compact-reset-card { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compact-reset-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
.compact-reset-copy > div { min-width: 0; display: flex; flex-direction: column; }
.compact-reset-copy small { color: var(--steel); }
.danger-status-icon { color: var(--red); background: var(--color-danger-soft); }
.compact-delete-position { flex: 0 0 auto; }

.position-editor-actions { bottom: 0; }
.position-editor-form { padding-bottom: 18px; }

@media (max-width: 900px) {
  .position-identity-summary { grid-template-columns: 1fr 1fr; }
  .position-identity-summary > label:first-child { grid-column: 1 / -1; }
  .compact-source-heading { align-items: flex-start; flex-direction: column; }
  .data-status-icons { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .position-text-expandable { grid-template-columns: minmax(0, 1fr) 44px; }
  .position-text-toggle { width: 44px; min-width: 44px; min-height: 44px; }
  .position-identity-summary,
  .position-editor-sap-reference .sap-values-grid { grid-template-columns: 1fr; }
  .position-identity-summary > label:first-child { grid-column: auto; }
  .manager-search-heading { align-items: stretch; flex-direction: column; }
  .manager-scope-switch { max-width: none; }
  .position-draft-status { margin-inline: 12px; }
  .compact-reset-card { align-items: flex-start; }
}
/* Switch alignment for legacy checkbox layouts. */
.previous-assessment-options label,
.card-preview-item { grid-template-columns: 42px minmax(0, 1fr); align-items: center; }
.assessment-benchmark-choice { align-items: center; }
.assessment-benchmark-choice input,
.card-preview-item input { margin-top: 0; }
.modal-form .context-confirm { align-items: center; }
.modal-form .context-confirm input { width: 42px; min-width: 42px; height: 24px; min-height: 24px; margin: 0; }
.context-toggle .assessment-context-card { padding-right: 70px; }

.manager-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.manager-search-row .manager-search-field { margin: 0; }
.manager-scope-compact {
  min-height: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}
.manager-scope-compact input { margin: 0; }
.manager-search-scope { display: block; color: var(--steel); font-size: 11px; }
.position-draft-status[data-status="saving"] { border-color: rgba(0, 47, 108, .35); background: var(--color-brand-soft); }
.position-draft-status[data-status="saved"],
.position-draft-status[data-status="unchanged"] { border-color: rgba(31, 122, 77, .3); background: #eef9f3; }
.position-draft-status[data-status="error"] { border-color: rgba(174, 36, 45, .35); background: var(--color-danger-soft); }
.position-draft-status[data-status="error"] .draft-status-icon { color: var(--red); background: rgba(174, 36, 45, .1); }
.position-extraction-process {
  margin-top: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--color-brand-soft);
}
.position-extraction-process > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--surface); font-weight: 800; }
.position-extraction-process > div { display: flex; flex-direction: column; gap: 2px; }
.position-extraction-process small { color: var(--steel); }
.position-extraction-process.error { border-color: rgba(174, 36, 45, .3); background: var(--color-danger-soft); }
.delete-plan { display: grid; gap: 12px; }
.delete-plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.delete-plan-grid > div, .delete-plan-parent { padding: 10px; display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.delete-plan-grid span, .delete-plan-parent span { color: var(--steel); font-size: 11px; }
.delete-plan-grid strong { font-size: 20px; }
.delete-plan-blockers { padding: 12px; border: 1px solid rgba(174, 36, 45, .3); border-radius: 10px; background: var(--color-danger-soft); }
.delete-plan-blockers ul { margin: 8px 0 0; padding-left: 20px; }
.delete-plan-caveat { color: var(--steel); line-height: 1.45; }
@media (max-width: 560px) {
  .manager-search-row { grid-template-columns: 1fr; }
  .manager-scope-compact { justify-content: center; }
  .delete-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Work-plan 5.25: explicit grade origin, anchored import result and accessible processing state. */
.position-grade-editor {
  min-height: 66px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.position-grade-editor > span { color: var(--steel); font-size: 11px; font-weight: 700; }
.position-grade-editor input { min-height: 32px; padding: 5px 8px; }
.position-grade-editor small { color: var(--steel); font-size: 10px; line-height: 1.35; }
.staff-units-label {
  min-height: 66px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.staff-units-label > span { color: var(--steel); font-size: 11px; font-weight: 700; }
.staff-units-label input { min-height: 32px; padding: 5px 8px; width: 80px; }
.staff-units-label small { color: var(--steel); font-size: 10px; line-height: 1.35; }
.manual-grade-origin-icon {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  cursor: help;
}
.position-extraction-process .process-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(0, 47, 108, .22);
  border-top-color: var(--blue);
  border-radius: 50%;
  background: transparent;
  animation: position-process-spin .8s linear infinite;
}
.position-extraction-process .process-error-icon { width: 18px; height: 18px; }
@keyframes position-process-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .position-extraction-process .process-spinner { animation: none; border-top-color: rgba(0, 47, 108, .22); }
}
.position-transfer-result {
  height: 76px;
  min-height: 76px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  overflow: auto;
  border: 1px solid rgba(31, 122, 77, .3);
  border-radius: 10px;
  background: #eef9f3;
}
.position-transfer-result.is-placeholder { visibility: hidden; pointer-events: none; }
.position-transfer-result > span,
.position-transfer-result details { color: var(--steel); font-size: 12px; }
.position-transfer-result summary { cursor: pointer; font-weight: 700; }
.position-transfer-result p { margin: 6px 0 0; }

@media (max-width: 560px) {
  .modal.fullscreen-editor {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
  }
}

/* Background process controls: keep open and cancel actions separate, never nested. */
.active-process-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.active-process-cancel {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(174, 36, 45, .35);
  border-radius: 50%;
  background: var(--surface);
  color: var(--color-danger, #ae242d);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.active-process-cancel:hover { background: var(--color-danger-soft); }
.position-extraction-process .btn.compact {
  margin-left: auto;
  min-height: 32px;
  padding: 5px 10px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .position-extraction-process { align-items: flex-start; flex-wrap: wrap; }
  .position-extraction-process .btn.compact { width: 100%; margin-left: 0; }
}

/* Assessment propagation: selection modal (same-name toggles / search any position). */
.propagate-modal-body { padding: 18px 24px; display: grid; gap: 16px; }
.propagate-mode-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 10px; background: var(--soft); }
.propagate-mode-tab {
  flex: 1;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--steel);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}
.propagate-mode-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.propagate-section { display: grid; gap: 9px; }
.propagate-section-heading { display: flex; justify-content: space-between; align-items: center; color: var(--steel); font-size: 12px; }
.propagate-section-heading strong { color: var(--ink); font-size: 13px; }
.propagate-search-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font: inherit;
  font-size: 14px;
}
.propagate-search-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.propagate-candidate-list { display: grid; gap: 7px; max-height: 320px; overflow: auto; }
.propagate-candidate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.propagate-candidate-row:hover { border-color: var(--blue); }
.propagate-candidate-row.selected { border-color: var(--blue); background: #f4f9ff; }
.propagate-candidate-row input[type="checkbox"] { flex: 0 0 auto; width: 17px; height: 17px; accent-color: var(--blue); }
.propagate-candidate-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.propagate-candidate-main strong { font-size: 13px; overflow-wrap: anywhere; }
.propagate-candidate-main small { color: var(--steel); font-size: 11px; overflow-wrap: anywhere; }
.propagate-candidate-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: var(--steel); font-size: 11px; white-space: nowrap; }
.propagate-overwrite-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: #fff1f0;
  color: #9c1820;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
}
.propagate-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--steel); font-size: 12px; text-align: center; }
.propagate-selection-summary { padding-top: 2px; color: var(--steel); font-size: 12px; }
.propagate-selection-summary strong { color: var(--ink); }
.propagate-overwrite-list { display: grid; gap: 7px; max-height: 240px; overflow: auto; }
.propagate-overwrite-list .propagate-candidate-row { cursor: default; }
@media (max-width: 640px) {
  .propagate-modal-body { padding: 14px 16px; }
  .propagate-mode-tabs { flex-direction: column; }
  .propagate-candidate-meta { white-space: normal; }
}
