:root {
  --app-bg: #eef1f6;
  --main-bg: #fbfcff;
  --surface: #ffffff;
  --surface-soft: #f8f9ff;
  --sidebar: #ececff;
  --sidebar-deep: #dedfff;
  --ink: #151b2d;
  --text: #2d3748;
  --muted: #7f8ba3;
  --faint: #a7b0c2;
  --line: #e7eaf2;
  --line-strong: #d8deea;
  --indigo: #5b63f1;
  --indigo-dark: #474fd4;
  --teal: #2fc7b7;
  --teal-dark: #159d93;
  --rail-navy: #061626;
  --rail-ink: #0b2540;
  --signal-cyan: #38d7c5;
  --action-indigo: #5267ff;
  --case-amber: #f5a524;
  --success: #1f9d74;
  --success-bg: #e8f7f1;
  --warning: #bb7a18;
  --warning-bg: #fff4dd;
  --danger: #c24b4b;
  --danger-bg: #fff0ef;
  --shadow-card: 0 18px 45px rgba(18, 26, 45, 0.08);
  --shadow-soft: 0 10px 24px rgba(18, 26, 45, 0.06);
  --shadow-button: 0 14px 25px rgba(91, 99, 241, 0.24);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: clamp(236px, 18vw, 286px);
  --page-gap: 28px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--app-bg);
}

html.file-redirecting body {
  visibility: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(115deg, rgba(236, 236, 255, 0.88) 0 24%, transparent 24% 100%),
    linear-gradient(140deg, #f5f7fb 0%, #edf1f7 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

::selection {
  color: white;
  background: var(--indigo);
}

.sidebar {
  position: fixed;
  inset: 22px auto 22px 22px;
  z-index: 30;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 30px 24px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-deep));
  box-shadow: 0 28px 70px rgba(31, 42, 68, 0.13);
}

.sidebar.zhiyin-sidebar {
  gap: 16px;
  color: rgba(238, 246, 255, 0.92);
  background:
    radial-gradient(circle at 24% 0%, rgba(56, 215, 197, 0.28), transparent 34%),
    linear-gradient(180deg, var(--rail-ink), var(--rail-navy));
  box-shadow: 0 28px 70px rgba(6, 22, 38, 0.24);
}

.sidebar.zhiyin-sidebar .brand-title,
.sidebar.zhiyin-sidebar .selected-box strong,
.sidebar.zhiyin-sidebar .employee-meta strong {
  color: #fff;
}

.sidebar.zhiyin-sidebar .brand-subtitle,
.sidebar.zhiyin-sidebar .selected-box span,
.sidebar.zhiyin-sidebar .selected-box small,
.sidebar.zhiyin-sidebar .employee-meta span,
.sidebar.zhiyin-sidebar .employee-meta small {
  color: rgba(216, 231, 248, 0.74);
}

.ai-rail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-rail-actions button,
.ai-rail-section-title button,
.ai-rail-item {
  border: 1px solid rgba(210, 229, 252, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(242, 248, 255, 0.94);
}

.ai-rail-actions button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  font-weight: 820;
}

.ai-rail-actions button:first-child {
  background: var(--action-indigo);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 24px rgba(82, 103, 255, 0.24);
}

.ai-rail-section {
  min-height: 0;
  display: grid;
  gap: 8px;
}

.ai-rail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(219, 233, 250, 0.66);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
}

.ai-rail-section-title button {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
}

.ai-rail-list {
  display: grid;
  gap: 7px;
  overflow-y: auto;
}

.ai-rail-item {
  width: 100%;
  display: grid;
  gap: 2px;
  border-radius: 12px;
  padding: 10px 11px;
  text-align: left;
}

.ai-rail-item:hover,
.ai-rail-item.active {
  border-color: rgba(56, 215, 197, 0.52);
  background: rgba(56, 215, 197, 0.13);
}

.ai-rail-item strong {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-rail-item span,
.ai-rail-empty {
  color: rgba(212, 228, 246, 0.68);
  font-size: 11px;
}

.ai-rail-empty {
  border: 1px dashed rgba(210, 229, 252, 0.16);
  border-radius: 12px;
  padding: 10px;
  line-height: 1.5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: hidden;
  color: transparent;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  top: 7px;
}

.brand-mark::before {
  left: 4px;
  background: var(--teal);
}

.brand-mark::after {
  right: 4px;
  background: var(--indigo);
  opacity: 0.86;
  mix-blend-mode: multiply;
}

.brand-title {
  color: var(--ink);
  font-size: 24px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1;
}

.brand-subtitle {
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 680;
}

.selected-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
}

.selected-box span,
.selected-box small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.selected-box strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
}

.selected-box small {
  overflow-wrap: anywhere;
}

.nav {
  display: grid;
  gap: 9px;
}

.employee-card {
  margin-top: auto;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.employee-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(135deg, var(--teal), var(--indigo));
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.employee-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.employee-meta span,
.employee-meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 880;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  color: #626b7e;
  background: transparent;
  text-align: left;
  font-weight: 760;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.nav-btn::before {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: currentColor;
  font-size: 13px;
  font-weight: 920;
  content: "A";
}

.nav-btn[data-view="workbench"]::before { content: "W"; }

.nav-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.44);
}

.nav-btn.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 24px rgba(40, 50, 78, 0.08);
  transform: translateX(1px);
}

.nav-btn.active::before {
  color: var(--indigo);
}

.main {
  position: relative;
  min-height: calc(100vh - 44px);
  margin: 22px 22px 22px calc(var(--sidebar-width) + 44px);
  padding: 0 0 28px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(115deg, transparent 0 56%, rgba(255, 246, 251, 0.82) 56% 100%),
    var(--main-bg);
  box-shadow: 0 34px 90px rgba(18, 26, 45, 0.12);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 40px 22px;
  background: linear-gradient(180deg, rgba(251, 252, 255, 0.96), rgba(251, 252, 255, 0.78));
  backdrop-filter: blur(18px);
}
.topbar-title-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-title-copy {
  min-width: 0;
}

.workflow-back-btn {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(195, 198, 214, 0.62);
  border-radius: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.workflow-back-btn:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.workflow-back-btn.hidden {
  display: none;
}

.kicker {
  margin: 0 0 7px;
  color: #8d99ad;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.02;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.search {
  width: min(330px, 34vw);
}

.workbench-only.hidden {
  display: none;
}
.language-select.hidden {
  display: none;
}

.language-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.language-toggle-btn {
  min-width: 54px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.language-toggle-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(98, 91, 246, 0.24);
}

.view {
  display: none;
  padding: 0 40px;
}

.view.active {
  display: block;
}

.panel,
.stat,
.login-panel,
.review-step,
.doc-item,
.task-item,
.review-block,
.supplement-card,
.envelope,
.upload-box,
.export-grid > div {
  border: 1px solid rgba(231, 234, 242, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-card);
}

.panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-radius: var(--radius-xl);
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 840;
  letter-spacing: 0;
}

.panel-head p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  line-height: 1.55;
}

.status-group,
.form-actions,
.package-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 880;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn.primary {
  color: #fff;
  background: var(--indigo);
  box-shadow: var(--shadow-button);
}

.btn.primary:hover:not(:disabled) {
  background: var(--indigo-dark);
}

.btn.secondary {
  color: #3b4557;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 7px 18px rgba(18, 26, 45, 0.04);
}

.btn.secondary:hover:not(:disabled) {
  border-color: #d3d8e6;
  box-shadow: 0 12px 22px rgba(18, 26, 45, 0.07);
}

input,
select,
textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
  min-height: 280px;
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(91, 99, 241, 0.62);
  box-shadow: 0 0 0 4px rgba(91, 99, 241, 0.11);
}

label {
  display: grid;
  gap: 8px;
  color: #5e687d;
  font-size: 12px;
  font-weight: 820;
}

.pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--indigo-dark);
  background: #eceeff;
  font-size: 12px;
  font-weight: 880;
  white-space: nowrap;
}

.pill.ok {
  color: var(--success);
  background: var(--success-bg);
}

.pill.warn {
  color: var(--warning);
  background: var(--warning-bg);
}

.pill.danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.pill.muted {
  color: var(--muted);
  background: #f0f2f7;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 24px;
}

.stat {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 9px;
  border-radius: var(--radius-lg);
  padding: 22px;
}

.stat span {
  color: #96a0b2;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat strong {
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 34px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(520px, 1fr) minmax(320px, 390px);
  gap: var(--page-gap);
  align-items: stretch;
}

.list-panel,
.detail-panel,
.package-review {
  height: max(620px, calc(100vh - 244px));
  min-height: 0;
  overflow: hidden;
}

.case-list,
#caseDetail,
.package-review,
.checklist,
.task-list,
#reviewPanel,
#supplementPanel,
#envelopePanel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(91, 99, 241, 0.28) transparent;
}

.case-list::-webkit-scrollbar,
#caseDetail::-webkit-scrollbar,
.package-review::-webkit-scrollbar,
.checklist::-webkit-scrollbar,
.task-list::-webkit-scrollbar,
#reviewPanel::-webkit-scrollbar,
#supplementPanel::-webkit-scrollbar,
#envelopePanel::-webkit-scrollbar {
  width: 7px;
}

.case-list::-webkit-scrollbar-thumb,
#caseDetail::-webkit-scrollbar-thumb,
.package-review::-webkit-scrollbar-thumb,
.checklist::-webkit-scrollbar-thumb,
.task-list::-webkit-scrollbar-thumb,
#reviewPanel::-webkit-scrollbar-thumb,
#supplementPanel::-webkit-scrollbar-thumb,
#envelopePanel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(91, 99, 241, 0.24);
}

.case-list {
  display: grid;
  gap: 12px;
  padding: 2px 4px 2px 0;
}

.case-row {
  width: 100%;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: inherit;
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
  box-shadow: 0 8px 18px rgba(18, 26, 45, 0.035);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
  cursor: pointer;
}

.case-row:hover,
.case-row.active,
.case-row:focus-visible {
  border-color: rgba(91, 99, 241, 0.45);
  background: white;
  box-shadow: 0 16px 32px rgba(91, 99, 241, 0.12);
  transform: translateY(-1px);
}

.case-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.case-main strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 860;
}

.case-main span,
.case-money {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.case-delete-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 999px;
  background: rgba(254, 242, 242, 0.88);
  color: #b42318;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.case-delete-btn:hover,
.case-delete-btn:focus-visible {
  border-color: rgba(220, 38, 38, 0.42);
  background: #fee2e2;
  color: #991b1b;
}

.case-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 2px 4px 2px 0;
}

.detail-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
}

.detail-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--indigo));
}

.detail-card.wide {
  grid-column: 1 / -1;
  min-height: 112px;
}

.detail-card span {
  color: #929db1;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.detail-card strong {
  color: var(--ink);
  font-weight: 740;
  line-height: 1.58;
}

.audit-list p {
  margin: 0 0 8px;
}

.audit-list small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.package-review {
  gap: 16px;
}

.package-head {
  margin-bottom: 4px;
}

.package-upload {
  padding: 14px;
  border: 1px dashed #cfd6e6;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.package-flow-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.package-flow-step {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 9px;
  row-gap: 2px;
  align-items: center;
  min-height: 58px;
  padding: 10px;
  border: 1px solid #dfe5ef;
  border-radius: 12px;
  background: #ffffff;
}

.package-flow-step span {
  grid-row: span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eef3ff;
  color: #3564e8;
  font-size: 11px;
  font-weight: 950;
}

.package-flow-step strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.package-flow-step small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.35;
}

.package-flow-step.done {
  border-color: rgba(31, 157, 116, 0.22);
  background: #f3fbf8;
}

.package-flow-step.done span {
  background: #dff6ed;
  color: #158764;
}

.package-flow-step.active {
  border-color: rgba(53, 100, 232, 0.34);
  box-shadow: 0 10px 22px rgba(53, 100, 232, 0.12);
}

.package-flow-step.blocked {
  border-color: rgba(214, 134, 19, 0.28);
  background: #fffaf0;
}

.package-flow-step.blocked span {
  background: #fff0cf;
  color: #b96e07;
}

.review-step {
  display: grid;
  gap: 12px;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 10px 24px rgba(18, 26, 45, 0.045);
}

.step-title {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.step-title strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 870;
}

.step-title small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.step-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: var(--radius-sm);
  color: var(--indigo);
  background: #eceeff;
  font-size: 12px;
  font-weight: 940;
}

.compact-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-list span {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--warning);
  background: var(--warning-bg);
  font-size: 12px;
  font-weight: 820;
}

.compact-list .ok-text {
  color: var(--success);
  background: var(--success-bg);
}

.package-supplement-card {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid rgba(91, 99, 241, 0.16);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f8f9ff);
}

.package-supplement-card.ok {
  border-color: rgba(31, 157, 116, 0.2);
  background: var(--success-bg);
}

.hub-case-supplement .step-title {
  align-items: center;
  margin: 4px 0 8px;
}

.hub-case-supplement .step-index {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 8px;
}

.hub-case-supplement .package-supplement-card {
  border-radius: 8px;
  box-shadow: none;
}

.hub-case-supplement .package-review-status-flow span {
  min-height: 23px;
  font-size: 10px;
}

.hub-case-supplement .package-supplement-grid input,
.hub-case-supplement .package-supplement-grid select {
  min-height: 34px;
  border-radius: 8px;
  font-size: 12px;
}

.package-supplement-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 880;
}

.package-supplement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.package-review-status-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.package-review-status-flow span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eaf0ff;
  font-size: 11px;
  font-weight: 850;
}

.package-supplement-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.package-supplement-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.package-supplement-grid input,
.package-supplement-grid select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.package-supplement-grid .supplement-check {
  min-height: 38px;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.package-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.split-layout,
.workflow-layout,
.export-grid,
.settings-grid {
  display: grid;
  gap: var(--page-gap);
  align-items: stretch;
}

.split-layout {
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
}

.workflow-layout {
  grid-template-columns: minmax(310px, 0.9fr) minmax(390px, 1.12fr) minmax(330px, 0.98fr);
}

.workflow-layout > .panel {
  height: max(640px, calc(100vh - 176px));
  min-height: 0;
  overflow: hidden;
}

.workflow-layout .checklist,
.workflow-layout #envelopePanel {
  flex: 1 1 auto;
}

.workflow-layout #reviewPanel {
  display: grid;
  gap: 12px;
  flex: 1 1 auto;
}

#supplementPanel {
  flex: 0 0 auto;
}

.workflow-layout .task-list {
  flex: 0 1 210px;
  margin-top: 12px;
}

.import-panel {
  min-height: 0;
}

