:root {
  --bg: #f4f3ef;
  --side: #e7e7e0;
  --panel: #ffffff;
  --line: #d7d5cb;
  --text: #20211f;
  --muted: #686b67;
  --accent: #8b1638;
  --accent-2: #0e6b59;
  --warn: #9c6700;
  --danger: #b42318;
  --shadow: 0 12px 28px rgba(29, 31, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  position: fixed;
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
}

body.modal-open .feedback-trigger {
  display: none;
}

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

button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  padding: 0 12px;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

button.danger {
  border-color: #e6c4c0;
  background: #fff;
  color: var(--danger);
}

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

button.ghost {
  background: transparent;
}

button.active {
  border-color: var(--accent);
  color: var(--accent);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

.app-notice {
  border: 1px solid #dfb6ad;
  border-left: 4px solid var(--danger);
  border-radius: 6px;
  background: #fff7f5;
  color: #7a271a;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 700;
}

.app-notice.warning {
  border-color: #e7cf9a;
  border-left-color: var(--warn);
  background: #fffaf0;
  color: #714b00;
}

.app-notice.success {
  border-color: #acd5c7;
  border-left-color: var(--accent-2);
  background: #f2faf7;
  color: #075848;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  border-right: 1px solid var(--line);
  background: var(--side);
  padding: 18px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.brand span,
.side-title,
.kicker,
.muted {
  color: var(--muted);
}

.brand span {
  display: block;
  font-size: 13px;
}

.dev-auth,
.side-section {
  margin-bottom: 18px;
}

.dev-auth label,
.side-title {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.wide {
  width: 100%;
  margin-bottom: 8px;
}

.workspace-list,
.case-list {
  display: grid;
  gap: 8px;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f5;
  padding: 4px;
}

.mode-switch button {
  min-height: 34px;
  border: 0;
  background: transparent;
}

.mode-switch button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 8px rgba(29, 31, 34, 0.08);
}

.empty-list {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
  padding: 14px;
  font-weight: 700;
}

.workspace-item,
.case-item {
  width: 100%;
  min-height: 58px;
  text-align: left;
  background: #fff;
}

.workspace-item.active,
.case-item.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.case-item strong,
.workspace-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.case-item span,
.workspace-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 22px;
}

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

.kicker {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 17px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: #a8cec5;
  background: #f3faf7;
  color: var(--accent-2);
}

.feedback-trigger-icon {
  position: relative;
  width: 17px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 5px;
}

.feedback-trigger-icon::after {
  position: absolute;
  bottom: -5px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-left: 2px solid currentColor;
  content: "";
  transform: skewY(-38deg);
}

.pill,
.count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.pill.ok {
  border-color: #bad9d1;
  color: var(--accent-2);
}

.empty,
.panel,
.meta-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.empty {
  display: grid;
  gap: 6px;
  max-width: 620px;
  padding: 28px;
}

.empty strong {
  font-size: 20px;
}

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

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

.meta-grid.matter {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meta-grid > div {
  min-height: 70px;
  padding: 12px;
}

.meta-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-reference-bar {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.42);
  padding: 12px 2px;
}

.case-reference-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.case-reference-head h2 {
  font-size: 14px;
}

.case-reference-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.case-reference-chip,
.case-reference-more {
  display: grid;
  min-height: 46px;
  max-width: 300px;
  padding: 6px 10px;
  text-align: left;
}

.case-reference-chip {
  border-color: #c9cbc5;
  background: #fff;
}

.case-reference-chip:hover,
.case-reference-chip:focus-visible,
.case-reference-more:hover,
.case-reference-more:focus-visible {
  border-color: var(--accent-2);
  outline: none;
}

.case-reference-chip.primary-reference {
  border-left: 3px solid var(--accent);
}

.case-reference-chip span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-reference-chip strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-reference-more {
  place-items: center;
  color: var(--accent-2);
}

.case-reference-empty {
  color: var(--muted);
  font-size: 13px;
}

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

.panel {
  padding: 14px;
}

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

.split {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
}

.case-form,
.upload {
  display: grid;
  gap: 10px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.file-picker {
  min-height: 58px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #fbfbf8;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.file-picker span {
  color: var(--accent-2);
  font-weight: 800;
}

.file-picker strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload.uploading .file-picker {
  cursor: wait;
  opacity: 0.72;
}

.file-picker:hover {
  border-color: var(--accent-2);
  background: #f6fbf8;
}

.file-picker.dragging {
  border-color: var(--accent);
  background: #fff8fb;
  box-shadow: inset 0 0 0 1px var(--accent);
}

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

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

.summary-card {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.document-list,
.dd-list,
.timeline-list,
.agent-list,
.job-list {
  display: grid;
  gap: 10px;
}

.document-card,
.dd-row,
.timeline-row,
.agent-row,
.job-row,
.processing-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.processing-card {
  border-left: 4px solid var(--line);
  min-height: 74px;
}

.processing-card.ok {
  border-left-color: var(--accent-2);
  background: #fbfffd;
}

.processing-card.warn {
  border-left-color: var(--warn);
  background: #fffaf0;
}

.processing-card.danger {
  border-left-color: var(--danger);
  background: #fff7f6;
}

.processing-card strong {
  display: block;
  margin-bottom: 6px;
}

.processing-card p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.document-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 220px;
  gap: 14px;
}

.doc-label,
.row-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.doc-title {
  font-weight: 850;
}

.doc-summary,
.timeline-row p,
.agent-row pre {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.doc-actions {
  display: grid;
  align-content: start;
  gap: 8px;
}

.dd-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.dd-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.dd-tabs button.active {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.dd-panel {
  min-height: 180px;
}

.dd-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.dd-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.dd-metric strong {
  font-size: 22px;
}

.filter {
  margin-bottom: 12px;
}

.dd-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: start;
}

.dd-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent-2);
}

.dd-category {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.dd-room {
  display: grid;
  gap: 10px;
}

.dd-doc,
.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.dd-doc p,
.request-row p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.request-row {
  display: block;
  border-left: 4px solid var(--warn);
}

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

.report-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.report-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.report-grid p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.report-sections,
.report-findings,
.evidence-list {
  display: grid;
  gap: 10px;
}

.report-findings article,
.evidence-list p {
  margin: 0;
  border-left: 3px solid var(--danger);
  background: #fff8f7;
  padding: 9px 11px;
}

.report-findings strong,
.report-findings span,
.evidence-list strong,
.evidence-list span {
  display: block;
}

.report-findings span,
.evidence-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.evidence-list p {
  border-left-color: var(--accent-2);
  background: #f7fcfa;
}

.badge {
  justify-self: end;
  min-height: 28px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.present {
  background: #dff4eb;
  color: var(--accent-2);
}

.badge.ok {
  background: #dff4eb;
  color: var(--accent-2);
}

.badge.partial,
.badge.unclear,
.badge.warn {
  background: #fff3d9;
  color: var(--warn);
}

.badge.open,
.badge.danger {
  background: #f0f0ed;
  color: var(--muted);
}

.badge.danger {
  background: #f6e5e3;
  color: var(--danger);
}

.badge.disabled {
  background: #f6e5e3;
  color: var(--danger);
}

.doc-status {
  display: grid;
  align-content: start;
  gap: 8px;
}

.finding-list,
.legal-note {
  margin-top: 10px;
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

.finding-list strong,
.legal-note strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.finding-list p,
.legal-note p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.danger-list {
  border-left-color: var(--danger);
}

.danger-list strong {
  color: var(--danger);
}

.reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.reference-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.timeline-row.deadline {
  border-left: 4px solid var(--accent);
}

.timeline-row.event {
  border-left: 4px solid var(--accent-2);
}

.work-product {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.work-product h3 {
  margin: 6px 0 8px;
  font-size: 18px;
}

.work-product p {
  color: var(--muted);
  line-height: 1.45;
}

.work-product details {
  margin-top: 12px;
}

.work-product summary {
  cursor: pointer;
  font-weight: 800;
}

.work-product pre,
.agent-row pre {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f5;
  padding: 10px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(32, 33, 31, 0.42);
  padding: 24px;
  overflow: hidden;
  overscroll-behavior: none;
}

.modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 960px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.modal-head h2 {
  margin-top: 2px;
  font-size: 22px;
}

.modal-body {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 18px;
}

.reference-modal {
  width: 720px;
}

.feedback-modal {
  width: 780px;
}

.feedback-modal-body {
  min-height: 360px;
}

.feedback-start {
  display: grid;
  gap: 16px;
}

.feedback-context-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #c8d9d4;
  border-radius: 7px;
  background: #f4f9f7;
  padding: 11px 13px;
}

.feedback-context-strip small,
.feedback-context-strip strong {
  display: block;
}

.feedback-context-strip small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.feedback-context-icon {
  position: relative;
  width: 26px;
  height: 21px;
  border: 2px solid var(--accent-2);
  border-radius: 4px;
}

.feedback-context-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: -6px;
  height: 2px;
  background: var(--accent-2);
}

.feedback-channel-choice {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(210px, 0.65fr);
  gap: 10px;
}

.feedback-voice-choice,
.feedback-text-choice {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.feedback-voice-choice {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  border-color: #8ebeb2;
  background: #f2faf7;
  padding: 15px 16px;
}

.feedback-voice-choice:hover {
  border-color: var(--accent-2);
  background: #eaf6f2;
  transform: translateY(-1px);
}

.feedback-text-choice {
  display: flex;
  align-items: center;
  padding: 15px;
}

.feedback-voice-choice strong,
.feedback-voice-choice small,
.feedback-text-choice strong,
.feedback-text-choice small {
  display: block;
}

.feedback-voice-choice strong,
.feedback-text-choice strong {
  margin-bottom: 4px;
  font-size: 15px;
}

.feedback-voice-choice small,
.feedback-text-choice small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.35;
}

.feedback-voice-choice b {
  color: var(--accent-2);
  font-size: 28px;
  font-weight: 400;
}

.feedback-mic-icon {
  position: relative;
  justify-self: center;
  width: 17px;
  height: 27px;
  border: 3px solid var(--accent-2);
  border-radius: 10px;
}

.feedback-mic-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 27px;
  height: 16px;
  border: 3px solid var(--accent-2);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  transform: translateX(-50%);
}

.feedback-mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 2px;
  height: 6px;
  background: var(--accent-2);
  transform: translateX(-50%);
}

.feedback-form {
  display: grid;
  gap: 16px;
}

.feedback-voice {
  display: grid;
  gap: 14px;
  min-height: 320px;
}

.feedback-live-header {
  margin: 0;
}

.feedback-audio-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dfbd72;
  border-radius: 7px;
  background: #fff9eb;
  padding: 10px 12px;
  color: #664b13;
  font-size: 13px;
  font-weight: 700;
}

.feedback-voice-error {
  border-left: 4px solid var(--danger);
  background: #fff7f5;
  padding: 16px;
}

.feedback-voice-error strong,
.feedback-voice-error p {
  display: block;
  margin: 0;
}

.feedback-voice-error p {
  margin-top: 5px;
  color: var(--muted);
}

.feedback-review {
  display: grid;
  gap: 14px;
}

.feedback-review-intro {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid #b9d8d0;
  border-radius: 7px;
  background: #f3faf7;
  padding: 12px 14px;
}

.feedback-review-intro strong,
.feedback-review-intro p {
  display: block;
  margin: 0;
}

.feedback-review-intro p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.feedback-review-intro > span {
  border-radius: 999px;
  background: var(--accent-2);
  padding: 5px 9px;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.feedback-review > label,
.feedback-review-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.feedback-review textarea {
  min-height: 104px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
}

#feedback-draft-steps {
  min-height: 88px;
}

.feedback-review label small {
  color: var(--muted);
  font-weight: 500;
}

.feedback-draft-context {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.feedback-draft-context div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-draft-context span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f7f4;
  padding: 5px 8px;
}

.feedback-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.feedback-categories legend,
.feedback-message-label {
  display: grid;
  gap: 7px;
  width: 100%;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.feedback-categories label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.feedback-categories input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.feedback-message-label textarea {
  min-height: 120px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
}

.feedback-screenshot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f5;
  padding: 12px;
}

.feedback-screenshot p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.feedback-screenshot-preview {
  position: relative;
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.feedback-screenshot-preview img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.feedback-screenshot-preview button {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 30px;
  background: rgba(255, 255, 255, 0.94);
}

.feedback-questions {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.feedback-questions > strong {
  font-size: 15px;
}

.feedback-questions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.feedback-questions textarea {
  min-height: 70px;
  color: var(--text);
  font-weight: 500;
}

.feedback-error {
  border-left: 4px solid var(--danger);
  background: #fff7f5;
  color: #7a271a;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}

.feedback-success {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #b9d8d0;
  border-radius: 8px;
  background: #f3faf7;
  padding: 18px;
}

.feedback-success-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-size: 21px;
  font-weight: 900;
}

.feedback-success h3,
.feedback-success p {
  margin: 0;
}

.feedback-success p {
  margin-top: 4px;
  color: var(--muted);
}

.reference-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reference-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.reference-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reference-form label:first-child,
.reference-confirm,
.reference-form-actions {
  grid-column: 1 / -1;
}

.reference-confirm {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  min-height: 36px;
  color: var(--text) !important;
}

.reference-confirm input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-2);
}

.reference-sources {
  display: grid;
  gap: 9px;
}

.reference-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  border-left: 3px solid var(--accent-2);
  background: #f7fcfa;
  padding: 9px 11px;
}

