* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

.app-shell {
  display: flex;
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: #f5f6fa;
  color: #1f2933;
}

.sidebar {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background-color: #111827;
  color: #e5e7eb;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.logo-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.sidebar-title {
  margin-left: 10px;
}

.app-name {
  font-size: 13px;
  letter-spacing: 0.08em;
}

.app-subtitle {
  font-size: 11px;
  color: #9ca3af;
}

.sidebar-section {
  margin-top: 16px;
}

.sidebar-section-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 4px;
}

.sidebar-subtitle {
  font-size: 10px;
  color: #9ca3af;
  margin-bottom: 8px;
  line-height: 1.3;
}

.sidebar-item {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: default;
}

.sidebar-item-clickable {
  cursor: pointer;
  transition: background-color 0.2s;
}

.sidebar-item-clickable:hover {
  background: rgba(59, 130, 246, 0.12);
}

.sidebar-item-active {
  background: rgba(59, 130, 246, 0.18);
}

.sidebar-item-clickable.sidebar-item-active:hover {
  background: rgba(59, 130, 246, 0.18);
}

.tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
}

.tag-fixed {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.tag-adhoc {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

.tag-action {
  background: #fee2e2;
  color: #b91c1c;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  background-color: #ffffff;
  gap: 24px;
  min-width: 0;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.run-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  visibility: hidden;
}

.run-status-container {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.breadcrumb {
  font-weight: 600;
  font-size: 15px;
}

.case-meta {
  display: flex;
  gap: 24px;
}

.label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.value {
  font-size: 13px;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
}

.content {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.questions-column {
  flex: 2;
  padding: 16px 24px 24px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}

.document-column {
  flex: 1.5;
  padding: 16px 24px 24px 0;
  border-left: 1px solid #e5e7eb;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.section-title {
  font-size: 16px;
  margin-bottom: 12px;
}

.question-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 14px 16px;
  margin-bottom: 10px;
  min-width: 0;
  overflow: hidden;
}

.question-card-focus {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.question-title {
  font-weight: 600;
  font-size: 14px;
}

.question-subtitle {
  font-size: 12px;
  color: #6b7280;
}

.question-body {
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
}

.placeholder {
  color: #9ca3af;
  font-style: italic;
}

.primary-btn {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

.primary-btn-large {
  padding: 10px 24px;
  font-size: 14px;
}

.primary-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.prompt-block {
  background: #f9fafb;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.pdf-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.pdf-label {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-input {
  font-size: 11px;
}

.pdf-hint {
  color: #6b7280;
  font-size: 11px;
}

.prompt-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 4px;
}

.prompt-text {
  margin: 0;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0;
}

.comparison-title {
  font-weight: 600;
  font-size: 13px;
}

.comparison-meta {
  font-size: 11px;
  color: #6b7280;
  display: flex;
  gap: 12px;
}

.run-status {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
}

.run-status.running {
  background: #fef3c7;
  color: #92400e;
}

.run-status.done {
  background: #dcfce7;
  color: #166534;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.comparison-grid-single {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.comparison-column {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.column-title {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.comparison-body {
  padding: 8px;
  font-size: 12px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.comparison-body.muted {
  color: #9ca3af;
}

.assessment-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.assessment-exact {
  background: #d1fae5;
  color: #065f46;
}

.assessment-strong {
  background: #d1fae5;
  color: #047857;
}

.assessment-good {
  background: #fef3c7;
  color: #92400e;
}

.assessment-partial {
  background: #fed7aa;
  color: #9a3412;
}

.assessment-weak {
  background: #fecaca;
  color: #991b1b;
}

.assessment-none {
  background: #fecaca;
  color: #7f1d1d;
}

.assessment-error {
  background: #e5e7eb;
  color: #374151;
}

.assessment-reasoning {
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.empty-state {
  color: #9ca3af;
}

.bullet-key {
  font-weight: 600;
  margin-right: 4px;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.doc-title {
  font-weight: 600;
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #10b981;
  margin-right: 6px;
}

.doc-meta {
  font-size: 11px;
  color: #6b7280;
}

.doc-pill {
  padding: 2px 6px;
  border-radius: 999px;
  background: #e5e7eb;
  margin-right: 4px;
}

.doc-viewer {
  flex: 1;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  overflow: hidden;
}

.doc-frame {
  width: 100%;
  height: 100%;
  border: none;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}



/* Custom Prompt Styles */
.custom-prompt-card {
  border-color: #a78bfa;
  background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
}

.custom-prompt-input-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  min-width: 0;
  overflow: hidden;
}

.custom-prompt-label {
  font-weight: 600;
  font-size: 13px;
  color: #4c1d95;
}

.custom-prompt-textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8b4fe;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  background: #ffffff;
  box-sizing: border-box;
}

.custom-prompt-textarea:focus {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}

.custom-prompt-response {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  min-width: 0;
  overflow: hidden;
}

.response-section {
  margin-bottom: 16px;
  min-width: 0;
  overflow: hidden;
}

.response-title {
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}

.response-text {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.response-json {
  background: #1f2937;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.model-info {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  background: rgba(79, 70, 229, 0.1);
  border-radius: 6px;
  font-size: 12px;
}

.model-info-label {
  color: #6b7280;
  margin-right: 8px;
}

.model-info-value {
  color: #e5e7eb;
  font-weight: 500;
}