.application-workspace {
  display: grid;
  grid-template-columns: minmax(480px, 580px) minmax(760px, 1fr);
  gap: 28px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.application-import-panel,
.application-paper {
  height: max(760px, calc(100vh - 142px));
  min-height: 0;
}

.application-import-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(214, 222, 238, 0.92);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.case-create-import-panel {
  align-items: center;
  justify-content: flex-start;
  height: auto;
  min-height: 0;
  padding: 26px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible !important;
}

.case-create-intro {
  width: min(100%, 580px);
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.case-create-plus {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #2563eb;
  background: #eef4ff;
  font-size: 30px;
  font-weight: 360;
  line-height: 1;
}

.case-create-intro h2 {
  margin: 8px 0 0;
  color: #202938;
  font-size: 25px;
  font-weight: 880;
  letter-spacing: 0;
  line-height: 1.2;
}

.case-create-intro p {
  max-width: 470px;
  margin: 0;
  color: #7b8798;
  font-size: 14px;
  font-weight: 680;
  line-height: 1.65;
}

.case-create-composer {
  width: min(100%, 580px);
  min-height: 162px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0;
  margin-top: 28px;
  padding: 16px 14px 10px;
  border: 1px solid #d8dee9;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
}

.case-create-message {
  display: block;
}

.case-create-import-panel .text-import {
  width: 100%;
  height: 96px;
  min-height: 96px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #1f2937;
  background: transparent;
  box-shadow: none;
  resize: none;
  font-size: 15px;
  font-weight: 680;
  line-height: 1.55;
}

.case-create-import-panel .text-import:focus {
  outline: 0;
}

.case-create-import-panel .text-import::placeholder {
  color: #8d98aa;
}

.case-create-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.case-upload-box {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.case-upload-trigger {
  position: relative;
  width: 108px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid #d9e0ec;
  border-radius: 10px;
  color: #4a5568;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.case-upload-trigger span {
  color: #718096;
  font-size: 16px;
  font-weight: 500;
}

.case-upload-trigger input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.case-upload-box p {
  margin: 0;
  color: #a0a8b7;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.application-import-panel .case-upload-box {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.application-import-panel .case-upload-box .case-upload-trigger {
  display: inline-flex;
  width: 108px;
  min-height: 36px;
  gap: 8px;
}

.application-import-panel .case-upload-box p {
  margin: 0;
  color: #a0a8b7;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
}

.case-create-bottom #parseImportBtn {
  min-height: 38px;
  min-width: 164px;
  padding: 0 18px;
  border-radius: 10px;
  background: #315fe8;
  box-shadow: 0 12px 26px rgba(49, 95, 232, 0.24);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.case-create-file-config {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf1f7;
}

.case-create-file-config.hidden {
  display: none !important;
}

.case-create-ocr-status {
  border: 1px solid #e3e9f4;
  border-radius: 10px;
  padding: 8px 10px;
  color: #6f7c90;
  background: #f8fbff;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.45;
}

.case-create-file-config-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}

.case-create-file-config-item div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.case-create-file-config-item strong,
.case-create-file-config-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-create-file-config-item strong {
  color: #27364a;
  font-size: 12px;
  font-weight: 850;
}

.case-create-file-config-item span {
  color: #9aa4b2;
  font-size: 11px;
  font-weight: 760;
}

.case-create-file-config-item select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #d9e0ec;
  border-radius: 9px;
  padding: 0 9px;
  color: #344054;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.case-create-import-panel::after {
  content: "本地 AI 处理 · 材料不出公司网络";
  margin-top: 14px;
  color: #b3bac7;
  font-size: 12px;
  font-weight: 760;
}

.application-import-panel > * {
  flex-shrink: 0;
}

.application-import-panel .text-import {
  height: 190px;
  min-height: 190px;
  resize: vertical;
}

.application-import-panel .import-label,
.application-import-panel .upload-box,
.application-import-panel .check-line,
.application-import-panel .import-actions {
  min-height: 0;
}

.application-import-panel .panel-head {
  align-items: flex-start;
  margin-bottom: 0;
  padding: 0;
  border: 0;
}

.application-import-panel .panel-head h2 {
  margin: 0 0 8px;
  color: #101828;
  font-family: "SF Pro Display", Inter, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 820;
  letter-spacing: 0;
}

.application-import-panel .panel-head p {
  max-width: 310px;
  margin: 0;
  color: #66758d;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.application-import-panel #importStatus {
  min-height: 32px;
  padding: 7px 12px;
  border: 0;
  color: #b76b00;
  background: #fff0d2;
  box-shadow: none;
  font-size: 13px;
  font-weight: 820;
}

.application-import-panel .import-label,
.application-import-panel .upload-box {
  flex: 0 0 auto;
}

.application-import-panel .import-label {
  display: grid;
  gap: 10px;
  color: #3e4b63;
  font-size: 13px;
  font-weight: 820;
}

.application-import-panel .text-import {
  width: 100%;
  padding: 18px;
  border: 1px solid #dbe3f1;
  border-radius: 12px;
  color: #172033;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
}

.application-import-panel .text-import::placeholder {
  color: #8b97ad;
}

.application-import-panel .upload-box {
  padding: 16px;
  border: 1px solid #e1e7f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.application-import-panel .upload-box label {
  display: grid;
  gap: 10px;
  color: #526176;
  font-size: 13px;
  font-weight: 820;
}

.application-import-panel .upload-box input[type="file"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dbe3f1;
  border-radius: 10px;
  color: #111827;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}

.application-import-panel .upload-box p {
  margin: 0;
  color: #697992;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.application-import-panel .check-line {
  align-items: flex-start;
  flex: 0 0 auto;
  gap: 10px;
  margin: 0;
  line-height: 1.4;
}

.application-import-panel .check-line span {
  flex: 1;
  min-width: 0;
  color: #53637b;
  font-size: 13px;
  font-weight: 720;
}

.application-import-panel .check-line input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #5f63f1;
}

.application-import-panel .import-actions {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-height: max-content;
  overflow: visible;
}

.import-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.import-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  line-height: 1.25;
  white-space: normal;
}

.import-actions #parseImportBtn {
  grid-column: 1 / -1;
  min-height: 52px;
  border-radius: 15px;
  background: #0756c9;
  box-shadow: 0 16px 34px rgba(0, 76, 190, 0.22);
  font-size: 15px;
  font-weight: 850;
}

.application-paper {
  width: 100%;
  min-width: 760px;
  max-width: none;
  overflow: auto;
  padding: 18px 22px 30px;
  border: 1px solid rgba(214, 222, 238, 0.82);
  border-radius: 12px;
  color: #111827;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  scrollbar-gutter: stable;
}

.pdf-application-paper {
  background: #fff;
}

.application-paper-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 2px solid #111827;
}

.application-paper-header-clean {
  display: none !important;
  margin-bottom: 0 !important;
}

.application-paper-clean .application-paper-header-clean {
  align-items: flex-end;
  border-bottom-color: #111827;
}

.application-paper-clean .application-paper-header-clean p:last-child {
  color: #111827;
  font-size: 13px;
  font-weight: 650;
}

.visually-hidden-state {
  position: absolute !important;
  display: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

#applicationScreeningSummary,
#formScore {
  display: none !important;
}

.application-paper-header h2 {
  margin: 2px 0 2px;
  color: #111827;
  font-family: "Times New Roman", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.application-paper-header p {
  margin: 0;
}

.pdf-page-wrap {
  flex: 0 0 auto;
  width: clamp(760px, 58vw, 980px);
  max-width: none;
  margin: 0 auto 18px;
}

.pdf-page-bg {
  position: relative;
  width: 100%;
  aspect-ratio: 612 / 792;
  overflow: hidden;
  border: 1px solid #d8deea;
  background-color: #fff;
  background-image: var(--chn-application-page-1);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.pdf-template-inline {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.pdf-page-bg.loading-template {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 760;
}

.pdf-field {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0 3px;
  border: 1px solid transparent;
  border-radius: 0;
  box-sizing: border-box;
  color: #111827;
  background: rgba(255, 255, 255, 0.02);
  font-family: Arial, sans-serif;
  font-size: clamp(7px, 1.23vw, 12px);
  font-weight: 700;
  line-height: 1;
  outline: 0;
  box-shadow: none;
}

.pdf-field:focus {
  background: rgba(91, 99, 241, 0.12);
  box-shadow: 0 0 0 2px rgba(91, 99, 241, 0.18);
}

.pdf-field[type="radio"],
.pdf-field[type="checkbox"] {
  min-height: 0;
  padding: 0;
  accent-color: #111827;
  transform: scale(0.82);
  transform-origin: center;
}

.hidden-form-state {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.application-paper fieldset {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 1px solid #111827;
  border-radius: 0;
  background: #fff;
}

.application-paper legend {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  color: #fff;
  background: #111827;
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.application-paper label {
  min-height: 74px;
  padding: 9px 10px 8px;
  border-top: 1px solid #111827;
  border-right: 1px solid #111827;
  color: #111827;
  background: #fff;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.application-paper label:nth-of-type(4n) {
  border-right: 0;
}

.application-paper label.wide {
  grid-column: 1 / -1;
}

.application-paper label.wide:nth-of-type(4n) {
  border-right: 1px solid #111827;
}

.application-paper input,
.application-paper select {
  min-height: 32px;
  margin-top: 9px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid #111827;
  border-radius: 0;
  color: #111827;
  background: transparent;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.application-paper .pdf-field {
  position: absolute;
  z-index: 2;
  min-height: 0;
  margin: 0;
  padding: 0 3px;
  border: 1px solid transparent;
  border-radius: 0;
  box-sizing: border-box;
  color: #111827;
  background: rgba(255, 255, 255, 0.02);
  font-family: Arial, sans-serif;
  font-size: clamp(7px, 1.23vw, 12px);
  font-weight: 700;
  line-height: 1;
  outline: 0;
  box-shadow: none;
}

.application-paper .pdf-field[type="radio"],
.application-paper .pdf-field[type="checkbox"] {
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  accent-color: #111827;
  transform: scale(0.82);
  transform-origin: center;
}

.application-screening-summary {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #d8dee9;
  border-radius: 14px;
  background: #fff;
  color: #475467;
  font-size: 13px;
}

.application-screening-summary strong {
  color: #111827;
  font-size: 14px;
}

.application-screening-summary.ok {
  border-color: #b7ebd6;
  background: #effcf6;
}

.application-screening-summary.warn {
  border-color: #f3c6c3;
  background: #fff7f6;
}

.application-screening-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.screening-tag,
.screening-more {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #f0b8b4;
  border-radius: 999px;
  color: #b42318;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.screening-tag {
  cursor: pointer;
}

.screening-tag:hover {
  border-color: #d93025;
  background: #fff0ef;
}

.application-paper select {
  appearance: auto;
}

.application-paper .check-line {
  min-height: auto;
  align-items: center;
  border-right: 1px solid #111827;
  font-size: 12px;
}

.application-paper .check-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin-top: 0;
}

.application-paper .form-actions {
  position: sticky;
  bottom: 0;
  margin: 0 -22px -30px;
  padding: 14px 22px;
  border-top: 1px solid #d7dce6;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.ai-fill-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(420px, 1.28fr);
  gap: 18px;
  margin: 8px 0 24px;
  padding: 20px;
  border: 1px solid rgba(231, 234, 242, 0.92);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(91, 99, 241, 0.08), rgba(31, 184, 196, 0.06) 42%, rgba(255, 255, 255, 0.92) 72%),
    rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.ai-fill-copy {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 8px 4px;
}

.ai-fill-copy h3 {
  margin: 0;
  color: var(--ink);
  font-family: "SF Pro Display", Inter, system-ui, sans-serif;
  font-size: clamp(24px, 2vw, 34px);
  font-weight: 760;
  letter-spacing: 0;
}

.ai-fill-copy p {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.7;
}

.template-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.template-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(91, 99, 241, 0.18);
  border-radius: 999px;
  color: #2f4377;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.ai-fill-inputs {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.ai-fill-actions {
  align-items: center;
  justify-content: flex-end;
  margin-top: 0;
}

.ai-fill-actions #importStatus {
  margin-right: auto;
}

.import-label {
  flex: 1;
  min-height: 0;
}

.text-import {
  height: 100%;
  min-height: 220px;
}

.upload-box {
  display: grid;
  gap: 10px;
  border-radius: var(--radius-lg);
  padding: 17px;
}

.upload-box p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--indigo);
}

.empty {
  display: grid;
  min-height: 148px;
  place-items: center;
  padding: 22px;
  border: 1px dashed #cfd6e6;
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: rgba(248, 249, 255, 0.72);
  text-align: center;
}

.empty.mini {
  min-height: 72px;
}

.export-grid h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 880;
}

.form-panel {
  max-width: 1280px;
  margin: 0 auto;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(248, 249, 255, 0.72);
}

legend {
  padding: 0 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 880;
}

label.wide {
  grid-column: 1 / -1;
}

label input,
label select,
label textarea {
  width: 100%;
}

.doc-item,
.task-item,
.review-block,
.supplement-card,
.envelope {
  border-radius: var(--radius-lg);
  padding: 17px;
}

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.doc-item strong,
.review-block strong,
.envelope strong {
  color: var(--ink);
  font-weight: 860;
}

.doc-item span,
.review-block p,
.envelope span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.doc-status {
  width: 112px;
  flex: 0 0 112px;
}

.review-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.score {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  flex: 0 0 76px;
  border-radius: var(--radius-md);
  color: var(--ink);
  background: #eef0ff;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 900;
}

.score.ok {
  color: var(--success);
  background: var(--success-bg);
}

.score.warn {
  color: var(--warning);
  background: var(--warning-bg);
}

.score.danger {
  color: var(--danger);
  background: var(--danger-bg);
}

.review-summary strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 880;
}

.review-summary span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.review-block strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.supplement-card {
  display: grid;
  gap: 15px;
  border-color: rgba(91, 99, 241, 0.18);
  background: linear-gradient(180deg, #fff, #fbfbff);
}

.supplement-card.ok {
  border-color: rgba(31, 157, 116, 0.2);
  background: var(--success-bg);
}

.supplement-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.supplement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.supplement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.supplement-grid .wide {
  grid-column: 1 / -1;
}

.supplement-check {
  display: flex;
  align-items: center;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-item input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.task-item span {
  color: var(--text);
  font-weight: 760;
}

.task-item span.done {
  color: var(--muted);
  text-decoration: line-through;
}

.sender-notice {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid rgba(47, 199, 183, 0.24);
  border-radius: var(--radius-lg);
  color: #126b66;
  background: #e9fbf8;
}

.sender-notice strong {
  color: #126b66;
}

.sender-notice span {
  color: #4a817e;
  font-size: 12px;
  font-weight: 650;
}

.signature-email-field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.signature-email-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 0 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
}

.signature-email-field input:focus {
  border-color: var(--indigo);
  outline: 3px solid rgba(91, 99, 241, 0.16);
}

.signature-recipient-summary {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  padding: 11px 12px;
  border: 1px solid rgba(91, 99, 241, 0.14);
  border-radius: var(--radius-md);
  background: rgba(245, 248, 255, 0.82);
}

.signature-recipient-summary span,
.signature-recipient-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.signature-recipient-summary strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.signature-status-card {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  padding: 13px;
  border: 1px solid rgba(91, 99, 241, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.signature-status-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.signature-status-card strong {
  overflow-wrap: anywhere;
}

.signature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.signed-reminder {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(47, 199, 183, 0.26);
  border-radius: var(--radius-lg);
  color: #126b66;
  background: #e9fbf8;
}

.signed-reminder strong {
  color: #126b66;
}

.signed-reminder span {
  color: #4a817e;
  font-size: 12px;
  font-weight: 700;
}

.envelope {
  display: grid;
  gap: 8px;
}

.export-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.export-grid > div {
  min-width: 0;
  border-radius: var(--radius-lg);
  padding: 18px;
}

.lendingpad-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(520px, 1.15fr);
  gap: var(--page-gap);
  align-items: stretch;
}

.lp-create-page {
  min-height: calc(100vh - 172px);
  margin: 10px -4px 0;
  padding: 12px 0 28px;
  color: #555;
  background: #f3f6fb;
  font-family: Poppins, Inter, "SF Pro Text", system-ui, sans-serif;
}

.lp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 0 12px;
  color: #60636b;
  font-size: 13px;
  font-weight: 600;
}

.lp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lp-breadcrumb span {
  color: #2368e8;
  font-weight: 500;
}

.lp-breadcrumb b {
  color: #aab2c2;
  font-weight: 600;
}

.lp-breadcrumb strong {
  color: #65666b;
  font-weight: 800;
}

.lp-actions {
  display: flex;
  gap: 14px;
}

.lp-outline-btn {
  height: 35px;
  padding: 0 22px;
  border: 1px solid #3557ca;
  border-radius: 0;
  color: #3557ca;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.lp-outline-btn + .lp-outline-btn {
  border-color: #6b7280;
  color: #596171;
}

.lp-pricing-note {
  height: 37px;
  display: flex;
  align-items: center;
  margin-bottom: 7px;
  padding: 0 15px;
  color: #fff;
  background: #659be9;
  font-size: 13px;
  font-weight: 700;
}

.lp-case-line {
  min-height: 28px;
  margin: 0;
  padding: 6px 2px;
  color: #667085;
  font-size: 12px;
  font-weight: 600;
}

.lp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 21px;
}

