:root {
  --primary: #274a86;
  --primary-dark: #223f73;
  --primary-soft: #eef3fb;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --border: #d9e0ea;
  --text: #101828;
  --muted: #607089;
  --muted-2: #8a97aa;
  --warning: #fff1bf;
  --success: #eaf8f0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 6px;
  padding: 10px 12px;
  color: #1f2937;
  background: #fff;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(39, 74, 134, 0.12);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f5f7fb;
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 900;
}

.brand-lockup strong,
.sidebar-brand strong {
  display: block;
  line-height: 1.2;
  font-size: 16px;
}

.brand-lockup span,
.sidebar-brand span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.login-panel {
  width: min(400px, 100%);
}

#loginForm[hidden], #registrationPanel[hidden], #showRegistration[hidden] { display: none; }
#showRegistration { margin-top: 14px; }
.registration-requests { margin-bottom: 20px; }
.registration-requests .member-card { min-width: 0; overflow-wrap: anywhere; }
.registration-review-form label, [data-reset-password] label { display: grid; gap: 6px; margin: 10px 0; }
.registration-review-form textarea { width: 100%; min-height: 72px; resize: vertical; }

.login-form {
  width: 100%;
  padding: 34px 32px 32px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.login-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
}

.login-heading .brand-mark {
  width: 44px;
  height: 44px;
  background: var(--primary);
  font-size: 18px;
}

.login-heading h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: 0;
}

.login-form label,
.case-form label,
.settings-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: #253246;
  font-weight: 650;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 750;
}

.primary-btn {
  color: #fff;
  background: var(--primary);
}

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

.secondary-btn,
.ghost-btn {
  color: #233450;
  background: #fff;
  border: 1px solid #cfd8e6;
}

.danger-btn {
  color: #b42318;
  background: #fff;
  border: 1px solid #f2b8b5;
}

.login-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
}

.login-message {
  margin: -14px 0 18px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
}

.login-error {
  color: #9f2d25;
  background: #fff1f0;
  border: 1px solid #f3c4c0;
}