.reference-source span {
  color: var(--muted);
  font-size: 12px;
}

.reference-source p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.reference-catalog {
  display: grid;
  gap: 8px;
}

.reference-catalog button {
  display: grid;
  grid-template-columns: minmax(140px, 0.65fr) minmax(180px, 1fr);
  gap: 3px 12px;
  min-height: 60px;
  padding: 9px 11px;
  text-align: left;
}

.reference-catalog button:hover,
.reference-catalog button:focus-visible {
  border-color: var(--accent-2);
  outline: none;
}

.reference-catalog span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-catalog strong {
  overflow-wrap: anywhere;
}

.reference-catalog small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.progress-panel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #ead9a9;
  border-radius: 8px;
  background: #fff8e8;
  padding: 14px;
}

.progress-panel p {
  margin: 4px 0 8px;
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #ead9a9;
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.analysis-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.analysis-section h3 {
  margin: 6px 0 0;
  font-size: 19px;
  line-height: 1.3;
}

.analysis-section p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.analysis-section pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f5;
  color: var(--muted);
  padding: 12px;
}

.voice-action {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  margin: 0 0 12px;
  padding: 11px 14px;
  border-color: #a8cec5;
  color: var(--accent-2);
  background: #f8fcfa;
  text-align: left;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.voice-action:hover,
.voice-action.attention {
  border-color: var(--accent-2);
  background: #edf8f4;
}

.voice-action:hover {
  box-shadow: 0 4px 14px rgba(14, 107, 89, 0.1);
}

.voice-action.attention {
  box-shadow: inset 3px 0 0 var(--accent-2);
}

.voice-action-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #a8cec5;
  border-radius: 50%;
  background: #fff;
}