.lp-card {
  min-height: 210px;
  padding: 13px 30px 20px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 43, 71, 0.03);
}

.lp-general-card {
  width: calc(50% - 15px);
  min-height: 107px;
  margin-top: 0;
}

.lp-card h3 {
  margin: 0 0 30px;
  color: #5d5f63;
  font-size: 13px;
  font-weight: 800;
}

.lp-nested-grid {
  margin-top: 0;
  gap: 18px 30px;
}

.lp-nested-grid h3 {
  margin: 0 0 12px;
  padding: 7px 10px;
  background: #f7f7f8;
  color: #4d4f55;
}

.lp-general-card h3 {
  margin-bottom: 27px;
}

.lp-form-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
}

.lp-form-row label {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-right: 12px;
  color: #55585f;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.lp-info-dot {
  display: inline-grid;
  width: 13px;
  height: 13px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #3f82e4;
  font-size: 9px;
  font-weight: 800;
}

.lp-form-row input,
.lp-form-row select {
  width: 100%;
  height: 35px;
  min-width: 0;
  border: 1px solid #d7d7d7;
  border-radius: 0;
  background: #fff;
  color: #2d3445;
  font-size: 13px;
  font-weight: 650;
  padding: 0 10px;
  box-shadow: none;
}

.lp-form-row.lp-field-missing input,
.lp-form-row.lp-field-missing select {
  border-color: #d93025;
  background: #fffafa;
  box-shadow: 0 0 0 2px rgba(217, 48, 37, 0.08);
}

.lp-form-row.lp-field-missing label {
  color: #b42318;
  font-weight: 700;
}

.lp-field-hint {
  grid-column: 2;
  margin-top: -2px;
  color: #b42318;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.lp-form-row input::placeholder {
  color: #b9bec8;
  font-weight: 500;
}

.lp-form-row select {
  appearance: auto;
}

.lp-inline-note-input::placeholder {
  color: #626262;
  opacity: 1;
  font-weight: 800;
}

.lp-checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 13px;
  justify-self: start;
  accent-color: #d8d8d8;
}

.lp-split-input {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.lp-price-btn {
  height: 35px;
  border: 1px solid #3557ca;
  border-radius: 0;
  color: #6477d8;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
}

.lp-import-summary {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  padding: 12px 16px;
  color: #5d6675;
  background: #fff;
  border-left: 3px solid #659be9;
  box-shadow: 0 -12px 28px rgba(28, 43, 71, 0.08);
  font-size: 13px;
  font-weight: 650;
}

.lp-import-summary span {
  min-width: 0;
}

.lp-export-primary {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 20px;
  border: 1px solid #3557ca;
  border-radius: 0;
  color: #fff;
  background: #3158d4;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.export-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.76);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.export-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 880;
}

.export-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.lendingpad-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lendingpad-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.lendingpad-form input,
.lendingpad-form select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  padding: 10px 11px;
}

pre {
  max-height: 560px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 16px;
  border-radius: var(--radius-md);
  color: #172033;
  background: #f4f6fb;
  font-size: 12px;
  line-height: 1.55;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-page {
  display: grid;
  gap: var(--page-gap);
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.settings-section-head h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 880;
}

.settings-section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.settings-account-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.settings-account-avatar {
  width: 64px;
  height: 64px;
  font-size: 16px;
}

.settings-account-main {
  min-width: 0;
}

.settings-account-main h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.settings-account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-account-meta span {
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f4f6fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-actions,
.settings-session-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.settings-session-actions {
  justify-content: flex-start;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(236, 236, 255, 0.92) 0 36%, transparent 36% 100%),
    linear-gradient(140deg, #f5f7fb 0%, #edf1f7 100%);
}

.login-screen.active {
  display: grid;
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 15px;
  border-radius: var(--radius-xl);
  padding: 32px;
}

.login-brand {
  margin-bottom: 10px;
}

.login-panel h1 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  font-weight: 360;
}

.login-panel .btn {
  width: 100%;
}

.login-brochure-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  color: #365a9d;
  font-size: 13px;
  font-weight: 800;
}

.login-brochure-link:hover,
.login-brochure-link:focus-visible {
  color: #164fbe;
  outline: 0;
}

.login-brochure-link .material-symbols-outlined {
  font-size: 19px;
}

.login-status {
  display: none;
  margin: 0;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.login-status.show {
  display: block;
}

.login-status.danger {
  color: var(--danger);
  border: 1px solid rgba(194, 75, 75, 0.22);
  background: var(--danger-bg);
}

body.auth-required .sidebar,
body.auth-required .main {
  display: none;
}

.toast {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 10000;
  width: min(520px, calc(100vw - 32px));
  max-width: 520px;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: start;
  gap: 12px;
  padding: 15px 14px 15px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  color: #fff;
  background: #151b2d;
  box-shadow: 0 24px 54px rgba(4, 10, 24, 0.36);
  transform: translateY(160px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-message {
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-weight: 760;
}

.toast-close {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
}

.toast-close:hover,
.toast-close:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.toast-close .material-symbols-outlined {
  font-size: 19px;
}

.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  place-items: center;
  gap: 14px;
  color: var(--ink);
  background: rgba(251, 252, 255, 0.68);
  backdrop-filter: blur(10px);
}

.loading-mask.active {
  display: grid;
}

.loader {
  width: 36px;
  height: 36px;
  border: 3px solid #d5d9e6;
  border-top-color: var(--indigo);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1500px) {
  :root {
    --page-gap: 20px;
  }

  .workbench-grid,
  .workflow-layout {
    grid-template-columns: minmax(310px, 0.92fr) minmax(430px, 1.08fr);
  }

  .application-workspace {
    grid-template-columns: minmax(440px, 540px) minmax(760px, 1fr);
    gap: 24px;
  }

  .lendingpad-grid {
    grid-template-columns: 1fr;
  }

  .lp-general-card {
    width: 100%;
  }

  .lp-two-col {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .application-import-panel,
  .application-paper {
    height: max(720px, calc(100vh - 142px));
    max-height: none;
  }

  .package-review,
  .workflow-layout > .panel:last-child {
    grid-column: 1 / -1;
    height: auto;
    min-height: 390px;
  }

  .package-review {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
  }

  .package-head,
  .package-upload,
  .package-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 246px;
  }

  .sidebar {
    inset: 14px auto 14px 14px;
    padding: 24px 18px;
  }

  .main {
    min-height: calc(100vh - 28px);
    margin: 14px 14px 14px calc(var(--sidebar-width) + 28px);
  }

  .topbar,
  .view {
    padding-left: 28px;
    padding-right: 28px;
  }

  .stats-row,
  .detail-grid,
  .export-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-layout,
  .ai-fill-panel,
  .lendingpad-grid,
  .lp-two-col,
  .workbench-grid,
  .workflow-layout {
    grid-template-columns: 1fr;
  }

  .application-workspace {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .list-panel,
  .detail-panel,
  .application-import-panel,
  .workflow-layout > .panel {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .application-paper {
    min-width: 0;
    height: auto;
    max-height: none;
  }

  .pdf-page-wrap {
    width: min(100%, 760px);
  }

  .case-list,
  #caseDetail,
  .checklist,
  .task-list,
  #reviewPanel,
  #envelopePanel {
    max-height: none;
    overflow: visible;
  }

  .package-review {
    display: flex;
  }
}

@media (max-width: 860px) {
  body {
    background: var(--main-bg);
  }

  .sidebar {
    position: static;
    width: auto;
    margin: 12px;
    border-radius: var(--radius-lg);
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    margin: 12px;
    border-radius: var(--radius-lg);
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 24px 18px 18px;
  }
  .settings-account-card {
    grid-template-columns: 1fr;
  }

  .settings-actions,
  .settings-session-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-session-actions .btn,
  .settings-actions .btn {
    width: 100%;
  }
  .topbar-title-group {
    align-items: flex-start;
    gap: 12px;
  }

  .workflow-back-btn {
    min-width: 40px;
    min-height: 40px;
    padding: 9px 12px;
  }

  .workflow-back-label {
    display: none;
  }

  .top-actions {
    justify-content: stretch;
  }

  .search,
  .language-toggle,
  .language-select,
  .top-actions .btn {
    width: 100%;
  }

  .view {
    padding: 0 18px 22px;
  }

  .stats-row,
  .detail-grid,
  .settings-grid,
  .export-grid,
  fieldset,
  .application-paper fieldset,
  .supplement-grid {
    grid-template-columns: 1fr;
  }

  .detail-card.wide,
  label.wide {
    grid-column: auto;
  }

  .panel {
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .application-paper {
    padding: 20px;
  }

  .application-paper label,
  .application-paper label:nth-of-type(4n),
  .application-paper label.wide:nth-of-type(4n) {
    border-right: 0;
  }

  .application-paper .form-actions {
    margin: 0 -20px -20px;
    padding: 14px 20px;
  }

  .panel-head,
  .supplement-head,
  .doc-item {
    align-items: stretch;
    flex-direction: column;
  }

  .lp-toolbar,
  .lp-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lp-card {
    padding: 14px;
  }

  .lp-form-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }

  .lp-form-row label {
    justify-content: flex-start;
    padding-right: 0;
    text-align: left;
  }

  .lp-split-input {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .status-group,
  .form-actions,
  .package-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .doc-status {
    width: 100%;
    flex-basis: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* AI Mortgage Zhiyin Hub Fusion */
:root {
  --zhiyin-blue: #003d9b;
  --zhiyin-blue-bright: #0052cc;
  --zhiyin-bg: #f7f9fc;
  --zhiyin-panel: rgba(255, 255, 255, 0.74);
  --zhiyin-border: rgba(195, 198, 214, 0.56);
}

body {
  background:
    radial-gradient(circle at 76% 0%, rgba(218, 226, 255, 0.62), transparent 31%),
    linear-gradient(140deg, #f9f9fb 0%, #f2f5fa 46%, #eef3fb 100%);
  font-family: Manrope, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

/* AI-first readable light sidebar */
.sidebar.zhiyin-sidebar {
  inset: 20px auto 20px 20px;
  width: var(--sidebar-width);
  max-height: calc(100vh - 40px);
  padding: 22px;
  gap: 14px;
  border-radius: 0 48px 48px 0;
  color: #223049;
  background:
    radial-gradient(circle at 18% 0%, rgba(219, 229, 255, 0.88), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
  border: 1px solid rgba(218, 226, 238, 0.9);
  box-shadow: 0 24px 70px rgba(59, 84, 130, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.zhiyin-brand .brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--zhiyin-blue-bright), #003d9b);
  box-shadow: 0 16px 34px rgba(0, 82, 204, 0.2);
}

.zhiyin-brand .brand-mark::before,
.zhiyin-brand .brand-mark::after {
  content: none;
}

.zhiyin-brand .brand-mark .material-symbols-outlined {
  font-size: 26px;
  font-variation-settings: "FILL" 1;
}

.zhiyin-brand .brand-title {
  color: #172033;
  font-family: Manrope, sans-serif;
  font-size: 24px;
  font-weight: 900;
}

.zhiyin-brand .brand-subtitle {
  color: #6f8199;
  font-size: 11px;
  font-weight: 760;
}

.zhiyin-sidebar .selected-box,
.zhiyin-sidebar .employee-card {
  border-color: rgba(218, 226, 238, 0.9);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(59, 84, 130, 0.1);
}

.zhiyin-sidebar .selected-box span,
.zhiyin-sidebar .selected-box small,
.zhiyin-sidebar .employee-meta span,
.zhiyin-sidebar .employee-meta small {
  color: #5d6f87;
}

.zhiyin-sidebar .selected-box strong,
.zhiyin-sidebar .employee-meta strong {
  color: #172033;
}

.zhiyin-sidebar .ai-rail-actions button,
.zhiyin-sidebar .ai-rail-section-title button,
.zhiyin-sidebar .ai-rail-item {
  border-color: rgba(218, 226, 238, 0.9);
  background: rgba(255, 255, 255, 0.86);
  color: #223049;
}

.zhiyin-sidebar .ai-rail-actions button:first-child {
  background: linear-gradient(135deg, #5267ff, #3158d4);
  border-color: rgba(49, 88, 212, 0.22);
  color: #ffffff;
}

.zhiyin-sidebar .ai-rail-actions button:last-child {
  background: #ffffff;
  color: #223049;
}

.ai-rail-section-title {
  color: #6f8199;
}

.ai-rail-item:hover,
.ai-rail-item.active {
  border-color: rgba(56, 215, 197, 0.72);
  background: #e8fbf8;
}

.ai-rail-item strong {
  color: #223049;
}

.ai-rail-item span,
.ai-rail-empty {
  color: #5d6f87;
}

.ai-rail-empty {
  border-color: rgba(218, 226, 238, 0.9);
  background: rgba(255, 255, 255, 0.72);
}

.zhiyin-nav {
  gap: 7px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  min-height: 0;
}

.nav-section-label {
  margin: 4px 2px 2px;
  color: #71839a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-section-label-gap {
  margin-top: 16px;
}

.zhiyin-nav .nav-btn,
.zhiyin-nav .hub-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-radius: 18px;
  color: #485a72;
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 760;
  text-align: left;
  transition: transform 0.22s ease, color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.zhiyin-nav .nav-btn:hover,
.zhiyin-nav .hub-link:hover {
  transform: translateX(4px);
  color: #0f4fc7;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(204, 215, 232, 0.9);
}

.zhiyin-nav .nav-btn.active {
  color: #0f4fc7;
  background: #ffffff;
  border-color: rgba(204, 215, 232, 0.95);
  box-shadow: inset 3px 0 0 #0f5bd8, 0 10px 24px rgba(59, 84, 130, 0.12);
}

.assistant-subnav {
  display: grid;
  gap: 6px;
  margin: -2px 0 6px 34px;
  padding-left: 14px;
  border-left: 1px solid rgba(204, 215, 232, 0.9);
}

.nav-sub-btn {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 13px;
  padding: 0 12px;
  color: #5d6f87;
  background: transparent;
  font-size: 12px;
  font-weight: 820;
  text-align: left;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.nav-sub-btn:hover {
  color: #0f4fc7;
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(2px);
}

.nav-sub-btn.active {
  color: #0f4fc7;
  background: rgba(232, 241, 255, 0.95);
  box-shadow: inset 3px 0 0 #0f5bd8;
}

.zhiyin-nav .material-symbols-outlined {
  font-size: 21px;
}

.main {
  background: transparent;
}

.panel,
.login-panel,
.topbar,
.stats-row > *,
.detail-card,
.review-step,
.export-grid > div {
  border-color: var(--zhiyin-border);
  background: var(--zhiyin-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.login-panel {
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.14);
}

.btn.primary {
  background: linear-gradient(135deg, #0052cc, #003d9b);
  box-shadow: 0 15px 30px rgba(0, 82, 204, 0.22);
}

.employee-card {
  cursor: pointer;
}

.employee-card:hover,
.employee-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(49, 88, 212, 0.24);
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(59, 84, 130, 0.14);
  outline: none;
}

@media (max-width: 980px) {
  .sidebar.zhiyin-sidebar {
    border-radius: 28px;
  }
}


/* Unified Hub SPA views */
.hub-workspace {
  display: grid;
  gap: 24px;
}

.hub-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.hub-hero h2,
.hub-simple-page h2,
.hub-chat-page h2,
.hub-detail-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.12;
  font-weight: 900;
}

.hub-hero p,
.hub-simple-page p,
.hub-chat-page p,
.hub-detail-header p,
.hub-placeholder-box p,
.hub-mini-grid p,
.hub-app-card p {
  color: var(--muted);
}

.hub-search-shell {
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.hub-search-shell input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
}

.hub-filter-row,
.hub-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hub-filter {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  cursor: pointer;
}

.hub-filter.active {
  color: #fff;
  background: var(--indigo);
  box-shadow: 0 14px 30px rgba(95, 101, 232, 0.24);
}

.hub-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.hub-app-card,
.hub-mini-grid article {
  display: grid;
  gap: 14px;
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--zhiyin-border, var(--line));
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
}

.hub-app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.11);
}

.hub-app-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--indigo));
}

.hub-app-card h3,
.hub-mini-grid h3,
.hub-placeholder-box h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
}

.hub-chip,
.hub-tag-row span {
  width: max-content;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--indigo);
  background: rgba(95, 101, 232, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.hub-detail-panel,
.hub-simple-page,
.hub-chat-page {
  padding: 30px;
}

.hub-back-btn {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.hub-detail-header {
  display: grid;
  gap: 12px;
  max-width: 760px;
}

.hub-placeholder-box,
.hub-chat-empty,
.hub-empty-state {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 24px 0;
  padding: 24px;
  border: 1px dashed rgba(95, 101, 232, 0.35);
  border-radius: 22px;
  background: rgba(95, 101, 232, 0.06);
}

.hub-placeholder-box .material-symbols-outlined,
.hub-chat-empty .material-symbols-outlined {
  color: var(--indigo);
  font-size: 38px;
}

.hub-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.hub-chat-shell {
  min-height: 360px;
  display: grid;
  place-items: center;
  margin-top: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.64);
}

@media (max-width: 900px) {
  .hub-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .hub-search-shell {
    min-width: 0;
  }
}

/* Zhiyin fused pages */
body[data-active-view="projects"] .topbar,
body[data-active-view="chat"] .topbar {
  display: none;
}

.borrower-only,
.knowledge-only,
.dashboard-only {
  display: none;
}

body[data-active-view="borrowers"] .topbar,
body[data-active-view="knowledge"] .topbar,
body[data-active-view="dashboard"] .topbar {
  min-height: 58px;
  border-bottom: 1px solid #dfe5ee;
  background: #ffffff;
}

body[data-active-view="borrowers"] .topbar-title-copy,
body[data-active-view="knowledge"] .topbar-title-copy,
body[data-active-view="dashboard"] .topbar-title-copy {
  display: grid;
  gap: 2px;
}

body[data-active-view="borrowers"] .topbar-title-copy .kicker,
body[data-active-view="knowledge"] .topbar-title-copy .kicker,
body[data-active-view="dashboard"] .topbar-title-copy .kicker {
  order: 2;
  margin: 0;
  color: #8b96a8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

body[data-active-view="borrowers"] .topbar h1,
body[data-active-view="knowledge"] .topbar h1,
body[data-active-view="dashboard"] .topbar h1 {
  margin: 0;
  color: #111827;
  font-size: 16px;
  line-height: 1.1;
}

body[data-active-view="borrowers"] .top-actions > :not(#newBorrowerBtn) {
  display: none;
}

body[data-active-view="borrowers"] #newBorrowerBtn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 14px;
  background: #315fe8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

body[data-active-view="knowledge"] .top-actions > :not(#knowledgeUploadBtn):not(#knowledgeUploadInput) {
  display: none;
}

body[data-active-view="knowledge"] #knowledgeUploadBtn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 14px;
  background: #315fe8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

body[data-active-view="dashboard"] .top-actions > :not(#dashboardMonthPill) {
  display: none;
}

body[data-active-view="dashboard"] #dashboardMonthPill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 14px;
  background: #f1f3f8;
  color: #596477;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-page {
  min-height: calc(100vh - 58px);
  padding: 26px 24px 60px;
  background: #f4f6fa;
}

.dashboard-shell {
  width: min(864px, 100%);
  margin: 0 auto;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-kpi-card {
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 33, 61, 0.035);
}

.dashboard-kpi-card span {
  color: #8b96a8;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-kpi-card strong {
  color: #111827;
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

.dashboard-kpi-card small {
  font-size: 13px;
  font-weight: 900;
}

.dashboard-kpi-card small.up {
  color: #0f9f63;
}

.dashboard-kpi-card small.down {
  color: #dc3b2f;
}

.dashboard-kpi-card small.neutral {
  color: #64748b;
}

.pipeline-stage-card {
  min-height: 230px;
  padding: 22px 22px 18px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 33, 61, 0.035);
}

.pipeline-stage-head {
  margin-bottom: 18px;
}

.pipeline-stage-head h2 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.pipeline-stage-head p {
  margin: 0;
  color: #8b96a8;
  font-size: 12px;
  font-weight: 800;
}

.pipeline-stage-list {
  display: grid;
  gap: 13px;
}

.pipeline-stage-row {
  display: grid;
  grid-template-columns: 48px minmax(160px, 1fr) 32px 72px;
  align-items: center;
  gap: 14px;
}

.pipeline-stage-row strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.pipeline-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf4;
}

.pipeline-bar-fill {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #3564e8;
}

.pipeline-count {
  color: #596477;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.pipeline-stage-row b {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.knowledge-library-page {
  min-height: calc(100vh - 58px);
  padding: 26px 24px 60px;
  background: #f4f6fa;
}

.knowledge-library-page .zhiyin-page {
  width: min(764px, 100%);
  min-height: auto;
  padding: 0;
  margin: 0 auto;
  background: transparent;
}

.knowledge-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -67px 0 38px -193px;
}

.knowledge-tabs button,
.knowledge-category-row button {
  height: 32px;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #ffffff;
  color: #445064;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.knowledge-tabs button {
  min-width: 80px;
  background: #eef3ff;
  color: #526078;
}

.knowledge-tabs button.active {
  border-color: #e8eefc;
  background: #eef4ff;
  color: #245bea;
}

.knowledge-search-panel {
  width: min(764px, 100%);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 16px;
  margin: 0 auto 16px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 33, 61, 0.04);
}

.knowledge-search-box {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9aa5b5;
}

.knowledge-search-box input {
  width: 100%;
  height: 42px;
  border: 0;
  outline: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 650;
}

.knowledge-search-box input::placeholder {
  color: #8d97a8;
}

.knowledge-ai-search {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: #eef4ff;
  color: #245bea;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.knowledge-ai-search .material-symbols-outlined {
  font-size: 16px;
}

.knowledge-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 20px;
}

.knowledge-category-row button {
  padding: 0 15px;
}

.knowledge-category-row button.active {
  border-color: #315fe8;
  background: #315fe8;
  color: #ffffff;
}

.knowledge-doc-count {
  margin: 0 0 10px;
  color: #8b96a8;
  font-size: 13px;
  font-weight: 800;
}

.knowledge-doc-list {
  display: grid;
  gap: 8px;
}

.knowledge-doc-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 72px 18px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 33, 61, 0.035);
}

