:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #152033;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #dfe5ec;
  --soft: #f1f5f9;
  --brand: #111827;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

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

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 56px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand {
  width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.brand-title {
  font-size: 14px;
  font-weight: 900;
}

.brand-subtitle {
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
}

.session-status {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
  color: #475569;
}

.record-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.record-dot.active {
  background: var(--rose);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}

.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.primary,
.secondary,
.danger {
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

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

.secondary {
  background: var(--soft);
  color: #475569;
}

.feedback-toggle[aria-pressed="true"] {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.danger {
  background: var(--rose-soft);
  color: var(--rose);
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(520px, 1fr) 360px;
  overflow: hidden;
}

.left-panel {
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #eef2f6;
  padding: 14px;
}

.panel-title {
  margin-bottom: 12px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.section-label {
  margin: 14px 4px 7px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 900;
}

.section-label.live {
  color: var(--rose);
}

.thread {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px;
  background: transparent;
}

.thread:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.thread.disabled-thread {
  opacity: 0.48;
  cursor: not-allowed;
}

.thread.disabled-thread:hover {
  background: transparent;
  border-color: transparent;
}

.thread.active {
  background: var(--brand);
  color: #fff;
}

.thread strong,
.thread span,
.thread em {
  display: block;
}

.thread strong {
  font-size: 12px;
}

.thread span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.thread em {
  margin-top: 7px;
  color: var(--subtle);
  font-size: 10px;
  font-style: normal;
}

.thread.active span,
.thread.active em {
  color: #cbd5e1;
}

.transcript-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
}

.case-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.case-header p {
  margin: 0 0 4px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 900;
}

.case-header h1 {
  margin: 0;
  font-size: 18px;
}

.demo-notice {
  margin-top: 8px;
  max-width: 760px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

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

.case-tags span {
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.timer {
  align-self: flex-start;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 900;
}

.live-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #f8fafc;
  padding: 18px 20px;
}

.empty-state {
  max-width: 560px;
  margin: 80px auto;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  margin: 0 0 8px;
  color: #334155;
  font-size: 18px;
}

.utterance {
  max-width: 780px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 13px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.utterance.client {
  border-left: 4px solid var(--blue);
}

.utterance.lawyer {
  border-left: 4px solid var(--green);
  margin-left: 36px;
}

.utterance.ai {
  border-left: 4px solid var(--amber);
}

.utterance-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.speaker {
  font-size: 12px;
  font-weight: 900;
}

.time {
  color: var(--subtle);
  font-size: 11px;
}

.utterance p {
  margin: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.65;
}

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

.tags span {
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 900;
}

.consult-controls {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hint {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
}

.assist-panel {
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid #fde68a;
  background: var(--amber-soft);
  padding: 12px;
}

.assist-card {
  border: 1px solid #f3e4b4;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 13px;
  margin-bottom: 12px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.assist-card.updated {
  border-color: #60a5fa;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.assist-card.focus {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.card-title {
  margin-bottom: 8px;
  color: #92400e;
  font-size: 10px;
  font-weight: 900;
}

.assist-card h2 {
  margin: 0 0 7px;
  font-size: 14px;
}

.assist-card p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.55;
}

.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fact-grid div {
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 8px;
}

.fact-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 900;
}

.fact-grid strong {
  color: #334155;
  font-size: 12px;
}

.suggestions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.suggestions li {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}

.suggestions li:last-child {
  border-bottom: 0;
}

.law-card {
  border-radius: 12px;
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  padding: 10px;
  margin-bottom: 8px;
}

.law-card.muted {
  background: #f8fafc;
  border-color: var(--line);
}

.law-card strong {
  display: block;
  color: #1e3a8a;
  font-size: 12px;
  margin-bottom: 5px;
}

.law-card p {
  font-size: 11px;
}

.law-card em {
  display: inline-block;
  margin-top: 7px;
  border-radius: 999px;
  background: #fff;
  color: var(--amber);
  padding: 3px 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.plan-draft ul {
  margin: 0;
  padding-left: 17px;
}

.plan-draft li {
  margin-bottom: 7px;
  color: #334155;
  font-size: 12px;
  line-height: 1.5;
}

.feedback-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.feedback-row button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.feedback-row button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.feedback-row button.selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

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

.outputs-hint {
  margin-bottom: 9px !important;
  color: #64748b !important;
  font-size: 11px !important;
}

.outputs button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  padding: 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.outputs button.ready {
  border-color: #bbf7d0;
  background: var(--green-soft);
  color: var(--green);
}

.outputs button.ready:hover {
  border-color: var(--green);
  background: #dcfce7;
}

.output-doc {
  border-left-color: #7c3aed;
}

.feedback-note {
  max-width: 520px;
  border-left-color: var(--green);
  background: var(--green-soft);
}

.output-doc h3 {
  margin: 12px 0 6px;
  font-size: 13px;
}

.output-doc ul,
.output-doc ol {
  margin: 6px 0 0;
  padding-left: 18px;
}

.output-doc li {
  margin-bottom: 6px;
  color: #374151;
  font-size: 13px;
  line-height: 1.55;
}

.doc-warning {
  border-radius: 10px;
  background: var(--amber-soft);
  color: #92400e !important;
  padding: 10px;
}

.disclaimer {
  margin-top: 9px !important;
  color: #92400e !important;
  font-size: 11px !important;
}

.demo-questions {
  display: grid;
  gap: 8px;
}

.feedback-guide {
  display: none;
}

.feedback-mode .feedback-guide {
  display: block;
}

.demo-questions p {
  border-left: 3px solid var(--blue);
  background: #f8fafc;
  padding: 8px 9px;
}

.review-grid {
  display: grid;
  gap: 10px;
  margin: 10px 0 12px;
}

.review-grid > div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 9px;
}

.review-grid strong {
  color: #334155;
  font-size: 12px;
}

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

  .assist-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .brand {
    width: auto;
  }

  .brand-subtitle,
  .session-status,
  .top-actions .secondary:not(.feedback-toggle) {
    display: none;
  }

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

  .left-panel {
    display: none;
  }
}