.feishu-login-option {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.feishu-login-option[hidden] { display: none; }

.feishu-login-button {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  transition: box-shadow 160ms ease;
}

.feishu-login-button:hover {
  box-shadow: 0 0 0 1px #dce6fa, 0 4px 12px rgba(51, 112, 255, 0.08);
}

.feishu-login-button:active { box-shadow: 0 0 0 2px #a9c5fa; }
.feishu-login-button > svg { width: 32px; height: 32px; }

.feishu-login-button:focus-visible,
.feishu-qr-actions button:focus-visible {
  outline: 3px solid #3370ff;
  outline-offset: 3px;
}

.feishu-login-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: max-content;
  padding: 6px 10px;
  border-radius: 6px;
  background: #253246;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.feishu-login-button:hover .feishu-login-tooltip,
.feishu-login-button:focus-visible .feishu-login-tooltip { visibility: visible; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .feishu-login-button { transition: none; }
}

#passwordLoginPanel[hidden],
.feishu-qr-panel[hidden] {
  display: none;
}

.feishu-qr-panel { text-align: center; }
.feishu-qr-panel h2 { margin: 0; font-size: 20px; font-weight: 650; }
.feishu-qr-caption { margin: 8px 0 20px; color: #607089; font-size: 12px; line-height: 1.6; }
.feishu-qr-container { min-height: 280px; display: grid; place-items: center; border: 1px solid #e3eaf5; border-radius: 16px; overflow: hidden; background: #fff; }
.feishu-qr-container iframe { max-width: 100%; }
.feishu-qr-status { min-height: 42px; margin: 12px 0 16px; font-size: 13px; line-height: 1.6; color: #6f7d91; }
.feishu-qr-status.login-error { color: #9f2d25; padding: 8px; border-radius: 6px; }
.feishu-qr-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.feishu-qr-actions button { flex: 1; min-width: 118px; padding: 10px 8px; border-radius: 10px; font-weight: 550; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--border);
}

.sidebar .sidebar-brand {
  padding: 18px 20px 16px;
  border-bottom: 1px solid #edf1f6;
}

.sidebar {
  z-index: 40;
}

.sidebar .brand-mark {
  background: var(--primary);
}

.sidebar-brand strong {
  color: #1d2939;
}

.sidebar-brand span {
  color: #607089;
}

.nav {
  display: grid;
  gap: 8px;
  padding: 14px 12px;
}

.nav button {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 0 12px;
  color: #263a59;
  background: transparent;
  text-align: left;
}

.nav button.active {
  color: #1e3f78;
  background: #f0f4fa;
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px 20px;
  border-top: 1px solid #edf1f6;
  color: #65758d;
  font-size: 13px;
}

.sidebar-footer button {
  margin-top: 12px;
  color: #263a59;
  background: transparent;
  padding: 0;
}

.content {
  min-width: 0;
  padding: 34px 24px 56px 32px;
}

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

.page-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.page-head p {
  margin: 0;
  color: #607089;
}

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

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

.yuandian-search-panel {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 45, 74, 0.06);
}

.analysis-workspace .analysis-page-head {
  width: min(1040px, 100%);
  margin: 0 auto 20px;
}

.analysis-page-head.has-conversation,
.ai-dialog-window.has-conversation {
  width: min(1440px, 100%);
}

.analysis-page-head:not(.has-conversation) {
  visibility: hidden;
  height: 0;
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ai-dialog-window {
  width: min(1040px, 100%);
  min-height: calc(100vh - 124px);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}

.ai-dialog-window.is-empty {
  justify-content: center;
  padding-bottom: 8vh;
}

.ai-empty-state {
  margin-bottom: 26px;
  text-align: center;
}

.ai-empty-mark,
.ai-answer-mark {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  font-weight: 850;
}

.ai-empty-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 8px;
  font-size: 20px;
}

.ai-empty-state h2 {
  margin: 0;
  color: #14213a;
  font-size: 25px;
  letter-spacing: 0;
}

.ai-empty-state p {
  margin: 10px 0 0;
  color: #687890;
}

.analysis-composer {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(32, 52, 84, 0.1);
}

.analysis-composer.is-follow-up {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  border-color: #d8e0eb;
  box-shadow: 0 12px 30px rgba(32, 52, 84, 0.14);
}

.analysis-composer.is-follow-up textarea {
  min-height: 68px;
  max-height: 150px;
  line-height: 1.65;
}

.analysis-composer textarea {
  min-height: 112px;
  padding: 4px 4px 10px;
  border: 0;
  border-radius: 0;
  line-height: 1.75;
  resize: vertical;
}

.analysis-composer:not(.is-follow-up) textarea {
  min-height: 150px;
}

.analysis-composer textarea:focus {
  border: 0;
  box-shadow: none;
}

.analysis-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.analysis-options {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analysis-file-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid #d9e0ea;
  border-radius: 6px;
  color: #233450;
  background: #f8fafc;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.analysis-file-button input {
  display: none;
}

.analysis-file-names {
  min-width: 0;
  overflow: hidden;
  color: #687890;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-submit {
  min-width: 104px;
  min-height: 38px;
}

.analysis-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border-left: 3px solid var(--primary);
  color: #29456f;
  background: #f2f6fc;
  font-size: 13px;
}

.analysis-composer .analysis-progress {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dce6f4;
  border-radius: 10px;
}

.analysis-composer .analysis-progress > div { display: grid; gap: 3px; }
.analysis-composer .analysis-progress > div > strong { color: #254574; font-size: 13px; }
.analysis-composer .analysis-progress > div > span { color: #617089; font-size: 12px; }

.analysis-upload-list { color: #526681; font-size: 13px; line-height: 1.7; }
.material-analysis-card { display: grid; gap: 14px; }
.material-auto-route { display: flex; flex-wrap: wrap; gap: 8px; }
.material-auto-route span { padding: 5px 9px; border: 1px solid #d9e3f0; border-radius: 999px; color: #425a77; background: #f7f9fc; font-size: 12px; }
.material-overview { display: grid; gap: 12px; padding: 18px; border: 1px solid #dce5f0; border-radius: 12px; background: #f8fafc; }
.material-overview h2 { margin: 0; color: #172c47; font-size: 20px; line-height: 1.45; }
.material-overview-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #63758d; font-size: 12px; }
.material-risk { padding: 4px 8px; border-radius: 5px; font-weight: 700; }
.material-risk-high { color: #a52a2a; background: #fde8e7; }
.material-risk-medium { color: #8a5315; background: #fff3df; }
.material-risk-low { color: #27653c; background: #e7f5eb; }
.material-risk-pending { color: #52657d; background: #eaf0f7; }
.material-key-points { display: grid; gap: 7px; padding-top: 2px; }
.material-key-points strong { color: #304966; font-size: 13px; }
.material-key-points ul { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: #26394f; line-height: 1.55; }
.material-source-status { margin: 0; color: #63758d; font-size: 13px; }
.material-summary { margin: 0; color: #26394f; line-height: 1.75; }
.material-analysis-card h3 { margin: 4px 0 0; font-size: 15px; }
.material-finding-list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.material-finding { display: flex; gap: 12px; padding: 14px; border: 1px solid #e0e7f1; border-radius: 9px; background: #fff; }
.material-priority { flex: none; align-self: start; padding: 3px 7px; border-radius: 4px; color: #8a5315; background: #fff3df; font-size: 11px; }
.material-finding div { display: grid; gap: 5px; }
.material-finding strong { color: #263f62; font-size: 13px; }
.material-finding p { margin: 0; color: #24364d; line-height: 1.55; }
.material-finding div > span { color: #536981; line-height: 1.6; }
.material-next-steps { padding: 12px 14px; border-radius: 8px; background: #f5f8fc; }
.material-next-steps ul { margin: 7px 0 0; padding-left: 19px; }

.analysis-stage-track {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5f2;
}

.analysis-stage-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.analysis-stage-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-stage-steps li {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  color: #7a879a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-stage-steps li > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid #aebbd0;
  border-radius: 50%;
  background: #fff;
}

.analysis-stage-steps li.is-complete,
.analysis-stage-steps li.is-current {
  color: #244b88;
  font-weight: 750;
}

.analysis-stage-steps li.is-complete > span,
.analysis-stage-steps li.is-current > span {
  border-color: var(--primary);
  background: var(--primary);
}

.analysis-stage-steps li.is-current > span {
  box-shadow: 0 0 0 3px rgba(39, 74, 134, 0.13);
}

.analysis-composer .analysis-progress > strong {
  color: #40516b;
  font-size: 12px;
  font-weight: 650;
}

.ai-review-note {
  margin: 12px 0 0;
  color: #8a97aa;
  font-size: 12px;
  text-align: center;
}

.ai-thread {
  display: grid;
  gap: 28px;
}

.ai-user-message {
  width: min(720px, 82%);
  justify-self: end;
  padding: 13px 16px;
  border: 0;
  border-radius: 8px;
  background: #edf2f8;
}

.ai-user-message span {
  color: #607089;
  font-size: 12px;
  font-weight: 750;
}

.ai-user-message p {
  margin: 6px 0 0;
  color: #1f2d43;
  line-height: 1.75;
  white-space: pre-wrap;
}

.ai-answer-document {
  min-width: 0;
  padding: 0;
}

.ai-related-sources {
  position: sticky;
  top: 18px;
  min-width: 0;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  padding-left: 18px;
  border-left: 1px solid #e1e7ef;
  background: transparent;
}

.ai-related-sources > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 12px;
}

.ai-related-sources > header span {
  color: #718096;
  font-size: 12px;
}

.ai-source-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 12px;
  padding: 3px;
  border-radius: 6px;
  background: #eef2f7;
}

.ai-source-tabs button {
  min-height: 32px;
  border-radius: 5px;
  color: #607089;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.ai-source-tabs button[aria-selected="true"] {
  color: #244b88;
  background: #fff;
  box-shadow: 0 1px 3px rgba(32, 52, 84, 0.1);
}

.ai-source-list {
  max-height: calc(100vh - 132px);
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 0 0 12px;
}

.ai-source-list article {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 12px 0 14px 24px;
  border-bottom: 1px solid #e4e9f0;
  background: transparent;
}

.ai-source-list article small {
  position: absolute;
  top: 13px;
  left: 0;
  color: #8794a8;
  font-weight: 750;
}

.ai-source-list article strong {
  color: #1d2939;
  font-size: 13px;
  line-height: 1.5;
}

.ai-source-list article span {
  color: #718096;
  font-size: 12px;
  line-height: 1.5;
}

.ai-source-list article p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #43516a;
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.ai-source-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.ai-source-actions .text-btn {
  min-height: 28px;
  padding: 3px 0;
  font-size: 12px;
}

.ai-source-placeholder {
  padding: 18px 14px;
  border: 1px dashed #d5dde8;
  border-radius: 8px;
  color: #607089;
  background: #f8fafc;
}

.ai-source-placeholder strong {
  color: #34445c;
  font-size: 13px;
}

.ai-source-placeholder p {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.65;
}

.ai-dialog-window.has-conversation .analysis-composer,
.ai-dialog-window.has-conversation .ai-review-note {
  width: 100%;
}

.ai-answer-document .yuandian-result {
  margin-top: 0;
}

.ai-answer-document .yuandian-result > header {
  display: none;
}

.ai-answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e4eaf2;
}

.ai-answer-identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ai-answer-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 6px;
  font-size: 14px;
}

.ai-answer-identity strong,
.ai-answer-identity span {
  display: block;
}

.ai-answer-identity span {
  margin-top: 3px;
  color: #718096;
  font-size: 12px;
}

.ai-answer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid #e4eaf2;
  color: #718096;
  font-size: 13px;
}

.ai-answer-actions > div {
  display: flex;
  gap: 18px;
}

.analysis-progress[hidden] {
  display: none;
}

.analysis-progress-indicator {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid #b8c8df;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: analysis-spin 0.8s linear infinite;
}

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

.yuandian-search-panel .section-title {
  margin-bottom: 14px;
}

.yuandian-search-panel h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.yuandian-search-form {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(320px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.case-region-status {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid #2f5ca8;
  color: #29456f;
  background: #f2f6fc;
  font-size: 13px;
}

.case-region-status.fallback {
  border-left-color: #c1841a;
  color: #76520f;
  background: #fff8e8;
}

.yuandian-search-form button {
  min-width: 96px;
}

.case-context-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #f8fafd;
}

.case-context-panel summary {
  cursor: pointer;
  color: #253246;
  font-weight: 750;
}

.case-context-panel label,
.case-context-panel small {
  display: block;
  margin-top: 10px;
  color: #607089;
  font-size: 13px;
}

.case-context-panel textarea {
  margin-top: 8px;
  background: #fff;
}

.search-empty {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  color: #607089;
  background: #f6f8fb;
}

.yuandian-result {
  margin-top: 16px;
}

.yuandian-result header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.yuandian-result header strong,
.yuandian-result header span {
  display: block;
}

.yuandian-result header span {
  margin-top: 4px;
  color: #607089;
  font-size: 13px;
}

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

.yuandian-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #f8fafd;
}

.yuandian-card.fail {
  border-color: #f2b8b5;
  background: #fff8f7;
}

.yuandian-card.notice {
  border-color: #f4d58d;
  background: #fffaf0;
}

.yuandian-card.notice small {
  display: block;
  margin-top: 8px;
  color: #7a5a14;
  line-height: 1.6;
}

.yuandian-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.yuandian-card h3 {
  margin: 0;
  font-size: 15px;
}

.yuandian-card-head span {
  color: #607089;
  font-size: 13px;
}

.resolved-company {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
}

.resolved-company strong {
  color: #284f91;
  font-size: 13px;
}

.resolved-company span {
  color: #334155;
  font-size: 13px;
  word-break: break-word;
}

.yuandian-card pre {
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  color: #1f2937;
  background: #fff;
  border: 1px solid #e4eaf2;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
}

.structured-fail {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #f2b8b5;
  background: #fff8f7;
}

.structured-fail p {
  margin: 6px 0 0;
  color: #8a2d24;
}

.structured-fail small {
  display: block;
  margin-top: 8px;
  color: #8a2d24;
}

.structured-empty {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #dce4ef;
  background: #fff;
}

.structured-empty strong,
.structured-empty p {
  display: block;
}

.structured-empty p {
  margin: 8px 0 0;
  color: #607089;
  line-height: 1.7;
}

.attempted-queries {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  color: #607089;
  font-size: 13px;
}

.attempted-queries b {
  padding: 3px 8px;
  border-radius: 999px;
  color: #284f91;
  background: #eef4ff;
  font-weight: 700;
}

.search-hit {
  color: #c1121f;
  background: transparent;
  font-weight: 800;
}

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

.case-search-list {
  display: grid;
  gap: 12px;
}

.case-priority-tip {
  padding: 10px 12px;
  border: 1px solid #f4c7c3;
  border-radius: 8px;
  color: #b42318;
  background: #fff7f6;
  font-size: 13px;
  font-weight: 700;
}

.case-search-item {
  padding: 14px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fff;
}

.case-research-workspace {
  margin-top: 12px;
}

.case-research-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e4eaf2;
}

.case-research-toolbar strong,
.case-research-toolbar span {
  display: block;
}

.case-research-toolbar span {
  margin-top: 5px;
  color: #607089;
  font-size: 13px;
}

.case-search-item.selectable {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
}

.case-select {
  padding-top: 2px;
}

.case-select input {
  width: 18px;
  height: 18px;
}

.case-search-body {
  min-width: 0;
}

.text-btn {
  padding: 3px 0;
  color: #284f91;
  background: transparent;
  font-weight: 750;
}

.analysis-notice,
.analysis-warning {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-left: 3px solid #3f6cab;
  color: #43516a;
  background: #f1f5fb;
  line-height: 1.65;
}

.analysis-warning {
  margin-top: 12px;
  border-left-color: #b54708;
  background: #fff8eb;
}

.legal-answer {
  margin-bottom: 14px;
  padding: 18px 0;
  border-bottom: 1px solid #dce4ef;
}

.legal-answer h3,
.legal-answer h4,
.legal-answer p {
  margin: 0;
}

.legal-answer-direct {
  margin-top: 10px !important;
  color: #17233a;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.legal-conclusions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.legal-conclusions article,
.legal-basis article {
  padding: 12px 14px;
  border-left: 3px solid #315d9d;
  background: #f6f8fb;
}

.legal-conclusions header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.legal-conclusions header span,
.legal-conclusions small {
  color: #607089;
}

.legal-conclusions p,
.legal-basis p {
  margin-top: 6px !important;
  color: #43516a;
  line-height: 1.7;
}

.legal-basis {
  margin-top: 14px;
}

.legal-basis summary {
  margin-bottom: 8px;
  color: #284f91;
  cursor: pointer;
  font-weight: 750;
}

.legal-basis article + article {
  margin-top: 8px;
}

.legal-basis blockquote {
  margin: 8px 0 0;
  color: #33445f;
  line-height: 1.7;
}

.legal-follow-up {
  margin-top: 14px;
}

.analysis-priority-grid {
  margin-top: 14px;
}

.analysis-full-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e4eaf2;
}

.analysis-full-details > summary {
  color: #284f91;
  cursor: pointer;
  font-weight: 750;
}

.analysis-full-details[open] > summary {
  margin-bottom: 12px;
}

.analyzed-case-list {
  display: grid;
  gap: 14px;
}

.analyzed-case {
  padding: 20px 0;
  border: 0;
  border-top: 1px solid #e1e7ef;
  border-radius: 8px;
  background: transparent;
}

.case-assessment-summary {
  padding-top: 0;
  border-top: 0;
}

.related-case-analysis {
  padding-bottom: 14px;
}

.case-comparison-summary {
  margin-top: 16px;
}

.case-analysis-details {
  margin-top: 14px;
}

.analyzed-case > header,
.analyzed-case > footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.analyzed-case h3,
.analyzed-case h4,
.analyzed-case p {
  margin: 0;
}

.analyzed-case header p,
.analyzed-case footer {
  margin-top: 6px;
  color: #607089;
  font-size: 13px;
}

.overall-score {
  flex: 0 0 auto;
  color: #1f4f8b;
  font-size: 30px;
}

.overall-score small {
  margin-left: 2px;
  font-size: 12px;
}

.six-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.six-score-grid > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 10px;
  background: #f6f8fb;
}

.six-score-grid span {
  color: #52637a;
  font-size: 13px;
}

.six-score-grid i {
  grid-column: 1 / -1;
  height: 4px;
  background: linear-gradient(to right, #3f6cab var(--score), #dce4ef var(--score));
}

.comparison-grid,
.strategy-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.comparison-grid section,
.strategy-map section {
  padding: 12px;
  border: 0;
  border-left: 2px solid #d9e2ee;
  background: #f7f9fc;
}

.comparison-grid h4,
.strategy-map h4 {
  margin-bottom: 8px;
  font-size: 14px;
}

.comparison-grid ul,
.strategy-map ul {
  margin: 0;
  padding-left: 18px;
  color: #43516a;
  line-height: 1.65;
}

.analysis-log,
.excluded-cases {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #e4eaf2;
  background: #fbfcfe;
}

.citable-points {
  margin-top: 12px;
  padding: 12px;
  border-left: 3px solid #526b8f;
  background: #f8fafd;
}

.citable-points h4 {
  margin: 0 0 10px;
}

.citable-points blockquote {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 2px solid #c7d2e3;
  background: #fff;
}

.citable-points blockquote p,
.citable-points blockquote small {
  display: block;
  margin: 6px 0 0;
  color: #52637a;
  line-height: 1.65;
}

.analysis-log summary,
.excluded-cases summary {
  cursor: pointer;
  color: #284f91;
  font-weight: 750;
}

.analysis-log dl {
  margin-bottom: 0;
}

.strategy-map {
  margin-top: 12px;
}

.strategy-map .assert { border-top: 3px solid #16835b; }
.strategy-map .evidence { border-top: 3px solid #c1811b; }
.strategy-map .defense { border-top: 3px solid #526b8f; }
.strategy-map .risk { border-top: 3px solid #b42318; }

.excluded-cases .analyzed-case-list {
  margin-top: 12px;
}

.case-search-item h4 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 15px;
  line-height: 1.5;
}

.case-search-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.case-search-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  color: #607089;
  background: #f1f5f9;
  font-size: 12px;
}

.case-search-item p {
  max-height: 110px;
  overflow: auto;
  margin: 0;
  color: #374151;
  line-height: 1.75;
}

.case-search-item .source-note {
  margin-top: 8px;
  color: #6b7280;
}

.case-search-item footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #607089;
  font-size: 13px;
}

.case-search-item a {
  color: #284f91;
  font-weight: 700;
  text-decoration: none;
}

.case-search-meta .region-priority-tag {
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #f4c7c3;
}

.structured-item {
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e4eaf2;
}

.structured-item h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.structured-item dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.structured-item dt {
  color: #607089;
  font-weight: 700;
}

.structured-item dd {
  margin: 0;
  color: #1f2937;
  word-break: break-word;
}

.stat-card,
.list-panel,
.detail-panel,
.management-panel,
.modal-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 45, 74, 0.06);
}

.fulltext-modal {
  width: min(1040px, 100%);
}

.fulltext-modal .modal-head {
  position: sticky;
  top: -22px;
  z-index: 1;
  padding: 14px 0;
  background: #fff;
  border-bottom: 1px solid #e4eaf2;
}

.fulltext-modal .modal-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.fulltext-modal .modal-head p,
.fulltext-source {
  margin: 0;
  color: #607089;
  font-size: 13px;
}

.fulltext-source {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.fulltext-content {
  margin: 0;
  padding: 18px;
  border: 1px solid #e4eaf2;
  color: #253246;
  background: #fbfcfe;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.9;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.management-panel {
  padding: 20px;
}

.management-panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.management-panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #253246;
  font-weight: 650;
}

.management-panel.wide {
  min-width: 0;
}

.management-list {
  display: grid;
  gap: 12px;
}

.management-card {
  padding: 14px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #fff;
}

.management-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.management-card header strong {
  font-size: 15px;
}

.management-card header span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #284f91;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 750;
}

.management-card p {
  margin: 0 0 10px;
  color: #607089;
  line-height: 1.7;
}

.management-card dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.management-card dt {
  color: #607089;
  font-weight: 750;
}

.management-card dd {
  margin: 0;
  color: #1f2937;
  word-break: break-word;
}

.member-grid,
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.member-card,
.permission-card {
  padding: 14px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #f8fafd;
}

.member-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
}

.member-feishu-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e4eaf2;
}

.member-feishu-form label {
  display: grid;
  gap: 6px;
  color: #52637a;
  font-size: 12px;
  font-weight: 700;
}

.member-feishu-form input,
.member-feishu-form button {
  min-height: 36px;
}

.member-card strong,
.member-card span,
.member-card p,
.permission-card h3,
.permission-card p {
  display: block;
  margin: 0;
}

.member-card span,
.member-card p,
.permission-card p {
  margin-top: 6px;
  color: #607089;
}

.permission-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.permission-card span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #284f91;
  background: #eef4ff;
  font-size: 12px;
}

.small-danger {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.sub-title {
  margin-top: 22px !important;
}

.inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.stat-card {
  min-height: 122px;
  padding: 20px;
  display: grid;
  align-content: space-between;
}

.stat-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #566987;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  color: #121a28;
}

.stat-card p {
  margin: 0;
  color: #667997;
  font-size: 13px;
}

.list-panel {
  padding: 20px;
}

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

.list-head h2 {
  margin: 0;
  font-size: 18px;
}

.search {
  max-width: 320px;
}

.case-rows {
  display: grid;
  gap: 8px;
}

.ai-conversation-window {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.ai-conversation-window.is-empty {
  justify-content: initial;
  padding-bottom: 0;
}

.ai-conversation-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  padding: 0 18px 0 0;
  border-right: 1px solid #e1e7ef;
  background: transparent;
}

.ai-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-history-header > strong {
  color: #40516b;
  font-size: 13px;
}

.ai-history-header .primary-btn {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
}

.ai-conversation-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 210px);
  overflow: auto;
}

.ai-conversation-list > p {
  margin: 4px 0;
  color: #8794a8;
  font-size: 13px;
}

.ai-conversation-list button {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 9px;
  border-radius: 6px;
  color: #263750;
  background: transparent;
  text-align: left;
}

.ai-conversation-list button:hover,
.ai-conversation-list button.active {
  background: #edf2f8;
}

.ai-conversation-list button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.ai-conversation-list button small {
  overflow: hidden;
  color: #75849a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-conversation-stage {
  min-width: 0;
  scroll-padding-bottom: 154px;
}

.ai-dialog-window.has-conversation .ai-conversation-stage {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.ai-dialog-window.has-conversation .ai-thread {
  min-height: 0;
  padding: 0 10px 14px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (min-width: 1181px) {
  .ai-dialog-window.has-conversation {
    grid-template-columns: 184px minmax(420px, 1fr) minmax(236px, 268px);
    gap: 24px;
    height: calc(100vh - 164px);
    min-height: 560px;
    overflow: hidden;
  }

  .ai-dialog-window.has-conversation .ai-conversation-stage {
    height: 100%;
  }

  .ai-dialog-window.has-conversation .ai-conversation-sidebar,
  .ai-dialog-window.has-conversation .ai-related-sources {
    align-self: stretch;
    min-height: 0;
    max-height: 100%;
  }

  .ai-dialog-window.has-conversation .ai-conversation-list,
  .ai-dialog-window.has-conversation .ai-source-list {
    max-height: calc(100% - 48px);
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .ai-conversation-window.has-conversation {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 24px;
  }

  .ai-conversation-window.has-conversation .ai-conversation-stage {
    height: max(500px, calc(100dvh - 164px));
  }

  .ai-conversation-window.has-conversation .ai-related-sources {
    position: static;
    grid-column: 2;
    max-height: 420px;
    margin-top: 8px;
  }
}

.ai-conversation-turn {
  display: grid;
  gap: 14px;
}

.ai-conversation-turn + .ai-conversation-turn {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid #e1e7f0;
}

.ai-archived-answer {
  padding: 18px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #fff;
}

.ai-archived-answer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #61718a;
}

.ai-archived-answer > header strong {
  color: #1f2d43;
}

.conversation-turn-progress {
  margin-left: 12%;
}

.case-row {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-radius: 8px;
  padding: 14px 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.case-row + .case-row {
  border-top: 1px solid #edf1f6;
  border-radius: 0;
}

.case-row h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.case-row p,
.case-meta {
  margin: 0;
  color: #607089;
  font-size: 14px;
}

.case-side {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #607089;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #9a6412;
  background: var(--warning);
  font-size: 13px;
  font-weight: 750;
}

.badge.done {
  color: #147245;
  background: var(--success);
}

.empty {
  padding: 24px 0;
  color: #607089;
}

.detail-panel {
  padding: 22px;
}

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

.detail-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.detail-header p {
  margin: 0;
  color: #607089;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tags,
.scores,
.analysis-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tags {
  margin: 18px 0;
}

.tags div,
.scores div,
.recognition-grid div {
  display: grid;
  gap: 5px;
  min-height: 68px;
  padding: 12px;
  border-radius: 8px;
  background: #f5f7fb;
}

.tags span,
.scores span,
.recognition-grid span {
  color: #697b95;
  font-size: 13px;
}

.classification-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title h3 {
  margin: 0 0 6px;
}

.section-title p {
  margin: 0;
  color: #607089;
  line-height: 1.7;
}

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

.recognition-grid div {
  background: #f7f9fd;
}

.recognition-basis {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  color: #4e5e74;
  background: #f6f8fb;
}

.recognition-basis p {
  margin: 6px 0;
}

.recognition-basis small {
  color: #7a8798;
}

.materials {
  margin: 18px 0 4px;
}

.materials h3,
.analysis-card h3,
.table-panel h2,
.similar h2,
.similar-card h3 {
  margin: 0 0 10px;
}

.materials span,
.file-chip {
  display: inline-flex;
  align-items: center;
  margin: 0 8px 8px 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: #edf2f7;
  color: #43516a;
  font-size: 13px;
}

.file-chip {
  cursor: pointer;
}

.file-chip:hover {
  background: #dfe8f3;
}

.analysis-grid {
  margin-top: 18px;
}

.analysis-card,
.table-panel,
.similar-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.analysis-card p,
.similar-card p,
dd {
  margin: 0;
  color: #4f5d72;
  line-height: 1.7;
}

.table-panel,
.similar {
  margin-top: 18px;
}

.table-panel {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e7edf4;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f6f8fb;
  color: #253246;
}

.similar {
  display: grid;
  gap: 14px;
}

.scores {
  margin: 14px 0;
}

dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 14px;
}

dt {
  color: #253246;
  font-weight: 800;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.35);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(820px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 22px;
}

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

.modal-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.modal-head p {
  margin: 0;
  color: #607089;
}

.close-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #4c5d75;
  background: #f1f4f8;
  font-size: 20px;
}

.case-form {
  display: grid;
  gap: 2px;
}

.conversation-case-preview {
  width: min(900px, 100%);
}

.case-save-preview-section {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  background: #f8fafc;
}

.case-save-preview-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.case-save-preview-section dl,
.case-save-preview-section ul,
.case-save-preview-section p {
  margin: 0;
}

.case-save-preview-section dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.case-save-preview-section dd {
  margin: 4px 0 0;
}

.case-save-turns {
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow: auto;
}

.case-save-turns article {
  padding: 10px 12px;
  border-left: 3px solid #315d9d;
  background: #fff;
}

.case-save-turns p {
  margin-top: 6px;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .case-save-preview-section dl { grid-template-columns: 1fr; }
}

.file-box {
  min-height: 76px;
  padding: 14px;
  border: 1px dashed #9cacbf;
  border-radius: 8px;
  background: #f7f9fc;
}

.file-box input {
  border: 0;
  padding: 0;
  background: transparent;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.settings-form {
  max-width: 680px;
}

.document-simple-page {
  min-height: calc(100vh - 150px);
  display: grid;
  place-items: start center;
  padding: clamp(72px, 10vh, 128px) 24px 60px;
}

.document-simple-hero {
  width: min(100%, 860px);
  text-align: center;
}

.document-simple-hero > h1 {
  margin: 0;
  color: #172235;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.035em;
}

.document-simple-hero > p {
  margin: 12px 0 36px;
  color: #718097;
  font-size: 18px;
}

.document-type-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.document-type-chip {
  min-height: 42px;
  padding: 0 22px;
  border: 1px solid #d7dfeb;
  border-radius: 999px;
  color: #33445e;
  background: #fff;
  font-weight: 750;
}

.document-type-chip:hover,
.document-type-chip.active {
  border-color: #8fb7f0;
  color: var(--primary);
  background: #eef5ff;
}

.document-type-chip:focus-visible {
  outline: 3px solid rgba(35, 113, 220, 0.22);
  outline-offset: 2px;
}

.document-prompt-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #d7dfeb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(28, 45, 74, 0.08);
  text-align: left;
}

.document-prompt-form textarea {
  width: 100%;
  min-height: 180px;
  box-sizing: border-box;
  resize: vertical;
  border: 0;
  padding: 6px;
  color: #1f2d42;
  background: transparent;
  font: inherit;
  font-size: 17px;
  line-height: 1.75;
  outline: 0;
}

.document-prompt-form textarea::placeholder {
  color: #98a3b3;
}

.document-case-picker {
  padding: 12px;
  border-radius: 8px;
  background: #f7f9fc;
}

.document-case-picker label {
  display: grid;
  gap: 7px;
  color: #34435a;
  font-weight: 700;
}

.document-prompt-status {
  min-height: 0;
  margin: 0;
  color: #b54708;
  font-size: 14px;
}

.document-prompt-status:empty {
  display: none;
}

.document-prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}

.document-case-button {
  max-width: 60%;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid #d7dfeb;
  border-radius: 8px;
  color: #52637b;
  background: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.document-start-button {
  min-width: 148px;
  min-height: 46px;
  font-size: 16px;
}

.document-safety-note {
  display: block;
  margin-top: 16px;
  color: #7b8798;
  font-size: 13px;
}

.document-simple-result {
  max-width: 1040px;
  margin-right: auto;
  margin-left: auto;
}

.settings-block .template-manager {
  margin: 0;
  padding: 0;
  border: 0;
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(460px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.smart-document-workspace {
  grid-template-columns: minmax(520px, 1.08fr) minmax(360px, 0.92fr);
}

.document-form-panel,
.document-preview-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 45, 74, 0.06);
}

.document-form-panel {
  padding: 20px;
}

.document-preview-panel {
  min-height: 620px;
  padding: 20px;
}

.document-status {
  max-width: 360px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #fff;
}

.document-status span {
  color: #1d2939;
  font-weight: 850;
}

.document-status small {
  color: #607089;
  line-height: 1.45;
}

.document-status.ok {
  border-color: #a8d7bb;
  background: #f2fbf5;
}

.document-status.idle {
  border-color: #dbe5f2;
  background: #f8fafc;
}

.segment-control {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: #f0f4fa;
}

.segment-control button {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 14px;
  color: #43516a;
  background: transparent;
  font-weight: 750;
}

.segment-control button.active {
  color: #fff;
  background: var(--primary);
}

.document-form {
  display: grid;
  gap: 2px;
}

.smart-document-form {
  gap: 4px;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 700;
}

.checkbox-row input {
  width: auto;
}

.template-manager {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e7edf4;
}

.template-manager details {
  margin-bottom: 14px;
}

.template-manager summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 800;
}

.template-form {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #f8fafd;
  border: 1px solid #e1e7f0;
}

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

.template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafd;
  border: 1px solid #e1e7f0;
}

.template-item p {
  margin: 5px 0;
  color: #607089;
  line-height: 1.6;
}

.template-item span {
  color: #7a8798;
  font-size: 13px;
}

.document-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #253246;
  font-weight: 650;
}

.document-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #607089;
}

.document-meta strong {
  color: #172229;
}

.document-references {
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  background: #f8fafc;
}

.document-references h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.document-references p {
  margin: 0 0 10px;
  color: #607089;
  font-size: 13px;
}

.document-draft-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(28, 45, 74, 0.06);
}

.document-draft {
  min-height: 520px;
  max-height: 70vh;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfcff;
  color: #1f2937;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
}

.split-actions {
  display: grid;
  grid-template-columns: auto auto 1fr;
}

.split-actions .primary-btn {
  justify-self: end;
}

.template-search-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #607089;
}

.template-search-meta strong {
  color: #172229;
}

.template-result-list {
  display: grid;
  gap: 12px;
}

.template-result-item {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid #e1e7f0;
  border-radius: 8px;
  background: #fbfcff;
}

.template-result-item div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.template-result-item strong {
  color: #172229;
}

.template-result-item span,
.template-result-item p {
  color: #607089;
}

.template-result-item p {
  margin: 0;
  line-height: 1.65;
}

.result-link {
  width: fit-content;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.hint-box {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  color: #4e5e74;
  background: #f6f8fb;
  border: 1px solid #e1e7f0;
}

.audit-panel,
.settings-block {
  margin-top: 18px;
}

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

.audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #edf1f6;
}

.audit-row:first-child {
  border-top: 0;
}

.audit-row p {
  margin: 6px 0 0;
  color: #607089;
}

.audit-row > div:last-child {
  display: grid;
  gap: 4px;
  color: #607089;
  text-align: right;
  white-space: nowrap;
}

.mcp-grid,
.mcp-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mcp-card,
.mcp-result {
  padding: 14px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #f8fafd;
}

.mcp-card div,
.mcp-result header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.mcp-card span,
.mcp-card small,
.mcp-result span {
  color: #607089;
  font-size: 13px;
}

.mcp-card p,
.mcp-result p {
  margin: 0 0 10px;
  color: #43516a;
  line-height: 1.6;
  word-break: break-all;
}

.mcp-results {
  margin-top: 14px;
}

.mcp-result.ok {
  border-color: #b7e3ca;
  background: #f2fbf6;
}

.mcp-result.fail {
  border-color: #f2b8b5;
  background: #fff8f7;
}

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

.tool-list span {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dce4ef;
  color: #43516a;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: #1f3e70;
  box-shadow: 0 12px 30px rgba(31, 62, 112, 0.24);
}

.floating-mark {
  position: fixed;
  right: 0;
  top: 44%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 18px 0 0 18px;
  color: #fff;
  background: #ed8aaa;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 980px) {
  .document-workspace,
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-footer {
    display: none;
  }

  .stats-grid,
  .yuandian-search-form,
  .yuandian-result-grid,
  .mcp-grid,
  .mcp-results,
  .analysis-grid,
  .workspace-grid,
  .tags,
  .scores,
  .recognition-grid,
  .form-grid,
  .split-actions {
    grid-template-columns: 1fr;
  }

  .six-score-grid,
  .comparison-grid,
  .strategy-map {
    grid-template-columns: 1fr;
  }

  .ai-conversation-window {
    grid-template-columns: 1fr;
  }

  .ai-conversation-window.has-conversation .ai-conversation-stage {
    position: sticky;
    top: 14px;
    z-index: 2;
    height: max(460px, calc(100dvh - 28px));
    background: var(--bg);
  }

  .ai-conversation-sidebar {
    position: static;
    padding: 0 0 16px;
    border-right: 0;
    border-bottom: 1px solid #e1e7ef;
  }

  .ai-conversation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 180px;
  }

  .ai-related-sources {
    position: static;
    max-height: none;
    padding: 18px 0 0;
    border-top: 1px solid #e1e7ef;
    border-left: 0;
  }

  .ai-source-list {
    max-height: 420px;
  }

  .ai-dialog-window.has-conversation .analysis-composer,
  .ai-dialog-window.has-conversation .ai-review-note {
    width: 100%;
  }

  .case-research-toolbar,
  .ai-answer-header,
  .analyzed-case > header,
  .analyzed-case > footer,
  .fulltext-source {
    align-items: flex-start;
    flex-direction: column;
  }

  .split-actions .primary-btn {
    justify-self: stretch;
  }
}

@media (max-width: 480px) {
  .ai-conversation-list {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding: 16px;
  }

  .login-form {
    padding: 28px 22px 24px;
  }
}

@media (max-width: 400px) {
  .login-page { padding: 8px; }
  .login-form { padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 700px) {
  .content {
    padding: 22px 14px 40px;
  }

  .document-simple-page {
    min-height: auto;
    padding: 48px 0 32px;
  }

  .document-simple-hero > p {
    margin-bottom: 26px;
    font-size: 16px;
  }

  .document-type-chips {
    justify-content: flex-start;
    gap: 8px;
  }

  .document-type-chip {
    padding: 0 16px;
  }

  .document-prompt-form {
    padding: 14px;
  }

  .document-prompt-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .document-case-button,
  .document-start-button {
    width: 100%;
    max-width: none;
  }

  .page-head,
  .list-head,
  .detail-header,
  .audit-row,
  .case-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .case-side,
  .actions {
    flex-wrap: wrap;
  }

  .ai-dialog-window {
    min-height: calc(100vh - 96px);
  }

  .ai-dialog-window.is-empty {
    justify-content: flex-start;
    padding-top: 8vh;
  }

  .ai-empty-state h2 {
    font-size: 21px;
  }

  .ai-user-message {
    width: 100%;
  }

  .analysis-composer {
    padding: 12px;
  }

  .analysis-composer.is-follow-up {
    gap: 8px;
    margin-top: 18px;
  }

  .analysis-composer.is-follow-up textarea {
    min-height: 64px;
  }

  .analysis-composer-footer,
  .ai-answer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .analysis-composer.is-follow-up .analysis-composer-footer {
    align-items: center;
    flex-direction: row;
  }

  .analysis-composer.is-follow-up .analysis-submit {
    width: auto;
    min-width: 88px;
  }

  .analysis-file-names {
    white-space: normal;
  }

  .analysis-submit {
    width: 100%;
  }

  .audit-row > div:last-child {
    text-align: left;
  }

  dl {
    grid-template-columns: 1fr;
  }
}

/* Case workspace: categorized list and in-platform case reading */
.case-filter-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.case-filter-controls select {
  min-width: 138px;
}

.case-type-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.case-type-tags span {
  padding: 3px 8px;
  border-radius: 999px;
  color: #31588f;
  background: #edf3fb;
  font-size: 12px;
}

.case-progress-label,
.case-row-arrow {
  color: #31588f;
  font-weight: 750;
}

.case-detail-page-head {
  align-items: flex-end;
}

.back-to-cases {
  padding-left: 0;
  margin-bottom: 10px;
}

.case-detail-page {
  border: 1px solid #e1e7ef;
  border-radius: 14px;
  background: #fff;
}

.case-progress-panel,
.case-summary-panel,
.case-management-panel,
.case-documents-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fbfcfe;
}

.case-progress-panel header,
.case-document-list article,
.case-file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.case-progress-panel h3,
.case-summary-panel h3,
.case-documents-panel h3 {
  margin: 0 0 5px;
}

.case-progress-panel header p,
.case-summary-panel p {
  margin: 0;
  color: #607089;
  line-height: 1.7;
}

.case-progress-panel header > strong {
  color: #244b88;
  font-size: 24px;
}

.case-progress-track {
  height: 8px;
  margin: 14px 0 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebf2;
}

.case-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2f5792;
}

.case-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.case-timeline li {
  display: flex;
  gap: 8px;
  color: #8a96a8;
}

.case-timeline li > span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-top: 4px;
  border: 2px solid #b9c4d3;
  border-radius: 50%;
}

.case-timeline li.done > span {
  border-color: #2f5792;
  background: #2f5792;
}

.case-timeline li div {
  display: grid;
  gap: 4px;
}

.case-timeline li strong,
.case-timeline li small {
  font-size: 12px;
}

.case-timeline li.done strong {
  color: #233a5e;
}

.case-management-panel summary {
  color: #244b88;
  cursor: pointer;
  font-weight: 750;
}

.case-management-panel form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.case-type-picker {
  padding: 12px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
}

.case-type-picker legend {
  padding: 0 6px;
  color: #4c5d76;
  font-size: 13px;
}

.case-type-picker > div {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
}

.case-type-picker label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.case-type-picker input {
  width: auto;
}

.progress-field {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-field input {
  flex: 1;
}

.case-file-row,
.case-document-list article {
  padding: 12px 0;
  border-bottom: 1px solid #e6ebf1;
}

.case-file-row > div:first-child,
.case-document-list article > div {
  display: grid;
  gap: 5px;
}

.case-file-row span,
.case-document-list span {
  color: #718096;
  font-size: 12px;
}

.case-file-row > div:last-child {
  display: flex;
  gap: 12px;
}

.case-file-frame {
  width: 100%;
  height: min(72vh, 900px);
  border: 0;
  border-radius: 8px;
  background: #f7f9fc;
}

.case-file-frame.compact {
  min-height: 420px;
}

.case-file-image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  margin: 0 auto;
  object-fit: contain;
}

.law-application {
  padding: 14px 18px;
  border-top: 1px solid #e2e8f0;
}

.law-application p {
  margin-bottom: 0;
  color: #53627a;
}

@media (max-width: 900px) {
  .case-list-toolbar,
  .case-progress-panel header,
  .case-file-row,
  .case-document-list article {
    align-items: stretch;
    flex-direction: column;
  }

  .case-filter-controls {
    justify-content: flex-start;
  }

  .case-timeline {
    grid-template-columns: 1fr;
  }
}

/* 2026-09 production workspace design */
.ui-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
}

.shell {
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar .sidebar-brand {
  min-height: 78px;
  padding: 20px 24px;
  border-bottom: 0;
}

.sidebar .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: #075fc2;
}

.sidebar .brand-mark .ui-icon {
  width: 26px;
  height: 26px;
}

.sidebar-brand strong {
  color: #142033;
  font-size: 18px;
}

.nav {
  gap: 12px;
  padding: 0 20px;
}

.nav button {
  min-height: 50px;
  gap: 14px;
  border-radius: 14px;
  padding: 0 16px;
  color: #536176;
  font-size: 16px;
}

.nav button.active {
  color: #075fc2;
  background: #e7f0fd;
}

.nav button span {
  display: grid;
  place-items: center;
}

.sidebar-footer {
  margin: auto 20px 0;
  padding: 20px 4px 26px;
  color: #768399;
  font-size: 13px;
}

.sidebar-footer .login-state {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-footer .login-state span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #23c76b;
}

.sidebar-footer > strong {
  display: block;
  margin-top: 12px;
  color: #243149;
  font-size: 14px;
}

.sidebar-footer button {
  margin-top: 14px;
  color: #8995a8;
}

.analysis-content {
  height: 100vh;
  padding: 0;
  overflow: hidden;
}

.analysis-workspace {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  overflow: hidden;
  background: #f7f8fa;
}

.analysis-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  padding: 36px 42px 18px;
}

.analysis-workspace > .analysis-main > .analysis-page-head {
  width: 100%;
  height: auto;
  display: flex;
  visibility: visible;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
}

.analysis-page-head h1 {
  margin: 0 0 8px;
  color: #101c31;
  font-size: 27px;
  letter-spacing: -0.02em;
}

.analysis-page-head p {
  margin: 0;
  color: #7b8799;
  font-size: 14px;
}

.analysis-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #d8dee8;
  border-radius: 50%;
  color: #5b697d;
  background: #fff;
}