.knowledge-doc-row:focus-visible,
.knowledge-doc-row:hover {
  border-color: #b9c8e3;
  outline: none;
}

.knowledge-doc-type {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 900;
}

.knowledge-doc-type.tone-blue,
.knowledge-doc-type.tone-slate {
  background: #fdecec;
  color: #e04436;
}

.knowledge-doc-type.tone-amber,
.knowledge-doc-type.tone-violet {
  background: #edf3ff;
  color: #315fe8;
}

.knowledge-doc-type.tone-green {
  background: #e9fbf1;
  color: #0f9f63;
}

.knowledge-doc-main h3 {
  margin: 0 0 4px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.knowledge-doc-main p {
  margin: 0;
  color: #697386;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-doc-tag {
  min-width: 42px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.knowledge-doc-tag.tone-blue {
  background: #eaf1ff;
  color: #245bea;
}

.knowledge-doc-tag.tone-amber {
  background: #fff6e7;
  color: #b76a00;
}

.knowledge-doc-tag.tone-green {
  background: #e8f8ef;
  color: #0f9f63;
}

.knowledge-doc-tag.tone-violet {
  background: #f1ecff;
  color: #6c4ee6;
}

.knowledge-doc-row time {
  color: #8b96a8;
  font-size: 12px;
  font-weight: 750;
}

.knowledge-doc-arrow {
  color: #a6b0c0;
  font-size: 20px;
}

.knowledge-empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed #c9d4e4;
  border-radius: 10px;
  background: #ffffff;
  color: #8b96a8;
  font-size: 13px;
  font-weight: 800;
}

.borrower-page {
  min-height: calc(100vh - 58px);
  padding: 26px 24px;
  background: #f4f6fa;
}

.borrower-grid {
  width: min(864px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 auto;
}

.borrower-card {
  min-height: 112px;
  display: grid;
  grid-template-rows: 1fr auto;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  padding: 16px 16px 12px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  box-shadow: none;
}

.borrower-card:hover {
  border-color: #cbd5e1;
}

.borrower-card-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.borrower-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf3ff;
  color: #315fe8;
  font-size: 15px;
  font-weight: 900;
}

.borrower-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.borrower-main strong {
  color: #1f2937;
  font-size: 14px;
  font-weight: 900;
}

.borrower-main span {
  color: #5d6677;
  font-size: 12px;
  font-weight: 650;
}

.borrower-status {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #edf3ff;
  color: #315fe8;
  font-size: 10px;
  font-weight: 900;
}

.borrower-status.amber {
  background: #fff4df;
  color: #c47a11;
}

.borrower-status.green {
  background: #e7f8ef;
  color: #10a865;
}

.borrower-status.slate {
  background: #eef1f5;
  color: #657084;
}

.borrower-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eef1f5;
  padding-top: 12px;
}

.borrower-card-bottom strong {
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.borrower-card-bottom span {
  color: #8b96a8;
  font-size: 11px;
  font-weight: 700;
}

.view.zhiyin-page-view {
  padding: 0;
}

.view.zhiyin-page-view.active {
  display: block;
}

.zhiyin-page {
  width: min(1180px, calc(100vw - var(--sidebar-width) - 96px));
  min-height: calc(100vh - 44px);
  margin: 0 auto;
  padding: 48px 40px 72px;
  color: #1a1c1d;
  font-family: Manrope, "PingFang SC", sans-serif;
  letter-spacing: 0;
}

.zhiyin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 40px;
}

.zhiyin-page-header h2,
.zhiyin-chat-empty h2,
.zhiyin-detail-card h2 {
  margin: 0 0 8px;
  color: #1a1c1d;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: 0;
}

.zhiyin-page-header p,
.zhiyin-chat-empty p,
.zhiyin-detail-card p,
.zhiyin-white-panel p,
.zhiyin-dataset-card p {
  margin: 0;
  color: #434654;
  line-height: 1.7;
}

.zhiyin-search-shell,
.zhiyin-small-search {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: #f3f3f5;
  color: #434654;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.zhiyin-search-shell {
  width: 320px;
  height: 58px;
  padding: 0 18px;
  border-radius: 28px;
}

.zhiyin-search-shell input,
.zhiyin-small-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1a1c1d;
  font: inherit;
}

.zhiyin-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.zhiyin-filter {
  border: 0;
  border-radius: 999px;
  padding: 10px 24px;
  background: #f3f3f5;
  color: #434654;
  font-size: 14px;
  font-weight: 760;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.zhiyin-filter:hover {
  transform: translateY(-1px);
  background: #e2e2e4;
}

.zhiyin-filter.active {
  color: #fff;
  background: #003d9b;
  box-shadow: 0 14px 28px rgba(0, 61, 155, 0.22);
}

.zhiyin-dataset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.zhiyin-dataset-card,
.zhiyin-detail-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 32px;
  border: 1px solid rgba(243, 243, 245, 0.9);
  border-radius: 24px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 20px 40px -10px rgba(0, 61, 155, 0.06);
  transition: transform 0.26s ease, box-shadow 0.26s ease;
}

.zhiyin-dataset-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 58px -16px rgba(0, 61, 155, 0.16);
}

.zhiyin-card-orb {
  position: absolute;
  top: -32px;
  right: -32px;
  width: 128px;
  height: 128px;
  border-radius: 0 0 0 999px;
  background: rgba(0, 61, 155, 0.1);
  transition: transform 0.26s ease;
}

