:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --line: #dee0e3;
  --line-strong: #c9cdd4;
  --text: #1f2329;
  --muted: #646a73;
  --nav: #ffffff;
  --nav-hover: #f2f3f5;
  --primary: #3370ff;
  --primary-hover: #285fdb;
  --info: #3370ff;
  --ok: #2f9e64;
  --warn: #d97706;
  --bad: #d54941;
  --shadow: 0 8px 28px rgba(31, 35, 41, .14);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-width: 320px; font-size: 14px; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 28px;
  padding: 28px;
  background: #f5f6f7;
}
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand h1 { margin: 0; font-size: 26px; }
.auth-brand p { margin: 4px 0 0; color: var(--muted); }
.brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center;
  color: white; background: var(--primary); border-radius: 6px; font-weight: 800;
}
.brand-mark.small { width: 32px; height: 32px; font-size: 12px; }
.auth-panel {
  width: min(390px, calc(100vw - 40px)); padding: 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow);
}
.auth-panel h2 { margin: 0 0 22px; font-size: 20px; }

label { display: grid; gap: 7px; color: #35434d; font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: 38px; padding: 8px 10px;
  color: var(--text); background: white; border: 1px solid var(--line-strong);
  border-radius: 6px; outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(51,112,255,.14); }
.auth-panel label + label { margin-top: 15px; }
.auth-panel .remember-login {
  display: flex; align-items: center; gap: 8px; margin-top: 13px;
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.remember-login input { width: 16px; min-height: 16px; margin: 0; }
.form-error { min-height: 20px; margin: 10px 0; color: var(--bad); font-size: 13px; }

.btn, .icon-text, .icon-btn {
  min-height: 36px; padding: 7px 14px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: white; color: var(--text); white-space: nowrap;
}
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:hover, .icon-text:hover, .icon-btn:hover { border-color: #8f959e; background: #f7f8fa; }
.btn.primary { color: white; border-color: var(--primary); background: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.transfer { color: #245bdb; border-color: #8fb1ff; background: #f5f8ff; }
.btn.transfer:hover { border-color: var(--primary); background: #eaf0ff; }
.btn.danger { color: var(--bad); border-color: #e7b8ba; }
.btn.small { min-height: 30px; padding: 4px 9px; font-size: 13px; }
.btn.wide { width: 100%; }
.icon-btn { width: 36px; padding: 0; display: inline-grid; place-items: center; font-size: 19px; }
.icon-text { white-space: nowrap; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: var(--text); background: var(--nav); border-right: 1px solid var(--line); }
.app-name { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.app-name b { font-size: 16px; }
#mainNav { padding: 12px 8px; }
.nav-item {
  width: 100%; height: 44px; display: flex; align-items: center; gap: 12px;
  padding: 0 13px; border: 0; border-radius: 6px; color: #4e5969; background: transparent; text-align: left;
}
.nav-item:hover { background: var(--nav-hover); }
.nav-item.active { color: #245bdb; background: #eaf0ff; font-weight: 700; }
.nav-icon { width: 20px; text-align: center; font-size: 20px; line-height: 1; }
.sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #3aca78; }

.main-area { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; height: 64px; display: flex; align-items: center;
  padding: 0 24px; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 19px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-menu { display: flex; align-items: center; gap: 7px; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--info); font-weight: 700; }
.role-label { color: var(--muted); font-size: 12px; }
.content { padding: 20px 22px; }
.view { display: none; }
.view.active { display: block; }

.query-band, .toolbar, .work-section, .metric-strip, .table-wrap {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.query-band { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px; }
.query-band .btn { min-width: 112px; }
.query-option { flex: 1 0 100%; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.query-option input { width: 16px; min-height: 16px; margin: 0; }
.grow { flex: 1 1 280px; }
.progress-line { margin: 10px 0; padding: 10px 14px; color: var(--info); background: #f0f5ff; border: 1px solid #bacefd; border-radius: 6px; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 2px solid #a9cae4; border-top-color: var(--info); border-radius: 50%; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-card { border-color: #bacefd; background: #f8faff; }
.progress-meter-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: center; gap: 10px; margin-top: 8px; }
.progress-track { height: 10px; overflow: hidden; background: #e5e6eb; border: 1px solid #d0d3d8; border-radius: 4px; }
.progress-bar { width: 0; height: 100%; background: var(--info); transition: width .25s ease; }
.progress-bar.ok { background: var(--ok); }
.progress-bar.error { background: var(--bad); }
.progress-percent { color: var(--info); font-size: 12px; font-weight: 700; text-align: right; }
.progress-stage { margin-top: 7px; color: var(--info); font-weight: 700; }
.progress-list { max-height: 220px; margin-top: 9px; overflow: auto; border-left: 2px solid #bacefd; padding-left: 10px; }
.progress-item { display: grid; grid-template-columns: 72px 92px minmax(0, 1fr); gap: 8px; padding: 5px 0; font-size: 12px; }
.progress-time { color: var(--muted); white-space: nowrap; }
.progress-stage-name { color: var(--info); font-weight: 700; }
.progress-item.ok .progress-stage-name { color: var(--ok); }
.progress-item.warn .progress-stage-name { color: var(--warn); }
.progress-item.error .progress-stage-name { color: var(--bad); }
.progress-message { min-width: 0; word-break: break-word; }
.candidate-notice { display: grid; gap: 3px; margin: 8px 0 12px; padding: 10px 12px; color: #8a251f; background: #fff3f1; border: 1px solid #e6b8b3; border-radius: 4px; font-size: 13px; }
.candidate-notice b { font-size: 14px; }
.work-section { margin-top: 12px; padding: 16px; }
.section-head { min-height: 36px; display: flex; align-items: center; gap: 10px; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head > :last-child { margin-left: auto; }
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); margin: 10px 0 15px; border: 1px solid var(--line); }
.info-item { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--line); }
.info-item:last-child { border-right: 0; }
.info-item span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.info-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.location-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.select-add { display: grid; grid-template-columns: minmax(0, 1fr) 38px; }
.select-add select { border-radius: 4px 0 0 4px; }
.select-add button { border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 4px 4px 0; background: #f7f9fa; font-size: 18px; }
.section-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.confirm-row { display: flex; align-items: end; gap: 12px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.confirm-row .btn { min-width: 170px; }
.query-workspace { margin-top: 18px; }
.query-result-head { padding: 0 2px 10px; border-bottom: 1px solid var(--line-strong); }
#queryCaseDetail { padding-top: 14px; }
.case-meta.compact { margin-bottom: 16px; }
.recommendations { padding: 0; overflow: hidden; }
.recommendations > .section-head { padding: 13px 16px; background: #fbfbfc; border-bottom: 1px solid var(--line); }
.candidate-workbench { min-height: 420px; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.candidate-dept-nav { min-width: 0; background: #f7f8fa; border-right: 1px solid var(--line); }
.candidate-nav-title { height: 40px; display: flex; align-items: center; padding: 0 16px; color: var(--muted); font-size: 12px; font-weight: 700; }
.candidate-dept-option {
  width: 100%; min-height: 68px; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 10px 14px; color: var(--text); background: transparent;
  border: 0; border-top: 1px solid var(--line); text-align: left;
}
.candidate-dept-option:hover { background: #f0f2f5; }
.candidate-dept-option.active { color: #245bdb; background: #eaf0ff; box-shadow: inset 3px 0 0 var(--primary); }
.candidate-dept-option > span { min-width: 0; display: grid; gap: 5px; }
.candidate-dept-option b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.candidate-dept-option small { color: var(--muted); font-size: 12px; }
.candidate-dept-option.active small { color: #4e7be8; }
.candidate-dept-option > strong {
  min-width: 26px; height: 24px; display: grid; place-items: center;
  color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 12px;
}
.candidate-dept-option.active > strong { color: #245bdb; border-color: #adc6ff; }
.candidate-panel-stack { min-width: 0; background: #fff; }
.candidate-number-panel { min-width: 0; }
.candidate-dept-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: #fbfbfc; border-bottom: 1px solid var(--line); }
.candidate-dept-head > div { min-width: 0; display: grid; gap: 5px; }
.candidate-dept-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.candidate-dept-head > div > span { color: var(--muted); font-size: 12px; }
.candidate-list { display: grid; }
.candidate-row { display: grid; grid-template-columns: 72px 170px minmax(180px, 1fr) 142px; align-items: center; gap: 12px; min-height: 72px; padding: 10px 18px; border-top: 1px solid var(--line); background: white; }
.candidate-row:first-child { border-top: 0; }
.candidate-row:hover { background: #fafbfc; }
.candidate-row.recommended { background: #f8fcfa; box-shadow: inset 3px 0 0 var(--ok); }
.candidate-row.fax { background: #fffafa; }
.candidate-rank { color: var(--muted); font-size: 12px; font-weight: 700; }
.candidate-number { color: var(--info); font-size: 16px; font-weight: 700; }
.candidate-number-wrap { min-width: 0; display: grid; gap: 5px; }
.candidate-number-wrap small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.candidate-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.candidate-actions { display: flex; justify-content: flex-end; gap: 7px; }
.empty-chain, .empty-list { min-height: 86px; display: grid; place-items: center; padding: 18px; color: var(--muted); background: white; border: 1px dashed var(--line-strong); border-radius: 6px; }
.empty-list { min-height: 110px; border: 0; border-radius: 0; }

.phone-list { display: grid; }
.phone-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 120px 130px; align-items: center; gap: 12px; min-height: 62px; padding: 10px; border-top: 1px solid var(--line); }
.phone-row:first-child { border-top: 0; }
.phone-number { color: var(--info); font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.tag { display: inline-flex; align-items: center; width: fit-content; padding: 3px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.tag.ok { color: #237b4b; background: #edf8f2; border: 1px solid #b7dfc7; }
.tag.warn { color: #a95f00; background: #fff7e8; border: 1px solid #f3d19e; }
.tag.bad { color: #c03932; background: #fff2f0; border: 1px solid #f2c1bd; }
.tag.info { color: #245bdb; background: #edf3ff; border: 1px solid #bacefd; }
.tag.neutral { color: #4e5969; background: #f2f3f5; border: 1px solid #dfe1e5; }

.split-view { min-height: calc(100vh - 101px); display: grid; grid-template-columns: 300px minmax(0, 1fr); margin: -18px; }
.list-pane { background: white; border-right: 1px solid var(--line); }
.pane-search { display: grid; grid-template-columns: 1fr 36px; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); }
.case-list { max-height: calc(100vh - 126px); overflow: auto; }
.case-item { width: 100%; display: block; padding: 13px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: white; text-align: left; }
.case-item:hover { background: #f5f6f7; }
.case-item.active { color: #245bdb; background: #eaf0ff; box-shadow: inset 3px 0 0 var(--primary); }
.case-item b, .case-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-item span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.detail-pane { min-width: 0; padding: 18px; }
.case-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.case-header h2 { margin: 0 0 5px; font-size: 19px; }
.case-header .actions { margin-left: auto; display: flex; gap: 7px; }
.case-meta { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 14px; background: white; border: 1px solid var(--line); }
.chain-title { margin: 18px 0 10px; font-size: 16px; }
.chain { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 28px; align-items: stretch; }
.chain-step { position: relative; min-width: 0; padding: 14px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.chain-step:not(:last-child)::after { content: "→"; position: absolute; right: -22px; top: 50%; color: var(--warn); font-size: 24px; }
.chain-step.final { border-color: #76c99a; box-shadow: inset 0 3px 0 var(--ok); }
.chain-step h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 7px; }
.chain-step dl { display: grid; grid-template-columns: 72px 1fr; gap: 7px; margin: 0; font-size: 13px; }
.chain-step dt { color: var(--muted); }
.chain-step dd { min-width: 0; margin: 0; word-break: break-word; }
.chain-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.empty-state { display: grid; place-items: center; min-height: 300px; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px; margin-bottom: 12px; }
.search-input { max-width: 460px; }
.toolbar-spacer { flex: 1; }
.metric-strip { display: flex; margin-bottom: 12px; overflow: hidden; }
.metric { min-width: 140px; padding: 13px 18px; border-right: 1px solid var(--line); }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric b { display: block; margin-top: 4px; font-size: 22px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.library-table { min-width: 1120px; }
.library-table td:nth-child(1),
.library-table td:nth-child(3),
.library-table td:nth-child(5) { white-space: normal; line-height: 1.45; }
.library-table td:nth-child(1) { min-width: 120px; }
.library-table td:nth-child(3) { min-width: 180px; }
.library-table td:nth-child(5) { min-width: 90px; }
.library-table th:last-child,
.library-table td:last-child { position: sticky; right: 0; z-index: 2; background: var(--surface); box-shadow: -1px 0 0 var(--line); }
.library-table th:last-child { z-index: 3; background: #f7f8fa; }
.library-table tbody tr:hover td:last-child { background: #f7f8fa; }
th, td { height: 44px; padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; color: #4e5969; background: #f7f8fa; font-weight: 700; }
tbody tr:hover { background: #f7f8fa; }
.table-actions { display: flex; gap: 5px; }

.settings-head { margin-bottom: 12px; }
.settings-head > div { display: grid; gap: 4px; }
.settings-head > div > span { font-size: 12px; }
.settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.setting-panel {
  min-width: 0; padding: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px;
}
.setting-title { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.setting-title > div { min-width: 0; display: grid; gap: 5px; }
.setting-title h3 { margin: 0; font-size: 16px; }
.setting-title .tag { margin-left: auto; }
.setting-title .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.setting-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.setting-facts div { min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting-facts div:nth-child(odd) { padding-right: 16px; }
.setting-facts dt { color: var(--muted); font-size: 12px; }
.setting-facts dd { margin: 5px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.setting-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); min-width: min(360px, calc(100vw - 32px)); min-height: min(260px, calc(100vh - 32px)); padding: 0; overflow: auto; resize: both; border: 0; border-radius: 8px; box-shadow: var(--shadow); }
.dialog.wide-dialog { width: min(840px, calc(100vw - 32px)); height: min(720px, calc(100vh - 32px)); min-width: min(600px, calc(100vw - 32px)); min-height: min(460px, calc(100vh - 32px)); overflow: hidden; resize: both; }
.dialog::backdrop { background: rgba(15, 29, 38, .45); }
.dialog form { padding: 18px; }
.dialog.wide-dialog form { display: flex; flex-direction: column; width: 100%; height: 100%; max-height: none; padding: 0; overflow: hidden; }
.dialog-head { display: flex; align-items: center; margin: -4px 0 16px; }
.wide-dialog .dialog-head { flex: 0 0 auto; margin: 0; padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-head .icon-btn { margin-left: auto; border: 0; }
.dialog label + label { margin-top: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; max-height: calc(100vh - 190px); overflow: auto; padding: 2px; }
.wide-dialog .form-grid { flex: 1 1 auto; max-height: none; padding: 16px 18px; overflow: auto; }
.wide-dialog .form-error { flex: 0 0 auto; margin: 0 18px; }
.wide-dialog .dialog-actions { flex: 0 0 auto; margin: 0; padding: 14px 18px 18px; background: var(--surface); }
.form-grid label + label { margin-top: 0; }
.span-2 { grid-column: span 2; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 420px; padding: 11px 15px; color: white; background: #263943; border-radius: 4px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .app-name b, .nav-item:not(.active) { font-size: 0; }
  .app-name { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 0; font-size: 0; }
  .nav-item.active { font-size: 0; }
  .nav-icon { font-size: 21px; }
  .sidebar-foot { display: none; }
  .info-grid, .location-grid, .case-meta { grid-template-columns: repeat(2, 1fr); }
  .phone-row { grid-template-columns: 1fr 1fr 110px; }
  .phone-row > :nth-child(2), .phone-row > :nth-child(3) { display: none; }
  .candidate-workbench { grid-template-columns: 230px minmax(0, 1fr); }
  .candidate-row { grid-template-columns: 64px 145px minmax(120px, 1fr) 136px; padding: 10px 12px; gap: 8px; }
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); min-width: 0; min-height: 0; resize: none; }
  .dialog.wide-dialog { width: calc(100vw - 20px); height: calc(100vh - 20px); min-width: 0; min-height: 0; resize: none; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 58px; }
  .app-name, .sidebar-foot { display: none; }
  #mainNav { height: 100%; display: flex; padding: 4px; }
  .nav-item { height: 50px; }
  .admin-only.nav-item { display: none !important; }
  .topbar { height: 56px; padding: 0 12px; }
  .topbar h1 { font-size: 17px; }
  .top-actions .icon-text, .role-label { display: none; }
  .content { padding: 10px 10px 72px; }
  .query-band { align-items: stretch; flex-direction: column; }
  .query-band .grow, .confirm-row .grow { flex: 0 0 auto; }
  .query-band .btn, .confirm-row .btn { width: 100%; }
  .confirm-row { align-items: stretch; flex-direction: column; }
  .info-grid, .location-grid, .case-meta { grid-template-columns: 1fr; }
  .info-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .split-view { min-height: auto; grid-template-columns: 1fr; margin: -10px; }
  .list-pane { border-right: 0; }
  .case-list { max-height: 240px; }
  .detail-pane { padding: 12px; }
  .chain { grid-template-columns: 1fr; }
  .chain-step:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -27px; }
  .metric-strip { overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .candidate-workbench { min-height: 0; grid-template-columns: 1fr; }
  .candidate-dept-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .candidate-nav-title { display: none; }
  .candidate-dept-option { min-width: 210px; border-top: 0; border-right: 1px solid var(--line); }
  .candidate-dept-option.active { box-shadow: inset 0 -3px 0 var(--primary); }
  .candidate-dept-head { align-items: flex-start; padding: 11px 12px; }
  .candidate-dept-head > .tag { display: none; }
  .candidate-row { grid-template-columns: 58px minmax(105px, 1fr) 130px; gap: 8px; padding: 10px 12px; }
  .candidate-meta { grid-column: 1 / -1; }
  .candidate-actions { grid-column: 3; grid-row: 1; align-self: center; gap: 5px; }
  .candidate-actions .btn { padding-left: 9px; padding-right: 9px; }
  .setting-facts { grid-template-columns: 1fr; }
  .setting-facts div:nth-child(odd) { padding-right: 0; }
  .setting-actions .btn { flex: 1 1 auto; }
}