.icon-button.primary {
  border-color: #075fc2;
  color: #fff;
  background: #075fc2;
}

.icon-button .ui-icon {
  width: 18px;
  height: 18px;
}

.analysis-scroll-region {
  min-height: 0;
  overflow-y: auto;
  padding: 50px 10px 30px;
  scrollbar-gutter: stable;
}

.analysis-workspace.is-empty .analysis-scroll-region {
  display: grid;
  place-items: center;
}

.analysis-workspace.is-empty .ai-empty-state {
  margin: 0 0 4vh;
}

.analysis-workspace .ai-thread {
  width: min(940px, 100%);
  display: grid;
  gap: 30px;
  margin: 0 auto;
}

.analysis-workspace .ai-user-message {
  width: min(700px, 82%);
  padding: 17px 22px;
  border-radius: 28px;
  background: #e5f0ff;
}

.analysis-workspace .ai-user-message span {
  display: none;
}

.analysis-workspace .ai-user-message p {
  margin: 0;
  color: #223149;
  font-size: 16px;
  line-height: 1.7;
}

.analysis-workspace .ai-analysis-card,
.analysis-workspace .ai-archived-answer {
  padding: 26px 28px 24px;
  border: 1px solid #e1e5eb;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 4px 15px rgba(31, 48, 75, 0.07);
}