.zhiyin-app-icon,
.zhiyin-detail-icon {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 18px;
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.zhiyin-app-icon .material-symbols-outlined,
.zhiyin-detail-icon .material-symbols-outlined {
  font-size: 27px;
  font-variation-settings: "FILL" 1;
}

.tone-blue .zhiyin-card-orb { background: rgba(59, 130, 246, 0.12); }
.tone-blue .zhiyin-app-icon,
.tone-blue .zhiyin-detail-icon { background: #dbeafe; color: #1d4ed8; }
.tone-orange .zhiyin-card-orb { background: rgba(249, 115, 22, 0.12); }
.tone-orange .zhiyin-app-icon,
.tone-orange .zhiyin-detail-icon { background: #ffedd5; color: #c2410c; }
.tone-rose .zhiyin-card-orb { background: rgba(244, 63, 94, 0.12); }
.tone-rose .zhiyin-app-icon,
.tone-rose .zhiyin-detail-icon { background: #ffe4e6; color: #be123c; }
.tone-amber .zhiyin-card-orb { background: rgba(245, 158, 11, 0.12); }
.tone-amber .zhiyin-app-icon,
.tone-amber .zhiyin-detail-icon { background: #fef3c7; color: #b45309; }
.tone-cyan .zhiyin-card-orb { background: rgba(6, 182, 212, 0.12); }
.tone-cyan .zhiyin-app-icon,
.tone-cyan .zhiyin-detail-icon { background: #cffafe; color: #0e7490; }
.tone-emerald .zhiyin-card-orb { background: rgba(16, 185, 129, 0.12); }
.tone-emerald .zhiyin-app-icon,
.tone-emerald .zhiyin-detail-icon { background: #d1fae5; color: #047857; }
.tone-red .zhiyin-card-orb { background: rgba(239, 68, 68, 0.12); }
.tone-red .zhiyin-app-icon,
.tone-red .zhiyin-detail-icon { background: #fee2e2; color: #b91c1c; }
.tone-violet .zhiyin-card-orb { background: rgba(139, 92, 246, 0.12); }
.tone-violet .zhiyin-app-icon,
.tone-violet .zhiyin-detail-icon { background: #ede9fe; color: #6d28d9; }
.tone-green .zhiyin-app-icon { background: #dcfce7; color: #15803d; }

.zhiyin-pill {
  width: max-content;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f3f3f5;
  color: #434654;
  font-size: 12px;
  font-weight: 780;
}

.zhiyin-dataset-card h3,
.zhiyin-white-panel h3 {
  margin: 0 0 10px;
  color: #1a1c1d;
  font-size: 18px;
  font-weight: 880;
  line-height: 1.35;
}

.zhiyin-dataset-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 48px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 14px;
}

.zhiyin-avatar-stack,
.zhiyin-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.zhiyin-avatar-stack span,
.zhiyin-tag-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #eef2ff;
  color: #3152d4;
  font-size: 11px;
  font-weight: 800;
}

.zhiyin-arrow {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f3f3f5;
  color: #434654;
  transition: background 0.2s ease, color 0.2s ease;
}

.zhiyin-detail-page {
  display: grid;
  place-items: start center;
}

.zhiyin-detail-card {
  width: min(780px, 100%);
  min-height: 0;
}

.zhiyin-back-btn,
.zhiyin-primary-btn,
.zhiyin-secondary-btn,
.zhiyin-section-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  padding: 12px 20px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.zhiyin-back-btn,
.zhiyin-secondary-btn {
  background: #fff;
  color: #003d9b;
  border: 1px solid rgba(195, 198, 214, 0.45);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.zhiyin-back-btn {
  margin-bottom: 20px;
}

.zhiyin-primary-btn {
  background: #003d9b;
  color: #fff;
  box-shadow: 0 16px 30px rgba(0, 61, 155, 0.2);
}

.zhiyin-primary-btn.full {
  width: 100%;
}

.zhiyin-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.zhiyin-placeholder-note {
  display: flex;
  gap: 16px;
  margin: 28px 0;
  padding: 18px;
  border-radius: 20px;
  background: #f3f3f5;
  color: #434654;
}

.zhiyin-placeholder-note h3 {
  margin: 0 0 4px;
}

.zhiyin-header-actions {
  align-items: flex-start;
}

.zhiyin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 44px;
}

.zhiyin-stat-grid article,
.zhiyin-white-panel {
  border: 1px solid #e2e2e4;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 40px -10px rgba(0, 61, 155, 0.06);
}

.zhiyin-stat-grid article {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.zhiyin-stat-grid .material-symbols-outlined {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 26px;
}

.zhiyin-stat-grid .blue { background: #eff6ff; color: #2563eb; }
.zhiyin-stat-grid .green { background: #ecfdf5; color: #059669; }
.zhiyin-stat-grid .amber { background: #fffbeb; color: #d97706; }
.zhiyin-stat-grid p { margin: 0 0 3px; color: #434654; font-size: 14px; font-weight: 700; }
.zhiyin-stat-grid strong { color: #1a1c1d; font-size: 30px; font-weight: 900; }
.zhiyin-stat-grid strong i,
.zhiyin-context-card i { display: inline-block; width: 11px; height: 11px; border-radius: 999px; background: #e2e2e4; }
.zhiyin-stat-grid strong i.ok { background: #10b981; }

.zhiyin-section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.zhiyin-section-toolbar.compact {
  margin-bottom: 18px;
}

.zhiyin-section-toolbar h3 {
  margin: 0;
  color: #1a1c1d;
  font-size: 20px;
  font-weight: 900;
}

.zhiyin-small-search {
  width: 260px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(195, 198, 214, 0.3);
  border-radius: 14px;
  background: #fff;
}

.zhiyin-dataset-card {
  min-height: 250px;
}

.zhiyin-dataset-card footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(195, 198, 214, 0.25);
}

.zhiyin-dataset-card footer span {
  color: #737685;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.zhiyin-dataset-card footer strong {
  color: #1a1c1d;
  font-size: 14px;
  font-weight: 900;
}

.zhiyin-chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 24px;
  height: calc(100vh - 44px);
  padding: 24px 28px;
}

.zhiyin-chat-main {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

body[data-active-view="chat"] .zhiyin-chat-main {
  max-width: 980px;
}

.zhiyin-chat-messages {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 10px;
}

.zhiyin-chat-empty {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.zhiyin-chat-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 20px;
  background: #0052cc;
  color: #fff;
  box-shadow: 0 18px 34px rgba(0, 61, 155, 0.2);
}

.zhiyin-chat-avatar .material-symbols-outlined {
  font-size: 32px;
}

.zhiyin-chat-empty h2 {
  font-size: 32px;
}

.zhiyin-chat-empty p {
  max-width: 560px;
  margin-bottom: 36px;
}

.zhiyin-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(740px, 100%);
}

.zhiyin-suggestion-grid button {
  display: grid;
  gap: 6px;
  border: 1px solid #e2e2e4;
  border-radius: 18px;
  padding: 16px 18px;
  background: #fff;
  color: #1a1c1d;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.zhiyin-suggestion-grid span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
}

.zhiyin-suggestion-grid small {
  color: #434654;
}

.zhiyin-chat-composer {
  display: grid;
  gap: 8px;
  padding: 12px 0 8px;
  background: #f9f9fb;
}

.zhiyin-file-chip {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e2e4;
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
}

.zhiyin-file-chip.hidden,
.hidden {
  display: none !important;
}

.zhiyin-file-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.zhiyin-composer-box {
  border: 1px solid rgba(195, 198, 214, 0.45);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 12px;
  box-shadow: 0 18px 34px -12px rgba(0, 61, 155, 0.08);
}

.zhiyin-composer-box textarea {
  width: 100%;
  height: 54px;
  min-height: 54px;
  max-height: 96px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 8px 10px;
  background: transparent;
  color: #1a1c1d;
  font: inherit;
  line-height: 1.45;
}

.zhiyin-composer-tools,
.zhiyin-tool-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.zhiyin-tool-left {
  overflow-x: auto;
  justify-content: flex-start;
}

.zhiyin-tool-left button,
.zhiyin-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  cursor: pointer;
}

.zhiyin-tool-left button:hover {
  background: #f1f5f9;
}

.zhiyin-tool-left i {
  width: 1px;
  height: 18px;
  background: #e2e8f0;
}

.zhiyin-send-btn {
  width: 38px;
  height: 38px;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
}

.zhiyin-send-btn:hover {
  background: #0052cc;
  color: #fff;
}

.zhiyin-chat-bubble {
  max-width: 78%;
  border-radius: 20px;
  padding: 14px 16px;
  background: #fff;
  color: #1a1c1d;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.zhiyin-chat-bubble.assistant {
  max-width: min(760px, calc(100% - 96px));
  border-radius: 16px;
  padding: 18px 20px;
  line-height: 1.72;
}

.zhiyin-chat-bubble.user {
  align-self: flex-end;
  background: #0052cc;
  color: #fff;
  max-width: min(520px, 72%);
}

.zhiyin-chat-bubble p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hub-chat-answer-text {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  color: #111827;
  font-size: 14px;
  line-height: 1.72;
}

.hub-chat-answer-text p {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.hub-chat-answer-text p + p {
  padding-top: 2px;
}

.zhiyin-chat-context {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding: 24px 0;
}

.hub-case-panel {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(18, 39, 63, 0.08);
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.96)),
    var(--surface);
  box-shadow: var(--shadow-card);
}

.hub-case-head {
  display: grid;
  gap: 6px;
}

.hub-case-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
}

.hub-case-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hub-case-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hub-case-actions .btn {
  min-height: 38px;
  padding: 0 10px;
}

.hub-case-docs {
  display: grid;
  gap: 10px;
}

.hub-case-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.hub-case-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.hub-case-metric strong {
  color: var(--ink);
  font-weight: 900;
}

.hub-case-metric strong.ok {
  color: var(--success);
}

.hub-case-metric strong.warn {
  color: var(--warning);
}

.hub-case-metric strong.danger {
  color: var(--danger);
}

.hub-case-doc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hub-case-doc-list span,
.hub-case-empty {
  border-radius: 999px;
  padding: 7px 10px;
  background: #eef4ff;
  color: #27415f;
  font-size: 12px;
  font-weight: 720;
}

.hub-case-empty {
  border-radius: 14px;
  line-height: 1.55;
}

.hub-case-note {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.hub-case-note textarea {
  width: 100%;
  resize: vertical;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.hub-case-note textarea:focus {
  border-color: rgba(82, 103, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(82, 103, 255, 0.12);
}

.zhiyin-greeting-card {
  text-align: center;
}

.zhiyin-greeting-card h2 {
  margin: 0;
  color: #1a1c1d;
  font-size: 28px;
  font-weight: 900;
}

.zhiyin-greeting-card p {
  margin: 8px 0 0;
  color: #434654;
}

.zhiyin-weather-card,
.zhiyin-context-card {
  border: 1px solid rgba(195, 198, 214, 0.25);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 20px 40px -10px rgba(0, 61, 155, 0.06);
}

.zhiyin-weather-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
}

.zhiyin-weather-card > span {
  font-size: 38px;
}

.zhiyin-weather-card strong {
  color: #1a1c1d;
  font-size: 30px;
  font-weight: 900;
}

.zhiyin-weather-card p {
  margin: 0;
  color: #434654;
}

.zhiyin-context-card {
  padding: 22px;
}

.zhiyin-context-card h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
  color: #1a1c1d;
}

.zhiyin-knowledge-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.zhiyin-knowledge-toggle-row p {
  margin: 4px 0 0;
  color: #434654;
  font-size: 12px;
}

.zhiyin-knowledge-toggle-row label {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 48px;
}

.zhiyin-knowledge-toggle-row input {
  position: absolute;
  opacity: 0;
}

.zhiyin-knowledge-toggle-row label span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #e2e2e4;
  cursor: pointer;
}

.zhiyin-knowledge-toggle-row label span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s ease;
}

.zhiyin-knowledge-toggle-row input:checked + span {
  background: #003d9b;
}

.zhiyin-knowledge-toggle-row input:checked + span::after {
  transform: translateX(20px);
}

.zhiyin-knowledge-disabled,
.zhiyin-kb-empty {
  margin-top: 18px;
  border-radius: 18px;
  background: #f3f3f5;
  color: #434654;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
}

.zhiyin-knowledge-panel {
  margin-top: 16px;
}

.zhiyin-knowledge-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.zhiyin-knowledge-panel button {
  border: 0;
  background: transparent;
  color: #003d9b;
  font-weight: 900;
  cursor: pointer;
}

.zhiyin-empty-state {
  grid-column: 1 / -1;
  border: 1px dashed #c3c6d6;
  border-radius: 18px;
  padding: 36px;
  color: #434654;
  text-align: center;
}

@media (max-width: 1280px) {
  .zhiyin-dataset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .zhiyin-chat-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .zhiyin-chat-context {
    display: none;
  }
}

@media (max-width: 980px) {
  .zhiyin-page {
    width: 100%;
    padding: 30px 20px 56px;
  }

  .zhiyin-page-header,
  .zhiyin-header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .zhiyin-search-shell,
  .zhiyin-small-search {
    width: 100%;
  }

  .zhiyin-dataset-grid,
  .zhiyin-stat-grid,
  .zhiyin-suggestion-grid {
    grid-template-columns: 1fr;
  }

  .zhiyin-chat-layout {
    height: auto;
    min-height: calc(100vh - 44px);
    padding: 18px;
  }
}
/* Sidebar icon cleanup */
.zhiyin-nav .nav-btn::before {
  content: none !important;
  display: none !important;
}

.zhiyin-nav .nav-btn {
  max-width: 100%;
  gap: 14px;
}

/* Navigation branches and responsive shell tuning */
.main,
.view,
.topbar,
.panel,
.workbench-grid,
.workflow-layout,
.application-workspace,
.lendingpad-grid,
.lp-two-col,
.export-grid,
.settings-grid {
  min-width: 0;
}

@media (max-width: 1280px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .top-actions {
    flex: 1 1 420px;
  }

  .search {
    width: min(100%, 360px);
  }

  .workbench-grid,
  .workflow-layout {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr);
  }

  .workbench-grid > .package-review,
  .workflow-layout > .panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  :root {
    --page-gap: 18px;
    --sidebar-width: 220px;
  }

  .sidebar.zhiyin-sidebar {
    position: fixed;
    inset: 10px auto 10px 10px;
    width: var(--sidebar-width);
    max-height: calc(100vh - 20px);
    margin: 0;
    padding: 16px 14px;
    border-radius: 0 28px 28px 0;
    overflow: hidden;
  }

  .ai-rail-actions {
    grid-template-columns: 1fr;
  }

  .ai-rail-section {
    max-height: 132px;
    overflow: hidden;
  }

  .ai-rail-section[aria-label="案件快捷入口"] {
    max-height: none;
    min-height: 0;
    overflow: hidden;
  }

  .ai-rail-section[aria-label="案件快捷入口"] .ai-rail-list {
    max-height: none;
    overflow-y: auto;
  }

  .zhiyin-nav {
    grid-template-columns: 1fr;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .assistant-subnav {
    grid-template-columns: 1fr;
    margin: -2px 0 8px 28px;
    padding-left: 12px;
    border-left: 1px solid rgba(0, 82, 204, 0.16);
  }

  .nav-sub-btn {
    justify-content: flex-start;
    min-height: 36px;
    padding: 0 10px;
    text-align: left;
  }

  .main {
    min-height: calc(100vh - 20px);
    margin: 10px 10px 10px calc(var(--sidebar-width) + 20px);
    overflow: visible;
  }

  .topbar {
    gap: 16px;
  }

  .top-actions {
    width: 100%;
    flex: 1 1 100%;
  }

  .workbench-grid,
  .workflow-layout,
  .application-workspace,
  .lendingpad-grid,
  .lp-two-col,
  .split-layout,
  .export-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .list-panel,
  .detail-panel,
  .package-review,
  .workflow-layout > .panel,
  .application-import-panel,
  .application-paper {
    height: auto;
    max-height: none;
  }
}

@media (max-width: 620px) {
  :root {
    --sidebar-width: 82px;
    --page-gap: 14px;
  }

  .sidebar.zhiyin-sidebar {
    inset: 8px auto 8px 8px;
    width: var(--sidebar-width);
    max-height: calc(100vh - 16px);
    padding: 10px 8px;
    border-radius: 0 22px 22px 0;
  }

  .brand.zhiyin-brand > div:not(.brand-mark),
  .selected-box,
  .ai-rail-actions,
  .ai-rail-section,
  .employee-card {
    display: none;
  }

  .brand.zhiyin-brand {
    justify-content: center;
  }

  .zhiyin-brand .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 14px;
  }

  .zhiyin-nav {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .zhiyin-nav .nav-btn {
    min-height: 46px;
    justify-content: center;
    gap: 0;
    padding: 0;
    border-radius: 16px;
  }

  .zhiyin-nav .nav-btn > span:not(.material-symbols-outlined) {
    display: none;
  }

  .zhiyin-nav .material-symbols-outlined {
    font-size: 23px;
  }

  .assistant-subnav {
    grid-template-columns: 1fr;
    gap: 6px;
    margin: -2px 0 8px;
    padding-left: 0;
    border-left: 0;
  }

  .nav-sub-btn {
    min-height: 34px;
    justify-content: center;
    padding: 0 6px;
    font-size: 10px;
    line-height: 1.15;
    text-align: center;
    word-break: break-word;
  }

  .main {
    min-height: calc(100vh - 16px);
    margin: 8px 8px 8px calc(var(--sidebar-width) + 16px);
    border-radius: 22px;
  }

  .topbar h1 {
    font-size: 30px;
  }

  .top-actions,
  .status-group,
  .form-actions,
  .package-actions,
  .lp-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .language-select,
  .top-actions .btn,
  .search {
    width: 100%;
  }
}

/* AI Mortgage lending OS reference layout */
:root {
  --sidebar-width: 224px;
}

body {
  background: var(--loan-os-bg);
}

.sidebar.zhiyin-sidebar {
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  max-height: 100vh;
  padding: 16px 10px;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: #10213d;
  box-shadow: none;
}

.main {
  min-height: 100vh;
  margin: 0 0 0 var(--sidebar-width);
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--loan-os-bg);
  box-shadow: none;
}

.zhiyin-brand .brand-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
}

.zhiyin-brand .brand-subtitle {
  color: #8f9db4;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.zhiyin-sidebar .selected-box {
  display: none;
}

.zhiyin-sidebar .ai-rail-actions {
  grid-template-columns: 1fr;
  padding-top: 34px;
}

.zhiyin-sidebar .ai-rail-actions button:first-child,
.zhiyin-sidebar .ai-rail-actions button:last-child {
  justify-content: flex-start;
  min-height: 36px;
  border-radius: 8px;
  background: #315fe8;
  color: #ffffff;
  box-shadow: none;
}

.ai-rail-list {
  max-height: 150px;
  padding-left: 20px;
  border-left: 1px solid rgba(219, 231, 248, 0.14);
}

.ai-rail-item {
  min-height: 28px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
}

.ai-rail-item:hover,
.ai-rail-item.active {
  background: rgba(255, 255, 255, 0.08);
}

.ai-rail-item strong {
  color: #dbe7f8;
  font-size: 12px;
}

.ai-rail-item span,
.ai-rail-empty {
  color: #b6c4d9;
}

.zhiyin-nav {
  margin-top: auto;
  padding: 12px 4px 8px;
  border-top: 1px solid rgba(219, 231, 248, 0.1);
}

.zhiyin-nav .nav-btn,
.zhiyin-nav .hub-link {
  min-height: 35px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #d8e3f4;
  box-shadow: none;
}

.zhiyin-nav .nav-btn:hover,
.zhiyin-nav .nav-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: none;
  transform: none;
}

.assistant-subnav {
  display: none;
}

.zhiyin-sidebar .employee-card {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.loan-os-topbar {
  height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  overflow: visible;
  padding: 0 24px;
  border-bottom: 1px solid #e2e7f0;
  background: #ffffff;
}

.loan-os-back {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 0 12px 0 9px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.loan-os-back:hover {
  border-color: #c8d2e2;
  background: #f8fafc;
  color: #0f172a;
}

.loan-os-back .material-symbols-outlined {
  font-size: 19px;
}

.loan-os-global-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loan-os-case-identity {
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  overflow: visible;
}

.loan-os-title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #111827;
  line-height: 1.35;
}

.loan-os-title strong {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.loan-os-title span {
  color: #315fe8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.25;
  white-space: nowrap;
}

.loan-os-permission {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 12px;
  background: #f4f6fa;
  color: #475569;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.loan-os-permission strong {
  color: #334155;
  font-weight: 900;
}

.loan-os-permission .material-symbols-outlined {
  color: #14a36c;
  font-size: 16px;
}

.loan-os-model-selector,
.loan-os-db-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  font-weight: 850;
}

.loan-os-model-selector {
  cursor: pointer;
}

.loan-os-model-selector .material-symbols-outlined {
  color: #7b8798;
  font-size: 18px;
}

.model-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #21b879;
  box-shadow: 0 0 0 3px rgba(33, 184, 121, 0.12);
}

.loan-os-db-pill {
  border-color: transparent;
  background: #eef3ff;
  color: #315fe8;
}

.loan-os-db-pill .material-symbols-outlined {
  font-size: 16px;
}

.zhiyin-chat-layout {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0;
  height: calc(100vh - 56px);
  padding: 0;
}

.zhiyin-chat-main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 30px 24px 18px;
}

body[data-active-view="chat"] .zhiyin-chat-main {
  max-width: none;
}

.zhiyin-chat-messages {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 0 0 20px;
}

.zhiyin-chat-empty {
  min-height: 54vh;
  align-content: start;
  padding-top: 0;
}

.zhiyin-chat-avatar {
  width: 30px;
  height: 30px;
  margin: 62px 0 18px;
  border-radius: 8px;
  background: #315fe8;
  box-shadow: none;
}

.zhiyin-chat-empty h2 {
  max-width: 620px;
  color: #111827;
  font-size: 18px;
  line-height: 1.5;
}

.zhiyin-chat-empty p {
  color: #667085;
  font-size: 13px;
}

.zhiyin-suggestion-grid {
  width: min(620px, 100%);
}

.suggestion-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  display: inline-block;
  border-radius: 999px;
  background: #315fe8;
}

.suggestion-dot.green {
  background: #20b981;
}

.suggestion-dot.amber {
  background: #b26b12;
}

.zhiyin-suggestion-grid button,
.zhiyin-chat-bubble,
.zhiyin-composer-box {
  border-radius: 10px;
  box-shadow: none;
}

.zhiyin-chat-composer {
  position: sticky;
  bottom: 0;
  width: min(760px, 100%);
  margin: 0 auto;
  background: transparent;
}

.zhiyin-send-btn {
  background: #315fe8;
  color: #ffffff;
}

.zhiyin-chat-context {
  gap: 0;
  overflow-y: auto;
  padding: 14px;
  border-left: 1px solid #e2e7f0;
  background: #f8fafc;
}

.hub-case-panel,
.zhiyin-context-card {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.hub-case-head,
.hub-case-actions {
  display: none;
}

.hub-case-doc-list {
  display: grid;
  gap: 8px;
}

.hub-case-doc-list span {
  position: relative;
  min-height: 36px;
  display: flex;
  align-items: center;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  padding: 0 10px 0 34px;
  background: #ffffff;
  color: #111827;
  font-size: 12px;
  font-weight: 820;
}

.hub-case-doc-list.submitted span::before {
  content: "✓";
  position: absolute;
  left: 12px;
  color: #14a36c;
}

.hub-case-doc-list.missing span {
  border-color: #f3d59e;
  background: #fffaf0;
}

.hub-case-doc-list.missing span::before {
  content: "!";
  position: absolute;
  left: 14px;
  color: #d68613;
}

.hub-case-docusign-card,
.hub-case-note textarea {
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.hub-case-docusign-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hub-case-docusign-card:hover,
.hub-case-docusign-card:focus-visible {
  border-color: #bfd0f8;
  box-shadow: 0 10px 28px rgba(34, 66, 124, 0.12);
  outline: 0;
}

.hub-case-docusign-card .btn {
  min-height: 40px;
  border-radius: 8px;
  background: #ffc928;
  color: #3f2d00;
  box-shadow: none;
}

.hub-case-docusign-card .btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.hub-lendingpad-btn {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #10213d;
  color: #ffffff;
  font-weight: 900;
}

.hub-case-side-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  background: #ffffff;
}

.hub-case-side-summary div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.hub-case-side-summary span,
.hub-case-action-card span,
.hub-case-metrics span {
  color: #8a96aa;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.hub-case-side-summary strong {
  overflow: hidden;
  color: #111827;
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-case-side-summary small {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: #eef4ff;
  color: #315fe8;
  font-size: 11px;
  font-weight: 900;
}

.hub-case-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hub-case-metrics button {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px 10px;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hub-case-metrics button:hover,
.hub-case-metrics button:focus-visible {
  transform: translateY(-1px);
  border-color: #bfd0f8;
  box-shadow: 0 10px 24px rgba(34, 66, 124, 0.12);
  outline: 0;
}

.hub-case-metrics strong {
  color: #111827;
  font-size: 18px;
  font-weight: 950;
}

.hub-case-action-grid {
  display: grid;
  gap: 10px;
}

.hub-case-action-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hub-case-action-card:hover,
.hub-case-action-card:focus-visible {
  transform: translateY(-1px);
  border-color: #bfd0f8;
  box-shadow: 0 12px 28px rgba(34, 66, 124, 0.12);
  outline: 0;
}

.hub-case-action-card div {
  display: grid;
  gap: 5px;
}

.hub-case-action-card strong {
  color: #111827;
  font-size: 15px;
  font-weight: 950;
}

.hub-case-action-card small {
  color: #6b7280;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.4;
}

.hub-case-action-btn {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}

.hub-case-action-btn.docusign {
  background: #ffc928;
  color: #3f2d00;
}

.hub-case-action-btn.lendingpad {
  background: #10213d;
  color: #ffffff;
}

body[data-hub-chat-mode="global"] .loan-os-back,
body[data-hub-chat-mode="global"] .loan-os-title {
  display: none;
}

body[data-hub-chat-mode="global"] .loan-os-case-identity {
  display: none;
}

body[data-hub-chat-mode="case"] .loan-os-global-controls {
  display: none;
}

body[data-hub-chat-mode="case"] .loan-os-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
}

body[data-hub-chat-mode="case"] .loan-os-title {
  justify-self: start;
}

body[data-hub-chat-mode="case"] .zhiyin-chat-context .zhiyin-greeting-card {
  display: none;
}

body[data-hub-chat-mode="case"] .zhiyin-chat-context .zhiyin-context-card {
  display: none;
}

body[data-hub-chat-mode="global"] .zhiyin-chat-layout {
  grid-template-columns: minmax(0, 1fr);
}

body[data-hub-chat-mode="global"] .zhiyin-chat-context {
  display: none;
}

body[data-hub-chat-mode="global"] .zhiyin-chat-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 30px 24px 18px;
}

body[data-hub-chat-mode="global"] .zhiyin-chat-messages {
  width: min(704px, 100%);
  padding-top: 0;
}

body[data-hub-chat-mode="global"] .zhiyin-chat-empty {
  min-height: 42vh;
  align-content: start;
  justify-items: stretch;
  padding-top: 28px;
  text-align: left;
}

body[data-hub-chat-mode="global"] .zhiyin-chat-avatar {
  display: none;
}

body[data-hub-chat-mode="global"] .zhiyin-chat-empty h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
}

body[data-hub-chat-mode="global"] .zhiyin-chat-empty p {
  margin: 0 0 20px;
  color: #667085;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.7;
}

body[data-hub-chat-mode="global"] .zhiyin-suggestion-grid {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

body[data-hub-chat-mode="global"] .zhiyin-suggestion-grid button {
  min-height: 42px;
  border: 1px solid #dfe5ee;
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  box-shadow: none;
}

body[data-hub-chat-mode="global"] .zhiyin-suggestion-grid button span {
  color: #1f2937;
  font-size: 13px;
  font-weight: 780;
}

body[data-hub-chat-mode="global"] .zhiyin-suggestion-grid small {
  display: none;
}

body[data-hub-chat-mode="global"] .zhiyin-chat-composer {
  width: min(760px, 100%);
  padding-bottom: 0;
}

body[data-hub-chat-mode="global"] .zhiyin-composer-box {
  border-color: #dfe5ee;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.hub-chat-context-chip {
  border-color: #d7ddea !important;
  background: #f8fbff !important;
  color: #526176 !important;
  font-weight: 760 !important;
}

.hub-chat-context-chip .material-symbols-outlined {
  color: #315fe8;
  font-size: 16px;
}

body[data-hub-chat-mode="case"] .zhiyin-chat-empty {
  align-content: start;
  padding-top: 32px;
}

body[data-hub-chat-mode="case"] .zhiyin-chat-avatar {
  display: none;
}

body[data-hub-chat-mode="case"] .zhiyin-chat-empty h2 {
  width: fit-content;
  max-width: min(680px, 100%);
  margin-left: auto;
  margin-bottom: 22px;
  border-radius: 10px;
  padding: 13px 18px;
  background: #315fe8;
  color: #ffffff;
  font-size: 14px;
  font-weight: 860;
  line-height: 1.45;
  text-align: left;
}

body[data-hub-chat-mode="case"] .zhiyin-chat-empty p {
  width: min(520px, 100%);
  margin: 0 auto 0 48px;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  padding: 16px 18px;
  background: #ffffff;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.8;
  text-align: left;
}

body[data-hub-chat-mode="case"] .zhiyin-suggestion-grid {
  display: none;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 210px;
  }

  .zhiyin-chat-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
}

@media (max-width: 900px) {
  .sidebar.zhiyin-sidebar {
    width: 74px;
  }

  .brand.zhiyin-brand > div:not(.brand-mark),
  .ai-rail-section,
  .employee-card {
    display: none;
  }

  .main {
    margin-left: 74px;
  }

  .loan-os-permission {
    display: none;
  }

  .zhiyin-chat-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar exact reference pass */
.sidebar.zhiyin-sidebar {
  width: 224px;
  padding: 14px 10px 12px;
  gap: 10px;
  overflow: hidden;
  background: #10213d;
}

.zhiyin-brand {
  min-height: 40px;
  gap: 10px;
  padding: 0 8px 16px;
  align-items: center;
}

.zhiyin-brand .brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(135deg, #4b70ff 0%, #315fe8 100%);
  box-shadow: 0 12px 22px rgba(49, 95, 232, 0.28);
}

.zhiyin-brand .brand-mark::before {
  content: "";
  position: static;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: #ffffff;
  transform: rotate(45deg);
}

.zhiyin-brand .brand-mark::after,
.zhiyin-brand .brand-mark .material-symbols-outlined {
  display: none;
}

.zhiyin-brand > div:not(.brand-mark) {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: center;
}

.zhiyin-brand .brand-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
}

.zhiyin-brand .brand-subtitle {
  margin-top: 0;
  color: #8d9ab1;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.1;
}

.sidebar-workspace-label {
  padding: 9px 10px 0;
  color: #6f7e96;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zhiyin-sidebar .ai-rail-actions {
  padding: 0;
}

.zhiyin-sidebar .sidebar-primary-action {
  width: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: #3564e8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: none;
}

.zhiyin-sidebar .sidebar-primary-action .material-symbols-outlined {
  font-size: 18px;
  font-weight: 600;
}

.ai-rail-section {
  gap: 7px;
}

.ai-rail-section-title {
  height: 20px;
  padding: 0 10px;
  color: #d7e2f2;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.ai-rail-section-title::before {
  content: none;
}

.ai-rail-section[aria-label="最近对话"] .ai-rail-section-title span,
.ai-rail-section[aria-label="案件快捷入口"] .ai-rail-section-title span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.ai-rail-section[aria-label="最近对话"] .ai-rail-section-title > span::before {
  content: "schedule";
  font-family: "Material Symbols Outlined";
  color: #d7e2f2;
  font-size: 17px;
  font-weight: 300;
}

.ai-rail-section[aria-label="案件快捷入口"] .ai-rail-section-title > span::before {
  content: "folder";
  font-family: "Material Symbols Outlined";
  color: #d7e2f2;
  font-size: 17px;
  font-weight: 300;
}

.ai-rail-section-title button {
  width: 22px;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #263b60;
  color: #dbe8fb;
  font-size: 10px;
  font-weight: 900;
}

#sidebarCaseCount {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(4, 14, 31, 0.42);
  z-index: 1;
}

.sidebar-drag-hint {
  display: none !important;
}

.ai-rail-list {
  gap: 2px;
  max-height: 144px;
  padding: 0 12px 0 18px;
  border-left: 1px solid rgba(116, 135, 165, 0.25);
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #dbe6f7 transparent;
}

.ai-rail-section[aria-label="最近对话"] .ai-rail-list {
  max-height: 118px;
  overflow-x: hidden;
}

.ai-rail-section[aria-label="案件快捷入口"] {
  flex: 0 1 auto;
  min-height: 0;
}

.ai-rail-list::-webkit-scrollbar {
  width: 5px;
}

.ai-rail-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #dbe6f7;
}

.ai-rail-section[aria-label="案件快捷入口"] .ai-rail-list {
  max-height: clamp(150px, 24vh, 210px);
  min-height: 0;
  padding-right: 18px;
  overflow-y: auto;
}

.ai-rail-item {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 0;
  border: 0;
  border-radius: 6px;
  padding: 0 7px 0 18px;
  background: transparent;
  color: #c9d6e8;
}

.ai-rail-item:hover,
.ai-rail-item.active {
  background: rgba(255, 255, 255, 0.06);
}

.ai-rail-item::before {
  content: none;
}

.sidebar-chat-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  padding: 0 2px 0 18px;
}

.sidebar-chat-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-chat-open-btn {
  min-width: 0;
  display: grid;
  gap: 2px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sidebar-case-item {
  position: relative;
  min-height: 26px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  column-gap: 10px;
  padding: 0 30px 0 10px;
  cursor: pointer;
  user-select: none;
}

.sidebar-case-item::before,
.sidebar-case-item::after {
  content: none;
}

.sidebar-case-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-case-rank {
  display: none;
}

.sidebar-case-drag-handle {
  content: "drag_indicator";
  width: 11px;
  flex: 0 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  color: rgba(151, 166, 194, 0.48);
  font-family: "Material Symbols Outlined";
  font-size: 14px;
  line-height: 1;
}

.sidebar-case-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: #4b70ff;
  box-shadow: 0 0 0 2px rgba(75, 112, 255, 0.16);
}

.sidebar-case-item.case-tone-1 .sidebar-case-dot {
  background: #f3a928;
  box-shadow: 0 0 0 2px rgba(243, 169, 40, 0.16);
}

.sidebar-case-item.case-tone-2 .sidebar-case-dot {
  background: #38c582;
  box-shadow: 0 0 0 2px rgba(56, 197, 130, 0.16);
}

.sidebar-case-item.case-tone-3 .sidebar-case-dot {
  background: #8aa0c2;
  box-shadow: 0 0 0 2px rgba(138, 160, 194, 0.16);
}

.sidebar-case-item.case-tone-4 .sidebar-case-dot {
  background: #5477ff;
  box-shadow: 0 0 0 2px rgba(84, 119, 255, 0.16);
}

.sidebar-case-item.case-tone-5 .sidebar-case-dot {
  background: #836035;
  box-shadow: 0 0 0 2px rgba(131, 96, 53, 0.16);
}

.sidebar-case-item.dragging {
  opacity: 0.45;
}

.sidebar-case-item.drag-over {
  background: rgba(255, 255, 255, 0.075);
}

.sidebar-case-item.muted {
  opacity: 0.55;
}

.sidebar-case-empty {
  padding: 8px 10px;
  color: rgba(151, 166, 194, 0.68);
  font-size: 13px;
  font-weight: 820;
}

.sidebar-chat-delete-btn,
.sidebar-case-delete-btn {
  width: 22px;
  height: 22px;
  display: inline-grid;
  flex: 0 0 22px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: rgba(201, 214, 232, 0.62);
  font-family: "Material Symbols Outlined";
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  opacity: 0;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.sidebar-case-delete-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

.sidebar-chat-item:hover .sidebar-chat-delete-btn,
.sidebar-chat-delete-btn:focus-visible,
.sidebar-case-item:hover .sidebar-case-delete-btn,
.sidebar-case-delete-btn:focus-visible {
  opacity: 1;
}

.sidebar-chat-delete-btn:hover,
.sidebar-chat-delete-btn:focus-visible,
.sidebar-case-delete-btn:hover,
.sidebar-case-delete-btn:focus-visible {
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  outline: none;
}

.ai-rail-item strong {
  color: #c9d6e8;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
}

.ai-rail-item span {
  display: none;
}

.sidebar-bottom-nav {
  margin-top: auto;
  gap: 14px;
  padding: 14px 4px 12px;
  border-top: 1px solid rgba(141, 154, 177, 0.18);
}

.sidebar-bottom-nav .nav-btn,
.sidebar-bottom-nav .nav-btn.active,
.sidebar-bottom-nav .nav-btn:hover {
  min-height: 28px;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 7px;
  background: transparent;
  color: #ecf3ff;
  box-shadow: none;
  transform: none;
  font-size: 13px;
  font-weight: 820;
}

.sidebar-bottom-nav .nav-btn .material-symbols-outlined {
  width: 20px;
  color: #d7e2f2;
  font-size: 18px;
  font-weight: 300;
}

.sidebar-bottom-nav .sidebar-hidden-route {
  display: none;
}

.zhiyin-sidebar .employee-card {
  flex: 0 0 auto;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  min-height: 34px;
  padding: 0 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.zhiyin-sidebar .employee-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #2d4168;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.zhiyin-sidebar .employee-meta span {
  display: none;
}

.zhiyin-sidebar .employee-meta strong {
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.zhiyin-sidebar .employee-meta small {
  color: #8d9ab1;
  font-size: 10px;
  font-weight: 700;
}

.zhiyin-sidebar .employee-meta small:nth-of-type(2),
.zhiyin-sidebar .employee-meta small:nth-of-type(3) {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

#sidebarBottomNav {
  flex: 0 0 auto;
  margin-top: auto;
  gap: 14px;
  padding: 14px 4px 12px;
  border-top: 1px solid rgba(141, 154, 177, 0.18);
  overflow: visible;
}

#sidebarBottomNav .nav-btn,
#sidebarBottomNav .nav-btn.active,
#sidebarBottomNav .nav-btn:hover {
  min-height: 28px;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 7px;
  background: transparent;
  color: #ecf3ff;
  box-shadow: none;
  transform: none;
  font-size: 13px;
  font-weight: 820;
}

#sidebarBottomNav .nav-btn .material-symbols-outlined {
  width: 20px;
  color: #d7e2f2;
  font-size: 18px;
  font-weight: 300;
}

#sidebarBottomNav .sidebar-hidden-route {
  display: none;
}

/* Keep sidebar scroll lists visually merged with the navy rail. */
.zhiyin-sidebar .ai-rail-list {
  background: #10213d;
  box-shadow: none;
}

.zhiyin-sidebar .ai-rail-item,
.zhiyin-sidebar .ai-rail-item:hover,
.zhiyin-sidebar .ai-rail-item.active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.zhiyin-sidebar .ai-rail-item strong {
  color: #c9d6e8;
}

.zhiyin-sidebar .ai-rail-item span,
.zhiyin-sidebar .ai-rail-empty,
.zhiyin-sidebar .sidebar-case-item::before {
  color: #8d9ab1;
}

.zhiyin-sidebar .sidebar-case-item,
.zhiyin-sidebar .sidebar-case-item:hover,
.zhiyin-sidebar .sidebar-case-item.active,
.zhiyin-sidebar .sidebar-case-item.drag-over {
  background: transparent;
}

.zhiyin-sidebar .sidebar-case-item.active,
.zhiyin-sidebar .sidebar-case-item.drag-over {
  background: rgba(18, 46, 87, 0.7);
}

.zhiyin-sidebar .sidebar-case-item span.sidebar-case-drag-handle {
  display: inline-flex;
  color: rgba(151, 166, 194, 0.48);
}

.zhiyin-sidebar .sidebar-case-item span.sidebar-case-dot {
  display: block;
}

/* New Case dialog-only intake view */
body[data-active-view="intake"] .main {
  background: #f5f7fb;
}


body[data-active-view="intake"] .topbar {
  min-height: 80px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e7ebf2;
}

body[data-active-view="intake"] .topbar-title-group {
  gap: 16px;
}

body[data-active-view="intake"] .topbar-title-copy h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
}