.voice-action-icon span {
  position: relative;
  width: 12px;
  height: 19px;
  border: 2px solid var(--accent-2);
  border-radius: 7px;
}

.voice-action-icon span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 18px;
  height: 10px;
  border: 2px solid var(--accent-2);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  transform: translateX(-50%);
}

.voice-action-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.voice-action-copy strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.voice-action-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-action-chevron {
  color: var(--accent-2);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  text-align: right;
}

.voice-action.processing .voice-action-icon {
  animation: voice-action-pulse 1.8s ease-out infinite;
}

.voice-modal {
  width: 820px;
}

.voice-modal-body {
  min-height: 360px;
}

.voice-intro,
.voice-live-header,
.voice-progress,
.voice-success {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 18px 4px 22px;
}

.voice-intro h3,
.voice-progress h3,
.voice-success h3,
.voice-error-state h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.voice-intro p,
.voice-progress p,
.voice-success p,
.voice-error-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.voice-intro-mark,
.voice-pulse {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #a8cec5;
  border-radius: 50%;
  background: #f2faf7;
}

.voice-intro-mark span {
  width: 16px;
  height: 24px;
  border: 3px solid var(--accent-2);
  border-radius: 9px;
  position: relative;
}

.voice-intro-mark span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 22px;
  height: 13px;
  border: 3px solid var(--accent-2);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  transform: translateX(-50%);
}