.analysis-workspace .ai-answer-header {
  margin-bottom: 18px;
  padding: 0;
  border-bottom: 0;
}

.analysis-workspace .ai-answer-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin: 0;
  color: #fff;
  background: #075fc2;
}

.analysis-workspace .ai-answer-identity strong {
  color: #17243a;
  font-size: 15px;
}

.analysis-workspace .ai-answer-identity > div > span {
  display: inline;
  margin: 0 0 0 10px;
}

.analysis-card-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analysis-workspace .legal-answer {
  margin: 0;
  padding: 0;
  border: 0;
}

.analysis-workspace .legal-answer > h3 {
  display: none;
}

.analysis-workspace .legal-answer > .legal-basis {
  display: none;
}

.analysis-workspace .legal-answer-direct {
  margin: 0 !important;
  color: #1c2a40;
  font-size: 16px;
  line-height: 1.95;
}

.analysis-workspace .legal-conclusions article,
.analysis-workspace .legal-basis article {
  border-left: 0;
  border-radius: 10px;
  background: #f7f9fc;
}

.answer-citation-summary {
  margin-top: 20px;
  color: #69768a;
  font-size: 13px;
  font-weight: 700;
}

.answer-citation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.answer-citation-chips span {
  max-width: 100%;
  padding: 8px 12px;
  overflow: hidden;
  border-radius: 999px;
  color: #15945c;
  background: #eaf9f1;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-citation-chips span.pending {
  color: #c26b16;
  background: #fff5e8;
}

.retrieval-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #707d90;
  background: #f1f4f8;
  font-size: 12px;
  font-weight: 650;
}

.retrieval-status .ui-icon {
  width: 18px;
  height: 18px;
  color: #075fc2;
}

.analysis-detail-sections {
  margin-top: 16px;
  color: #40516b;
}

.analysis-detail-sections > summary {
  cursor: pointer;
  color: #075fc2;
  font-size: 13px;
  font-weight: 700;
}

.analysis-workspace .ai-answer-actions {
  margin-top: 18px;
  padding: 0;
  border-top: 0;
}

.analysis-workspace .ai-answer-actions > div:first-child {
  gap: 10px;
}

.analysis-workspace .answer-utility-actions {
  display: flex;
  gap: 16px;
}

.analysis-workspace .analysis-composer {
  width: min(940px, 100%);
  gap: 10px;
  margin: 0 auto;
  padding: 14px 16px;
  border-color: #dde2e9;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(31, 48, 75, 0.08);
}

.analysis-workspace .analysis-composer textarea,
.analysis-workspace .analysis-composer:not(.is-follow-up) textarea,
.analysis-workspace .analysis-composer.is-follow-up textarea {
  min-height: 54px;
  max-height: 120px;
  padding: 2px 8px 6px;
  color: #26354d;
  line-height: 1.65;
}

.analysis-workspace .analysis-file-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  color: #69768a;
  background: #fff;
}

.analysis-workspace .analysis-file-button > span {
  display: none;
}

.analysis-workspace .analysis-file-button .ui-icon {
  width: 20px;
  height: 20px;
}

.analysis-workspace .analysis-submit {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background: #075fc2;
}

.analysis-workspace .analysis-submit .ui-icon {
  width: 22px;
  height: 22px;
}

.analysis-workspace.is-empty .analysis-submit {
  width: auto;
  min-width: 104px;
  border-radius: 9px;
  padding: 0 18px;
}

.analysis-workspace .ai-review-note {
  margin: 8px 0 0;
}

.analysis-workspace .ai-related-sources {
  position: static;
  min-width: 0;
  max-height: none;
  overflow: hidden;
  padding: 34px 28px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid #e3e6eb;
  background: #fff;
  outline: 0;
  transition: box-shadow 180ms ease;
}

.analysis-workspace .ai-related-sources.is-highlighted {
  box-shadow: inset 4px 0 #075fc2;
}

.analysis-workspace .ai-related-sources > header {
  padding: 0;
  color: #17243a;
  font-size: 18px;
}

.analysis-workspace .ai-related-sources > header span {
  display: none;
}

.source-verification-summary {
  margin: 18px 0;
  color: #6f7b8d;
  font-size: 12px;
  line-height: 1.7;
}

.analysis-workspace .ai-source-tabs {
  margin-bottom: 16px;
  border-radius: 999px;
}

.analysis-workspace .ai-source-tabs button {
  border-radius: 999px;
}

.analysis-workspace .ai-source-list {
  max-height: calc(100vh - 185px);
  gap: 16px;
  padding-bottom: 24px;
}

.analysis-workspace .ai-source-list article {
  gap: 8px;
  padding: 18px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: #f7f8fa;
}

.analysis-workspace .ai-source-list article small {
  display: none;
}

.analysis-workspace .ai-source-list article strong {
  font-size: 14px;
}

.source-status {
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.source-status.verified {
  color: #15945c;
  background: #e8f8ef;
}

.source-status.partially-verified,
.source-status.unverified {
  color: #8a5a00;
  background: #fff4d6;
}

.source-status.conflicted,
.source-status.invalid {
  color: #b42318;
  background: #feeceb;
}

.analysis-workspace .ai-source-placeholder {
  margin-top: 20px;
  border-radius: 16px;
}

.analysis-history-backdrop {
  position: fixed;
  inset: 0 0 0 260px;
  z-index: 29;
  background: rgba(16, 28, 48, 0.18);
}

.analysis-history-backdrop[hidden] {
  display: none;
}

.analysis-history-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 260px;
  z-index: 30;
  width: min(360px, calc(100vw - 260px));
  padding: 28px 22px;
  overflow-y: auto;
  border-right: 1px solid #e0e5ec;
  background: #fff;
  box-shadow: 12px 0 30px rgba(27, 43, 68, 0.12);
  transform: translateX(-100%);
  transition: transform 180ms ease;
}

.analysis-history-drawer.is-open {
  transform: translateX(0);
}

.analysis-history-drawer .ai-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: #17243a;
  font-size: 18px;
  font-weight: 800;
}

.analysis-history-drawer .ai-history-header .icon-button {
  width: 32px;
  height: 32px;
  font-size: 22px;
}

.analysis-history-drawer .ai-conversation-list {
  max-height: none;
}