body[data-active-view="intake"] .topbar-title-copy .kicker {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
}

body[data-active-view="intake"] .workflow-back-btn,
body[data-active-view="intake"] .workflow-back-btn.hidden {
  min-width: 94px;
  min-height: 44px;
  border-radius: 12px;
  padding: 0 14px;
  color: #667085;
}

body[data-active-view="intake"] #view-intake {
  min-height: calc(100vh - 74px);
}

body[data-active-view="intake"] .application-workspace {
  width: 100%;
  min-height: calc(100vh - 104px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: start center;
  gap: 0;
  padding: 52px 32px 0;
  overflow: visible;
}

body[data-active-view="intake"] #intakeForm {
  display: none !important;
}

body[data-active-view="intake"] .case-create-import-panel {
  width: min(840px, 100%);
  min-height: 0;
  height: auto;
  padding: 0;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body[data-active-view="intake"] .case-create-intro {
  width: min(700px, 100%);
  gap: 10px;
}

body[data-active-view="intake"] .case-create-plus {
  width: 62px;
  height: 62px;
  border-radius: 17px;
  background: #edf4ff;
  color: #2f61e8;
  font-size: 38px;
  font-weight: 320;
}

body[data-active-view="intake"] .case-create-intro h2 {
  margin-top: 8px;
  color: #172033;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.16;
}

body[data-active-view="intake"] .case-create-intro p {
  max-width: 700px;
  color: #7f8898;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.65;
}

body[data-active-view="intake"] .case-create-composer {
  width: min(840px, 100%);
  min-height: 236px;
  margin-top: 30px;
  padding: 22px 20px 16px;
  border: 1px solid #dbe2ee;
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.1);
}