.voice-boundaries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.voice-boundaries span {
  min-height: 58px;
  padding: 14px 16px 14px 28px;
  position: relative;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.voice-boundaries span + span {
  border-left: 1px solid var(--line);
}

.voice-boundaries span::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
}

.voice-start-row,
.voice-live-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.voice-start-row .primary {
  min-width: 190px;
}

.voice-live-header {
  grid-template-columns: 72px minmax(0, 1fr);
  border: 1px solid #b9d8d0;
  border-radius: 8px;
  background: #f3faf7;
  padding: 16px;
}

.voice-live-header span,
.voice-live-header strong {
  display: block;
}

.voice-live-header span {
  color: var(--accent-2);
  font-weight: 800;
}

.voice-live-header strong {
  margin-top: 4px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.voice-level {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 58px;
  height: 46px;
}

.voice-level i {
  width: 5px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent-2);
  animation: voice-level 1.1s ease-in-out infinite;
}

.voice-level i:nth-child(2) {
  height: 24px;
  animation-delay: 0.14s;
}

.voice-level i:nth-child(3) {
  height: 34px;
  animation-delay: 0.28s;
}

.voice-level i:nth-child(4) {
  height: 18px;
  animation-delay: 0.42s;
}

.voice-level.thinking i,
.voice-level.connecting i,
.voice-level.finalizing i {
  background: var(--warn);
}

.voice-transcript {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 2px;
}

.voice-turn {
  width: min(86%, 620px);
}

.voice-turn.user {
  justify-self: end;
}

.voice-turn span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.voice-turn.user span {
  text-align: right;
}

