:root {
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --sidebar: #0c1f34;
  --text: #17212b;
  --muted: #687585;
  --line: #d7dee5;
  --brand: #157f67;
  --brand-2: #0f6955;
  --brand-soft: #e8f5f1;
  --blue: #276ef1;
  --blue-soft: #edf3ff;
  --amber: #c57a00;
  --amber-soft: #fff6df;
  --red: #bf3b3b;
  --red-soft: #fff0f0;
  --shadow: 0 10px 28px rgba(21, 42, 64, 0.07);
  --radius: 14px;
  --sidebar-width: 248px;
  --sidebar-collapsed: 72px;
  --header-height: 70px;
  --radius-control: 9px;
  --font-ui: Calibri, "Segoe UI", sans-serif;
  --font-table: Oswald, "Segoe UI", sans-serif;
  --font-table-head: Oswald, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--surface-page, var(--bg));
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns .2s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar) 0%, #0a1827 100%);
  color: #eaf2f8;
  padding: 16px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
  transition: width .2s ease, padding .2s ease;
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  padding-inline: 8px;
}
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .brand-sub,
.sidebar.collapsed .brand-title,
.sidebar.collapsed .sidebar-status,
.sidebar.collapsed .nav-badge {
  display: none;
}
.sidebar.collapsed .brand {
  justify-content: center;
  padding-inline: 0;
}
.sidebar.collapsed .brand > div:not(.brand-mark) {
  display: none;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding-inline: 10px;
  position: relative;
}
.nav-icon {
  display: none;
  width: 18px;
  height: 18px;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
  opacity: .92;
}
.sidebar.collapsed .nav-icon {
  display: inline-grid;
}
.nav-label { min-width: 0; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,.09);
  margin-bottom: 12px;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #28a686, #126a57);
  font-weight: 800;
}
.brand-title { font-weight: 760; }
.brand-sub { font-size: 11px; color: #9fb2c4; margin-top: 2px; }
.nav-group-title {
  padding: 12px 12px 6px;
  color: #7690a7;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #c9d7e3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 2px 0;
  text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(30,154,124,.28), rgba(30,154,124,.08));
  color: #fff;
}
.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(63,195,159,.18);
}
.sidebar-status {
  margin: 18px 8px 4px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.08);
}
.status-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #afc2d2; margin: 6px 0;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4bd2a9;
  box-shadow: 0 0 0 4px rgba(75,210,169,.08);
}
.status-dot.bad { background: #df4b4b; box-shadow: 0 0 0 4px rgba(223,75,75,.1); }

.main { grid-column: 2; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  min-height: 66px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px;
  background: rgba(238,242,245,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(214,221,227,.85);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
/* Codex ui/app-shell-sidebar.md тАФ ghost sm toggle (╤Н╤В╨░╨╗╨╛╨╜ r2d2) */
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: 0 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-toggle:hover {
  background: var(--blue-soft);
}
.sidebar-toggle svg { display: block; }
.page-title { font-size: 20px; font-weight: 780; letter-spacing: -.35px; }
.page-caption { color: var(--muted); font-size: 12px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.org-switch {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  min-width: 180px;
}
.org-switch select {
  border: 0; background: transparent; width: 100%;
  font-weight: 650; outline: none;
}
.avatar {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: #d9ebe6; color: #126a57; font-weight: 800;
  border: 1px solid #c4ddd6;
}
.content { padding: 22px 24px 40px; }

.hero {
  background: linear-gradient(118deg, #0f2f4c 0%, #143e5e 52%, #126a57 120%);
  color: #fff;
  border-radius: 18px;
  padding: 22px 24px;
  display: flex; justify-content: space-between; gap: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: -.4px; max-width: 640px; }
.hero p { margin: 0; color: #c9d9e5; max-width: 620px; line-height: 1.5; }
.hero-badge {
  min-width: 180px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 12px;
  position: relative; z-index: 1;
}
.hero-badge strong { display: block; font-size: 24px; margin: 4px 0; }

.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(30, 48, 66, .04);
}
.stat-card { padding: 14px; }
.stat-head { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 24px; font-weight: 780; margin: 10px 0 4px; }
.stat-foot { font-size: 11px; color: var(--muted); }
.panel { padding: 16px; }
.panel-header {
  display: flex; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; align-items: flex-start;
}
.panel-title { font-size: 15px; font-weight: 760; }
.panel-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.btn {
  border: 1px solid transparent;
  height: 38px; padding: 0 13px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 13px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-secondary { background: var(--surface); color: #3f4b58; border-color: var(--line); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #f2cece; }
.btn-amber { background: var(--amber-soft); color: #9b6200; border-color: #f3dfac; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-icon-download {
  width: 30px;
  min-width: 30px;
  padding: 0;
  text-decoration: none;
  color: #3f4b58;
}
.btn-icon-download:hover {
  background: var(--brand-soft);
  border-color: #b7e0d3;
  color: var(--brand-2);
}
.btn-icon-download svg { display: block; }
.docs-file-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 24px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 750;
}
.badge-green { color: #0d6e56; background: var(--brand-soft); }
.badge-blue { color: #245fc9; background: var(--blue-soft); }
.badge-amber { color: #996000; background: var(--amber-soft); }
.badge-red { color: #a63131; background: var(--red-soft); }
.badge-gray { color: #5d6875; background: #edf0f2; }
/* Codex status marks */
.badge-success { color: #276749; background: #f0fff4; border: 1px solid #9ae6b4; }
.badge-warn { color: #975a16; background: #fffff0; border: 1px solid #f6e05e; }
.badge-cancel { color: #4a5568; background: #fafafa; border: 1px solid #e2e8f0; }
.badge-error { color: #c53030; background: #fff5f5; border: 1px solid #fc8181; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-family: var(--font-table, Oswald, "Segoe UI", sans-serif); }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap td.table-align-left,
.table-wrap th.table-align-left { text-align: left; }
.table-wrap td.table-align-right,
.table-wrap th.table-align-right { text-align: right; }
th { background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .3px; font-family: var(--font-table-head, Impact, Oswald, sans-serif); }
th.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.th-sortable:hover,
th.th-sortable:focus-visible {
  color: var(--text);
  background: #eef5f2;
  outline: none;
}
th.th-sortable.is-sorted { color: var(--brand-2); }
.th-sort-label { margin-right: 4px; }
.th-sort-mark {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  opacity: .85;
  font-family: var(--font-ui);
}
.th-sort-mark-idle { opacity: .28; }
th.th-sortable:hover .th-sort-mark-idle { opacity: .55; }
tr:hover td { background: #fafcfd; }
/* flex on <td> breaks shared row height and border lines тАФ use inner wrappers */
.table-wrap td.cell-actions,
.table-wrap td.cell-links {
  vertical-align: top;
  width: 1%;
}
.table-wrap td.cell-actions {
  text-align: right;
}
.table-wrap .cell-actions-inner {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: flex-start;
  max-width: 260px;
}
.table-wrap .source-links-compact {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex-wrap: nowrap;
}
.row-click { cursor: pointer; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.stack { display: grid; gap: 10px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.docs-panel-actions {
  margin-top: 6px;
  margin-bottom: 4px;
  align-items: center;
}
.docs-panel-actions .source-links-compact { margin: 0; }
.field {
  display: grid; gap: 6px;
}
.field label { font-size: 12px; color: var(--muted); font-weight: 650; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.field textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.45;
  display: block;
}
.field textarea:focus,
.field input:focus,
.field select:focus {
  outline: 2px solid rgba(21, 127, 103, 0.28);
  outline-offset: 0;
  border-color: var(--brand);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 650;
  background: var(--surface-2); border: 1px solid var(--line);
}
.source-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.source-links-compact { gap: 6px; }
.source-link { text-decoration: none; white-space: nowrap; }
a.source-link:hover { border-color: var(--brand); color: var(--brand-2); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  height: 32px; padding: 0 12px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.filter-btn.active { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.empty {
  padding: 28px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 12px;
}
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  background: #12324a; color: #fff; padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--shadow); max-width: 360px;
}
.toast.err { background: #7a2a2a; }
.toast.busy { background: #1a4563; }
.btn.is-loading {
  position: relative;
  padding-right: 28px;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.dialog {
  border: 0; border-radius: 16px; padding: 0; width: min(820px, 94vw);
  max-height: min(92vh, 960px);
  box-shadow: 0 24px 60px rgba(10, 24, 40, .28);
  overflow: hidden;
}
.dialog::backdrop { background: rgba(12, 24, 36, .45); }
.dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 960px);
  padding: 0;
}
.dialog-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface, #fff);
  position: relative;
  z-index: 2;
}
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-close-form { margin: 0; display: inline-flex; }
.dialog-body {
  padding: 12px 18px 16px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.dialog-actions {
  flex-shrink: 0;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2, #f7f9fb);
  position: relative;
  z-index: 2;
}
.dialog-actions.hidden { display: none; }
.dialog-actions .panel-title { margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
    .tap-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 180px; overflow: auto;
  padding: 4px 0 2px;
}
.tap-grid--okpd {
  max-height: min(52vh, 360px);
}
.tap-mode {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0 4px;
}
.tap-block { min-width: 0; }
.tap-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.tap-panel.collapsed { display: none; }
.intel-raw > summary {
  cursor: pointer;
  color: var(--brand-2, #2b6cb0);
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}
.intel-raw > summary:hover { text-decoration: underline; }
.tap {
  border: 1px solid var(--line);
  background: #fff;
  color: #3f4b58;
  border-radius: 999px;
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 700;
}
.tap.on {
  background: var(--brand-soft);
  color: var(--brand-2);
  border-color: transparent;
}
.tap-muted { color: var(--muted); font-size: 11px; margin-top: 4px; }
.okpd-search {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0;
}
.okpd-search input { flex: 1; min-width: 160px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }

.cascade-stepper {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
  margin: 4px 0 8px;
}
.cascade-sep {
  width: 18px;
  align-self: center;
  border-top: 2px solid var(--line);
  margin: 0 2px;
}
.cascade-step {
  min-width: 92px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px;
}
.cascade-code { font-weight: 800; font-size: 12px; }
.cascade-meta { color: var(--muted); margin-top: 2px; }
.cascade-passed { border-color: #9ae6b4; background: #f0fff4; }
.cascade-stopped { border-color: #fc8181; background: #fff5f5; }
.cascade-skipped, .cascade-pending { opacity: 0.72; }
.cascade-failed { border-color: #fc8181; background: #fff5f5; }
.cascade-incomplete,
.cascade-title_only,
.cascade-pending_docs {
  border-color: #f6e05e;
  background: #fffff0;
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .sidebar-toggle-desktop { display: none; }
  .app-shell,
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 88vw);
    transform: translateX(0);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
    z-index: 50;
  }
  .sidebar.collapsed {
    width: min(280px, 88vw);
    transform: translateX(-105%);
    box-shadow: none;
  }
  .sidebar.collapsed .nav-group-title,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .brand-sub,
  .sidebar.collapsed .brand-title,
  .sidebar.collapsed .sidebar-status,
  .sidebar.collapsed .nav-badge {
    display: revert;
  }
  .sidebar.collapsed .brand > div:not(.brand-mark) { display: revert; }
  .sidebar.collapsed .nav-icon { display: none; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding-inline: 12px; }
  .main { grid-column: 1; }
}

/* Case workspace тАФ ╨┐╨░╤В╤В╨╡╤А╨╜ ValiQ deal workspace: ╨╛╤З╨╡╤А╨╡╨┤╤М | ╤А╨░╨▒╨╛╤В╨░ | ╨┤╨╡╤В╨░╨╗╨╕ */
body.case-mode .content { padding: 0; }
.case-workspace {
  height: calc(100vh - 66px);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
.case-ws-grid {
  display: flex;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}
.case-ws-queue {
  flex: 0 0 auto;
  width: var(--case-ws-queue-w, 280px);
  min-width: 200px;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
}
.case-ws-splitter {
  flex: 0 0 5px;
  cursor: col-resize;
  background: var(--line);
  opacity: 0.45;
  touch-action: none;
  user-select: none;
  transition: opacity .15s ease, background .15s ease;
}
.case-ws-splitter:hover,
.case-ws-splitter.dragging,
.case-ws-splitter:focus-visible {
  opacity: 1;
  background: var(--brand);
  outline: none;
}
body.case-ws-resizing {
  cursor: col-resize;
  user-select: none;
}
body.case-ws-resizing * {
  cursor: col-resize !important;
}
.case-ws-main {
  flex: 1 1 auto;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.case-ws-rail {
  flex: 0 0 auto;
  width: var(--case-ws-rail-w, 320px);
  min-width: 260px;
  max-width: 560px;
  overflow-y: auto;
  min-height: 0;
  background: var(--surface-2);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.case-ws-queue,
.case-ws-main {
  border-right: none;
}
.case-ws-queue-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.case-queue-search {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.case-queue-list {
  overflow-y: auto;
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case-queue-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.case-queue-item:hover { background: #fafcfd; }
.case-queue-item.active {
  background: var(--brand-soft);
  border-color: #9ae6b4;
}
.case-queue-item-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.case-queue-title { font-size: 13px; font-weight: 650; line-height: 1.35; }
.case-queue-meta { font-size: 11px; margin-top: 4px; }
.case-queue-id { font-size: 11px; margin-top: 4px; }
.case-queue-empty { margin: 12px; }
.case-ws-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.case-ws-head-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.case-ws-title-wrap { min-width: 0; flex: 1; }
.case-ws-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: -.2px;
}
.case-ws-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.case-ws-cascade { margin-top: 4px; }
.case-ws-note { font-size: 12px; margin-top: 6px; }
.case-ws-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--surface-2);
}
.case-ws-tab {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  border-radius: 10px 10px 0 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.case-ws-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -1px 0 var(--surface);
  border: 1px solid var(--line);
  border-bottom-color: var(--surface);
  margin-bottom: -1px;
}
.case-ws-main-scroll {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 20px;
  min-height: 0;
}
.case-rail-card { padding: 14px; }
.case-rail-kv { grid-template-columns: 88px 1fr; font-size: 12px; margin-top: 10px; }
.case-rail-block { margin-top: 8px; min-width: 0; }
.case-rail-decision { min-width: 0; }
.case-rail-decision .stack { min-width: 0; }
.case-rail-decision .field textarea {
  min-height: 96px;
  max-height: 280px;
  resize: none;
  overflow-y: auto;
}
.case-rail-decision select {
  text-overflow: ellipsis;
}
.case-workspace-loading { margin: 24px; }

@media (max-width: 1200px) {
  .case-ws-queue { max-width: 360px; }
  .case-ws-rail { max-width: 420px; }
}
@media (max-width: 960px) {
  .case-ws-grid {
    flex-direction: column;
    overflow-y: auto;
  }
  .case-ws-splitter { display: none; }
  .case-workspace { height: auto; min-height: calc(100vh - 66px); }
  .case-ws-queue,
  .case-ws-rail {
    width: auto !important;
    max-width: none;
    min-width: 0;
  }
  .case-ws-main { min-width: 0; border-right: 0; }
  .case-ws-queue { max-height: 220px; border-bottom: 1px solid var(--line); }
  .case-ws-rail { max-height: none; }
}

/* P10 security: browser-session login */
.auth-dialog {
  width: min(430px, calc(100vw - 32px));
  border: 0;
  background: transparent;
  padding: 0;
}
.auth-dialog::backdrop { background: rgba(15, 23, 42, .36); backdrop-filter: blur(4px); }
.auth-card {
  display: grid;
  gap: 14px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .18);
}
.auth-card h2 { margin: 0; }
.auth-brand { color: var(--brand); font-weight: 800; letter-spacing: .3px; }
.auth-card label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}
.auth-error { padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 12px; }