body[data-active-view="intake"] .case-create-import-panel #importStatus {
  display: none !important;
}

body[data-active-view="intake"] .case-create-import-panel .text-import {
  height: 126px;
  min-height: 126px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #202938;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.55;
  resize: none;
}

body[data-active-view="intake"] .case-create-import-panel .text-import::placeholder {
  color: #8b93a3;
}

body[data-active-view="intake"] .case-create-bottom {
  align-items: center;
  gap: 18px;
}

body[data-active-view="intake"] .case-upload-trigger {
  width: 132px;
  min-height: 48px;
  border-radius: 12px;
  color: #596274;
  font-size: 15px;
  font-weight: 850;
}

body[data-active-view="intake"] .case-upload-trigger span {
  font-size: 20px;
}

body[data-active-view="intake"] .case-upload-box p {
  color: #a3adbc;
  font-size: 13px;
  font-weight: 820;
}

body[data-active-view="intake"] .case-create-bottom #parseImportBtn {
  min-width: 228px;
  min-height: 50px;
  border-radius: 12px;
  background: #315fe8;
  box-shadow: 0 14px 30px rgba(49, 95, 232, 0.28);
  font-size: 15px;
  font-weight: 900;
}

body[data-active-view="intake"] .case-create-import-panel::after {
  margin-top: 18px;
  color: #b7becb;
  font-size: 13px;
  font-weight: 760;
}

body[data-active-view="intake"] .workflow-back-btn,
body[data-active-view="intake"] .workflow-back-btn.hidden {
  display: inline-flex !important;
}

body[data-active-view="intake"] .top-actions > :not(#newCaseBtn) {
  display: none !important;
}

body[data-active-view="intake"] #newCaseBtn {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  color: #5f6b7d;
  background: #f1f4f8;
  box-shadow: none;
  font-size: 14px;
  font-weight: 850;
}

@media (max-width: 920px) {
  body[data-active-view="intake"] .application-workspace {
    min-height: calc(100vh - 96px);
    padding: 34px 18px 0;
  }

  body[data-active-view="intake"] .case-create-intro h2 {
    font-size: 26px;
  }

  body[data-active-view="intake"] .case-create-intro p {
    font-size: 14px;
  }

  body[data-active-view="intake"] .case-create-composer {
    min-height: 250px;
  }

  body[data-active-view="intake"] .case-create-bottom {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-active-view="intake"] .case-upload-box {
    justify-content: space-between;
  }

  body[data-active-view="intake"] .case-create-bottom #parseImportBtn {
    width: 100%;
  }
}

body[data-active-view="intake"][data-case-create-state] .application-workspace {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 84px);
  align-items: stretch;
  justify-items: stretch;
  padding: 0;
}

body[data-active-view="intake"][data-case-create-state] .case-create-workspace {
  width: 100%;
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0;
}

body[data-active-view="intake"] .case-create-workspace.hidden {
  display: none !important;
}

.case-create-chat-main {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 34px 24px 18px;
  background: #f7f9fc;
}

.case-create-chat-messages {
  width: min(760px, 100%);
  margin: 0 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 0 20px;
}

.case-create-chat-composer {
  width: min(760px, 100%);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 1px solid #e3e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.case-create-context-chip {
  min-width: 0;
  overflow: hidden;
  color: #7a8495;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-create-file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.case-create-file-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 240px;
  overflow: hidden;
  border-radius: 999px;
  padding: 6px 10px;
  color: #27415f;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-create-file-row .material-symbols-outlined {
  flex: 0 0 auto;
  font-size: 16px;
}

.case-create-user-bubble {
  margin-left: auto;
}

.case-create-ocr-summary {
  border: 1px solid rgba(47, 99, 230, 0.16);
  background: #ffffff;
}

.case-create-ocr-summary strong {
  color: #1f4fc6;
}

.case-create-side-panel {
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px;
  border-left: 1px solid #e2e7f0;
  background: #f8fafc;
}

.case-create-side-head,
.case-create-case-head {
  display: grid;
  gap: 5px;
}

.case-create-side-head p {
  margin: 0;
  color: #9aa4b2;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.case-create-side-head h3,
.case-create-case-head h3 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 920;
}

.case-create-side-head span,
.case-create-case-head p,
.hub-case-status-block > span {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 820;
}

.case-create-progress-list {
  display: grid;
  gap: 8px;
}

.case-create-progress-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  min-height: 46px;
  padding: 10px;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  background: #ffffff;
}

.case-create-progress-item i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef4ff;
}

.case-create-progress-item i::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
}

.case-create-progress-item.running i::before {
  background: #315fe8;
  box-shadow: 0 0 0 5px rgba(49, 95, 232, 0.12);
}

.case-create-progress-item.done i::before {
  width: 11px;
  height: 11px;
  background: #14a36c;
}

.case-create-progress-item.error {
  border-color: #f0b4aa;
  background: #fff7f5;
}

.case-create-progress-item.error i::before {
  background: #d92d20;
}

.case-create-progress-item strong {
  display: block;
  color: #111827;
  font-size: 12px;
  font-weight: 900;
}

.case-create-progress-item span {
  display: block;
  margin-top: 3px;
  color: #7a8495;
  font-size: 12px;
  line-height: 1.45;
}

.case-create-error {
  border: 1px solid #f0b4aa;
  border-radius: 10px;
  padding: 10px 12px;
  color: #b42318;
  background: #fff7f5;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.hub-case-status-block {
  display: grid;
  gap: 8px;
}

.case-create-side-panel .hub-case-docusign-card {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.case-create-side-panel .hub-case-docusign-card strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.case-create-side-panel .hub-case-docusign-card small {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 760;
}

.case-create-side-panel .hub-case-docusign-card .btn {
  min-height: 40px;
  border-radius: 8px;
  background: #ffc928;
  color: #3f2d00;
  box-shadow: none;
}

.case-create-side-panel .hub-case-docusign-card .btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.case-create-side-panel .hub-case-note {
  gap: 8px;
}

body.modal-open {
  overflow: hidden;
}

.docusign-form-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.48);
}

.docusign-form-modal.hidden {
  display: none;
}

.docusign-form-sheet {
  position: relative;
  width: min(1180px, 100%);
  max-height: min(860px, calc(100vh - 56px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid #d9e2ef;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.docusign-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e5ebf3;
}

.docusign-form-head span {
  color: #8a94a6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.docusign-form-head h2 {
  margin: 6px 0 4px;
  color: #101828;
  font-size: 22px;
  line-height: 1.2;
}

.docusign-form-head p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.docusign-review-form {
  min-height: 0;
  overflow: auto;
  padding: 18px 24px 24px;
}

.docusign-review-status {
  display: grid;
  grid-template-columns: minmax(260px, 520px) minmax(180px, 1fr);
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid #e5ebf3;
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
}

.docusign-send-email-field {
  display: grid;
  gap: 7px;
}

.docusign-send-email-field span,
.docusign-review-status small {
  color: #667085;
  font-size: 12px;
  font-weight: 850;
}

.docusign-send-email-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  padding: 10px 12px;
  color: #111827;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
}

.docusign-send-email-field input:focus {
  border-color: #2f63e6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 99, 230, 0.12);
}

.docusign-review-status small {
  line-height: 1.45;
}

.docusign-review-grid {
  display: grid;
  gap: 14px;
}

.docusign-pdf-application {
  min-width: 0;
  display: grid;
  place-items: start center;
}

.docusign-pdf-application .pdf-page-wrap {
  width: clamp(760px, 72vw, 980px);
  max-width: 100%;
}

.docusign-pdf-application .pdf-page-bg {
  width: 100%;
}

.docusign-review-section {
  border: 1px solid #e5ebf3;
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
}

.docusign-review-section h3 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 14px;
  font-weight: 900;
}

