* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  color: var(--ink);
  background:
    radial-gradient(720px 440px at 4% -8%, rgba(0, 47, 108, .10), transparent 68%),
    radial-gradient(680px 360px at 102% 6%, rgba(0, 47, 108, .07), transparent 62%),
    linear-gradient(180deg, #f7fafd 0%, var(--surface) 48%);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.48;
}
button, input, textarea, select { font: inherit; }
button { border: 0; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .quality-table-wrap tr:focus-visible {
  outline: 3px solid rgba(0, 47, 108, .18);
  outline-offset: 2px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .68;
  background:
    radial-gradient(760px 420px at 8% 0%, rgba(0, 47, 108, .10), transparent 62%),
    linear-gradient(to right, rgba(215, 224, 232, .18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(215, 224, 232, .16) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
  mask-image: linear-gradient(180deg, black 0%, rgba(0, 0, 0, .65) 48%, transparent 100%);
}

.app-shell { min-height: 100vh; min-height: 100dvh; }
.topbar {
  min-height: 82px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  
  color: var(--surface);
  background: linear-gradient(135deg, rgba(0, 47, 108, .99), rgba(7, 28, 51, .99));
  box-shadow: 0 16px 42px rgba(7, 28, 51, .18);
}
.brand { display: flex; align-items: center; gap: var(--space-3); font-weight: 800; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: var(--radius-md);
  color: var(--surface);
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .07));
  font-size: 21px;
  font-weight: 900;
}
.brand-light strong { display: block; margin-top: 2px; font-size: 17px; }
.eyebrow, .section-kicker {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.eyebrow { color: rgba(255, 255, 255, .76); }
.eyebrow.dark, .section-kicker { color: var(--blue); }
.topnav { display: flex; gap: 5px; }
.nav-btn {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 11px;
  color: rgba(255, 255, 255, .78);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}
.nav-btn:hover, .nav-btn.active { color: var(--surface); background: rgba(255, 255, 255, .12); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.user-chip, .chip, .status-label{
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}


.user-chip {
  
  max-width: 240px;
  padding: 7px 11px;
  color: var(--surface);
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}
.icon-btn {
  width: 38px;
  height: 38px;
  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;
  font-weight: 800;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
}
.icon-btn:hover { transform: translateY(-1px); border-color: var(--blue); background: var(--soft); }
.icon-btn.light { border-color: rgba(255, 255, 255, .19); color: var(--surface); background: rgba(255, 255, 255, .08); }

.page { width: min(1800px, 100%); margin: 0 auto; padding: 18px; }
.guide-card {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 52px 18px 22px;
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(420px, .9fr);
  align-items: center;
  gap: 28px;
  border: 1px solid rgba(0, 47, 108, .15);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 0%, #f4f9ff 100%);
  box-shadow: var(--shadow-soft);
}
.guide-card h1 { margin: 4px 0 5px; color: var(--dark); font-size: 22px; letter-spacing: -.025em; }
.guide-card p { margin: 0; max-width: 760px; color: var(--steel); font-size: 13px; }
.guide-card > .icon-btn { position: absolute; top: 12px; right: 12px;   }
.guide-steps { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.guide-steps div { min-width: 110px; text-align: center; }
.guide-steps b { width: 34px; height: 34px; margin: 0 auto 5px; display: grid; place-items: center; border-radius: 50%; color: var(--surface); background: var(--blue); }
.guide-steps span { color: var(--steel); font-size: 11px; font-weight: 700; }
.guide-steps i { width: 44px; height: 1px; background: var(--line); }

.summary-strip {
  margin-bottom: 14px;
  
  
  
}
.summary-item{
  padding: 13px 15px;
  border: 1px solid rgba(215, 224, 232, .9);
  border-radius: 13px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}
.summary-item span{ color: var(--steel); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.summary-item strong { display: block; margin: 2px 0; color: var(--blue); font-size: 25px; line-height: 1.1; }
.summary-item small{ color: var(--steel); font-size: 10px; }
.summary-item.warning { border-left: 4px solid var(--orange); }


.workspace { display: grid; grid-template-columns: 360px minmax(560px, 1fr); gap: 14px;  }
.panel {
  min-width: 0;
  border: 1px solid rgba(215, 224, 232, .84);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  padding: 17px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--soft));
}
.panel-header h2 { margin: 3px 0 0; color: var(--dark); font-size: 17px; letter-spacing: -.02em; }
.panel-header p { margin: 4px 0 0; max-width: 760px; color: var(--steel); font-size: 11px; }
.tree-panel, .list-panel {  display: flex; flex-direction: column; }
.tree-help, .list-caption { padding: 10px 17px; border-bottom: 1px solid var(--line); color: var(--steel); background: var(--soft);  }
.tree-scroll {   padding: 8px; overflow: auto; overflow-anchor: none; }
.tree-row { min-height: 36px; display: flex; align-items: stretch; border-radius: 10px; }
.tree-row:hover { background: var(--color-brand-muted); }
.tree-row.selected { background: #eaf2fa; box-shadow: inset 3px 0 0 var(--blue); }
.tree-toggle {  flex: 0 0 auto; color: var(--steel); background: transparent; cursor: pointer; }
.tree-label { min-width: 0; flex: 1; padding: 6px 8px 6px 2px; display: flex; align-items: center; gap: 7px; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.tree-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;  font-weight: 650; }
.tree-icon { color: var(--blue); }
.tree-label em { min-width: 20px; color: var(--steel); font-size: 10px; font-style: normal; text-align: right; }
.tree-children { margin-left: 14px; padding-left: 7px; border-left: 1px solid var(--line); }


.btn {
  min-height: 40px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 750;
  line-height: 1.2;
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(7, 28, 51, .13); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { color: var(--surface); border-color: var(--blue); background: var(--blue); }
.btn.primary:hover { border-color: var(--dark); background: var(--dark); }
.btn.secondary { color: var(--blue); border-color: var(--line); background: var(--surface); }
.btn.secondary:hover { border-color: var(--blue); background: var(--soft); }
.btn.danger { color: #a02029; border-color: rgba(227, 6, 19, .24); background: var(--color-danger-soft); }
.btn.compact { min-height: 34px; padding: 7px 10px; border-radius: 10px; font-size: 11px; }

.search-box { margin: 14px 16px 10px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 47, 108, .09); }
.search-box > span { padding-left: 13px; color: var(--blue); font-size: 18px; }
.search-box input { min-width: 0; min-height: var(--control-height); flex: 1; padding: 9px 10px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box button { width: 38px; color: var(--steel); background: transparent; cursor: pointer; font-size: 18px; }
.position-table-wrap, .quality-table-wrap { min-height: 0; flex: 1; overflow: auto; overflow-anchor: none; }
.quality-table-wrap table { width: 100%; border-collapse: collapse; background: var(--surface); }
.quality-table-wrap th, .quality-table-wrap td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.quality-table-wrap th { position: sticky; top: 0; z-index: 2; color: var(--surface); background: linear-gradient(180deg, var(--blue), #06275a);  font-weight: 750; }
.quality-table-wrap tbody tr { transition: background .14s ease; }
.quality-table-wrap tbody tr:nth-child(even) { background: var(--color-surface-alt); }
.quality-table-wrap tbody tr:hover { background: #eef5fb; cursor: pointer; }
.quality-table-wrap td strong { display: block; color: var(--ink);  }
.quality-table-wrap td small { display: block;  color: var(--steel);  }

.status-label { padding: 4px 8px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.status-label.success { color: #17613d; background: #eaf7f0; }
.status-label.warning { color: #815209; background: var(--color-warning-soft); }
.status-label.modified { color: var(--blue); background: #e9f2fb; }

.empty-state { min-height: 320px; padding: 30px; display: grid; place-items: center; align-content: center; color: var(--steel); text-align: center; }
.empty-state > span { width: 68px; height: 68px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 20px; color: var(--blue); background: var(--soft); font-size: 28px; }
.empty-state h3 { margin: 12px 0 4px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 11px; }
.skeleton { height: 40px; margin: 8px 12px; border-radius: 10px; background: linear-gradient(90deg, #eef2f6, #fafcfd, #eef2f6); background-size: 200% 100%; animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; padding: 22px; display: grid; place-items: center; overflow: auto; overscroll-behavior: contain; background: rgba(7, 28, 51, .43); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-backdrop.modal-backdrop-fullscreen { overflow: clip; }
.modal { width: min(1180px, calc(100vw - 44px)); max-width: 100%; min-width: 0; max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px); display: flex; flex-direction: column; isolation: isolate; border: 1px solid rgba(255, 255, 255, .36); border-radius: var(--radius-dialog); background: var(--surface); box-shadow: var(--shadow-dialog); overflow: hidden; animation: modalIn .18s ease-out; }
.modal.modal-rerendered { animation: none; }
.modal.medium { width: min(820px, calc(100vw - 44px)); }
.modal.small { width: min(620px, calc(100vw - 44px)); }
.modal > :where(header, footer, nav, form, section, article, div),
.modal :where(header, footer, nav, form, section, article, fieldset, label, div, dl, ul, ol) { min-width: 0; }
.modal :where(input, textarea, select, button, table, pre, .modal-body, .modal-form, .help-content, .picker-content, .assessment-form, .expert-line-form, .assessment-result-body, .card-preview-body, .process-body) { max-width: 100%; min-width: 0; }
.modal :where(h1, h2, h3, h4, p, span, strong, small, label, dt, dd, li, th, td, button, .notice, .chip) { overflow-wrap: anywhere; word-break: normal; }
.modal :where(.btn, .modal-tab) { white-space: normal; }
.modal :where(img, video, canvas) { max-width: 100%; height: auto; }
.modal pre { overflow: auto; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.992); } to { opacity: 1; transform: none; } }
.modal-header { position: relative; padding: 21px 60px 19px 23px; display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), #f7fafe); }
.modal-header h2 { margin: 5px 0; color: var(--dark); font-size: 23px; line-height: 1.2; letter-spacing: -.025em; }
.modal-header p { margin: 0; max-width: 840px; color: var(--steel); font-size: 11px; }
.modal-close { position: absolute; top: 16px; right: 17px; width: var(--touch-target); min-width: var(--touch-target); height: var(--touch-target); min-height: var(--touch-target); border-radius: 10px; color: var(--steel); background: transparent; cursor: pointer; font-size: 22px; }
.modal-close:hover { color: var(--red); background: #fff1f0; }
.position-modal-header { display: grid; grid-template-columns: minmax(0, 1fr) 122px; }
.modal-title-block { min-width: 0; }
.header-badges { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 8px; border: 1px solid rgba(0, 47, 108, .15); color: var(--blue); background: var(--surface); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.chip.modified { color: #17613d; border-color: rgba(31, 122, 77, .22); background: #eef9f3; }
.grade-box { min-height: 90px; padding: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(0, 47, 108, .16); border-radius: 14px; color: var(--blue); background: var(--color-brand-subtle); }
.grade-box span { font-size: 9px; text-transform: uppercase; }
.grade-box strong { margin-top: 4px; font-size: 32px; line-height: 1; }
.modal-toolbar { padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); border-bottom: 1px solid var(--line); }
.modal-tabs { min-width: 0; display: flex; overflow-x: auto; }
.modal-tab { min-height: 50px; padding: 0 12px; position: relative; color: var(--steel); background: transparent; cursor: pointer; white-space: normal; overflow-wrap: anywhere; font-size: 12px; font-weight: 750; }
.modal-tab.active { color: var(--blue); }
.modal-tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); }
.toolbar-actions { display: flex; gap: 7px; }
.modal-body { min-height: 360px; padding: 20px 22px 28px; overflow: auto; }
.modal-loading { min-height: 500px; padding: 30px; }
.hierarchy-help { margin-bottom: 16px; padding: 11px 14px; display: flex; gap: var(--space-3); border-left: 4px solid var(--steel); border-radius: 10px; color: var(--steel); background: var(--soft); font-size: 11px; }
.hierarchy-help strong { color: var(--ink); }
.hierarchy-flow { display: flex; flex-direction: column; align-items: center; }
.hierarchy-level { width: min(820px, 100%); text-align: center; }
.level-label { display: block; margin-bottom: 7px; color: var(--steel); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.flow-line { width: 2px; height: 25px; background: linear-gradient(var(--line), var(--blue)); }
.current-position-card { width: min(560px, 100%); padding: 16px 18px; border: 2px solid rgba(0, 47, 108, .32); border-radius: 14px; color: var(--surface); background: linear-gradient(135deg, var(--blue), var(--dark)); box-shadow: 0 14px 34px rgba(0, 47, 108, .18); text-align: center; }
.current-position-card span, .current-position-card small { display: block; color: rgba(255, 255, 255, .74); font-size: 9px; text-transform: uppercase; }
.current-position-card strong { display: block; margin: 5px 0; font-size: 16px; }
.relation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.relation-card { width: 100%; padding: 12px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 20px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); color: var(--ink); background: var(--surface); cursor: pointer; text-align: left; }
.relation-card:hover { border-color: rgba(0, 47, 108, .4); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.relation-card.manager { width: min(560px, 100%); margin: auto; border-left: 4px solid var(--blue); }
.relation-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--color-brand-soft); font-weight: 900; }
.relation-card strong { display: block; font-size: 11px; }
.relation-card small { display: block; margin-top: 3px; color: var(--steel); font-size: 9px; }
.relation-card em {  font-style: normal; }
.empty-relation { padding: 15px; border: 1px dashed var(--line); border-radius: var(--radius-md); color: var(--steel); background: var(--soft);  }
.reports-level { width: min(980px, 100%); }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.content-grid.single { grid-template-columns: 1fr; }
.info-section { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(180deg, var(--surface), var(--color-surface-alt)); }
.info-section h3 { margin: 0 0 9px; color: var(--blue); font-size: 13px; }
.info-section p { margin: 0; white-space: pre-wrap; color: #38485a;  line-height: 1.58; }
.info-section p.muted { color: #98a2ac; font-style: italic; }
.data-layout { display: grid; gap: var(--space-3); }
.source-card, .reset-card { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.source-card h3, .reset-card h3 { margin: 0 0 12px; color: var(--blue); }
dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
dl div { padding: 10px 12px; border-radius: 10px; background: var(--soft); }
dt { color: var(--steel); font-size: 9px; text-transform: uppercase; }
dd { margin: 4px 0 0; font-size: 11px; font-weight: 700; }
.issue-stack { display: grid; gap: 7px; }
.reset-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); border-left: 4px solid var(--red); background: #fff8f8; }
.reset-card h3 { color: #8f2028; }
.reset-card p { margin: 0; color: var(--steel); font-size: 11px; }
.notice { padding: 11px 13px; display: flex; gap: var(--space-2); border-radius: 10px; font-size: 11px; }
.notice strong, .notice span { display: block; }
.notice.info { border-left: 4px solid var(--steel); color: var(--color-text-secondary); background: var(--soft); }
.notice.success { border-left: 4px solid var(--green); color: #155b39; background: #eaf7f0; }
.notice.warning { border-left: 4px solid var(--orange); color: #79500c; background: #fff7e6; }
.notice.error { border-left: 4px solid var(--red); color: #9c1820; background: #fff1f0; }

.modal-form { padding: 20px 23px 24px; display: flex; flex-direction: column; gap: 14px; overflow: auto; }
.modal-form label, .login-form label { display: flex; flex-direction: column; gap: 6px; color: var(--color-text-secondary); font-size: 11px; font-weight: 750; }
.modal-form input, .modal-form textarea, .modal-form select, .login-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.modal-form input:focus, .modal-form textarea:focus, .modal-form select:focus, .login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 47, 108, .09); }
.modal-form textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.form-details { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.form-details summary { min-height: 48px; padding: 13px 16px; color: var(--blue); background: var(--surface); cursor: pointer; font-weight: 800; }
.form-details[open] summary { border-bottom: 1px solid var(--line); background: var(--soft); }
.details-content { padding: 15px; display: grid; gap: 13px; }
.form-notice { padding: 12px 14px; border-left: 4px solid var(--blue); border-radius: 10px; color: var(--steel); background: #f4f9ff; font-size: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.help-content { padding: 22px; overflow: auto; }
.help-steps { margin: 0 0 16px; padding: 0; display: grid; gap: 10px; list-style: none; }
.help-steps li { padding: 13px; display: grid; grid-template-columns: 180px 1fr; gap: var(--space-3); border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.help-steps b { color: var(--blue); }
.help-steps span { color: var(--steel); font-size: 11px; }
.help-content .notice { margin-top: 9px; flex-direction: column; }

.quality-page { display: grid; gap: 14px; }
.quality-intro { padding: 20px 22px; display: flex; justify-content: space-between; gap: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.quality-intro h1 { margin: 4px 0; color: var(--dark); font-size: 23px; }
.quality-intro p { margin: 0; color: var(--steel); font-size: 11px; }
.quality-grid { display: grid;   overflow-x: auto; }
.quality-card {    flex-direction: column; justify-content: space-between;   border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft); }
.quality-card span { color: var(--steel); font-size: 9px; }
.quality-card strong { color: var(--blue);  }
.quality-table-panel { min-height: 560px; display: flex; flex-direction: column; }
.loading-panel { min-height: 600px; padding: 20px; }

.global-error { position: fixed; top: 94px; right: 18px; z-index: 90; max-width: 620px; padding: 12px 13px; display: flex; gap: var(--space-3); border: 1px solid rgba(227, 6, 19, .22); border-left: 4px solid var(--red); border-radius: var(--radius-md); color: #8c1b23; background: var(--color-danger-soft); box-shadow: var(--shadow); font-size: 11px; }
.global-error button { margin-left: auto; color: inherit; background: transparent; cursor: pointer; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; padding: 13px 16px; border: 1px solid rgba(31, 122, 77, .2); border-left: 4px solid var(--green); border-radius: var(--radius-md); color: #155b39; background: rgba(255, 255, 255, .98); box-shadow: var(--shadow); font-size: 11px; font-weight: 750; }

.login-page { min-height: 100vh; padding: 24px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(0, 47, 108, .99), rgba(7, 28, 51, .99)); }
.login-page .bg-grid { z-index: 0; opacity: .22; mask-image: none; }
.login-card { position: relative; z-index: 1; width: min(590px, 100%); padding: 34px; border: 1px solid rgba(255, 255, 255, .38); border-radius: 20px; background: rgba(255, 255, 255, .98); box-shadow: 0 34px 90px rgba(0, 0, 0, .24); }
.login-card .brand { margin-bottom: 28px; color: var(--blue); }
.login-card .brand-mark { background: var(--blue); }
.login-card h1 { margin: 9px 0; color: var(--dark); font-size: 34px; line-height: 1.12; letter-spacing: -.035em; }
.login-card .lead { margin: 0 0 24px; color: var(--steel); font-size: 14px; }
.login-sso-note { margin: -8px 0 18px; padding: 11px 13px; display: grid; gap: 3px; border: 1px solid rgba(0, 47, 108, .16); border-radius: 11px; color: var(--steel); background: #f3f8fc; font-size: 10px; }
.login-sso-note strong { color: var(--blue); font-size: 11px; }
.login-form { display: grid; gap: 13px; }
.login-form input, .login-form .btn { min-height: 49px; }
.privacy-note { margin-top: 20px; padding: 13px; display: grid; gap: 2px; border-radius: 11px; color: var(--steel); background: var(--soft); font-size: 10px; }
.privacy-note strong { color: var(--blue); }
.login-card > .notice { margin-top: 12px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: var(--radius-pill); background: rgba(0, 47, 108, .28); background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 47, 108, .42); background-clip: content-box; }


@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topnav { order: 3; width: 100%; }
  
  .tree-panel { min-height: 460px; }
  .guide-card { grid-template-columns: 1fr; }
  .guide-steps { justify-content: flex-start; }
  
}

@media (max-width: 720px) {
  
  
  
  .user-chip:not(.compact-user) { display: none; }
  
  .guide-steps { overflow-x: auto; }
  .panel-header, .quality-intro { flex-direction: column; }
  .panel-header .btn, .quality-intro .btn { width: 100%; }
  
  
  .position-modal-header { grid-template-columns: 1fr; }
  .grade-box { width: 100%; min-height: 60px; flex-direction: row; justify-content: space-between; }
  .content-grid, .relation-grid, dl, .form-grid { grid-template-columns: 1fr; }
  .reset-card { align-items: stretch; flex-direction: column; }
  .help-steps li { grid-template-columns: 1fr; }
  .login-page { padding: 12px; }
  .login-card { padding: 25px 20px; }
  .login-card h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.load-more { padding: 13px; display: flex; align-items: center; justify-content: center; gap: var(--space-3); border-top: 1px solid var(--line); color: var(--steel); background: var(--soft); font-size: 10px; }
.panel-actions { display: flex; gap: 7px; }

/* UX audit corrections: clearer primary action, constrained work area and accessible dialogs. */
body.modal-open { overflow: hidden; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--surface);
  background: var(--blue);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.field-help { color: var(--steel); font-size: 11px; font-weight: 400; line-height: 1.4; }
.required-mark { margin-left: 5px; color: #8a2630; font-size: 10px; font-weight: 700; }


.finder-card {
  margin-bottom: 12px;
  padding: 15px 17px;
  display: grid;
  
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(0, 47, 108, .18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow-soft);
}
.finder-copy h2 { margin: 3px 0 4px; color: var(--dark); font-size: 18px; letter-spacing: -.02em; }
.finder-copy p { margin: 0; color: var(--steel); font-size: 12px; }
.finder-search { margin: 0; }
.unit-picker-button {
  min-width: 0;
  min-height: 50px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
  text-align: left;
}
.unit-picker-button:hover { border-color: var(--blue); background: var(--color-brand-subtle); }
.unit-picker-button span { min-width: 0; }
.unit-picker-button small { display: block; color: var(--steel); font-size: 10px; text-transform: uppercase; }
.unit-picker-button strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.unit-picker-button em { color: var(--blue); font-size: 11px; font-style: normal; font-weight: 800; }


.tree-panel, .list-panel { height: 100%; min-height: 0; }
.tree-scroll, .position-table-wrap { min-height: 0; }
.tree-toggle:disabled { cursor: default; }
.tree-name { font-size: 12px; }
.tree-help, .list-caption { font-size: 11px; line-height: 1.45; }

.position-list { padding: 6px; display: grid; gap: 7px; }
.position-row {
  width: 100%;
  min-height: 76px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(300px, auto) 135px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .12s ease, box-shadow .15s ease;
}
.position-row:hover, .position-row:focus-visible {
  border-color: rgba(0, 47, 108, .42);
  background: var(--soft);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}
.position-main { min-width: 0; }
.position-main strong { display: block; color: var(--dark); font-size: 13px; }
.position-main small { display: block; margin-top: 4px; overflow: hidden; color: var(--steel); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }

.position-facts > span:not(.status-label) {
  min-width: 82px;
  padding: 6px 9px;
  border-radius: 9px;
  background: var(--soft);
  text-align: center;
}
.position-facts small { display: block; color: var(--steel); font-size: 9px; }
.position-facts b { display: block; margin-top: 1px; color: var(--blue); font-size: 13px; }
.position-open {  font-size: 11px; font-weight: 800; text-align: right; }
.status-label { white-space: normal; text-align: center; line-height: 1.25; }
.empty-state .btn { margin-top: 14px; }
.empty-state.compact { min-height: 180px; }

.relation-card em {  font-size: 10px; font-weight: 800;  }
.empty-relation { display: grid; gap: var(--space-1); font-size: 12px; }
.empty-relation strong { color: var(--ink); }
.empty-relation span { color: var(--steel); font-size: 11px; }
.warning-relation { border-left: 4px solid var(--orange); background: var(--color-warning-surface); }
.info-section p { font-size: 13px; }

.picker-content { min-height: 0; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.picker-search { margin: 0; flex: 0 0 auto; }
.picker-meta { color: var(--steel); font-size: 11px; }
.unit-picker-list { min-height: 0; max-height: 56vh; padding: 4px; display: grid; gap: var(--space-1); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--soft); }
.unit-picker-row {
  min-height: 54px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: calc(var(--depth, 0) * 12px) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}
.unit-picker-row:hover { border-color: rgba(0, 47, 108, .28); background: #f5f9fd; }
.unit-picker-row.selected { border-color: rgba(0, 47, 108, .42); box-shadow: inset 3px 0 0 var(--blue); background: var(--color-brand-soft); }
.unit-picker-row strong { display: block; font-size: 12px; }
.unit-picker-row small { display: block; margin-top: 3px; overflow: hidden; color: var(--steel); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.unit-picker-row em { color: var(--steel); font-size: 10px; font-style: normal; }
.picker-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }


.confirm-body { padding: 20px 22px 22px; display: grid; gap: 18px; }
.confirm-header h2 { color: #8f2028; }
.confirm-header.foreign-danger { border-left: 4px solid #c0392b; }
.confirm-header.foreign-danger h2 { color: #c0392b; }
.confirm-header.foreign-danger .section-kicker { color: #c0392b; }
.confirm-body.foreign-danger { border-top: none; }
.foreign-danger-title { display: flex; align-items: center; gap: 8px; }
.foreign-danger-title svg { flex-shrink: 0; }
.foreign-danger-description { font-size: 12px; line-height: 1.5; color: var(--steel); margin: 0; }
.foreign-danger-btn { background: #c0392b; border-color: #c0392b; }
.foreign-danger-btn:hover { background: #a93226; border-color: #a93226; }

.quality-card { border: 1px solid var(--line); border-left: 4px solid var(--orange); cursor: pointer; text-align: left; }
.quality-card:hover { border-color: rgba(0, 47, 108, .35); transform: translateY(-1px); }
.quality-card.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 47, 108, .08); background: #f4f9ff; }
.quality-card small { margin-top: 8px; color: var(--steel); font-size: 9px; line-height: 1.3; }
.quality-table-wrap td small { margin-top: 5px; }

@media (max-width: 1180px) {
  
  
  .position-row { grid-template-columns: minmax(220px, 1fr) minmax(260px, auto) 110px; }
}

@media (max-width: 980px) {
  .workspace { height: auto; min-height: 520px; grid-template-columns: 1fr; }
  .tree-panel { display: none; }
  .list-panel { min-height: 520px; height: auto; }
  .position-table-wrap { max-height: none; overflow: visible; }
  
  .unit-picker-button { grid-column: auto; }
  .position-row { grid-template-columns: minmax(0, 1fr) 130px; }
  .position-facts { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .position-open { grid-row: 1; grid-column: 2; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar { min-height: 72px; }
  
  
  .finder-card {  gap: 9px; }
  .finder-search input { min-height: 48px; font-size: 14px; }
  .unit-picker-button { min-height: 54px; }
  .workspace { min-height: 0; }
  .list-panel { min-height: 480px; }
  .position-row { min-height: 0; padding: 12px;  gap: 9px; }
  .position-open {   text-align: left; }
  .position-facts {   grid-template-columns: 1fr 1fr; }
  .position-facts .status-label { grid-column: 1 / -1; justify-self: start; }
  .panel-header .btn { width: auto; }
  .list-header .btn { width: 100%; }
  .modal-toolbar { padding-bottom: 8px; }
  
  .unit-picker-list { max-height: none; flex: 1; }
  .picker-actions { display: grid; grid-template-columns: 1fr; }
  .picker-actions .btn { width: 100%; }
  .quality-table-wrap table, .quality-table-wrap tbody, .quality-table-wrap tr, .quality-table-wrap td { display: block; width: 100%; }
  .quality-table-wrap thead { display: none; }
  .quality-table-wrap tr { padding: 12px; border-bottom: 1px solid var(--line); }
  .quality-table-wrap td { padding: 5px 0; border: 0; }
  .quality-table-wrap td .btn { width: 100%; }
  
}

@media (max-width: 720px) {
  .guide-steps {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
  }
  .guide-steps div { min-width: 0; }
  .guide-steps i { display: none; }
  
  .guide-steps b { width: 31px; height: 31px; }
  .modal-tabs {
    display: grid;
    
    overflow: visible;
  }
  .modal-tab {
    
    padding: 7px 8px;
    white-space: normal;
    line-height: 1.25;
  }
}


/* Assessment workflow */
.nav-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  border-radius: var(--radius-pill);
  color: var(--surface);
  background: rgba(255, 255, 255, .16);
  font-size: 11px;
}
.assessment-modal { width: min(1120px, calc(100vw - 28px)); max-height: calc(100vh - 28px); }
.assessment-header, .assessment-result-header { align-items: center; }
.assessment-form { overflow: auto; }
.assessment-section { padding: 22px 26px; border-bottom: 1px solid var(--line); }
.assessment-section-title { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 16px; }
.assessment-section-title > span {
  width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 9px; color: var(--surface); background: var(--blue); font-weight: 900;
}
.assessment-section-title h3 { margin: 0 0 3px; font-size: 18px; }
.assessment-section-title p { margin: 0; color: var(--steel); }
.assessment-context-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.context-toggle { position: relative; display: block; cursor: pointer; }
.context-toggle > input { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; z-index: 1; }
.assessment-context-card {
  min-height: 112px; padding: 16px 44px 16px 16px; display: flex; flex-direction: column; gap: 5px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--soft);
}
.assessment-context-card span { color: var(--steel); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.assessment-context-card strong { font-size: 15px; }
.assessment-context-card small { color: var(--steel); line-height: 1.5; }
.context-toggle:has(input:checked) .assessment-context-card { border-color: rgba(0, 47, 108, .45); box-shadow: inset 0 0 0 1px rgba(0, 47, 108, .08); background: var(--surface); }
.muted-card { opacity: .68; }
.peer-picker { max-height: 310px; overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding-right: 4px; }
.peer-option {
  min-height: 82px; padding: 13px; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); cursor: pointer;
}
.peer-option:hover { border-color: rgba(0, 47, 108, .35); background: var(--soft); }
.peer-option:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px rgba(0, 47, 108, .14); }
.peer-option input { width: 17px; height: 17px; margin-top: 2px; }
.peer-option span { min-width: 0; }
.peer-option strong, .peer-option small { display: block; }
.peer-option strong { margin-bottom: 4px; }
.peer-option small { color: var(--steel); line-height: 1.35; }
.peer-option em { color: var(--blue); font-size: 10px; font-style: normal; white-space: nowrap; }

.clarification-form label, .expert-code-grid label{ display: flex; flex-direction: column; gap: 6px; font-weight: 700; }

.expert-codes > small{ color: var(--steel); font-weight: 400; }
.expert-codes { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--soft); }
.expert-codes summary { cursor: pointer; color: var(--blue); font-weight: 800; }
.expert-code-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 8px; }
.expert-code-grid select {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); background: var(--surface);
}
.expert-code-grid select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 47, 108, .08); }
.factor-code-hint.compact { min-height: 66px; padding: 8px; font-size: 9px; }
.assessment-footer { padding: 18px 26px; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); background: var(--soft); }
.compact-notice { margin: 0; max-width: 610px; }
.compact-notice strong, .compact-notice span, .storage-warning strong, .storage-warning span { display: block; }
.assessment-loading { min-height: 500px; padding: 56px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.assessment-loading h2 { margin: 18px 0 6px; }
.assessment-loading p { max-width: 620px; color: var(--steel); }
.spinner { width: 48px; height: 48px; border: 4px solid #dce5ed; border-top-color: var(--blue); border-radius: 50%; animation: assessment-spin .9s linear infinite; }
@keyframes assessment-spin { to { transform: rotate(360deg); } }


.assessment-result-body { padding: 24px 26px 28px; overflow: auto; }


.result-json { margin-top: 14px; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.result-json summary { padding: 12px 14px; cursor: pointer; font-weight: 800; background: var(--soft); }
.result-json pre { max-height: 340px; margin: 0; padding: 14px; overflow: auto; white-space: pre-wrap; background: #071c33; color: #eaf2fb; font-size: 12px; }
.assessment-result-actions { margin-top: 18px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.results-page { max-width: 1320px; }
.storage-warning { margin: 0 0 14px; }
.results-panel { overflow: hidden; }
.result-list { display: grid; }
.results-panel-header { gap: 18px; align-items: end; }
.results-toolbar { margin-left: auto; display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.results-search-field,
.results-page-size { display: grid; gap: 5px; color: var(--steel); font-size: 11px; font-weight: 700; }
.results-search-input-wrap { min-width: 300px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.results-search-input-wrap input,
.results-page-size select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.results-search-input-wrap input { width: 100%; padding: 8px 11px; }
.results-page-size select { min-width: 82px; padding: 8px 30px 8px 10px; }
.results-search-input-wrap input:focus,
.results-page-size select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 47, 108, .12); }
.results-search-input-wrap .icon-btn { width: 38px; min-width: 38px; height: 38px; }
.results-pagination {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}
.results-pagination span { color: var(--steel); font-size: 12px; font-weight: 700; }
.result-row { padding: 16px 20px; display: grid;  gap: 18px; align-items: center; text-align: left; border-top: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.result-row:hover { background: var(--soft); }
.result-row span strong, .result-row span small { display: block; }
.result-row span small { margin-top: 3px; color: var(--steel); }
.result-row-metrics { text-align: right; }
.result-row em { color: var(--blue); font-style: normal; font-weight: 800; text-align: right; }

@media (max-width: 900px) {
  .results-panel-header { align-items: stretch; }
  .results-toolbar { width: 100%; margin-left: 0; }
  .results-search-field { flex: 1 1 260px; }
  .results-search-input-wrap { min-width: 0; }
  .assessment-context-grid, .peer-picker{ grid-template-columns: 1fr; }
  .expert-code-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assessment-footer { align-items: stretch; flex-direction: column; }
  .assessment-footer .form-actions { width: 100%; }
  .result-row { grid-template-columns: 1fr; gap: 7px; }
  .result-row-metrics, .result-row em { text-align: left; }
}

@media (max-width: 620px) {
  .results-toolbar { display: grid; grid-template-columns: 1fr; }
  .results-search-field,
  .results-page-size { width: 100%; }
  .results-page-size select { width: 100%; }
  .results-pagination { justify-content: space-between; gap: 8px; }
  .results-pagination span { text-align: center; }
  .assessment-section, .assessment-result-body { padding: 16px; }
  .assessment-footer { padding: 14px 16px; }
  .expert-code-grid { grid-template-columns: 1fr; }
  .assessment-result-actions { display: grid; grid-template-columns: 1fr; }
  .assessment-result-actions .btn { width: 100%; }
}

/* 4.1: compact hierarchy inside an organizational unit */
.unit-hierarchy { padding: 12px 14px 28px; }
.unit-hierarchy-meta {
  margin-bottom: 13px;
  
  
  
  
  
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--steel);
  background: var(--soft);
  font-size: 10px;
}
.unit-hierarchy-meta strong { color: var(--blue); font-size: 13px; }


.hierarchy-column-label {  color: var(--steel); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.unit-position-node { position: relative; margin: 7px 0; }
.unit-position-card {
  min-height: 66px;
  padding: 9px 10px;
  display: grid;
  
  align-items: center;
  
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(7, 28, 51, .04);
}
.unit-position-card.top-position { border-left: 5px solid var(--blue); background: linear-gradient(90deg, #f2f7fc, var(--surface) 36%); }
.unit-position-card.direct-position { border-left: 4px solid #6e94b7; }
.unit-position-card.nested-position { border-left: 3px solid #b8c9d8; background: var(--color-surface-alt); }
.unit-position-card.context-position { border-style: dashed; border-left-style: solid; background: linear-gradient(90deg, #f7f8fa, var(--surface) 42%); }
.unit-position-marker {
  width: 22px; height: 22px; display: grid; place-items: center;
  border: 1px solid #a9bfd2; border-radius: 50%; color: var(--blue);
  background: var(--color-brand-muted); text-align: center;  font-weight: 900;
}
.unit-position-main { min-width: 0; color: var(--ink); background: transparent; cursor: pointer; text-align: left; }
.unit-position-main strong { display: block;  color: var(--dark);   font-size: 12px; }
.unit-position-main small { display: block; margin-top: 4px; color: var(--steel); font-size: 10px; }


.branch-toggle {  padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--blue); background: var(--surface); cursor: pointer; font-size: 9px; font-weight: 800; }
.branch-toggle:hover { border-color: var(--blue); background: var(--soft); }
.branch-spacer { min-width: 120px; }
.unit-position-open { width: 32px; height: 32px; border-radius: 9px; color: var(--blue); background: var(--color-brand-soft); cursor: pointer; font-weight: 900; }
.unit-position-open:hover { color: var(--surface); background: var(--blue); }
.unit-position-children {
  position: relative; margin: 6px 0 5px 30px; padding-left: 24px;
  border-left: 2px solid #b7c9d8;
}
.hierarchy-connector { position: absolute; top: 0; left: -2px; width: 24px; height: 22px; border-bottom: 2px solid #b7c9d8; }
.unit-position-children .unit-position-children { border-left-color: #c9d6e1; }
.status-label.context { color: #526273; border: 1px dashed #9fb0bf; background: #f4f6f8; }

/* 4.1: guided creation of organizational objects */
.add-org-form { gap: var(--space-4); }
.creation-context-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  border: 1px solid rgba(0, 47, 108, .24);
  border-left: 5px solid var(--blue);
  border-radius: 13px;
  background: linear-gradient(90deg, var(--color-brand-hover), var(--surface));
}
.creation-context-card.blocked { border-left-color: var(--red); background: var(--color-danger-soft); }
.creation-context-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: var(--surface); background: var(--blue); font-size: 20px; }
.creation-context-card span, .creation-context-card strong, .creation-context-card small { display: block; }
.creation-context-card span { color: var(--steel); font-size: 9px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.creation-context-card strong { margin: 3px 0; color: var(--dark); font-size: 13px; line-height: 1.35; }
.creation-context-card small { color: var(--steel); font-size: 10px; }
.org-type-fieldset { margin: 0; padding: 0; border: 0; }
.org-type-fieldset legend { margin-bottom: 7px; color: var(--color-text-secondary); font-size: 11px; font-weight: 750; }
.org-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.org-type-option { position: relative; min-height: 84px; cursor: pointer; }
.org-type-option input { position: absolute; opacity: 0; pointer-events: none; }
.org-type-option > span { height: 100%; padding: 11px 12px; display: block; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.org-type-option:hover > span { border-color: rgba(0, 47, 108, .42); }
.org-type-option input:checked + span { border-color: var(--blue); background: #f1f7fc; box-shadow: 0 0 0 3px rgba(0, 47, 108, .08); }
.org-type-option strong, .org-type-option small, .org-type-option em { display: block; }
.org-type-option strong { color: var(--dark); font-size: 11px; }
.org-type-option small { margin-top: 4px; color: var(--steel); font-size: 9px; line-height: 1.35; }
.org-type-option em { margin-top: 6px; color: var(--green); font-size: 8px; font-style: normal; font-weight: 850; text-transform: uppercase; }
.org-type-option.disabled { cursor: not-allowed; }
.org-type-option.disabled > span { opacity: .48; background: var(--soft); }
.creation-preview { padding: 12px 14px; border: 1px dashed rgba(0, 47, 108, .35); border-radius: 11px; background: var(--color-surface-alt); }
.creation-preview span, .creation-preview strong { display: block; }
.creation-preview span { color: var(--steel); font-size: 9px; text-transform: uppercase; }
.creation-preview strong { margin: 3px 0; color: var(--blue); font-size: 13px; }
.creation-preview p { margin: 0; color: var(--steel); font-size: 10px; line-height: 1.45; }
.creation-preview b { color: var(--dark); }
.modal-form .context-confirm { padding: 11px 12px; flex-direction: row; align-items: flex-start; border: 1px solid var(--line); border-radius: 11px; background: var(--soft); cursor: pointer; }
.modal-form .context-confirm input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--blue); }
.context-confirm span { color: var(--ink); font-size: 10px; line-height: 1.45; }

@media (max-width: 1080px) {
  .unit-position-card { grid-template-columns: 22px minmax(180px, 1fr) 50px minmax(100px, auto) 34px; }
  .unit-position-card .status-label { display: none; }
  .branch-spacer { min-width: 0; }
}

@media (max-width: 720px) {
  
  .unit-position-card { padding: 10px;   }
  .unit-position-card .status-label, .branch-spacer{ display: none; }
  .branch-toggle { grid-column: 2 / -1; justify-self: start; }
  .unit-position-children { margin-left: 13px; padding-left: 12px; }
  .org-type-grid { grid-template-columns: 1fr; }
  .creation-context-card { grid-template-columns: 34px minmax(0, 1fr); }
  .creation-context-icon { width: 34px; height: 34px; }
}

/* 4.1.0: backend-generated grouped hierarchy */
.grouped-position-card { background: linear-gradient(90deg, var(--color-brand-hover), var(--surface) 42%); }
.status-label.grouped { color: var(--blue); border: 1px solid rgba(0, 47, 108, .18); background: var(--color-brand-soft); }
.backend-members {
  margin: 5px 0 3px 20px;
  padding: 6px 0 6px 17px;
  display: grid;
  gap: 5px;
  border-left: 1px dashed #9eb6ca;
}
.backend-member-row {
  width: 100%;
  
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}
.backend-member-row:hover { border-color: rgba(0, 47, 108, .42); background: var(--soft); }
.backend-member-row span { min-width: 0; }
.backend-member-row strong, .backend-member-row small { display: block; }
.backend-member-row strong { color: var(--dark); font-size: 11px; }
.backend-member-row small { margin-top: 2px; color: var(--steel); font-size: 9px; }
.backend-member-row em { color: var(--blue); font-size: 9px; font-style: normal; font-weight: 850; white-space: nowrap; }

@media (max-width: 720px) {
  .backend-members { margin-left: 8px; padding-left: 9px; }
  .backend-member-row { align-items: flex-start; flex-direction: column; gap: var(--space-1); }
}


/* 4.2.0: minimal source indicator for organizational assignment */
.position-title-line { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.assignment-badge {
  display: inline-flex; align-items: center; min-height: 18px; padding: 2px 7px;
  border: 1px solid rgba(0, 47, 108, .18); border-radius: var(--radius-pill);
  background: #f5f8fb; color: var(--steel); font-size: 8px; font-weight: 850;
  line-height: 1; white-space: nowrap; letter-spacing: .01em;
}
.assignment-badge.direct { background: #f4f7fa; color: #4d6579; }
.assignment-badge.inferred { border-color: rgba(0, 47, 108, .24); background: var(--color-brand-hover); color: var(--blue); }
.assignment-badge.warning { border-color: rgba(178, 106, 0, .25); background: #fff8e9; color: #825409; }
.assignment-badge.missing { border-color: rgba(169, 45, 45, .2); background: #fff1f1; color: #8e2b2b; }
.assignment-badge.manual { border-color: rgba(62, 123, 79, .22); background: #eff8f1; color: #346b43; }
.assignment-badge.mixed { border-color: rgba(92, 103, 114, .2); background: #f4f4f4; color: #56616b; }
.header-badges .assignment-badge { min-height: 24px; padding: 4px 9px; font-size: 9px; }

/* 5.0: unified assessment experience and position-card enrichment */
.position-import-offer {
  grid-column: 1 / -1;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(0, 47, 108, .2);
  border-left: 5px solid var(--blue);
  border-radius: 13px;
  background: linear-gradient(100deg, var(--color-brand-hover) 0%, var(--surface) 82%);
}
.position-import-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--surface);
  background: var(--blue);
  font-size: 21px;
  font-weight: 900;
}
.position-import-offer span,
.position-import-offer strong { display: block; }
.position-import-offer span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.position-import-offer strong { margin-top: 2px; color: var(--dark); font-size: 15px; }
.position-import-offer p { margin: 4px 0 0; color: var(--steel); font-size: 11px; line-height: 1.45; }

.assessment-source-section { background: linear-gradient(180deg, var(--color-surface-alt) 0%, var(--surface) 100%); }
.assessment-readiness {
  margin-bottom: 14px;
  
  display: grid;
  
  align-items: center;
  gap: var(--space-3);
  border: 1px solid rgba(178, 106, 0, .22);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-md);
  background: #fff9eb;
}
.assessment-readiness.success { border-color: rgba(31, 122, 77, .2); border-left-color: var(--green); background: #f0f8f4; }
.readiness-icon {
  
  
  
  
  
  color: var(--surface);
  background: var(--orange);
  font-weight: 900;
}
.assessment-readiness strong,
.assessment-readiness span,
.assessment-readiness small { display: block; }
.assessment-readiness span { margin-top: 2px; color: var(--ink); }
.assessment-readiness small { margin-top: 4px; color: var(--steel); }

.source-text-field,
.assessment-comment-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 800;
}
.source-text-field textarea,
.assessment-comment-field textarea,
.clarification-question textarea,
.expert-justification-grid textarea {
  width: 100%;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.source-text-field textarea { min-height: 168px; }
.source-text-field textarea:focus,
.assessment-comment-field textarea:focus,
.clarification-question textarea:focus,
.expert-justification-grid textarea:focus,
.expert-factor-grid select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 47, 108, .08);
  background: var(--surface);
}
.source-text-field small { color: var(--steel); font-weight: 400; }
.file-drop-field {
  min-height: 212px;
  padding: 24px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  border: 1px dashed #9bb1c5;
  border-radius: 13px;
  color: var(--ink);
  background: #f5f9fd;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.file-drop-field:hover { transform: translateY(-1px); border-color: var(--blue); background: var(--color-brand-hover); }
.file-drop-field input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-drop-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--surface);
  background: var(--blue);
  font-size: 24px;
  font-weight: 900;
}
.file-drop-field strong { max-width: 100%; overflow: hidden; color: var(--blue); text-overflow: ellipsis; }
.file-drop-field small { max-width: 260px; color: var(--steel); font-size: 11px; font-weight: 400; line-height: 1.45; }
.source-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.source-actions > span { color: var(--steel); font-size: 11px; }
.assessment-safe-note { max-width: 590px; }
.assessment-safe-note strong,
.assessment-safe-note span { display: block; }
.assessment-safe-note strong { color: var(--blue); }
.assessment-safe-note span { margin-top: 2px; color: var(--steel); font-size: 11px; }

.card-preview-body { padding: 22px 26px 26px; overflow: auto; }
.card-preview-list { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card-preview-item {
  min-height: 145px;
  padding: 14px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.card-preview-item:hover { border-color: rgba(0, 47, 108, .42); background: var(--soft); }
.card-preview-item:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px rgba(0, 47, 108, .1); }
.card-preview-item input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--blue); }
.card-preview-item b { color: var(--dark); font-size: 13px; }
.card-preview-item p { margin: 9px 0 0; color: var(--ink); white-space: pre-line; line-height: 1.5; }
.card-preview-item small { display: block; margin-top: 9px; color: var(--steel); font-size: 10px; line-height: 1.45; }
.card-preview-item.not_found { opacity: .62; background: var(--soft); cursor: default; }
.confidence {
  float: right;
  margin-left: 8px;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
.confidence.high { color: var(--green); background: #eaf6ef; }
.confidence.medium { color: var(--orange); background: var(--color-warning-soft); }
.confidence.low { color: #8f3434; background: #fff0f0; }
.extracted-context-card,
.unresolved-card {
  margin-top: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}
.extracted-context-card > span,
.unresolved-card > span { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.extracted-context-card p { margin: 8px 0 0; }
.extracted-context-card small { display: block; margin-top: 10px; color: var(--steel); }
.unresolved-card ul { margin: 9px 0 0; padding-left: 19px; }
.unresolved-card li + li { margin-top: 5px; }

.process-header p { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.process-body { padding: 22px 26px 26px; overflow: auto; }
.process-hero {
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(0, 47, 108, .18);
  border-radius: 13px;
  background: linear-gradient(100deg, var(--color-brand-hover), var(--surface));
}
.process-hero .spinner { width: 38px; height: 38px; border-width: 3px; }
.process-hero strong,
.process-hero span { display: block; }
.process-hero strong { color: var(--dark); font-size: 15px; }
.process-hero span { margin-top: 3px; color: var(--steel); font-size: 11px; }
.process-stage-list { margin-top: 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.process-stage {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.process-stage > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #c6d2dd;
  border-radius: 50%;
  color: #8896a4;
  background: var(--soft);
  font-weight: 900;
}
.process-stage strong,
.process-stage small { display: block; }
.process-stage strong { color: #435166; font-size: 12px; }
.process-stage small { margin-top: 2px; color: var(--steel); font-size: 9px; line-height: 1.35; }
.process-stage.completed { border-color: rgba(31, 122, 77, .2); background: #f5fbf8; }
.process-stage.completed > span { border-color: rgba(31, 122, 77, .2); color: var(--surface); background: var(--green); }
.process-stage.active { border-color: rgba(0, 47, 108, .36); box-shadow: 0 0 0 3px rgba(0, 47, 108, .06); background: var(--color-brand-muted); }
.process-stage.active > span { border-color: var(--blue); color: var(--surface); background: var(--blue); }
.process-stage.failed { border-color: rgba(227, 6, 19, .25); background: #fff4f5; }
.process-stage.failed > span,
.process-stage.cancelled > span { color: var(--surface); background: var(--red); border-color: var(--red); }
.process-events { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--soft); }
.process-events > span { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.process-events p { margin: 8px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); color: var(--color-text-secondary); font-size: 11px; }
.process-events b { color: var(--steel); font-size: 9px; }
.process-events em { padding: 2px 6px; border-radius: var(--radius-pill); color: var(--blue); background: #e4eef8; font-size: 9px; font-style: normal; font-weight: 800; }
.process-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 9px; }

.clarification-header { border-bottom-color: rgba(0, 47, 108, .15); background: linear-gradient(115deg, var(--surface), #f1f7fc); }
.clarification-form { background: var(--surface); }
.clarification-intro {
  margin: 20px 26px 0;
  padding: 14px 16px;
  border: 1px solid rgba(0, 47, 108, .18);
  border-left: 4px solid var(--blue);
  border-radius: 11px;
  background: var(--color-brand-subtle);
}
.clarification-intro strong,
.clarification-intro span { display: block; }
.clarification-intro strong { color: var(--blue); }
.clarification-intro span { margin-top: 3px; color: var(--steel); font-size: 11px; }
.clarification-question-list { padding: 14px 26px 22px; display: grid; gap: 10px; }
.clarification-form .clarification-question {
  padding: 15px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(7, 28, 51, .035);
}
.question-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--surface);
  background: var(--blue);
  font-weight: 900;
}
.question-content { min-width: 0; }
.question-content b { display: block; margin-bottom: 7px; color: var(--dark); font-size: 13px; }
.question-content textarea { min-height: 92px; font-weight: 400; }

.cancelled-process-body { min-height: 390px; padding: 44px 28px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.cancelled-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: var(--surface); background: var(--red); font-size: 32px; font-weight: 900; }
.cancelled-process-body h3 { margin: 17px 0 5px; }
.cancelled-process-body p { margin: 0 0 20px; max-width: 560px; color: var(--steel); }

.expert-line-form { overflow: auto; }
.line-comparison-banner {
  margin: 20px 26px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.line-comparison-banner > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--soft); }
.line-comparison-banner span,
.line-comparison-banner strong { display: block; }
.line-comparison-banner span { color: var(--steel); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.line-comparison-banner strong { margin-top: 4px; color: var(--dark); }
.line-comparison-banner > div:last-child { border-color: rgba(0, 47, 108, .28); background: var(--color-brand-hover); }
.expert-factor-grid { padding: 14px 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.expert-factor-grid section { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.expert-factor-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.expert-factor-heading > span:first-child { color: var(--blue); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.factor-info-mark {
  width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid #b9c9d8; border-radius: 50%; color: var(--blue); background: var(--soft);
  font-size: 11px; font-weight: 900; text-transform: none;
}
.factor-overview { min-height: 58px; margin: 7px 0 12px; color: var(--steel); font-size: 10px; line-height: 1.45; }
.expert-factor-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--color-text-secondary); font-size: 11px; font-weight: 750; }
.expert-factor-grid label + label { margin-top: 9px; }
.expert-factor-grid select { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); }
.factor-code-hint {
  min-height: 72px; padding: 9px 10px; display: flex; align-items: flex-start; gap: var(--space-2);
  border: 1px solid #dce7f0; border-radius: 9px; color: #536477; background: #f7fafd;
  font-size: 9.5px; font-weight: 400; line-height: 1.42;
}
.factor-code-hint > span:last-child { min-width: 0; }
.factor-code-hint strong { display: block; margin-bottom: 2px; color: var(--blue); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.code-hint-icon {
  width: 17px; height: 17px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 50%; color: var(--surface); background: var(--blue); font-size: 9px; font-weight: 900;
}
.expert-preview-placeholder { margin: 0 26px 14px; padding: 17px; border: 1px dashed #aab9c7; border-radius: var(--radius-md); color: var(--steel); background: var(--soft); text-align: center; }
.expert-preview-placeholder.loading { color: var(--blue); }
.expert-preview-metrics { margin: 0 26px 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.expert-preview-metrics > div { padding: 14px; border-radius: 11px; color: var(--surface); background: linear-gradient(135deg, var(--blue), #123f72); }
.expert-preview-metrics span,
.expert-preview-metrics strong { display: block; }
.expert-preview-metrics span { color: rgba(255, 255, 255, .72); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.expert-preview-metrics strong { margin-top: 3px; font-size: 22px; }
.expert-justification-grid { padding: 0 26px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.expert-justification-grid label { display: flex; flex-direction: column; gap: 7px; color: var(--color-text-secondary); font-size: 12px; font-weight: 800; }
.expert-line-form > .notice { margin: 0 26px 20px; }

@media (max-width: 900px) {
  .card-preview-list, .process-stage-list, .expert-factor-grid, .expert-justification-grid{ grid-template-columns: 1fr; }
  .expert-preview-metrics { grid-template-columns: 1fr; }
  .file-drop-field { min-height: 150px; }
  .position-import-offer { grid-template-columns: 38px minmax(0, 1fr); }
  .position-import-offer .btn { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 620px) {
  .source-actions,
  .process-actions { align-items: stretch; flex-direction: column; }
  .source-actions .btn,
  .process-actions .btn { width: 100%; }
  .clarification-intro { margin: 14px 16px 0; }
  .clarification-question-list { padding: 12px 16px 16px; }
  .clarification-form .clarification-question { grid-template-columns: 28px minmax(0, 1fr); padding: 12px; }
  .question-number { width: 28px; height: 28px; border-radius: var(--radius-sm); }
  .card-preview-body,
  .process-body { padding: 16px; }
  .line-comparison-banner { margin: 16px 16px 0; grid-template-columns: 1fr; }
  .expert-factor-grid { padding: 12px 16px; }
  .expert-preview-placeholder,
  .expert-preview-metrics { margin-left: 16px; margin-right: 16px; }
  .expert-justification-grid { padding: 0 16px 12px; }
  .expert-line-form > .notice { margin: 0 16px 16px; }
}

/* Голосовой ввод для всех текстовых полей в диалогах. */
.voice-field-shell { position: relative; width: 100%; }
.voice-field-shell > input,
.voice-field-shell > textarea { width: 100%;  }
.voice-input-button {
  position: absolute; top: 50%;  z-index: 2;  
  display: grid; place-items: center; padding: 0; transform: translateY(-50%);
  border: 1px solid #cbd8e4; border-radius: 9px; color: #63778b; background: rgba(255, 255, 255, .94);
  box-shadow: 0 3px 10px rgba(7, 28, 51, .06); cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease, transform .15s ease;
}
.voice-field-shell.is-textarea .voice-input-button { top: 9px; transform: none; }
.voice-input-button svg { width: 16px; height: 16px; }
.voice-input-button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); background: #f2f7fc; }
.voice-input-button:disabled { cursor: wait; opacity: .75; }
.voice-input-button.is-recording { border-color: rgba(227, 6, 19, .48); color: var(--red); background: #fff3f4; }
.voice-input-button.is-sending { border-color: rgba(0, 47, 108, .35); color: var(--blue); background: #eef5fb; }
.voice-input-button.is-sending svg { animation: voice-spin .85s linear infinite; }
.voice-input-status { min-height: 0; color: var(--steel); font-size: 9px; font-weight: 500; line-height: 1.35; }
.voice-input-status:empty { display: none; }
.voice-input-status.is-error { color: var(--red); }
.voice-input-status.is-ok { color: var(--green); }
@keyframes voice-spin { to { transform: rotate(360deg); } }
.active-assessment-chip {
  min-height: 36px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--radius-pill);
  color: var(--surface);
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.active-assessment-chip i { width: 8px; height: 8px; border-radius: 50%; background: #74dca0; box-shadow: 0 0 0 4px rgba(116, 220, 160, .13); }
.active-assessment-chip.attention i { background: #ffc857; box-shadow: 0 0 0 4px rgba(255, 200, 87, .14); }
.active-assessment-chip:hover { background: rgba(255, 255, 255, .18); }
@media (max-width: 1120px) { .active-assessment-chip span { display: none; } .active-assessment-chip { width: 36px; justify-content: center; padding: 0; } }

/* Stable assessment polling: progress updates no longer recreate the modal. */
.process-body[data-assessment-progress] { min-height: min(610px, calc(100vh - 190px)); }
.process-hero [data-assessment-current-message] { min-height: 20px; }
.process-events.is-empty { display: none; }

/* Hard grade range and explicit critic stage */
.grade-range-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #cbdbea;
  border-radius: var(--radius-md);
  background: var(--color-brand-subtle);
}
.grade-range-panel label { display: flex; flex-direction: column; gap: 7px; color: var(--color-text-secondary); font-size: 12px; font-weight: 800; }
.grade-range-panel input {
  width: min(340px, 100%);
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
}
.grade-range-panel input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 47, 108, .08); }
.grade-range-panel small { max-width: 760px; color: var(--steel); font-weight: 400; line-height: 1.45; }

.file-drop-field.is-drag-over {
  border-color: var(--blue);
  background: var(--color-brand-hover);
  box-shadow: 0 0 0 3px rgba(0, 47, 108, .08);
}
.file-drop-field.is-file-error {
  border-color: var(--red);
  background: var(--color-danger-soft);
}
.file-drop-field .file-drop-error {
  max-width: 100%;
  color: var(--red);
  font-weight: 700;
}

/* Stable viewport during in-place rerenders: JavaScript restores these positions explicitly. */
.modal-backdrop,
.modal-body,
.modal-form,
.modal-tabs,
.help-content,
.assessment-form,
.expert-line-form,
.assessment-result-body,
.card-preview-body,
.process-body,
.unit-picker-list,
.peer-picker,
.manager-search-results,
.summary-strip,
.quality-grid,
.result-json pre {
  overflow-anchor: none;
}