@media (max-width: 1180px) {
  .analysis-workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .analysis-main {
    padding-right: 28px;
    padding-left: 28px;
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar .sidebar-brand {
    min-height: 68px;
  }

  .nav {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
    overflow-x: auto;
  }

  .nav button {
    flex: 0 0 auto;
  }

  .analysis-content,
  .analysis-workspace {
    height: calc(100vh - 132px);
  }

  .analysis-workspace {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .analysis-main {
    min-height: calc(100vh - 132px);
  }

  .analysis-workspace .ai-related-sources {
    min-height: 420px;
    border-top: 1px solid #e3e6eb;
    border-left: 0;
  }

  .analysis-history-backdrop {
    inset: 0;
  }

  .analysis-history-drawer {
    left: 0;
    width: min(360px, 88vw);
  }
}

@media (max-width: 700px) {
  .analysis-main {
    padding: 22px 14px 14px;
  }

  .analysis-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .analysis-head-actions {
    width: 100%;
  }

  .analysis-scroll-region {
    padding: 30px 0 20px;
  }

  .analysis-workspace .ai-user-message {
    width: 94%;
  }

  .analysis-workspace .ai-analysis-card,
  .analysis-workspace .ai-archived-answer {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .analysis-workspace .ai-answer-actions {
    align-items: flex-start;
  }
}
.practice-actions { margin: 18px 0; display: grid; gap: 16px; }
.practice-actions summary { cursor: pointer; color: #244b80; font-weight: 600; padding: 10px 0; }
.comparison-scroll { overflow-x: auto; max-width: 100%; }
.comparison-scroll table { min-width: 800px; border-collapse: collapse; }
.comparison-scroll th, .comparison-scroll td { min-width: 200px; padding: 12px; vertical-align: top; border-bottom: 1px solid #dbe3ee; }
.material-task { padding: 14px 0; border-bottom: 1px solid #dbe3ee; }
.material-task select { display: block; width: 100%; min-height: 80px; }
.document-edit-content { width: 100%; min-height: 40vh; line-height: 1.8; padding: 16px; box-sizing: border-box; }
.document-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.document-comparison section { min-width: 0; background: #f5f7fa; padding: 12px; }
.document-comparison pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; }
@media (max-width: 768px) { .document-comparison { grid-template-columns: 1fr; } }
.source-card-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.case-timeline { display: grid; gap: 12px; margin-top: 16px; }
.timeline-event { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid #dbe3ee; }
.timeline-event-date { color: #667085; font-weight: 700; }
.timeline-event header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timeline-event p { white-space: pre-wrap; }
.timeline-version { padding: 10px 12px; margin-top: 8px; background: #f5f7fa; border-radius: 8px; }
.undated-events { margin-top: 16px; }
@media (max-width: 720px) { .timeline-event { grid-template-columns: 1fr; gap: 6px; } }
.evidence-matrix-panel { margin-top: 22px; }
.evidence-matrix th > small { display: block; margin-top: 6px; color: #667085; font-weight: 500; }
.evidence-matrix-item { display: grid; gap: 7px; padding: 12px; margin-bottom: 10px; background: #f7f9fc; border: 1px solid #dbe3ee; border-radius: 10px; }
.evidence-matrix-item:last-child { margin-bottom: 0; }
.evidence-matrix-item header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.evidence-matrix-item header span { color: #667085; font-size: 13px; white-space: nowrap; }
.evidence-matrix-item p { margin: 0; white-space: pre-wrap; }
.evidence-gap { margin: 0; padding: 12px; color: #9f2d24; background: #fff4f2; border: 1px dashed #e1a49e; border-radius: 8px; }
.case-analysis-records { margin-top: 22px; }
.case-analysis-record { margin-top: 12px; padding: 0 16px 16px; border: 1px solid #dbe3ee; border-radius: 12px; background: #fff; }
.case-analysis-record > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer; font-weight: 700; }
.case-analysis-record > summary small { color: #667085; font-weight: 500; }
.case-analysis-record.is-superseded { background: #f6f7f9; opacity: .88; }
.analysis-snapshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.analysis-snapshot-grid section { padding: 12px; background: #f7f9fc; border-radius: 9px; }
.analysis-snapshot-grid h4, .analysis-snapshot-grid p { margin: 0 0 7px; }
.analysis-superseded-note, .analysis-review-note { padding: 10px 12px; background: #fff7e8; border-radius: 8px; }
.analysis-review-actions { display: flex; align-items: end; gap: 10px; margin: 12px 0; }
.analysis-review-actions label { flex: 1; }
.analysis-review-actions textarea { width: 100%; min-height: 70px; box-sizing: border-box; }
@media (max-width: 720px) { .analysis-snapshot-grid { grid-template-columns: 1fr; } .analysis-review-actions { align-items: stretch; flex-direction: column; } }
.analysis-revision-panel { margin: 16px 0; padding: 14px; border: 1px solid #cfdbea; border-radius: 10px; background: #fbfcfe; }
.analysis-revision-current { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.analysis-revision-current article { padding: 12px; background: #fff; border: 1px solid #dbe3ee; border-radius: 8px; }
.analysis-revision-current p { white-space: pre-wrap; }
.analysis-revision-current small { color: #667085; }
.analysis-revision-history { padding: 12px 0; border-top: 1px solid #dbe3ee; }
.analysis-revision-history header { display: flex; justify-content: space-between; gap: 12px; }
.analysis-revision-history p { white-space: pre-wrap; }
.analysis-revision-forms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.analysis-revision-forms form { padding: 12px; background: #fff; border: 1px solid #dbe3ee; border-radius: 8px; }
.analysis-revision-forms textarea { width: 100%; min-height: 90px; box-sizing: border-box; }
.analysis-original-note { color: #667085; font-weight: 600; }
@media (max-width: 900px) { .analysis-revision-current, .analysis-revision-forms { grid-template-columns: 1fr; } }
.case-lifecycle-panel { margin: 18px 0; padding: 14px 16px; background: #f7f9fc; border: 1px solid #dbe3ee; border-radius: 12px; }
.case-status-form { display: grid; grid-template-columns: minmax(180px, .45fr) 1fr auto; align-items: end; gap: 12px; }
.case-status-form textarea { width: 100%; min-height: 70px; box-sizing: border-box; }
@media (max-width: 720px) { .case-status-form { grid-template-columns: 1fr; } }

/* Case library and private case workspace */
.case-library-head, .my-cases-head { align-items: end; }
.case-library-title-line { display: flex; align-items: center; gap: 14px; }
.case-library-title-line h1 { margin: 0; }
.case-library-title-line span { padding: 5px 9px; color: #175cd3; background: #eff4ff; border-radius: 6px; font-size: 12px; font-weight: 700; }
.case-library-search { display: grid; gap: 14px; margin: 22px 0 0; padding: 0; background: #fff; border: 1px solid #dbe3ee; border-radius: 14px 14px 0 0; overflow: hidden; }
.case-library-search form { display: flex; gap: 10px; padding: 18px 18px 0; }
.case-library-search input { flex: 1; min-width: 0; min-height: 46px; padding-left: 16px; font-size: 15px; }
.case-library-filter-row { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: start; gap: 12px; padding: 0 18px; }
.case-library-filter-row > strong { padding-top: 8px; color: #344054; font-size: 13px; }
.case-library-tabs, .case-library-categories, .case-library-causes, .my-case-status-tabs, .my-case-category-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.case-library-tabs { padding: 0 18px; border-top: 1px solid #e7ecf3; }
.case-library-tabs button { padding: 14px 18px 12px; border-radius: 0; border-bottom: 3px solid transparent; background: transparent; }
.case-library-tabs button.active { color: #155eef; background: transparent; border-color: transparent transparent #155eef; }
.case-library-categories button, .case-library-causes button, .my-case-status-tabs button, .my-case-category-tabs button, .case-intake-tabs button { padding: 8px 14px; color: #475467; background: #f6f8fb; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.case-library-categories button.active, .case-library-causes button.active, .my-case-status-tabs button.active, .my-case-category-tabs button.active, .case-intake-tabs button.active { color: #0b5fd7; background: #eaf2ff; border-color: #b9d3fb; font-weight: 700; }
.case-library-results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 18px; color: #475467; background: #fff; border: 1px solid #dbe3ee; border-top: 0; }
.case-library-results-toolbar label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.case-library-results-toolbar select { width: auto; min-width: 144px; padding: 8px 32px 8px 10px; }
.case-library-privacy, .my-cases-privacy, .case-intake-privacy { margin: 12px 0 16px; padding: 10px 14px; color: #24613f; background: #eef9f2; border: 1px solid #bce1c9; border-radius: 8px; font-size: 13px; }
.case-library-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.case-library-card { display: grid; gap: 12px; padding: 18px 20px; background: #fff; border: 1px solid #dbe3ee; border-radius: 12px; box-shadow: 0 3px 12px rgba(16, 24, 40, .035); }
.case-library-card header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.case-library-card h3, .case-library-card p { margin: 0; }
.case-library-card h3 { color: #182230; font-size: 17px; }
.case-library-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.case-source-badge, .case-verified-badge, .case-anonymized-badge, .case-version-badge { padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.case-source-badge { color: #175cd3; background: #eff4ff; }
.case-source-badge.internal { color: #93370d; background: #fff4ed; }
.case-verified-badge { color: #067647; background: #ecfdf3; }
.case-anonymized-badge { color: #175cd3; background: #eef4ff; }
.case-version-badge { color: #475467; background: #f2f4f7; }
.case-library-update { flex: 0 0 auto; color: #667085; font-size: 12px; }
.case-library-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 10px 0; border-top: 1px solid #eef1f5; border-bottom: 1px solid #eef1f5; }
.case-library-meta div { min-width: 0; padding: 0 14px; border-right: 1px solid #e7ecf3; }
.case-library-meta div:first-child { padding-left: 0; }
.case-library-meta div:last-child { padding-right: 0; border-right: 0; }
.case-library-meta dt { color: #98a2b3; font-size: 12px; }
.case-library-meta dd { margin: 4px 0 0; overflow: hidden; color: #344054; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.case-library-card .case-library-summary { color: #475467; line-height: 1.7; }
.case-library-topic-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.case-library-topic-tags span { padding: 5px 9px; color: #475467; background: #f5f7fa; border-radius: 6px; font-size: 12px; }
.case-library-card small { color: #667085; }
.case-library-card footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 2px; }
.case-library-card footer > span { min-width: 0; color: #667085; }
.case-library-card footer .text-btn { flex: 0 0 auto; }
.published-case-detail { display: grid; gap: 18px; }
.published-case-tabs { display: flex; gap: 4px; margin: 4px 0 18px; padding: 4px; background: #f2f4f7; border-radius: 8px; }
.published-case-tabs button { flex: 1; padding: 9px 12px; color: #475467; background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.published-case-tabs button.active { color: #175cd3; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); font-weight: 700; }
.published-case-detail section { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; border-bottom: 1px solid #e6ebf2; }
.published-case-detail section:last-child { border-bottom: 0; }
.published-case-detail h3, .published-case-detail p { margin: 0; }
.published-case-detail p { margin-top: 8px; line-height: 1.8; white-space: pre-wrap; }
.published-case-order { display: grid; place-items: center; width: 26px; height: 26px; color: #175cd3; background: #eff4ff; border-radius: 50%; font-size: 12px; font-weight: 700; }
.published-case-history { display: grid; gap: 10px; }
.published-case-history article { padding: 13px 14px; background: #f8fafc; border: 1px solid #e4e9f0; border-radius: 8px; }
.published-case-history p { margin: 5px 0 0; color: #667085; }
.my-cases-panel { overflow: hidden; }
.my-cases-panel > header { display: grid; gap: 14px; padding: 18px; border-bottom: 1px solid #e6ebf2; }
.my-case-category-tabs { padding: 14px 18px; border-bottom: 1px solid #e6ebf2; }
.case-row { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(180px, .55fr) 150px; gap: 16px; align-items: center; width: 100%; padding: 18px; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #e6ebf2; cursor: pointer; }
.case-row:hover { background: #f8fbff; }
.case-row h3 { margin: 0 0 8px; }
.case-row-lawyers, .case-row-updated { display: grid; gap: 6px; color: #667085; }
.case-row-updated { grid-template-columns: 1fr auto; align-items: center; }
.co-counsel-picker { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 8px; padding: 12px; background: #f7f9fc; border: 1px solid #dbe3ee; border-radius: 10px; }
.co-counsel-picker label { display: flex; flex-direction: row; align-items: center; gap: 7px; margin: 0; }
.case-intake-modal { width: min(820px, calc(100vw - 28px)); }
.case-intake-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.case-intake-drop { display: grid; place-items: center; min-height: 180px; padding: 24px; text-align: center; border: 2px dashed #a9bdd7; border-radius: 14px; background: #f8fbff; cursor: pointer; }
.case-intake-drop small { margin-top: 8px; color: #667085; }
.case-intake-drop input { margin-top: 18px; }
.intake-file-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid #e6ebf2; }
.intake-file-row label { min-width: 260px; }
.intake-warning { margin-bottom: 16px; padding: 14px; color: #7a4d00; background: #fff8e8; border: 1px solid #efd18d; border-radius: 10px; }
.intake-warning p { margin: 6px 0 0; }
.intake-groups { display: grid; gap: 12px; }
.intake-groups article, .intake-review fieldset { padding: 16px; border: 1px solid #dbe3ee; border-radius: 12px; }
.intake-groups h3 { margin-top: 0; }
.intake-review form { display: grid; gap: 16px; }

@media (max-width: 900px) {
  .case-library-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .case-library-meta div:nth-child(2) { border-right: 0; }
  .case-row { grid-template-columns: 1fr 1fr; }
  .case-row-updated { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .case-library-search form, .case-intake-tabs { flex-direction: column; }
  .case-library-filter-row { grid-template-columns: 1fr; }
  .case-library-filter-row > strong { padding-top: 0; }
  .case-library-results-toolbar { align-items: stretch; flex-direction: column; }
  .case-library-results-toolbar label { justify-content: space-between; }
  .case-library-card header { flex-direction: column; }
  .case-library-meta { grid-template-columns: 1fr; }
  .case-library-meta div { padding: 0 0 10px; border-right: 0; border-bottom: 1px solid #eef1f5; }
  .case-library-meta div:last-child { padding-bottom: 0; border-bottom: 0; }
  .case-library-card footer { align-items: flex-start; flex-direction: column; }
  .case-row { grid-template-columns: 1fr; gap: 8px; }
  .case-row-updated { grid-column: auto; }
  .intake-file-row { align-items: stretch; flex-direction: column; }
  .intake-file-row label { min-width: 0; }
}

/* Case library master-detail workspace */
.shell:has(.case-library-workspace) { grid-template-columns: 220px minmax(0, 1fr); background: #f4f7fb; }
.shell:has(.case-library-workspace) .content { padding: 0; }
.case-library-workspace { display: grid; grid-template-columns: minmax(520px, 1.18fr) minmax(390px, .82fr); min-height: 100vh; color: #172033; }
.case-library-browser { min-width: 0; padding: 28px 28px 48px; }
.case-library-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.case-library-head h1 { margin: 0 0 7px; color: #101828; font-size: 28px; letter-spacing: -.02em; }
.case-library-head p { margin: 0; color: #667085; line-height: 1.5; }
.case-library-head > span { flex: 0 0 auto; padding: 6px 10px; color: #175cd3; background: #eaf2ff; border: 1px solid #cddfff; border-radius: 999px; font-size: 12px; font-weight: 700; }
.case-library-workspace .case-library-search { gap: 0; margin: 0 0 16px; border: 1px solid #dce3ed; border-radius: 12px; box-shadow: 0 8px 24px rgba(16, 24, 40, .04); overflow: visible; }
.case-library-workspace .case-library-search form { position: relative; padding: 12px; }
.case-library-search-icon { position: absolute; left: 27px; top: 50%; display: grid; width: 20px; color: #667085; transform: translateY(-50%); pointer-events: none; }
.case-library-workspace .case-library-search input { min-height: 48px; padding-left: 44px; border-color: #cfd8e5; border-radius: 8px; }
.case-library-workspace .case-library-search form .primary-btn { min-width: 84px; }
.case-library-advanced-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 14px; color: #344054; background: #f8fafc; border: 0; border-top: 1px solid #e7ecf3; border-radius: 0 0 11px 11px; font-weight: 700; cursor: pointer; }
.case-library-advanced-toggle span { color: #155eef; font-size: 18px; }
.case-library-advanced { display: grid; gap: 12px; padding: 14px 0 16px; border-top: 1px solid #e7ecf3; }
.case-library-advanced[hidden] { display: none; }
.case-library-workspace .case-library-filter-row { grid-template-columns: 74px minmax(0, 1fr); }
.case-library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #dce3ed; }
.case-library-view-tabs { display: flex; align-items: center; min-width: 0; }
.case-library-view-tabs button { padding: 12px 15px 11px; color: #667085; background: transparent; border: 0; border-bottom: 3px solid transparent; cursor: pointer; font-weight: 700; }
.case-library-view-tabs button.active { color: #155eef; border-color: #155eef; }
.case-library-toolbar > label { display: flex; align-items: center; gap: 8px; color: #667085; font-size: 12px; }
.case-library-toolbar select { width: auto; min-width: 132px; padding: 8px 30px 8px 10px; background-color: transparent; border: 0; }
.case-library-active-order { padding: 10px 2px 12px; color: #667085; font-size: 12px; }
.case-library-workspace .case-library-grid { gap: 9px; }
.case-library-workspace .case-library-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; padding: 0; border-radius: 10px; box-shadow: none; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; overflow: hidden; }
.case-library-workspace .case-library-card:hover { border-color: #a9c7f5; box-shadow: 0 8px 22px rgba(21, 94, 239, .07); transform: translateY(-1px); }
.case-library-workspace .case-library-card.is-selected { border-color: #6ea3ef; box-shadow: inset 3px 0 #155eef, 0 8px 22px rgba(21, 94, 239, .08); }
.case-library-card-main { display: grid; gap: 7px; min-width: 0; padding: 15px 12px 15px 17px; text-align: left; color: inherit; background: transparent; border: 0; cursor: pointer; }
.case-library-card-main strong { overflow: hidden; color: #172033; font-size: 15px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.case-library-row-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.case-library-row-top .case-library-badges { margin: 0; }
.case-library-row-top .case-source-badge, .case-library-row-top .case-verified-badge { padding: 3px 7px; font-size: 11px; }
.case-library-case-no { color: #344054; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; }
.case-library-row-meta { overflow: hidden; color: #667085; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.case-library-card-main .case-library-summary { display: -webkit-box; overflow: hidden; color: #667085; font-size: 13px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.case-library-workspace .case-library-card > footer { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 4px; padding: 12px 11px 12px 0; }
.case-library-favorite, .case-detail-favorite { color: #52647e; background: transparent; border: 0; cursor: pointer; }
.case-library-favorite { width: 32px; height: 32px; padding: 0; font-size: 21px; }
.case-library-favorite.active, .case-detail-favorite.active { color: #e59c18; }
.case-library-workspace .case-library-card footer .text-btn { padding: 5px 2px; font-size: 12px; white-space: nowrap; }
.case-library-detail { position: sticky; top: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; align-self: start; height: 100vh; background: #fff; border-left: 1px solid #dce3ed; box-shadow: -10px 0 28px rgba(16, 24, 40, .035); }
.case-library-detail-scroll { min-height: 0; padding: 28px 28px 20px; overflow: auto; }
.case-library-detail header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.case-library-detail h2 { margin: 7px 0 0; font-size: 21px; line-height: 1.45; }
.case-detail-eyebrow { color: #155eef; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.case-detail-favorite { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #d6deea; border-radius: 8px; font-weight: 700; }
.case-detail-number { margin-top: 13px; color: #344054; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; }
.case-detail-number span { margin-right: 9px; color: #98a2b3; font-family: inherit; font-size: 11px; font-weight: 600; }
.case-detail-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0 13px; padding: 13px 0; border-top: 1px solid #e7ecf3; border-bottom: 1px solid #e7ecf3; }
.case-detail-meta div { min-width: 0; padding: 0 12px; border-right: 1px solid #e7ecf3; }
.case-detail-meta div:first-child { padding-left: 0; }
.case-detail-meta div:last-child { padding-right: 0; border-right: 0; }
.case-detail-meta dt { color: #98a2b3; font-size: 11px; }
.case-detail-meta dd { margin: 4px 0 0; overflow: hidden; color: #344054; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.case-library-detail > .case-library-detail-scroll > .case-library-badges { margin: 0 0 17px; }
.case-detail-summary { display: grid; gap: 9px; }
.case-detail-summary article { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px; padding: 13px 14px; background: linear-gradient(135deg, #f7faff, #fbfcfe); border: 1px solid #e0e8f3; border-radius: 9px; }
.case-detail-summary article > span { display: grid; place-items: center; width: 28px; height: 28px; color: #155eef; background: #e7f0ff; border-radius: 7px; font-size: 11px; font-weight: 800; }
.case-detail-summary h3 { margin: 1px 0 5px; font-size: 13px; }
.case-detail-summary p { margin: 0; color: #475467; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.case-detail-tabs { display: flex; gap: 2px; margin-top: 20px; padding-bottom: 1px; overflow-x: auto; border-bottom: 1px solid #dce3ed; }
.case-detail-tabs button { flex: 0 0 auto; padding: 10px 9px; color: #667085; background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.case-detail-tabs button.active { color: #155eef; border-color: #155eef; }
.case-detail-panel { padding: 16px 1px 6px; }
.case-detail-deep { display: grid; gap: 7px; }
.case-detail-deep h3 { margin: 5px 0 0; font-size: 14px; }
.case-detail-deep p { margin: 0 0 10px; color: #475467; font-size: 13px; line-height: 1.75; white-space: pre-wrap; }
.case-detail-caution { padding: 10px 12px; background: #fff9eb; border-left: 3px solid #fdb022; border-radius: 5px; }
.case-detail-timeline { display: grid; gap: 0; }
.case-detail-timeline div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f5; font-size: 13px; }
.case-detail-timeline span { color: #98a2b3; }
.case-detail-timeline strong { color: #344054; }
.case-library-detail .published-case-history { gap: 8px; }
.case-library-detail .published-case-history article { padding: 11px 12px; }
.case-detail-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 18px; background: rgba(255,255,255,.96); border-top: 1px solid #dce3ed; box-shadow: 0 -8px 22px rgba(16,24,40,.05); backdrop-filter: blur(8px); }
.case-detail-actions button { min-height: 40px; padding: 8px 9px; font-size: 12px; }
.case-library-detail-empty { align-self: center; padding: 40px; text-align: center; color: #667085; }
.case-library-detail-empty strong { color: #344054; font-size: 17px; }

@media (max-width: 1180px) {
  .case-library-workspace { grid-template-columns: minmax(450px, 1fr) minmax(340px, .8fr); }
  .case-library-browser, .case-library-detail-scroll { padding-right: 20px; padding-left: 20px; }
  .case-detail-actions { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .shell:has(.case-library-workspace) { grid-template-columns: minmax(0, 1fr); }
  .case-library-workspace { grid-template-columns: 1fr; }
  .case-library-detail { position: relative; height: auto; min-height: 720px; border-top: 1px solid #dce3ed; border-left: 0; }
  .case-library-detail-scroll { overflow: visible; }
  .case-detail-actions { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .case-library-browser, .case-library-detail-scroll { padding: 20px 15px; }
  .case-library-head { flex-direction: column; }
  .case-library-workspace .case-library-search form { flex-direction: row; }
  .case-library-workspace .case-library-search form .primary-btn { min-width: 66px; padding: 0 10px; }
  .case-library-toolbar { align-items: stretch; flex-direction: column; gap: 0; }
  .case-library-view-tabs { overflow-x: auto; }
  .case-library-toolbar > label { justify-content: space-between; padding: 8px 0; }
  .case-library-row-top { align-items: flex-start; flex-direction: column; gap: 6px; }
  .case-library-update { white-space: normal; }
  .case-library-workspace .case-library-card { grid-template-columns: minmax(0, 1fr) 42px; }
  .case-detail-meta { grid-template-columns: 1fr; }
  .case-detail-meta div, .case-detail-meta div:first-child, .case-detail-meta div:last-child { padding: 8px 0; border-right: 0; border-bottom: 1px solid #eef1f5; }
  .case-detail-meta div:last-child { border-bottom: 0; }
  .case-detail-actions { grid-template-columns: 1fr; }
}

/* Enterprise analysis workspace: clear hierarchy and compact evidence review. */
.shell:has(.analysis-content) { grid-template-columns: 220px minmax(0, 1fr); }
.shell:has(.analysis-content) .sidebar { background: #fff; border-right: 1px solid #e5e9f0; }
.shell:has(.analysis-content) .sidebar .sidebar-brand { min-height: 72px; padding: 16px 20px; }
.shell:has(.analysis-content) .nav { gap: 4px; padding: 12px; }
.shell:has(.analysis-content) .nav button { min-height: 43px; padding: 0 14px; border-radius: 8px; font-size: 14px; }
.shell:has(.analysis-content) .nav button.active { position: relative; color: #155eef; background: #f0f5ff; }
.shell:has(.analysis-content) .nav button.active::before { position: absolute; inset: 9px auto 9px 0; width: 3px; border-radius: 2px; background: #155eef; content: ""; }
.analysis-workspace { grid-template-columns: minmax(0, 1fr) 304px; background: #fafbfc; color: #182230; }
.analysis-workspace.sources-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
.analysis-workspace.sources-collapsed > .ai-related-sources { display: none; }
.analysis-workspace .analysis-main { padding: 0 34px 16px; }
.analysis-workspace > .analysis-main > .analysis-page-head { align-items: center; min-height: 74px; padding: 12px 0; border-bottom: 1px solid #e5e9f0; }
.analysis-workspace .analysis-page-head h1 { margin: 0 0 3px; font-size: 19px; font-weight: 750; letter-spacing: 0; }
.analysis-workspace .analysis-page-head p { font-size: 12px; color: #667085; }
.analysis-workspace .analysis-head-actions { gap: 8px; }
.analysis-workspace .icon-button { width: 32px; height: 32px; border-radius: 8px; }
.analysis-workspace .icon-button.primary { background: #155eef; border-color: #155eef; }
.analysis-sources-toggle { min-height: 32px; padding: 0 10px; border: 1px solid #d7deea; border-radius: 8px; background: #fff; color: #344054; font-size: 12px; }
.analysis-workspace .analysis-scroll-region { padding: 22px 0 16px; }
.analysis-workspace .ai-thread { width: min(860px, 100%); gap: 20px; }
.analysis-workspace .ai-user-message { width: min(680px, 88%); margin-left: auto; padding: 12px 16px; border: 1px solid #dbe7fb; border-radius: 10px; background: #f0f5ff; }
.analysis-workspace .ai-user-message p { font-size: 14px; line-height: 1.65; }
.analysis-workspace .yuandian-result > header { margin-bottom: 10px; }
.analysis-workspace .ai-analysis-card, .analysis-workspace .ai-archived-answer { padding: 24px 28px; border-color: #e4e9f0; border-radius: 10px; box-shadow: none; }
.analysis-workspace .ai-answer-header { margin-bottom: 22px; padding-bottom: 15px; border-bottom: 1px solid #edf0f4; }
.analysis-workspace .ai-answer-mark { width: 28px; height: 28px; border-radius: 7px; background: #155eef; font-size: 13px; }
.analysis-workspace .legal-answer > h3 { display: block; margin: 0 0 12px; color: #182230; font-size: 17px; }
.analysis-workspace .legal-answer-direct { font-size: 15px; line-height: 1.8; }
.analysis-workspace .legal-conclusions { margin-top: 22px; }
.analysis-workspace .legal-conclusions > h4 { margin: 0 0 10px; color: #344054; font-size: 14px; }
.analysis-workspace .legal-conclusions article { margin: 0 0 8px; padding: 12px 15px; border: 1px solid #e7ebf1; border-radius: 8px; background: #fafbfc; }
.analysis-workspace .legal-conclusions .text-btn { padding: 4px 0; font-size: 12px; color: #155eef; }
.analysis-action-plan { margin-top: 22px; padding-top: 18px; border-top: 1px solid #e7ebf1; }
.analysis-action-plan h3 { margin: 0 0 12px; font-size: 17px; }
.analysis-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analysis-action-grid > div { min-width: 0; padding: 14px 16px; border: 1px solid #e7ebf1; border-radius: 8px; background: #fafbfc; }
.analysis-action-grid h4 { margin: 0 0 8px; font-size: 13px; color: #344054; }
.analysis-action-grid ul { margin: 0; padding-left: 18px; }
.analysis-action-grid li, .analysis-action-grid p { margin: 0 0 5px; color: #475467; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.analysis-workspace .answer-citation-summary { margin-top: 20px; font-weight: 600; }
.analysis-workspace .answer-citation-chips { gap: 6px; margin-top: 8px; }
.analysis-workspace .answer-citation-chips span { padding: 5px 8px; border-radius: 5px; font-size: 11px; }
.analysis-workspace .retrieval-status { padding: 9px 11px; border: 1px solid #e8edf5; border-radius: 7px; background: #f4f7fb; }
.analysis-workspace .ai-answer-actions { padding-top: 16px; border-top: 1px solid #edf0f4; }
.analysis-workspace .ai-answer-actions .primary-btn { background: #155eef; }
.analysis-workspace .analysis-composer { width: min(860px, 100%); padding: 10px 12px; border-radius: 10px; box-shadow: 0 3px 12px rgba(16, 24, 40, .06); }
.analysis-workspace .analysis-composer textarea, .analysis-workspace .analysis-composer:not(.is-follow-up) textarea, .analysis-workspace .analysis-composer.is-follow-up textarea { min-height: 40px; font-size: 14px; }
.analysis-workspace .analysis-file-button, .analysis-workspace .analysis-submit { border-radius: 8px; }
.analysis-workspace .analysis-submit { background: #155eef; }
.analysis-workspace .ai-review-note { font-size: 11px; color: #98a2b3; }
.analysis-workspace .ai-related-sources { padding: 24px 18px; overflow-y: auto; }
.analysis-workspace .ai-related-sources > header { font-size: 16px; }
.analysis-workspace .source-verification-summary { margin: 10px 0 17px; }
.analysis-workspace .ai-source-tabs { margin-bottom: 12px; border-radius: 7px; }
.analysis-workspace .ai-source-tabs button { border-radius: 6px; }
.analysis-workspace .ai-source-list { max-height: none; gap: 0; padding: 0; }
.analysis-workspace .ai-source-list article { position: relative; display: grid; gap: 6px; padding: 13px 2px; border: 0; border-bottom: 1px solid #e7ebf1; border-radius: 0; background: #fff; }
.analysis-workspace .ai-source-list article small { display: block; color: #98a2b3; }
.analysis-workspace .ai-source-list article strong { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.analysis-workspace .ai-source-list article p { max-height: 4.5em; overflow: hidden; }
.analysis-workspace .source-status { padding: 3px 7px; border-radius: 5px; }
@media (max-width: 1180px) { .analysis-workspace .analysis-main { padding-right: 22px; padding-left: 22px; } }
@media (max-width: 980px) {
  .shell:has(.analysis-content) { grid-template-columns: minmax(0, 1fr); }
  .analysis-workspace, .analysis-workspace.sources-collapsed { grid-template-columns: minmax(0, 1fr); }
  .analysis-workspace .ai-related-sources { min-height: 0; max-height: 340px; border-top: 1px solid #e7ebf1; }
  .analysis-workspace.sources-collapsed > .ai-related-sources { display: none; }
}
@media (max-width: 700px) {
  .analysis-workspace .analysis-main { padding: 0 14px 12px; }
  .analysis-workspace > .analysis-main > .analysis-page-head { flex-direction: row; align-items: center; gap: 8px; }
  .analysis-workspace .analysis-head-actions { width: auto; }
  .analysis-workspace .analysis-page-head h1 { font-size: 16px; }
  .analysis-workspace .analysis-page-head p { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .analysis-sources-toggle { font-size: 0; padding: 0 7px; }
  .analysis-sources-toggle::after { content: "依据"; font-size: 11px; }
  .analysis-workspace .ai-analysis-card, .analysis-workspace .ai-archived-answer { padding: 16px; border-radius: 8px; }
  .analysis-action-grid { grid-template-columns: 1fr; }
  .analysis-workspace .ai-answer-actions { flex-wrap: wrap; gap: 12px; }
  .analysis-workspace .analysis-composer.is-follow-up .analysis-submit { width: 44px; min-width: 44px; flex: 0 0 44px; }
}

/* UI006 reference-aligned analysis console. */
.shell:has(.analysis-content) { grid-template-columns: 250px minmax(0, 1fr); }
.shell:has(.analysis-content) .sidebar .sidebar-brand { min-height: 78px; padding: 18px 26px; }
.shell:has(.analysis-content) .nav { gap: 8px; padding: 14px 18px; }
.shell:has(.analysis-content) .nav button { min-height: 50px; padding: 0 18px; border-radius: 8px; font-size: 15px; }
.shell:has(.analysis-content) .nav button.active { background: #edf4ff; }
.analysis-workspace { grid-template-columns: minmax(680px, 1fr) 316px; background: #f7f9fc; }
.analysis-workspace.sources-collapsed { grid-template-columns: minmax(680px, 1fr) 48px; }
.analysis-workspace.sources-collapsed > .ai-related-sources { display: block; padding: 22px 7px; }
.analysis-workspace.sources-collapsed > .ai-related-sources > :not(header) { display: none; }
.analysis-workspace.sources-collapsed > .ai-related-sources > header { justify-content: center; }
.analysis-workspace.sources-collapsed > .ai-related-sources > header strong { display: none; }
.analysis-workspace .analysis-main { padding: 0 18px 14px; }
.analysis-workspace > .analysis-main > .analysis-page-head { min-height: 78px; padding: 12px 10px; }
.analysis-title-group { min-width: 0; display: flex; align-items: center; gap: 20px; }
.analysis-workspace .analysis-page-head h1 { flex: 0 0 auto; margin: 0; color: #0d1c35; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.analysis-status-strip { min-width: 0; display: flex; align-items: center; gap: 14px; color: #53627a; font-size: 12px; font-weight: 650; white-space: nowrap; }
.analysis-status-strip i { width: 1px; height: 18px; background: #d8dee8; }
.analysis-complete-state, .analysis-processing-state { display: flex; align-items: center; gap: 7px; }
.analysis-complete-state > span { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #35b86b; font-size: 11px; }
.analysis-complete-state.needs-facts { color: #9a650e; }
.analysis-complete-state.needs-facts > span { background: #d99a2b; }
.analysis-toolbar-button { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #dbe3ef; border-radius: 7px; color: #3c4d67; background: #fff; font-weight: 700; }
.analysis-toolbar-button .ui-icon { width: 17px; height: 17px; }
.analysis-toolbar-button.primary { color: #fff; border-color: #2875e8; background: #2875e8; box-shadow: 0 5px 12px rgba(40,117,232,.16); }
.analysis-workspace .analysis-scroll-region { padding: 18px 10px 12px; }
.analysis-workspace .ai-thread { width: min(940px, 100%); gap: 16px; }
.analysis-workspace.has-conversation .ai-conversation-turn:has(#yuandianResultHost) > .ai-user-message { display: block; }
.analysis-workspace .ai-analysis-card { padding: 0; overflow: hidden; border: 1px solid #e1e7f0; border-radius: 10px; background: #fff; box-shadow: 0 2px 10px rgba(16,36,66,.035); }
.analysis-result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 22px 14px; }
.analysis-result-header h2 { margin: 0 0 6px; color: #0d1c35; font-size: 22px; letter-spacing: -.02em; }
.analysis-result-header p { margin: 0; color: #7a879a; font-size: 13px; }
.analysis-card-tools { flex: 0 0 auto; }
.analysis-brief { padding: 0 16px; }
.analysis-core-conclusion h3, .analysis-key-basis h3, .analysis-action-plan h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: #182842; font-size: 16px; }
.analysis-core-conclusion h3 .ui-icon, .analysis-key-basis h3 .ui-icon, .analysis-action-plan h3 .ui-icon { width: 20px; height: 20px; color: #2070e5; }
.analysis-core-copy { display: flex; align-items: flex-end; gap: 8px; margin-left: 34px; padding: 12px 14px; border-radius: 7px; background: linear-gradient(100deg, #f2f7ff, #edf5ff); }
.analysis-core-copy p { flex: 1; margin: 0; color: #263a58; font-size: 14px; line-height: 1.75; }
.analysis-inline-citations { flex: 0 0 auto; display: inline-flex; gap: 8px; }
.analysis-inline-citations button, .analysis-key-basis-list article > button { padding: 0; border: 0; color: #1767d4; background: transparent; font-size: 13px; cursor: pointer; }
.analysis-key-basis { margin-top: 18px; }
.analysis-key-basis-list { margin-left: 34px; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 7px; }
.analysis-key-basis-list article { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 11px 12px; border-bottom: 1px solid #edf0f5; }
.analysis-key-basis-list article:last-child { border-bottom: 0; }
.analysis-basis-number { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #1767d4; background: #e8f1ff; font-size: 12px; font-weight: 800; }
.analysis-key-basis-list strong { display: block; margin: 1px 0 3px; color: #22344f; font-size: 13px; line-height: 1.45; }
.analysis-key-basis-list p { margin: 0; color: #718097; font-size: 12px; line-height: 1.55; }
.analysis-action-plan { margin-top: 18px; padding-top: 0; border-top: 0; }
.analysis-action-grid { margin-left: 34px; gap: 10px; }
.analysis-action-grid > div { padding: 11px 14px; border: 0; border-radius: 7px; }
.analysis-action-grid > .immediate { background: linear-gradient(110deg, #f0fbf4, #f6fcf8); }
.analysis-action-grid > .prepare { background: linear-gradient(110deg, #eef5ff, #f5f8fd); }
.analysis-action-grid h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.analysis-action-grid h4 .ui-icon { width: 17px; height: 17px; }
.analysis-action-grid .immediate h4 { color: #20975a; }
.analysis-action-grid .prepare h4 { color: #1767d4; }
.analysis-action-grid ul { padding-left: 17px; }
.analysis-action-grid li, .analysis-action-grid p { font-size: 12px; line-height: 1.55; }
.analysis-workspace .analysis-detail-sections { margin: 10px 16px 0; }
.analysis-workspace .analysis-detail-sections > summary { display: flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px dashed #d1d9e5; border-radius: 5px; color: #3f5879; list-style: none; }
.analysis-workspace .analysis-detail-sections > summary::-webkit-details-marker { display: none; }
.analysis-workspace .analysis-detail-sections[open] > summary { margin-bottom: 16px; }
.analysis-workspace .ai-answer-actions { margin: 8px 16px 0; padding: 8px 0 12px; border-top: 0; }
.analysis-workspace .ai-answer-actions button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; border-radius: 6px; }
.analysis-workspace .ai-answer-actions .ui-icon { width: 16px; height: 16px; }
.analysis-workspace .analysis-composer { width: min(790px, 100%); padding: 9px 10px; border-radius: 10px; box-shadow: 0 3px 12px rgba(16,36,66,.05); }
.analysis-unified-input { display: grid; grid-template-columns: 38px minmax(0, 1fr) 42px; align-items: end; gap: 7px; }
.analysis-workspace .analysis-composer textarea, .analysis-workspace .analysis-composer:not(.is-follow-up) textarea, .analysis-workspace .analysis-composer.is-follow-up textarea { min-height: 42px; max-height: 110px; padding: 9px 7px 5px; border: 0; background: transparent; box-shadow: none; }
.analysis-workspace .analysis-file-button { width: 36px; height: 36px; min-height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #56667c; background: transparent; cursor: pointer; }
.analysis-workspace .analysis-file-button:hover { color: #155eef; background: #eef4ff; }
.analysis-workspace .analysis-file-button .ui-icon { width: 18px; height: 18px; }
.analysis-workspace .analysis-submit, .analysis-workspace.is-empty .analysis-submit, .analysis-workspace .analysis-composer.is-follow-up .analysis-submit { width: 38px; min-width: 38px; height: 38px; min-height: 38px; display: grid; place-items: center; padding: 0; border-radius: 50%; background: #2875e8; }
.analysis-workspace .analysis-submit .ui-icon { width: 17px; height: 17px; }
.analysis-unified-hint { margin: 4px 7px 0 45px; color: #98a2b3; font-size: 11px; line-height: 1.45; }
.analysis-workspace .analysis-file-names { display: block; margin: 4px 7px 0 45px; color: #52647e; font-size: 11px; }
.analysis-workspace .ai-review-note { margin: 6px 0 0; }
.analysis-workspace .ai-related-sources { padding: 22px 22px; overflow-y: auto; }
.analysis-workspace .ai-related-sources > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 18px; }
.source-panel-toggle { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid #dbe3ef; border-radius: 6px; color: #49617f; background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.analysis-workspace .source-verification-summary { margin: 14px 0 12px; }
.source-sort-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 12px; color: #5d6f88; font-size: 12px; }
.source-sort-row[hidden] { display: none; }
.source-sort-row .ui-icon { width: 15px; height: 15px; }
.analysis-workspace .ai-source-tabs { padding: 2px; border: 1px solid #e8edf4; border-radius: 6px; background: #f4f6f9; }
.analysis-workspace .ai-source-tabs button { border-radius: 4px; }
.analysis-workspace .ai-source-tabs button[aria-selected="true"] { color: #1767d4; background: #fff; box-shadow: 0 1px 2px rgba(16,36,66,.08); }
.analysis-workspace .ai-source-list { max-height: none; gap: 0; padding-bottom: 14px; }
.analysis-workspace .ai-source-list article { position: static; display: grid; gap: 7px; padding: 16px 2px; border: 0; border-bottom: 1px solid #e8edf3; border-radius: 0; background: transparent; }
.source-card-heading { display: flex; align-items: center; gap: 9px; }
.analysis-source-files { margin-top: 16px; color: var(--muted); font-size: 13px; }
.analysis-source-files summary { cursor: pointer; }
.analysis-source-files ul { padding-left: 20px; overflow-wrap: anywhere; }
.analysis-source-files li { margin-top: 8px; }
.analysis-workspace .ai-source-list article .source-card-heading small { position: static; display: inline; color: #1767d4; font-weight: 800; }
.analysis-workspace .ai-source-list article strong { color: #1b2c47; font-size: 13px; line-height: 1.55; }
.analysis-workspace .ai-source-list article span { color: #718097; }
.analysis-workspace .ai-source-list article p { margin: 2px 0; color: #697990; font-size: 12px; line-height: 1.65; }
.analysis-workspace .ai-source-actions { flex-wrap: wrap; justify-content: flex-start; gap: 8px 14px; }
.analysis-workspace .ai-source-actions .text-btn { color: #1767d4; }
.analysis-workspace .source-status { padding: 3px 7px; border-radius: 4px; }
.source-similarity { width: max-content; padding: 3px 7px; border-radius: 4px; color: #1767d4; background: #eaf2ff; font-size: 11px; font-style: normal; font-weight: 750; }
.source-similarity-details { min-width: 0; color: #1767d4; font-size: 12px; }
.source-similarity-details > summary { padding: 3px 0; list-style: none; cursor: pointer; font-weight: 700; }
.source-similarity-details > summary::-webkit-details-marker { display: none; }
.source-similarity-details[open] { flex: 1 0 100%; padding: 8px 10px; border: 1px solid #dbe7f8; border-radius: 7px; background: #f7faff; }
.source-similarity-details ul { margin: 0; padding-left: 17px; color: #475467; }
.source-similarity-details li { margin: 0 0 4px; line-height: 1.55; }
.source-similarity-details small { display: block !important; margin-top: 7px; color: #7b8798 !important; font-weight: 500 !important; line-height: 1.5; }

.analysis-readiness { margin: 0 0 18px; padding: 13px 14px; border: 1px solid #f2d59b; border-radius: 8px; background: #fffaf0; }
.analysis-readiness > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.analysis-readiness strong { display: flex; align-items: center; gap: 8px; color: #8a5607; font-size: 14px; }
.analysis-readiness strong .ui-icon { width: 17px; height: 17px; }
.analysis-readiness span, .analysis-readiness p { color: #8c6b35; font-size: 12px; }
.analysis-readiness p { margin: 8px 0 0; line-height: 1.6; }
.analysis-question-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.analysis-question-list button { padding: 6px 10px; border: 1px solid #ebcc8a; border-radius: 15px; color: #795317; background: #fff; font-size: 12px; cursor: pointer; }
.deep-analysis-workbench { display: grid; gap: 12px; margin-top: 20px; }
.deep-analysis-workbench > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 8px; color: #fff; background: linear-gradient(120deg, #152d52, #214d85); }
.deep-analysis-workbench > header small { color: #90b9ef; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.deep-analysis-workbench > header h3 { margin: 3px 0 0; color: #fff; font-size: 18px; }
.deep-analysis-workbench > header > span { color: #d4e4f8; font-size: 11px; }
.deep-analysis-block { overflow: hidden; border: 1px solid #e1e7ef; border-radius: 8px; background: #fff; }
.deep-analysis-block > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; color: #203550; background: #f8fafc; font-weight: 800; cursor: pointer; }
.deep-analysis-block > summary span { color: #77869a; font-size: 11px; font-weight: 650; }
.fact-audit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.fact-audit-grid section { padding: 12px; border-radius: 7px; background: #f7f9fc; }
.fact-audit-grid section.confirmed { background: #f1faf5; }
.fact-audit-grid section.warning { background: #fff7ed; }
.fact-audit-grid section.missing { background: #fff3f2; }
.fact-audit-grid h4, .adversarial-grid h4 { margin: 0 0 7px; color: #334963; font-size: 12px; }
.fact-audit-grid ul, .adversarial-grid ul { margin: 0; padding-left: 17px; }
.fact-audit-grid li, .adversarial-grid li { margin: 4px 0; color: #5a6c82; font-size: 12px; line-height: 1.55; }
.issue-tree-list, .claim-analysis-list { display: grid; gap: 0; padding: 4px 14px 12px; }
.issue-tree-list article { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf0f4; }
.issue-tree-list article:last-child { border-bottom: 0; }
.issue-tree-list article > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #1767d4; background: #eaf2ff; font-size: 11px; font-weight: 800; }
.issue-tree-list header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.issue-tree-list header strong { color: #243a58; font-size: 13px; }
.issue-tree-list header em { padding: 3px 7px; border-radius: 4px; color: #1767d4; background: #edf4ff; font-size: 10px; font-style: normal; }
.issue-tree-list p, .issue-tree-list small { display: block; margin: 5px 0 0; color: #718097; font-size: 11px; }
.issue-tree-list ul { margin: 6px 0 0; padding-left: 16px; color: #4d6078; font-size: 12px; }
.claim-analysis-list article { padding: 14px 0; border-bottom: 1px solid #e9edf3; }
.claim-analysis-list article:last-child { border-bottom: 0; }
.claim-analysis-list h4 { margin: 0 0 5px; color: #1d3555; }
.claim-analysis-list > article > p, .claim-analysis-list footer { margin: 5px 0; color: #617189; font-size: 12px; line-height: 1.6; }
.claim-analysis-list article > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.claim-analysis-list section { padding: 10px; border-radius: 6px; background: #f7f9fc; }
.claim-analysis-list section strong { color: #40536d; font-size: 11px; }
.claim-analysis-list section ul { margin: 6px 0 0; padding-left: 16px; color: #617189; font-size: 11px; }
.claim-analysis-list footer { padding: 9px 11px; border-left: 3px solid #2f79e8; background: #f1f6ff; }
.evidence-matrix-wrap { overflow-x: auto; padding: 10px 12px 14px; }
.deep-evidence-matrix { width: 100%; min-width: 760px; border-collapse: collapse; }
.deep-evidence-matrix th { padding: 9px; color: #607188; background: #f5f7fa; font-size: 11px; text-align: left; }
.deep-evidence-matrix td { padding: 10px 9px; border-bottom: 1px solid #e9edf3; color: #586a81; font-size: 11px; vertical-align: top; }
.deep-evidence-matrix td strong { color: #263b57; }
.deep-evidence-matrix td span { display: block; margin-bottom: 4px; }
.deep-evidence-matrix td em { display: inline-block; padding: 3px 7px; border-radius: 10px; color: #725a17; background: #fff4ca; font-style: normal; }
.deep-evidence-matrix td em[data-strength="强"] { color: #167347; background: #e8f8ef; }
.deep-evidence-matrix td em[data-strength="弱"], .deep-evidence-matrix td em[data-strength="缺失"] { color: #a33a32; background: #fff0ee; }
.adversarial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.adversarial-grid section { padding: 12px; border-radius: 7px; background: #eef7f2; }
.adversarial-grid section.opponent { background: #fff2f0; }
.adversarial-grid section.rebuttal { background: #eef5ff; }
.adversarial-grid section.weak { background: #fff8e9; }
.scenario-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.scenario-grid article { padding: 12px; border: 1px solid #e4e9f0; border-radius: 7px; }
.scenario-grid header { display: flex; align-items: flex-start; gap: 9px; }
.scenario-grid header em { flex: 0 0 auto; padding: 3px 6px; border-radius: 4px; color: #875914; background: #fff3d6; font-size: 10px; font-style: normal; }
.scenario-grid header strong { color: #2d425f; font-size: 12px; }
.scenario-grid p, .scenario-grid footer { margin: 8px 0 0; color: #63748a; font-size: 11px; line-height: 1.6; }
.scenario-grid footer { padding-top: 7px; border-top: 1px dashed #dfe5ed; color: #2e67af; }
.deep-followup-actions { margin: 14px 16px 0; padding: 12px 14px; border-radius: 8px; background: #f5f8fc; }
.deep-followup-actions > strong { color: #3a4f6a; font-size: 12px; }
.deep-followup-actions > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.deep-followup-actions button { padding: 7px 10px; border: 1px solid #d4deeb; border-radius: 16px; color: #34577f; background: #fff; font-size: 11px; cursor: pointer; }
.deep-followup-actions button:hover, .analysis-question-list button:hover { border-color: #2b73dc; color: #1767d4; }

@media (max-width: 1180px) {
  .shell:has(.analysis-content) { grid-template-columns: 220px minmax(0, 1fr); }
  .analysis-workspace { grid-template-columns: minmax(600px, 1fr) 280px; }
  .analysis-title-group { gap: 12px; }
  .analysis-status-strip { gap: 8px; }
  .analysis-workspace .analysis-page-head h1 { font-size: 19px; }
}
@media (max-width: 980px) {
  .shell:has(.analysis-content) { grid-template-columns: minmax(0, 1fr); }
  .analysis-workspace, .analysis-workspace.sources-collapsed { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; overflow-y: auto; }
  .analysis-workspace .analysis-main { min-height: 100vh; }
  .analysis-workspace .ai-related-sources { min-height: 260px; max-height: 380px; }
  .analysis-workspace.sources-collapsed > .ai-related-sources { display: none; }
  .analysis-status-strip span:not(:first-child), .analysis-status-strip i { display: none; }
}
@media (max-width: 700px) {
  .analysis-workspace .analysis-main { padding: 0 10px 12px; }
  .analysis-workspace > .analysis-main > .analysis-page-head { min-height: 68px; align-items: center; }
  .analysis-title-group { align-items: flex-start; flex-direction: column; gap: 3px; }
  .analysis-workspace .analysis-page-head h1 { font-size: 17px; }
  .analysis-status-strip { font-size: 10px; }
  .analysis-toolbar-button { width: 34px; min-height: 34px; justify-content: center; padding: 0; }
  .analysis-toolbar-button span { display: none; }
  .analysis-result-header { padding: 18px 16px 12px; }
  .analysis-result-header h2 { font-size: 19px; }
  .analysis-result-header .analysis-card-tools { display: none; }
  .analysis-brief { padding: 0 12px; }
  .analysis-core-copy, .analysis-key-basis-list, .analysis-action-grid { margin-left: 0; }
  .analysis-action-grid { grid-template-columns: 1fr; }
  .analysis-key-basis-list article { grid-template-columns: 24px minmax(0, 1fr); }
  .analysis-key-basis-list article > button { grid-column: 2; justify-self: start; }
  .analysis-workspace .analysis-detail-sections, .analysis-workspace .ai-answer-actions { margin-right: 12px; margin-left: 12px; }
  .analysis-workspace .ai-answer-actions { align-items: flex-start; flex-direction: column; }
  .fact-audit-grid, .claim-analysis-list article > div, .adversarial-grid, .scenario-grid { grid-template-columns: 1fr; }
  .deep-analysis-workbench > header { align-items: flex-start; flex-direction: column; }
  .deep-analysis-workbench > header > span { line-height: 1.5; }
  .deep-followup-actions { margin-right: 12px; margin-left: 12px; }
  .analysis-workspace .analysis-composer-tool { display: none; }
  .analysis-workspace .analysis-file-button { width: 36px; padding: 0; }
  .analysis-workspace .analysis-submit, .analysis-workspace.is-empty .analysis-submit, .analysis-workspace .analysis-composer.is-follow-up .analysis-submit { width: 38px; min-width: 38px; padding: 0; }
  .analysis-unified-hint, .analysis-workspace .analysis-file-names { margin-left: 4px; }
}
/* Evidence-grounded research: compact status and expandable source records. */
.research-review-status { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 12px 16px; background: #f3f6fb; border-radius: 8px; font-size: 13px; color: #48566b; }
.research-review-status strong { color: #23364f; }
.research-review-status small { margin-left: auto; }
.research-evidence-workbench { margin: 18px 0; min-width: 0; }
.research-evidence-block { border: 1px solid #e3e8ef; border-radius: 8px; padding: 12px 16px; margin: 10px 0; overflow-wrap: anywhere; }
.research-evidence-block > summary { cursor: pointer; color: #23364f; font-weight: 600; }
.research-evidence-block article { padding: 12px 0; border-top: 1px solid #edf0f5; }
.research-evidence-block article header { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.research-evidence-block small, .legal-conclusions blockquote small { display: block; color: #677489; font-size: 12px; }
.research-evidence-block blockquote, .legal-conclusions blockquote { margin: 8px 0; padding: 10px 12px; background: #f6f8fb; border-left: 3px solid #bac8da; white-space: pre-wrap; overflow-wrap: anywhere; }
.research-evidence-block p { color: #48566b; line-height: 1.7; }

.case-library-connection { display: block; margin: 10px 0; color: #244779; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; }
.case-library-search-status { padding: 12px; background: #eef4fc; border-radius: 8px; color: #435674; line-height: 1.6; overflow-wrap: anywhere; }
.case-library-relevance { margin-top: 20px; padding: 16px; background: #f4f8ff; border-radius: 10px; }

.answer-brief-caution { color: #86601b; font-size: 13px; margin: 0 0 12px; }
.analysis-brief .analysis-core-copy { white-space: pre-line; }
.answer-brief-steps, .answer-brief-question { margin-top: 22px; }
.answer-brief-steps ol { padding-left: 22px; line-height: 1.85; }
.answer-brief-steps li { margin: 8px 0; }
.answer-brief-question button { text-align: left; padding: 12px 16px; background: #f6f8fc; border: 1px solid #dfe5ef; border-radius: 8px; color: #334a68; line-height: 1.7; max-width: 100%; }
.answer-brief-context { margin-top: 18px; line-height: 1.8; overflow-wrap: anywhere; }
.answer-brief-context h3 { font-size: 15px; margin-bottom: 8px; }
.analysis-deliverable { margin: 18px 0; padding: 14px; border: 1px solid #dfe5ef; border-radius: 8px; background: #f7f9fc; min-width: 0; }
.analysis-deliverable header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.analysis-deliverable header span { color: #6b7280; font-size: 12px; }
.deliverable-content { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.85; }
.source-provenance { overflow-wrap: anywhere; }
.analysis-failure p { margin: 8px 0; line-height: 1.7; }

/* Conversational answers: keep the evidence sidebar and audit details, simplify the reading surface. */
.analysis-workspace .conversational-answer { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.conversational-answer .analysis-result-header { padding: 8px 0 12px; align-items: center; }
.conversational-answer .analysis-result-header h2 { font-size: 15px; }
.conversational-answer .analysis-brief { padding: 0; }
.conversational-answer .analysis-core-copy { display: block; margin: 0; padding: 0; background: transparent; border: 0; font-size: 16px; line-height: 1.9; }
.conversational-answer .analysis-core-copy p { margin: 0 0 14px; }
.conversational-answer .analysis-core-conclusion { padding: 0; }
.conversational-answer .answer-brief-steps h3 { font-size: 15px; }
.conversational-answer .answer-brief-question button { border: 0; border-left: 2px solid #b5c8e4; border-radius: 0; padding: 8px 12px; background: #f4f7fb; text-align: left; }
.analysis-workspace .conversational-answer .analysis-detail-sections,
.analysis-workspace .conversational-answer .ai-answer-actions { margin-right: 0; margin-left: 0; }

/* Approved v7: one readable reply, an inline artifact and a persistent evidence pane. */
.analysis-workspace .natural-feedback { max-width: 760px; font-size: 16px; line-height: 1.85; color: #292d34; overflow-wrap: anywhere; }
.natural-feedback p { margin: 0 0 18px; }
.natural-feedback > p:first-child { font-weight: 500; }
.natural-feedback ul, .natural-feedback ol { padding-left: 24px; margin: 0 0 18px; }
.natural-feedback li { margin: 6px 0; }
.natural-feedback code { font-size: .9em; background: #f1f2f4; padding: 1px 4px; border-radius: 3px; }
.natural-feedback .analysis-deliverable { background: #f7f7f8; border: 0; border-left: 3px solid #c8cbd0; border-radius: 0 6px 6px 0; padding: 16px 20px; margin: 22px 0; }
.natural-feedback .analysis-deliverable header { font-size: 13px; color: #59616d; }
.natural-feedback .analysis-deliverable header strong { font-weight: 500; }
.natural-feedback .analysis-deliverable header button { margin-left: auto; }
.natural-feedback .deliverable-content { margin: 14px 0 0; }
.natural-feedback .analysis-deliverable > p { margin: 12px 0 0; font-size: 14px; }
.natural-feedback-notes { color: #796136; font-size: 14px; line-height: 1.75; }
.natural-feedback-notes p { margin-bottom: 10px; }
.natural-feedback-question { display: block; text-align: left; font: inherit; color: #334a68; background: #f4f6f9; border: 0; border-radius: 6px; padding: 10px 14px; max-width: 100%; }
.ai-previous-turn { margin: 0 0 20px; border-bottom: 1px solid #e5e7eb; padding-bottom: 14px; }
.ai-previous-turn > summary { display: flex; align-items: center; gap: 16px; cursor: pointer; color: #646b75; font-size: 13px; }
.ai-previous-turn > summary::before { content: '›'; font-size: 18px; }
.ai-previous-turn[open] > summary::before { transform: rotate(90deg); }
.ai-previous-turn > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ai-previous-turn > summary small { flex-shrink: 0; }
.ai-previous-turn[open] > .ai-conversation-turn { margin-top: 20px; }
.analysis-workspace .ai-source-list > article { border: 0; border-bottom: 1px solid #e6e8ec; border-radius: 0; box-shadow: none; background: transparent; padding: 18px 0; }
.ai-source-list .source-case-relevance, .ai-source-list .source-case-difference { font-size: 13px; line-height: 1.7; margin: 8px 0; color: #525d6d; }
.source-metadata { font-size: 12px; line-height: 1.7; color: #717988; margin: 10px 0; }
.source-metadata summary { cursor: pointer; }
.source-verification-details { margin: 12px 0 16px; color: #717988; font-size: 12px; line-height: 1.7; }
.source-verification-details > summary { cursor: pointer; }
.source-verification-details .source-verification-summary { margin: 8px 0 0; font-size: 12px; }
.source-verification-details:not([open]) > :not(summary) { display: none; }
.analysis-workspace .ai-source-list article .source-metadata small {
  position: static;
  display: block;
  margin-top: 5px;
  color: #717988;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.analysis-workspace .ai-thread { max-width: 820px; }
@media (max-width: 980px) {
  .analysis-content { height: calc(100dvh - 158px); }
  .analysis-workspace, .analysis-workspace.sources-collapsed { height: 100%; grid-auto-rows: max-content; }
  .analysis-workspace .analysis-main { min-height: 0; height: calc(100dvh - 158px); }
}
@media (max-width: 700px) {
  .analysis-workspace .natural-feedback { font-size: 15px; line-height: 1.85; }
  .natural-feedback .analysis-deliverable { padding: 12px 14px; }
  .ai-previous-turn > summary { gap: 8px; }
}

.natural-feedback h3 { font-size: 18px; line-height: 1.55; font-weight: 650; margin: 28px 0 12px; color: #202938; }
.natural-feedback h3:first-child { margin-top: 0; }
.natural-feedback h4 { font-size: 16px; font-weight: 650; margin: 20px 0 10px; }

/* Continuous answer typography matching the supplied conversation references. */
.analysis-workspace .analysis-main, .analysis-workspace .analysis-scroll-region { background: #fff; }
.analysis-workspace .ai-thread { max-width: 860px; }
.analysis-workspace .ai-thread,
.analysis-workspace .ai-conversation-turn {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}
.analysis-workspace .ai-thread > * { min-width: 0; }
.analysis-workspace .natural-feedback { max-width: none; color: #171717; font-size: 16px; line-height: 1.75; }
.natural-feedback p { margin: 0 0 16px; }
.natural-feedback h3 { color: #111; font-size: 20px; font-weight: 700; margin: 28px 0 14px; }
.natural-feedback h4 { color: #111; font-size: 17px; font-weight: 650; margin: 20px 0 12px; }
.natural-feedback li { margin: 8px 0; }
.conversational-answer .analysis-result-header { justify-content: flex-end; padding: 0 0 16px; }
.analysis-workspace .analysis-detail-sections:not([open]) > :not(summary),
.natural-feedback-notes:not([open]) > :not(summary) { display: none !important; }
.analysis-workspace .analysis-detail-sections > summary { border: 0; padding: 6px 0; color: #6b7280; font-size: 13px; }
.natural-feedback-notes { margin: 20px 0; color: #6b7280; font-size: 13px; }
.natural-feedback-notes > summary { cursor: pointer; }
.natural-feedback-notes[open] > summary { margin-bottom: 12px; }
@media (max-width: 700px) {
  .analysis-workspace .natural-feedback { font-size: 15px; }
  .natural-feedback h3 { font-size: 18px; }
}

/* Lawyer entry sits beside the existing two status buttons. */
.case-list-toolbar { gap:16px; flex-wrap:wrap; }
.my-case-status-tabs { align-items:center; }
.case-lawyer-entry { width:auto; max-width:240px; min-height:38px; margin:0; padding:8px 30px 8px 14px; color:#475467; background-color:#f6f8fb; border:1px solid #dbe3ee; border-radius:7px; cursor:pointer; }
@media (max-width:620px) { .case-lawyer-entry { width:100px; min-width:0; max-width:100%; padding-right:24px; } .case-list-toolbar .case-filter-controls { width:100%; } }
.case-row-updated span { white-space:nowrap; }
/* Approved history / reading / source layout, 2026-10-13. */
.shell:has(.analysis-content) { grid-template-columns: 76px minmax(0, 1fr); }
.shell:has(.analysis-content) .sidebar { width: 76px; min-width: 0; padding: 0; }
.shell:has(.analysis-content) .sidebar .sidebar-brand { padding: 18px 0; min-height: 86px; justify-content: center; }
.shell:has(.analysis-content) .sidebar-brand strong { display: none; }
.shell:has(.analysis-content) .nav { padding: 8px; gap: 8px; }
.shell:has(.analysis-content) .nav button { flex-direction: column; justify-content: center; gap: 6px; min-height: 64px; padding: 8px 3px; font-size: 11px; text-align: center; }
.shell:has(.analysis-content) .nav button .ui-icon { width: 23px; height: 23px; }
.shell:has(.analysis-content) .nav-label { font-size: 11px; line-height: 1.3; }
.shell:has(.analysis-content) .sidebar-footer { padding: 12px 5px; text-align: center; }
.shell:has(.analysis-content) .sidebar-footer .login-state,
.shell:has(.analysis-content) .sidebar-footer > strong { display: none; }
.shell:has(.analysis-content) .sidebar-footer button { font-size: 11px; padding: 5px 0; }
.analysis-workspace.history-open { grid-template-columns: 280px minmax(0, 1fr) 300px; }
.analysis-workspace.history-closed { grid-template-columns: minmax(0, 1fr) 300px; }
.analysis-workspace > .analysis-main { grid-column: 2; grid-row: 1; grid-template-columns: minmax(0, 1fr); padding: 0 28px 12px; }
.analysis-workspace.history-closed > .analysis-main { grid-column: 1; }
.analysis-workspace > .ai-related-sources { grid-column: 3; grid-row: 1; width: auto; min-width: 0; padding: 24px 22px; }
.analysis-workspace.history-closed > .ai-related-sources { grid-column: 2; }
.analysis-workspace.sources-collapsed.history-open { grid-template-columns: 280px minmax(0, 1fr) 0; }
.analysis-workspace.sources-collapsed.history-closed { grid-template-columns: minmax(0, 1fr) 0; }
.analysis-workspace .analysis-history-drawer { position: relative; grid-column: 1; grid-row: 1; inset: auto; width: auto; min-width: 0; height: 100%; z-index: 2; padding: 24px 16px 14px; transform: none; box-shadow: none; background: #f9fafc; display: flex; flex-direction: column; overflow: hidden; }
.analysis-workspace.history-closed .analysis-history-drawer { display: none; }
.analysis-history-drawer .ai-history-header { margin-bottom: 18px; font-size: 18px; }
.analysis-history-drawer .history-new-button { width: 100%; min-height: 44px; justify-content: center; color: #155eef; background: transparent; border: 1px solid #7ba8fa; box-shadow: none; margin-bottom: 16px; }
.history-search { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px; background: #fff; border: 1px solid #dfe4eb; border-radius: 8px; }
.history-search .ui-icon { width: 17px; height: 17px; color: #7b8797; flex-shrink: 0; }
.history-search input { width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; font-size: 13px; outline: none; }
.history-search:focus-within { border-color: #155eef; }
.analysis-history-drawer .ai-conversation-list { flex: 1; overflow-y: auto; min-height: 0; padding-top: 10px; }
.history-date-group { margin: 20px 5px 10px; color: #667085; font-size: 13px; font-weight: 600; }
.history-conversation { position: relative; border-radius: 8px; margin: 4px 0; }
.history-conversation.active { background: #e8f0ff; }
.history-conversation:hover { background: #eef2f8; }
.history-conversation > button { display: flex; flex-direction: column; text-align: left; width: 100%; padding: 12px 30px 12px 10px; gap: 5px; background: transparent; border: 0; color: #182230; }
.history-conversation > button span { max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: 14px; font-weight: 600; }
.history-conversation small { font-size: 12px; color: #7b8797; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 100%; }
.history-record-status { font-size: 10px !important; }
.history-menu { position: absolute; right: 4px; top: 9px; z-index: 3; }
.history-menu summary { list-style: none; cursor: pointer; padding: 0 6px; color: #68768c; font-size: 20px; }
.history-menu summary::-webkit-details-marker { display: none; }
.history-menu > div { position: absolute; right: 0; top: 25px; width: 112px; padding: 4px; background: #fff; border: 1px solid #e4e7ec; border-radius: 7px; box-shadow: 0 5px 14px #16253c16; }
.history-menu:not([open]) > div { display: none; }
.history-menu button { width: 100%; border: 0; background: transparent; padding: 9px; text-align: left; font-size: 13px; }
.history-menu button:hover { background: #f2f5fa; }
.history-pin-mark { position: absolute; right: 11px; bottom: 9px; color: #155eef; }
.history-rename { padding: 5px 8px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.history-rename input { width: 100%; min-width: 0; border: 1px solid #d2d9e4; border-radius: 5px; padding: 7px; font-size: 13px; }
.history-rename button { border: 0; background: #eaf1ff; color: #155eef; border-radius: 4px; padding: 5px 10px; font-size: 12px; }
.history-empty, .history-preferences-note { font-size: 12px; color: #7b8797; padding: 10px 4px; }
.history-preferences-note { margin: 0; padding-bottom: 0; }
.analysis-title-group { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.analysis-title-group h1 { flex: 1; min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: 100%; }
.analysis-workspace .analysis-composer { min-width: 0; max-width: 100%; }
.analysis-workspace .analysis-head-actions { flex-shrink: 0; }
.analysis-workspace .analysis-head-actions .analysis-toolbar-button { white-space: nowrap; }
@media (min-width: 1101px) {
  .analysis-workspace.history-open #openAnalysisHistory { display: none; }
}
.analysis-workspace .ai-thread { max-width: 790px; }
.analysis-workspace .ai-user-message { max-width: 78%; border: 0; background: #f1f3f7; }
.analysis-workspace .natural-feedback h3 { font-size: 20px; margin: 28px 0 14px; }
.analysis-workspace .analysis-result-header h2 { display: none; }
#openAnalysisSourcesMobile { display: none; }
@media (max-width: 1100px) {
  .analysis-workspace.history-open, .analysis-workspace.history-closed { grid-template-columns: minmax(0,1fr) 280px; }
  .analysis-workspace.history-open.sources-collapsed, .analysis-workspace.history-closed.sources-collapsed { grid-template-columns: minmax(0,1fr) 0; }
  .analysis-workspace > .analysis-main { grid-column: 1; }
  .analysis-workspace > .ai-related-sources { grid-column: 2; }
  .analysis-workspace .analysis-history-drawer { position: absolute; top: 0; bottom: 0; left: 0; width: min(300px, 90%); z-index: 35; border-right: 1px solid #dfe4eb; box-shadow: 8px 0 24px #16253c15; }
  .analysis-workspace .analysis-history-backdrop { position: absolute; inset: 0; z-index: 34; }
}
@media (max-width: 900px) {
  .analysis-workspace.history-open, .analysis-workspace.history-closed,
  .analysis-workspace.history-open.sources-collapsed, .analysis-workspace.history-closed.sources-collapsed { grid-template-columns: minmax(0,1fr); }
  .analysis-workspace > .ai-related-sources { display: none; }
  .analysis-workspace.mobile-sources-open > .ai-related-sources { display: block; position: absolute; inset: 0 0 0 auto; width: min(340px, 100%); z-index: 36; background: #fff; overflow-y: auto; }
  #openAnalysisSourcesMobile { display: inline-flex; }
}
@media (max-width: 700px) {
  .shell:has(.analysis-content) { grid-template-columns: minmax(0,1fr); }
  .shell:has(.analysis-content) .sidebar { display: none; }
  .analysis-workspace > .analysis-main { height: 100dvh; padding: 0 16px 10px; }
  .analysis-workspace, .analysis-workspace.history-open, .analysis-workspace.history-closed { height: 100dvh; }
  .analysis-content { height: 100dvh; }
  .analysis-workspace .analysis-page-head h1 { font-size: 16px; }
  .analysis-workspace .analysis-head-actions { gap: 5px; }
  .analysis-workspace .analysis-head-actions .analysis-toolbar-button { padding: 8px; font-size: 12px; }
  .analysis-workspace .analysis-head-actions #openAnalysisHistory span { display: none; }
  .analysis-workspace .natural-feedback h3 { font-size: 18px; }
}
.analysis-history-drawer .ai-conversation-list { display: block; }
.analysis-history-drawer .ai-history-header strong { font-size: 18px; }
.shell:has(.analysis-content) .sidebar-footer button { width: 100%; white-space: nowrap; margin: 0; line-height: 22px; font-size: 10px; }
.inline-source-citation { display: inline; padding: 0 3px; border: 0; background: transparent; color: #2563eb; font-size: inherit; line-height: inherit; white-space: normal; vertical-align: baseline; }
.inline-source-citation:hover { text-decoration: underline; }

/* Keep source disclosures visible and the narrow-screen drawer inside the full grid. */
.source-similarity-details > summary::after { content: ' ▾'; }
.source-similarity-details[open] > summary::after { content: ' ▴'; }
.analysis-workspace .source-similarity-details small { position: static; }
.analysis-workspace .source-similarity-details p { max-height: none; display: block; -webkit-line-clamp: unset; }
.source-similarity-details strong { display: block; margin: 10px 0 6px; }
@media (max-width: 900px) {
  .analysis-workspace.mobile-sources-open > .ai-related-sources {
    grid-column: 1 / -1; grid-row: 1; box-sizing: border-box;
    min-height: 0; max-height: none; height: 100%;
  }
  .analysis-workspace .analysis-composer { min-width: 0; max-width: 100%; box-sizing: border-box; }
}
/* Keep prior feedback readable beside later review outcomes. */
.analysis-feedback-history { display: grid; gap: 18px; margin: 0 0 24px; }
.analysis-feedback-history > article { border-left: 3px solid #e3e9f1; padding: 4px 0 4px 14px; }
.analysis-feedback-history .muted { font-size: 12px; color: #727d8b; }
.analysis-review-notes { margin: 18px 0; padding: 12px 14px; border-left: 3px solid #d8aa48; background: #fffaf0; }
.law-source-group { min-width: 0; margin-bottom: 18px; }
.law-source-group-heading { padding: 13px 0 9px; border-bottom: 1px solid #dfe5ed; }
.law-source-group-heading h3 { margin: 0 0 5px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.law-source-group-heading > small { color: #7b8592; font-size: 11px; }
.analysis-workspace .ai-source-list .law-source-clause { gap: 8px; padding: 14px 0; }
.analysis-workspace .ai-source-list .law-source-clause .law-clause-text { max-height: none; overflow: visible; white-space: pre-wrap; color: #354154; font-size: 13px; line-height: 1.85; }
.law-source-relation { font-size: 12px; color: #6e7988; line-height: 1.7; }
.law-source-relation summary { cursor: pointer; }
.analysis-workspace .ai-source-list .law-source-clause .law-identity-warning { max-height: none; color: #9b6b1d; }