.docusign-review-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.docusign-review-field {
  display: grid;
  gap: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.docusign-review-field.wide {
  grid-column: 1 / -1;
}

.docusign-review-field input,
.docusign-review-field select,
.docusign-review-field textarea {
  width: 100%;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

.docusign-review-field textarea {
  resize: vertical;
  min-height: 64px;
}

.docusign-review-field input:focus,
.docusign-review-field select:focus,
.docusign-review-field textarea:focus {
  border-color: #3461e6;
  outline: 3px solid rgba(52, 97, 230, 0.12);
}

.docusign-review-field input[readonly] {
  background: #f4f6f9;
  color: #667085;
}

.docusign-review-field.checkbox-field {
  align-content: center;
}

.docusign-checkbox {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 10px 11px;
  color: #111827;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 820;
}

.docusign-checkbox input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.docusign-review-actions {
  position: sticky;
  bottom: -24px;
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) minmax(240px, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding: 16px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), #ffffff 32%);
}

.docusign-send-review-btn {
  min-height: 48px;
  border-radius: 10px;
  background: #ffc928;
  color: #3f2d00;
  box-shadow: none;
  font-size: 15px;
  font-weight: 900;
}

.docusign-send-review-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lendingpad-review-sheet {
  width: min(1280px, 100%);
  max-height: min(900px, calc(100vh - 56px));
}

.lendingpad-review-form {
  padding: 18px 24px 0;
}

.lendingpad-review-body {
  min-height: 0;
}

.lendingpad-review-body .lp-create-page,
.lp-create-page.lendingpad-modal-page {
  min-height: auto;
  margin: 0;
  padding: 0 0 18px;
  background: #f3f6fb;
}

.lendingpad-review-status,
.lendingpad-review-body .lp-toolbar,
.lendingpad-review-body .lp-pricing-note,
.lendingpad-review-body .lp-import-summary {
  display: none;
}

.lendingpad-review-body .lp-actions,
.lendingpad-review-body .lp-import-summary .lp-export-primary {
  display: none;
}

.lendingpad-review-body .lp-card {
  border-radius: 6px;
}

.lendingpad-review-actions {
  bottom: 0;
  margin-top: 0;
  padding: 14px 0 18px;
}

.lendingpad-send-review-btn {
  background: #0f2748;
  color: #ffffff;
}

.case-action-sheet {
  width: min(920px, 100%);
  max-height: min(820px, calc(100vh - 56px));
}

.case-action-modal.case-file-preview-mode {
  padding: 18px;
}

.case-action-modal.case-file-preview-mode .case-action-sheet {
  width: min(980px, calc(100vw - 36px));
  height: min(820px, calc(100vh - 36px));
  max-height: calc(100vh - 36px);
  grid-template-rows: minmax(0, 1fr);
}

.case-action-modal.case-file-preview-mode .case-action-head {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  padding: 0;
  border: 0;
}

.case-action-modal.case-file-preview-mode .case-action-head > div {
  display: none;
}

.case-action-modal.case-file-preview-mode .case-action-body {
  overflow: hidden;
  padding: 12px;
}

.case-action-body {
  display: grid;
  gap: 14px;
}

.case-action-summary {
  display: grid;
  gap: 4px;
  border: 1px solid #e5ebf3;
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8fafc;
}

.case-action-summary strong {
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.case-action-summary span {
  color: #667085;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.case-action-list,
.case-action-form {
  display: grid;
  gap: 10px;
}

.case-action-list-row,
.case-action-upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #e5ebf3;
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
}

.case-action-list-row div,
.case-action-upload-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.case-action-list-row strong,
.case-action-upload-row strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.case-action-list-row span,
.case-action-upload-row span,
.case-action-list-row small {
  color: #667085;
  font-size: 12px;
  font-weight: 740;
}

.case-action-upload-row input {
  flex: 0 0 260px;
  max-width: 48%;
}

.case-action-uploaded-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-action-uploaded-files span,
.case-action-uploaded-files button {
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  padding: 6px 9px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 780;
}

.case-action-uploaded-files-list {
  display: grid;
  gap: 10px;
}

.case-action-uploaded-files-list .case-action-file-row {
  width: 100%;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
}

.case-action-file-row div {
  display: grid;
  gap: 3px;
}

.case-action-file-row strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.case-action-file-row span {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #667085;
  font-size: 12px;
  font-weight: 740;
}

.case-action-uploaded-files button {
  cursor: pointer;
  font-family: inherit;
}

.case-action-uploaded-files button:hover,
.case-action-uploaded-files button:focus-visible {
  border-color: #2f63e6;
  color: #2f63e6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 99, 230, 0.12);
}

.case-file-preview {
  position: relative;
  height: 100%;
  min-height: 0;
}

.case-file-preview-loading {
  min-height: 420px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 850;
}

.case-file-preview-controls {
  position: absolute;
  top: 52px;
  right: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

.case-file-preview-controls button {
  min-width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f4f7fb;
  color: #10213d;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.case-file-preview-controls button:hover,
.case-file-preview-controls button:focus-visible {
  border-color: #2f63e6;
  color: #2f63e6;
  outline: none;
}

.case-file-preview-controls .material-symbols-outlined {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.case-file-preview-controls > span {
  min-width: 48px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.case-file-preview-surface {
  --case-file-zoom: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px;
  cursor: grab;
  overscroll-behavior: contain;
  user-select: none;
}

.case-file-preview-surface:active {
  cursor: grabbing;
}

.case-file-preview-surface.dragging {
  cursor: grabbing;
}

.case-file-preview-media {
  display: block;
  width: calc(100% * var(--case-file-zoom));
  max-width: none;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.case-file-preview-frame {
  display: block;
  width: calc(100% * var(--case-file-zoom));
  min-width: 100%;
  height: calc(760px * var(--case-file-zoom));
  border: 0;
  border-radius: 10px;
  background: #fff;
  pointer-events: none;
}

.case-file-preview-text {
  display: block;
  width: calc(100% * var(--case-file-zoom));
  min-width: 100%;
  min-height: 360px;
  margin: 0;
  padding: 18px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: calc(0.9rem * var(--case-file-zoom))/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.case-action-field-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.case-action-field-table label {
  display: grid;
  gap: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 820;
}

.case-action-field-table input,
.case-action-field-table select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  padding: 10px 11px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

.case-action-footer {
  position: sticky;
  bottom: -24px;
  display: grid;
  grid-template-columns: minmax(140px, 0.35fr) minmax(220px, 1fr);
  gap: 12px;
  margin-top: 6px;
  padding: 16px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), #ffffff 32%);
}

@media (max-width: 720px) {
  .docusign-form-modal {
    padding: 12px;
  }

  .docusign-form-head {
    padding: 18px;
  }

  .docusign-review-form {
    padding: 14px 18px 18px;
  }

  .docusign-review-status,
  .docusign-review-actions {
    grid-template-columns: 1fr;
  }

  .docusign-review-section-grid {
    grid-template-columns: 1fr;
  }

  .case-action-field-table,
  .case-action-footer {
    grid-template-columns: 1fr;
  }

  .case-action-list-row,
  .case-action-upload-row {
    display: grid;
  }

  .case-action-upload-row input {
    max-width: 100%;
  }

  .case-file-preview-controls {
    align-self: stretch;
    justify-content: center;
    border-radius: 14px;
  }
}

.case-create-side-panel .hub-case-note .btn {
  min-height: 38px;
  border-radius: 8px;
}

@media (max-width: 980px) {
  body[data-active-view="intake"][data-case-create-state] .case-create-workspace {
    grid-template-columns: 1fr;
  }

  .case-create-side-panel {
    border-left: 0;
    border-top: 1px solid #e2e7f0;
  }
}

/* Chat scroll containment */
body[data-active-view="chat"] .zhiyin-chat-layout {
  min-height: 0;
  overflow: hidden;
}

body[data-active-view="chat"] .zhiyin-chat-main {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

body[data-active-view="chat"] .zhiyin-chat-messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 28px;
  scrollbar-gutter: stable;
}

body[data-active-view="chat"] .zhiyin-chat-composer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0), #f7f9fc 32%);
}

body[data-active-view="intake"][data-case-create-state] .case-create-workspace {
  height: calc(100vh - 84px);
  min-height: 0;
  overflow: hidden;
}

body[data-active-view="intake"][data-case-create-state] .case-create-chat-main {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body[data-active-view="intake"][data-case-create-state] .case-create-chat-messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 28px;
  scrollbar-gutter: stable;
}

body[data-active-view="intake"][data-case-create-state] .case-create-chat-composer {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
}

/* Case document collection */
.case-create-file-config-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #cdd9f3;
  border-radius: 8px;
  background: #f5f8ff;
}

.case-create-file-config-summary strong {
  color: #163b8f;
  font-size: 13px;
}

.case-create-file-config-summary span {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

.zhiyin-file-chip {
  max-width: min(760px, 100%);
}

#hubChatFileName {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-case-file-section {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.hub-case-file-section-head {
  display: grid;
  gap: 3px;
}

.hub-case-section-head-row,
.hub-case-file-section-head > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hub-case-section-toggle {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #111827;
  cursor: pointer;
}

.hub-case-section-toggle .material-symbols-outlined {
  color: #64748b;
  font-size: 18px;
}

.hub-case-section-toggle:hover span:not(.material-symbols-outlined),
.hub-case-section-toggle:focus-visible span:not(.material-symbols-outlined) {
  color: #315fe8;
}

.hub-case-inline-upload-btn {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #dbe6f6;
  border-radius: 999px;
  background: #f7faff;
  color: #315fe8;
  cursor: pointer;
}

.hub-case-inline-upload-btn:hover,
.hub-case-inline-upload-btn:focus-within {
  border-color: #9db5ef;
  background: #eef4ff;
}

.hub-case-inline-upload-btn .material-symbols-outlined {
  font-size: 18px;
}

.hub-case-inline-upload-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hub-case-file-section-head span {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.hub-case-file-section-head strong {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 7px;
  background: #eef4ff;
  color: #315fe8;
  font-size: 12px;
}

.hub-case-file-section-head small,
.hub-case-upload-guidance {
  margin: 0;
  color: #7a8495;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.45;
}

.hub-case-direct-file-list,
.hub-case-required-list {
  display: grid;
  gap: 6px;
}

.hub-case-direct-file-row {
  position: relative;
  min-width: 0;
}

.hub-case-direct-file-list .hub-case-file-open-btn {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5eaf2;
  border-radius: 7px;
  padding: 8px 9px 8px 34px;
  background: #ffffff;
  color: #315fe8;
  text-align: left;
  cursor: pointer;
}

.hub-case-direct-file-list .hub-case-file-open-btn:hover,
.hub-case-direct-file-list .hub-case-file-open-btn:focus-visible {
  border-color: #9db5ef;
  background: #f7f9ff;
  outline: 0;
}

.hub-case-direct-file-list .hub-case-file-open-btn:disabled {
  opacity: 0.58;
  cursor: default;
}

.hub-case-direct-file-list .hub-case-file-open-btn > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.hub-case-file-delete-btn {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  z-index: 2;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  color: #98a2b3;
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: opacity 0.16s ease, border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.hub-case-file-delete-btn .material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
}

.hub-case-direct-file-row:hover .hub-case-file-delete-btn,
.hub-case-direct-file-row:focus-within .hub-case-file-delete-btn {
  opacity: 1;
}

.hub-case-file-delete-btn:hover,
.hub-case-file-delete-btn:focus-visible {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #dc2626;
  outline: 0;
}

.hub-case-direct-file-list strong,
.hub-case-direct-file-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-case-direct-file-list strong {
  color: #111827;
  font-size: 12px;
}

.hub-case-direct-file-list small {
  color: #7a8495;
  font-size: 10px;
}

.hub-case-direct-file-list .material-symbols-outlined {
  font-size: 18px;
}

.hub-case-required-list > div {
  min-height: 34px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 1px solid #f1d39b;
  border-radius: 7px;
  padding: 7px 9px;
  background: #fffaf0;
}

.hub-case-required-list .material-symbols-outlined {
  color: #d68613;
  font-size: 17px;
}

.hub-case-required-list strong {
  color: #3d3527;
  font-size: 11px;
  line-height: 1.35;
}

.hub-case-required-list small {
  color: #b66b05;
  font-size: 10px;
  font-weight: 900;
}

.hub-case-required-list .hub-case-requirement-complete {
  grid-template-columns: 18px minmax(0, 1fr);
  border-color: #b9e4d4;
  background: #f3fbf8;
  color: #087a55;
  font-size: 12px;
  font-weight: 850;
}

.hub-case-required-list .hub-case-requirement-complete .material-symbols-outlined {
  color: #14a36c;
}

.hub-case-optional-files {
  display: grid;
  gap: 3px;
  border-left: 3px solid #f0b13b;
  padding: 5px 0 5px 9px;
}

.hub-case-optional-files span {
  color: #7c570e;
  font-size: 10px;
  font-weight: 900;
}

.hub-case-optional-files small {
  color: #7a8495;
  font-size: 10px;
  line-height: 1.45;
}

.hub-case-empty.compact {
  min-height: 0;
  padding: 9px;
  font-size: 11px;
}

@media (max-width: 720px) {
  .case-create-file-config-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .case-create-file-config-summary span {
    text-align: left;
  }
}

/* Final chat layout guard: keep messages scrollable and never clip bubbles. */
body[data-active-view="chat"] .zhiyin-chat-layout {
  height: calc(100dvh - 56px);
  min-height: 0;
  overflow: hidden;
}

body[data-active-view="chat"] .zhiyin-chat-main {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding-bottom: 0;
}

body[data-active-view="chat"] .zhiyin-chat-messages {
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 10px 28px;
  scroll-padding-bottom: 28px;
  overscroll-behavior: contain;
}

body[data-active-view="chat"] .zhiyin-chat-composer {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding-top: 12px;
  padding-bottom: 10px;
  background: linear-gradient(180deg, rgba(247, 249, 252, 0), #f7f9fc 30%);
}

body[data-active-view="chat"] .zhiyin-chat-bubble {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  overflow: visible;
  white-space: normal;
}

body[data-active-view="chat"] .zhiyin-chat-bubble.assistant {
  width: fit-content;
  max-width: min(760px, calc(100% - 72px));
}

body[data-active-view="chat"] .zhiyin-chat-bubble.user {
  width: fit-content;
  min-width: 72px;
  max-width: min(520px, 72%);
  display: grid;
  gap: 4px;
  justify-items: start;
  line-height: 1.55;
}

body[data-active-view="chat"] .zhiyin-chat-bubble.user strong,
body[data-active-view="chat"] .zhiyin-chat-bubble.user p {
  min-width: 0;
  max-width: 100%;
}

body[data-active-view="chat"] .zhiyin-chat-bubble.user p {
  margin: 0;
  color: #ffffff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body[data-active-view="chat"] .hub-chat-answer-text,
body[data-active-view="chat"] .hub-chat-answer-text p {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