.voice-turn p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f7f4;
  padding: 10px 12px;
  line-height: 1.48;
}

.voice-turn.user p {
  border-color: #b9d8d0;
  background: #f2faf7;
}

.voice-transcript-empty {
  color: var(--muted);
  padding: 12px 0;
  text-align: center;
}

.voice-privacy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.voice-progress {
  border: 1px solid #b9d8d0;
  border-radius: 8px;
  background: #f3faf7;
  padding: 22px;
}

.voice-pulse span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: voice-pulse 1.2s ease-out infinite;
}

.voice-review-intro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.voice-review-intro span {
  color: var(--muted);
  font-size: 13px;
}

.voice-review-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
}

.voice-review-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.voice-review-form label:nth-of-type(3),
.voice-open-questions,
.voice-review-actions {
  grid-column: 1 / -1;
}

.voice-review-form textarea {
  min-height: 300px;
  color: var(--text);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  text-transform: none;
}

.voice-open-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-left: 3px solid var(--warn);
  background: #fffaf0;
  padding: 10px 12px;
}

.voice-open-questions strong {
  width: 100%;
}

.voice-open-questions span {
  border: 1px solid #ead9a9;
  border-radius: 999px;
  background: #fff;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
}

.voice-transcript-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.voice-transcript-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.voice-transcript-details[open] summary {
  margin-bottom: 10px;
}

.voice-error,
.voice-error-state {
  border-left: 4px solid var(--danger);
  background: #fff7f6;
  padding: 12px 14px;
  color: var(--danger);
}

.voice-error-state p {
  color: var(--muted);
}

.voice-success {
  border: 1px solid #b9d8d0;
  border-radius: 8px;
  background: #f3faf7;
  padding: 22px;
}

.voice-success > span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-2);
  color: #fff;
  font-size: 26px;
  font-weight: 900;
}

@keyframes voice-level {
  0%,
  100% {
    transform: scaleY(0.45);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes voice-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 107, 89, 0.32);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(14, 107, 89, 0);
  }
}

@keyframes voice-action-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 107, 89, 0.22);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(14, 107, 89, 0);
  }
}

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

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

  .side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .meta-grid,
  .split,
  .summary-cards,
  .dd-summary,
  .report-grid,
  .document-card,
  .dd-row,
  .dd-doc {
    grid-template-columns: 1fr;
  }

  .meta-grid.matter,
  .reference-form,
  .reference-catalog button {
    grid-template-columns: 1fr;
  }

  .reference-form label:first-child,
  .reference-confirm,
  .reference-form-actions,
  .reference-catalog small {
    grid-column: auto;
  }

  .case-reference-chip,
  .case-reference-more {
    max-width: 100%;
  }

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

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .legal-modal {
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
  }

  .modal-head,
  .progress-panel {
    grid-template-columns: 1fr;
  }

  .voice-boundaries,
  .voice-review-form,
  .feedback-categories,
  .feedback-channel-choice,
  .feedback-review-grid,
  .feedback-screenshot,
  .feedback-success {
    grid-template-columns: 1fr;
  }

  .feedback-voice-choice,
  .feedback-text-choice {
    min-height: 76px;
  }

  .feedback-review-intro {
    align-items: flex-start;
  }

  .feedback-screenshot-preview {
    grid-column: auto;
  }

  .voice-boundaries span + span {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .voice-review-form label:nth-of-type(3),
  .voice-open-questions,
  .voice-review-actions {
    grid-column: auto;
  }

  .voice-review-intro {
    display: grid;
  }

  .voice-intro,
  .voice-live-header,
  .voice-progress,
  .voice-success {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
  }

  .voice-action {
    grid-template-columns: 42px minmax(0, 1fr) 16px;
    gap: 10px;
    padding: 10px 12px;
  }

  .voice-action-copy small {
    white-space: normal;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .status-row {
    justify-content: flex-start;
  }

  .feedback-trigger {
    position: fixed;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 80;
    min-height: 48px;
    border-color: #78b5a8;
    background: #ffffff;
    padding: 0 16px;
    box-shadow: 0 8px 24px rgba(25, 38, 34, 0.2);
  }

  .case-view,
  .case-view > *,
  .panel,
  .meta-grid,
  .tabs,
  .dd-tabs,
  .report-sections,
  .report-sections > *,
  .report-findings,
  .evidence-list {
    min-width: 0;
    max-width: 100%;
  }

  .meta-grid,
  .panel,
  .tab-panel {
    width: 100%;
  }

  h1,
  .work-product,
  .work-product *,
  .work-product strong,
  .report-findings strong {
    overflow-wrap: anywhere;
  }
}
