:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1d2931;
  background: #eef2f3;
  font-synthesis: none;
  --ink: #1d2931;
  --muted: #66747d;
  --line: #d9e0e2;
  --line-soft: #e8edef;
  --surface: #ffffff;
  --brand: #173d4f;
  --brand-soft: #e8f0f2;
  --teal: #0f766e;
  --green: #19734c;
  --amber: #a15b00;
  --red: #b73832;
  --sidebar: 228px;
  --topbar: 58px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #eef2f3; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: #176a89; }
.skip-link { position: fixed; z-index: 100; top: -50px; left: 12px; padding: 10px 14px; background: #fff; }
.skip-link:focus { top: 8px; }

.login-pending { overflow: hidden; }
.login-pending > .topbar, .login-pending > .app-shell { visibility: hidden; }
.login-screen { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 22px; background: #e9eef0; }
.login-screen[hidden] { display: none; }
.login-screen::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: var(--brand); }
.login-panel { position: relative; width: min(390px, 100%); padding: 28px 30px 22px; background: #fff; border: 1px solid #d4dde0; border-radius: 6px; box-shadow: 0 16px 40px rgb(26 50 60 / 12%); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-brand .brand-mark { color: var(--brand); border-color: #789aa7; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 14px; }
.login-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.dev-flag { position: absolute; top: 29px; right: 28px; display: flex; align-items: center; gap: 5px; color: #73501a; font-size: 10px; }
.dev-flag i { width: 6px; height: 6px; border-radius: 50%; background: #d08b22; }
.login-panel h1 { margin: 0; font-size: 21px; }
.login-panel > p { margin: 8px 0 20px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.login-panel form { display: grid; }
.login-methods { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.login-methods button { position: relative; padding: 8px; color: var(--muted); border: 0; background: transparent; cursor: pointer; font-size: 11px; }
.login-methods button.active { color: var(--brand); font-weight: 700; }
.login-methods button.active::after { content: ""; position: absolute; right: 18px; bottom: -1px; left: 18px; height: 2px; background: var(--teal); }
.login-panel label { margin: 0 0 6px; font-size: 11px; font-weight: 650; }
.login-panel input, .login-panel select { width: 100%; height: 38px; margin-bottom: 13px; padding: 7px 10px; border: 1px solid #bdc9cd; border-radius: 4px; background: #fff; font-size: 12px; }
.login-panel input:focus, .login-panel select:focus { outline: 2px solid #70a7b8; outline-offset: 1px; }
.login-submit { width: 100%; min-height: 39px; margin-top: 2px; }
.login-error { min-height: 16px; margin: -3px 0 7px; color: var(--red); font-size: 10px; }
.login-panel footer { margin-top: 20px; padding-top: 14px; color: #7f8b91; border-top: 1px solid var(--line-soft); font-size: 9px; text-align: center; }

.topbar { position: fixed; z-index: 40; inset: 0 0 auto; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: #fff; background: var(--brand); border-bottom: 1px solid #0f3141; }
.brand { display: flex; gap: 10px; align-items: center; min-width: 210px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid #80a6b6; border-radius: 5px; color: #d9eff4; font-weight: 700; }
.brand strong, .brand small { display: block; line-height: 1.2; letter-spacing: 0; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; color: #a9c3ce; font-size: 10px; font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 10px; height: 100%; }
.environment { display: flex; align-items: center; gap: 6px; padding-right: 12px; color: #bed1d8; font-size: 12px; border-right: 1px solid #426170; }
.environment i, .sidebar-foot i { width: 7px; height: 7px; border-radius: 50%; background: #4fc08d; box-shadow: 0 0 0 3px rgb(79 192 141 / 14%); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; font-size: 20px; }
.icon-button:hover, .icon-button:focus-visible { border-color: #6c8996; background: rgb(255 255 255 / 8%); outline: none; }
.user-menu { display: flex; align-items: center; gap: 8px; min-width: 148px; height: 42px; padding: 0 8px; color: #fff; border: 0; background: transparent; cursor: pointer; text-align: left; }
.user-menu:hover { background: rgb(255 255 255 / 6%); }
.avatar { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: #d9a441; color: #1c2c32; font-size: 12px; font-weight: 700; }
.user-copy { flex: 1; }
.user-copy strong, .user-copy small { display: block; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy small { margin-top: 2px; color: #adc2cb; font-size: 10px; font-weight: 400; }

.app-shell { min-height: 100vh; padding-top: var(--topbar); }
.sidebar { position: fixed; z-index: 30; top: var(--topbar); bottom: 0; left: 0; width: var(--sidebar); display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.scope-block { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.scope-block span, .scope-block strong { display: block; }
.scope-block span { color: var(--muted); font-size: 11px; }
.scope-block strong { margin-top: 5px; font-size: 13px; }
.sidebar nav { flex: 1; padding: 10px; overflow-y: auto; }
.nav-group { margin: 18px 10px 7px; color: #89949b; font-size: 10px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; margin: 2px 0; padding: 7px 10px; border: 0; border-left: 3px solid transparent; border-radius: 3px; background: transparent; cursor: pointer; font-size: 13px; text-align: left; }
.nav-item[hidden] { display: none; }
.nav-item:hover { background: #f2f5f5; }
.nav-item.active { border-left-color: var(--teal); background: var(--brand-soft); color: #123e50; font-weight: 650; }
.nav-icon { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #c6d0d4; border-radius: 4px; color: #49616c; font-size: 11px; font-weight: 700; }
.nav-item.active .nav-icon { border-color: #7296a3; background: #fff; }
.nav-badge { min-width: 20px; margin-left: auto; padding: 2px 6px; border-radius: 9px; background: #dce8eb; color: #315464; font-size: 10px; text-align: center; }
.nav-badge.danger { color: #922c27; background: #f8dfdc; }
.nav-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--red); }
.sidebar-foot { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; padding: 14px 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.sidebar-foot strong { display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--green); font-size: 11px; }
.sidebar-foot a { grid-column: 1 / -1; margin-top: 3px; font-size: 11px; text-decoration: none; }
.sidebar-backdrop { display: none; }

main { min-height: calc(100vh - var(--topbar)); margin-left: var(--sidebar); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 28px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.breadcrumbs { margin: 0 0 6px; color: #758189; font-size: 11px; }
.page-head h1 { margin: 0; font-size: 21px; letter-spacing: 0; }
.page-head .summary { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-body { padding: 20px 28px 32px; }

.button { min-height: 34px; padding: 7px 13px; border: 1px solid #bec9cd; border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 600; }
.button:hover { border-color: #78919b; background: #f6f9f9; }
.button:focus-visible, .filter-control:focus-visible, .search-input:focus-visible, textarea:focus-visible { outline: 2px solid #70a7b8; outline-offset: 1px; }
.button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.button.primary:hover { background: #0f3141; }
.button.danger { color: var(--red); border-color: #ddb9b5; }
.button.small { min-height: 28px; padding: 4px 9px; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.link-button { padding: 0; color: #156583; border: 0; background: none; cursor: pointer; font-size: 12px; }
.link-button:hover { text-decoration: underline; }

.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.metric { min-width: 0; padding: 15px 16px; border-right: 1px solid var(--line-soft); }
.metric:last-child { border-right: 0; }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-label em { font-size: 9px; font-style: normal; }
.metric-value { display: block; margin: 9px 0 5px; font-size: 23px; font-weight: 700; line-height: 1; }
.metric-foot { display: block; overflow: hidden; color: #7a868d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.section-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .9fr); gap: 16px; margin-top: 16px; }
.section { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.section-header { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.section-header h2 { margin: 0; font-size: 14px; }
.section-header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.section-body { padding: 14px; }

.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.search-wrap { position: relative; flex: 1 1 220px; max-width: 360px; }
.search-wrap::before { content: "⌕"; position: absolute; left: 10px; top: 6px; color: #7c888e; font-size: 17px; }
.search-input, .filter-control { height: 34px; color: var(--ink); border: 1px solid #c6d0d4; border-radius: 4px; background: #fff; font-size: 12px; }
.search-input { width: 100%; padding: 7px 10px 7px 30px; }
.filter-control { min-width: 116px; padding: 6px 28px 6px 9px; }
.toolbar-spacer { flex: 1; }
.filter-tabs { display: flex; align-items: center; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.filter-tab { position: relative; padding: 10px 13px; color: var(--muted); border: 0; background: transparent; cursor: pointer; font-size: 12px; }
.filter-tab.active { color: var(--brand); font-weight: 700; }
.filter-tab.active::after { content: ""; position: absolute; right: 9px; bottom: -1px; left: 9px; height: 2px; background: var(--teal); }
.tab-count { margin-left: 4px; color: #89959c; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.data-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 12px; }
.data-table th { height: 38px; padding: 8px 12px; color: #617078; background: #f5f7f7; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 650; text-align: left; white-space: nowrap; }
.data-table td { height: 49px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8faf9; }
.data-table .primary-cell { color: #173d4f; font-weight: 650; }
.subline { display: block; margin-top: 3px; color: #849098; font-size: 10px; font-weight: 400; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 7px; border-radius: 3px; background: #edf1f2; color: #56656d; font-size: 10px; white-space: nowrap; }
.status::before { content: ""; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.success { color: var(--green); background: #e8f4ee; }
.status.warning { color: var(--amber); background: #fbf0df; }
.status.danger { color: var(--red); background: #f9e7e5; }
.status.info { color: #176a89; background: #e6f1f5; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 11px 2px 0; color: var(--muted); font-size: 11px; }
.pagination div { display: flex; gap: 5px; }

.todo-list, .health-list, .rule-list { margin: 0; padding: 0; list-style: none; }
.todo-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.todo-item:last-child { border-bottom: 0; }
.todo-symbol { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 4px; color: #52656e; background: #edf1f2; font-size: 11px; font-weight: 700; }
.todo-symbol.warning { color: #875215; background: #fbefd9; }
.todo-symbol.danger { color: #9e302b; background: #f8e2df; }
.todo-item strong, .todo-item span { display: block; }
.todo-item strong { font-size: 12px; }
.todo-item span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.todo-count { font-size: 17px; font-weight: 700; }
.health-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.health-item:last-child { border: 0; }
.health-item strong { font-size: 11px; }
.health-item small { color: var(--muted); }
.progress { grid-column: 1 / -1; height: 5px; overflow: hidden; background: #e7ecee; border-radius: 2px; }
.progress i { display: block; height: 100%; background: var(--teal); }
.progress i.warning { background: #c88727; }
.mini-bars { display: flex; align-items: flex-end; gap: 7px; height: 102px; padding: 10px 4px 0; border-bottom: 1px solid var(--line); }
.mini-bar { flex: 1; min-width: 13px; height: var(--value); background: #96b3bd; border-radius: 2px 2px 0 0; }
.mini-bar.highlight { background: #1c7b76; }
.chart-labels { display: flex; justify-content: space-between; padding: 6px 3px 0; color: #7b888f; font-size: 9px; }

.empty-state { display: grid; place-items: center; min-height: 260px; padding: 32px; color: var(--muted); text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.empty-state strong { display: block; color: var(--ink); font-size: 14px; }
.empty-state p { max-width: 390px; margin: 7px 0 14px; font-size: 11px; line-height: 1.7; }
.empty-symbol { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 10px; border: 1px solid #cbd5d8; border-radius: 50%; color: #708088; font-size: 18px; }
.notice { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 9px 12px; color: #73501a; background: #fff7e7; border: 1px solid #efd9a9; border-radius: 4px; font-size: 11px; }
.notice.danger { color: #8d2f2b; background: #fff0ee; border-color: #edc5c1; }

.match-layout, .review-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(440px, 1.25fr); min-height: 520px; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.case-list { border-right: 1px solid var(--line); }
.case-list-head { padding: 12px; border-bottom: 1px solid var(--line); }
.case-row { display: block; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: #fff; cursor: pointer; text-align: left; }
.case-row:hover { background: #f8faf9; }
.case-row.active { background: #eaf2f3; box-shadow: inset 3px 0 var(--teal); }
.case-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.case-row strong { font-size: 12px; }
.case-row p { margin: 6px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.case-content { min-width: 0; padding: 18px; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-heading h2 { margin: 0 0 5px; font-size: 16px; }
.detail-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.evidence-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px 0; border: 1px solid var(--line); }
.evidence-grid div { padding: 10px; border-right: 1px solid var(--line-soft); }
.evidence-grid div:last-child { border-right: 0; }
.evidence-grid span, .evidence-grid strong { display: block; }
.evidence-grid span { color: var(--muted); font-size: 9px; }
.evidence-grid strong { margin-top: 5px; font-size: 12px; }
.candidate { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 4px; }
.candidate.recommended { border-color: #79a7a2; background: #f4faf8; }
.candidate-score { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e7efef; color: #185f5a; font-size: 12px; font-weight: 700; }
.candidate strong, .candidate small { display: block; }
.candidate small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.reason-box { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.reason-box label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; }
.reason-box textarea { width: 100%; min-height: 70px; padding: 8px; resize: vertical; border: 1px solid #c5d0d4; border-radius: 4px; font-size: 11px; }
.action-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.review-score { display: flex; align-items: center; gap: 14px; }
.score-value { font-size: 31px; font-weight: 750; color: var(--brand); }
.rule-row { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.rule-row:hover { background: #f8faf9; }
.rule-row.active { background: #eef5f5; box-shadow: inset 3px 0 var(--teal); }
.rule-row-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; font-weight: 650; }
.rule-row p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.rule-score { white-space: nowrap; }
.transcript { margin: 12px 0; padding: 12px; background: #f6f8f8; border-left: 3px solid #779ba7; font-size: 11px; line-height: 1.8; }
.transcript mark { padding: 1px 2px; color: #573a08; background: #f7df9e; }
.evidence-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.checkline { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-size: 11px; }
.checkline input { width: 16px; height: 16px; accent-color: var(--teal); }

.drawer { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(520px, 92vw); display: flex; flex-direction: column; background: #fff; box-shadow: -10px 0 28px rgb(26 46 54 / 18%); transform: translateX(105%); transition: transform .2s ease; }
.drawer.open { transform: translateX(0); }
.drawer header { display: flex; align-items: flex-start; justify-content: space-between; padding: 17px 20px; color: var(--ink); background: #fff; border-bottom: 1px solid var(--line); }
.drawer header p { margin: 0 0 4px; color: var(--muted); font-size: 10px; }
.drawer header h2 { margin: 0; font-size: 17px; }
.drawer header .icon-button:hover { background: #eef2f3; border-color: #cbd5d8; }
.drawer-body { flex: 1; padding: 18px 20px; overflow-y: auto; }
.drawer footer { display: flex; justify-content: flex-end; gap: 8px; min-height: 58px; padding: 12px 20px; border-top: 1px solid var(--line); }
.drawer-backdrop { position: fixed; z-index: 60; inset: 0; display: none; border: 0; background: rgb(13 30 37 / 32%); }
.drawer-backdrop.open { display: block; }
.detail-list { display: grid; grid-template-columns: 105px 1fr; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.detail-list dt, .detail-list dd { margin: 0; padding: 10px 4px; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { color: var(--ink); font-weight: 550; }
.timeline { margin: 18px 0 0; padding: 0; list-style: none; }
.timeline li { position: relative; margin-left: 6px; padding: 0 0 18px 20px; border-left: 1px solid #bdcbd0; }
.timeline li::before { content: ""; position: absolute; top: 2px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.timeline strong, .timeline span { display: block; font-size: 11px; }
.timeline span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.toast-region { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 390px; padding: 11px 13px; color: #fff; background: #203943; border-radius: 4px; box-shadow: 0 6px 20px rgb(0 0 0 / 20%); font-size: 11px; animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-only { display: none; }
.loading { opacity: .58; pointer-events: none; }
[data-role="auditor"] [data-demo], [data-role="auditor"] .action-row,
[data-role="staff"] [data-demo], [data-role="staff"] .action-row { display: none !important; }

@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .evidence-grid { grid-template-columns: repeat(2, 1fr); }
  .evidence-grid div:nth-child(2) { border-right: 0; }
  .evidence-grid div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 820px) {
  :root { --topbar: 54px; }
  .mobile-only { display: grid; }
  .topbar { padding: 0 10px; }
  .brand { min-width: 0; margin-right: auto; }
  .brand-mark, .brand small, .environment, .user-copy { display: none; }
  .brand strong { font-size: 14px; }
  .user-menu { min-width: 40px; padding: 0 3px; }
  .sidebar { transform: translateX(-105%); transition: transform .2s ease; box-shadow: 8px 0 24px rgb(24 48 58 / 18%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 20; inset: var(--topbar) 0 0; border: 0; background: rgb(15 32 39 / 35%); }
  .sidebar-backdrop.open { display: block; }
  main { margin-left: 0; }
  .page-head { padding: 17px 16px 14px; }
  .page-head h1 { font-size: 18px; }
  .page-body { padding: 14px 16px 24px; }
  .section-grid { grid-template-columns: 1fr; }
  .match-layout, .review-layout { grid-template-columns: 1fr; }
  .case-list { max-height: 286px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .topbar-actions { gap: 2px; }
  .page-head { display: block; }
  .head-actions { justify-content: flex-start; margin-top: 12px; }
  .page-body { padding-right: 12px; padding-left: 12px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(n) { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
  .metric:nth-child(even) { border-right: 0; }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
  .metric-value { font-size: 20px; }
  .toolbar > .filter-control { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .search-wrap { max-width: none; flex-basis: 100%; }
  .filter-tabs { overflow-x: auto; }
  .filter-tab { flex: 0 0 auto; }
  .pagination { align-items: flex-start; flex-direction: column; gap: 8px; }
  .case-content { padding: 14px 12px; }
  .detail-heading { flex-direction: column; }
  .evidence-grid { grid-template-columns: 1fr 1fr; }
  .candidate { grid-template-columns: auto 1fr; }
  .candidate .button { grid-column: 1 / -1; width: 100%; }
  .quality-detail { grid-template-columns: 1fr !important; }
  .drawer { width: 100%; }
  .toast-region { right: 10px; bottom: 10px; left: 10px; }
  .toast { min-width: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}

/* 2026 enterprise workspace refresh */
:root {
  --ink: #202a33;
  --muted: #68747d;
  --line: #d9dee3;
  --line-soft: #e9edf0;
  --surface: #ffffff;
  --brand: #1f2933;
  --brand-soft: #e8f3ef;
  --teal: #087f5b;
  --green: #16794f;
  --amber: #9a5b13;
  --red: #b33a32;
  --sidebar: 232px;
  --topbar: 56px;
}

body { color: var(--ink); background: #f3f5f7; }

.login-screen {
  place-items: center;
  padding: 32px 20px;
  background: #eef1f3;
}
.login-screen::before { height: 4px; background: var(--teal); }
.login-panel {
  width: min(424px, 100%);
  padding: 30px 34px 24px;
  border-color: #cfd6db;
  border-radius: 8px;
  box-shadow: 0 18px 55px rgb(28 39 47 / 12%);
}
.login-brand { margin-bottom: 34px; }
.login-brand .brand-mark {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}
.login-brand strong { font-size: 15px; }
.login-brand small { font-size: 11px; }
.dev-flag {
  top: 31px;
  right: 34px;
  padding: 4px 7px;
  color: #78511a;
  background: #fff5df;
  border: 1px solid #ead7ad;
  border-radius: 3px;
}
.login-panel h1 { font-size: 24px; font-weight: 720; }
.login-panel > p { margin: 8px 0 24px; font-size: 12px; }
.login-methods { margin-bottom: 20px; }
.login-methods button { min-height: 40px; font-size: 12px; }
.login-methods button.active::after { right: 10px; left: 10px; background: var(--teal); }
.login-panel label { margin-bottom: 7px; font-size: 12px; }
.login-panel input, .login-panel select {
  height: 42px;
  margin-bottom: 15px;
  padding: 8px 11px;
  border-color: #bcc6cd;
  font-size: 13px;
}
.login-panel input:focus, .login-panel select:focus {
  outline: 2px solid rgb(8 127 91 / 25%);
  border-color: var(--teal);
}
.login-submit { min-height: 42px; }
.login-panel footer { margin-top: 22px; font-size: 10px; }

.topbar {
  padding: 0 18px 0 0;
  color: var(--ink);
  background: #fff;
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgb(20 33 42 / 2%);
}
.brand {
  align-self: stretch;
  flex: 0 0 var(--sidebar);
  min-width: var(--sidebar);
  padding: 0 16px;
  color: #fff;
  background: #182129;
}
.brand-mark {
  border-color: #3d8b72;
  color: #fff;
  background: #087f5b;
}
.brand small { color: #9baab4; }
.topbar-actions { gap: 6px; margin-left: auto; }
.environment {
  color: #56636d;
  border-right-color: var(--line);
}
.environment i, .sidebar-foot i { background: #2f9e6f; }
.icon-button { color: #4c5963; }
.icon-button svg { width: 18px; height: 18px; }
.icon-button:hover, .icon-button:focus-visible {
  border-color: #cbd3d8;
  background: #f4f6f7;
}
.user-menu { color: var(--ink); }
.user-menu:hover { background: #f4f6f7; }
.avatar { color: #fff; background: #39766c; }
.user-copy small { color: #78858e; }
.user-chevron { width: 15px; height: 15px; color: #89949c; }

.sidebar {
  color: #d8dee3;
  background: var(--brand);
  border-right: 0;
}
.scope-block {
  margin: 10px 10px 5px;
  padding: 11px 12px;
  background: #293641;
  border: 1px solid #364551;
  border-radius: 5px;
}
.scope-block span { color: #97a4ad; }
.scope-block strong { color: #fff; font-size: 12px; }
.sidebar nav { padding: 5px 8px 12px; }
.nav-group {
  margin: 15px 12px 6px;
  color: #7f8d97;
  font-size: 10px;
  text-transform: uppercase;
}
.nav-item {
  min-height: 38px;
  gap: 9px;
  padding: 7px 10px;
  color: #c5ced4;
  border-left: 0;
  border-radius: 4px;
  font-size: 12px;
}
.nav-item:hover { color: #fff; background: #293641; }
.nav-item.active {
  color: #fff;
  background: #31413d;
  box-shadow: inset 3px 0 #4ec795;
}
.nav-icon {
  width: 23px;
  height: 23px;
  color: #9daab3;
  border: 0;
}
.nav-icon svg { width: 17px; height: 17px; }
.nav-item.active .nav-icon { color: #73d2aa; border: 0; background: transparent; }
.nav-badge { background: #3a4852; color: #d8e0e4; }
.nav-badge.danger { color: #ffd3cf; background: #5c3535; }
.sidebar-foot {
  padding: 15px 18px;
  color: #8f9ca5;
  border-top-color: #35424d;
}
.sidebar-foot strong { color: #83d9b5; }
.sidebar-foot a { color: #b6c4cc; }
.sidebar-foot strong.error { color: #ffb4ae; }
.sidebar-foot strong.error i { background: #d9554e; box-shadow: 0 0 0 3px rgb(217 85 78 / 14%); }

.page-head {
  min-height: 76px;
  padding: 14px 24px 13px;
  align-items: center;
}
.breadcrumbs { margin-bottom: 4px; color: #87929a; }
.page-head h1 { font-size: 19px; font-weight: 720; }
.page-head .summary { margin-top: 5px; }
.page-body { padding: 16px 24px 30px; }

.button {
  min-height: 32px;
  padding: 6px 12px;
  border-color: #bcc6cc;
  border-radius: 4px;
  font-size: 11px;
}
.button.primary { border-color: var(--teal); background: var(--teal); }
.button.primary:hover { background: #066c4d; }
.button:focus-visible, .filter-control:focus-visible, .search-input:focus-visible, textarea:focus-visible {
  outline-color: rgb(8 127 91 / 30%);
}
.link-button { color: #086b75; }

.metrics, .section, .table-wrap, .match-layout, .review-layout {
  border-color: #d5dce1;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgb(27 39 47 / 3%);
}
.metric { padding: 13px 14px; }
.metric-value { margin: 7px 0 5px; font-size: 21px; }
.section-grid { gap: 14px; margin-top: 14px; }
.section-header { min-height: 46px; padding: 9px 13px; }
.section-header h2 { font-size: 13px; }
.section-body { padding: 13px; }

.toolbar {
  min-height: 52px;
  margin-bottom: 10px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  color: #4e5b65;
  border-right: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.toolbar-label svg { width: 15px; height: 15px; color: var(--teal); }
.search-wrap::before { top: 5px; }
.search-input, .filter-control { height: 32px; border-color: #c4cdd3; }
.filter-tabs { margin-bottom: 10px; background: #fff; border: 1px solid var(--line); border-width: 0 0 1px; }
.filter-tab { padding: 9px 12px; }
.table-wrap { position: relative; }
.data-table { min-width: 860px; }
.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 34px;
  background: #f1f4f5;
  color: #55636d;
  border-bottom-color: #cfd7dc;
}
.data-table td { height: 44px; }
.data-table tbody tr:nth-child(even) { background: #fafbfb; }
.data-table tbody tr:hover { background: #f5faf8; }
.data-table th:last-child, .data-table td:last-child { width: 66px; text-align: right; }
.primary-cell { overflow-wrap: anywhere; }
.status { padding: 3px 7px; border-radius: 3px; }
.status.success { color: #16734d; background: #e6f3ed; }
.status.warning { color: #91550f; background: #fff1dc; }
.status.danger { color: #a93630; background: #fae9e7; }
.status.info { color: #176b87; background: #e8f2f7; }
.notice { border-left-width: 3px; }
.empty-state { min-height: 220px; border-style: dashed; }
.case-row.active, .rule-row.active { background: #ebf5f1; box-shadow: inset 3px 0 var(--teal); }
.candidate.recommended { border-color: #6eaa92; background: #f2f8f5; }
.transcript { background: #f5f7f8; border-left-color: #5d8798; }

.drawer {
  width: min(520px, 94vw);
  border-left: 1px solid #cbd3d8;
  box-shadow: -14px 0 36px rgb(24 35 43 / 16%);
}
.drawer header { flex: 0 0 auto; padding: 16px 22px; }
.drawer-body { padding: 0 22px 22px; }
.drawer footer { flex: 0 0 auto; min-height: 62px; padding: 13px 22px; background: #f8faf9; }
.drawer-backdrop { background: rgb(24 33 40 / 40%); }
.drawer-open { overflow: hidden; }
.detail-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 -22px 18px;
  padding: 13px 22px;
  background: #f6f8f8;
  border-bottom: 1px solid var(--line);
}
.detail-summary > div { min-width: 0; padding-right: 16px; }
.detail-summary > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.detail-summary span, .detail-summary strong { display: block; }
.detail-summary > div > span:first-child { margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.detail-summary strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-section + .drawer-section { margin-top: 22px; }
.drawer-section h3 {
  margin: 0 0 9px;
  padding-bottom: 8px;
  color: #3f4d57;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.drawer-section .detail-list { border-top: 0; }
.drawer-section .timeline { margin-top: 2px; }
.toast { background: #28343d; }

.loading-bar {
  position: fixed;
  z-index: 85;
  top: var(--topbar);
  right: 0;
  left: var(--sidebar);
  height: 2px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.loading-bar i { display: block; width: 32%; height: 100%; background: #19a974; transform: translateX(-110%); }
.loading-bar[aria-hidden="false"] { opacity: 1; }
.loading-bar[aria-hidden="false"] i { animation: loading-slide .75s ease-in-out infinite; }
.is-refreshing #view-root { opacity: .58; transition: opacity .12s ease; }
.is-refreshing #refresh-button svg { animation: loading-spin .7s linear infinite; }
@keyframes loading-slide { to { transform: translateX(420%); } }
@keyframes loading-spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  :root { --topbar: 54px; }
  .topbar { padding: 0 10px; }
  .brand { flex: 0 1 auto; min-width: 0; padding: 0 8px; color: var(--ink); background: transparent; }
  .sidebar { box-shadow: 8px 0 28px rgb(19 28 35 / 24%); }
  .sidebar-backdrop.open { background: rgb(22 31 38 / 46%); }
  .brand strong { font-size: 13px; }
  .loading-bar { left: 0; }
  .page-head { min-height: 72px; padding: 14px 16px 12px; }
  .page-body { padding: 14px 16px 24px; }
}

@media (max-width: 560px) {
  .page-head { align-items: stretch; }
  .page-body { padding-right: 12px; padding-left: 12px; }
  .toolbar { padding: 8px; }
  .toolbar-label { flex: 1 0 100%; padding: 0 0 7px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .metrics { box-shadow: none; }
  .drawer header, .drawer-body { padding-right: 16px; padding-left: 16px; }
  .detail-summary { margin-right: -16px; margin-left: -16px; padding-right: 16px; padding-left: 16px; }
}

/* Device center badge overview */
.device-page { container-type: inline-size; }
.device-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgb(27 39 47 / 3%);
}
.device-summary > div { padding: 12px 16px; border-right: 1px solid var(--line-soft); }
.device-summary > div:last-child { border-right: 0; }
.device-summary span, .device-summary strong { display: block; }
.device-summary span { color: var(--muted); font-size: 10px; }
.device-summary strong { margin-top: 5px; font-size: 18px; }
.device-summary .attention strong { color: var(--amber); }
.device-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.device-section-title h2 { margin: 0; font-size: 15px; }
.device-section-title p, .device-section-title > span {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(270px, 1fr));
  gap: 12px;
}
.device-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid #d5dce1;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgb(27 39 47 / 4%);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.device-card:hover {
  border-color: #aab9c1;
  box-shadow: 0 5px 14px rgb(31 51 62 / 8%);
  transform: translateY(-1px);
}
.device-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.device-person-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #176c78;
  background: #e9f4f3;
  border: 1px solid #b9d7d3;
  border-radius: 50%;
}
.device-person-icon svg { width: 20px; height: 20px; }
.device-person { min-width: 0; }
.device-person strong, .device-person span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-person strong { font-size: 14px; }
.device-person span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.device-card-runtime {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(100px, .85fr);
  gap: 14px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.battery-line {
  display: grid;
  grid-template-columns: auto minmax(42px, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.battery-line > span, .runtime-line > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.battery-line > strong, .runtime-line > strong { font-size: 10px; white-space: nowrap; }
.battery-track { height: 6px; overflow: hidden; background: #e3e9eb; border-radius: 3px; }
.battery-track i { display: block; height: 100%; background: #28a86b; border-radius: inherit; }
.device-card.warning .battery-track i { background: #d18a20; }
.device-card.danger .battery-track i { background: #c94c43; }
.runtime-line { display: flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 0; }
.device-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 9px 16px;
  margin: 0;
  padding: 12px 14px;
}
.device-card-meta > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px; min-width: 0; }
.device-card-meta dt, .device-card-meta dd { margin: 0; font-size: 10px; }
.device-card-meta dt { color: var(--muted); white-space: nowrap; }
.device-card-meta dd { overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.device-card footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 28px;
  gap: 8px;
  align-items: center;
  min-height: 39px;
  padding: 5px 8px 5px 14px;
  color: var(--muted);
  background: #f7f9fa;
  border-top: 1px solid var(--line-soft);
  font-size: 9px;
}
.device-card footer > span { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-card footer svg { width: 13px; height: 13px; }
.device-card footer .icon-button { width: 28px; height: 28px; }
.device-empty { grid-column: 1 / -1; }

@container (max-width: 950px) {
  .device-grid { grid-template-columns: repeat(2, minmax(270px, 1fr)); }
}
@container (max-width: 610px) {
  .device-grid { grid-template-columns: 1fr; }
}
@media (min-width: 1680px) {
  .device-grid { grid-template-columns: repeat(4, minmax(270px, 1fr)); }
}
@media (max-width: 620px) {
  .device-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-summary > div:nth-child(2) { border-right: 0; }
  .device-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .device-section-title { align-items: flex-start; flex-direction: column; gap: 2px; }
  .device-card-runtime { grid-template-columns: 1fr; gap: 9px; }
  .runtime-line { justify-content: flex-start; }
  .device-card-meta { grid-template-columns: 1fr; }
}
