* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f7f8;
  color: #1a1a1a;
}

.access-gate {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: #f6f7fb;
}

.access-gate[hidden] { display: none; }

.access-card {
  width: min(100%, 29rem);
  padding: 2rem;
  border: 1px solid #e1e5ef;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1.25rem 3.75rem rgba(24, 39, 75, 0.12);
}

.access-card h1 { margin: 0.2rem 0 0.7rem; font-size: 1.55rem; }
.access-card label { display: grid; gap: 0.4rem; margin: 1.25rem 0 0.8rem; font-weight: 600; }
.access-card input { padding: 0.75rem; border: 1px solid #cbd3e1; border-radius: 0.45rem; font: inherit; }
.access-card button { width: 100%; }
.access-mark { width: 2.25rem; height: 2.25rem; object-fit: contain; }
.access-help { margin: 1.15rem 0 0; font-size: 0.9rem; color: #586174; }
.app { max-width: 1200px; margin: 0 auto; padding: 24px; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
h1 { font-size: 20px; margin: 0; }
h2 { margin: 0; font-size: 17px; line-height: 1.3; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 28px; height: 28px; object-fit: cover; border-radius: 7px; }
.controls { display: flex; gap: 8px; }
input { padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; width: 220px; }
button { padding: 8px 14px; border-radius: 8px; border: none; background: #111; color: #fff; cursor: pointer; font-size: 13px; }
button:hover { background: #333; }
button.secondary { background: #fff; color: #111; border: 1px solid #ddd; }
button.secondary:hover { background: #f0f0f0; }
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; }
.session-list, .session-detail { background: #fff; border-radius: 12px; padding: 16px; border: 1px solid #eee; min-height: 400px; }
.session-item { padding: 10px; border-radius: 8px; cursor: pointer; margin-bottom: 6px; font-size: 13px; border: 1px solid transparent; }
.session-item:hover { background: #f5f5f5; }
.session-item.active { background: #eef2ff; border-color: #c7d2fe; }
.session-item .meta { color: #888; font-size: 11px; margin-top: 2px; }
.empty { color: #999; font-size: 13px; }
.section-title { font-size: 14px; font-weight: 600; margin: 18px 0 10px; }
.feedback-card { border: 1px solid #eee; border-radius: 10px; padding: 12px; margin-bottom: 8px; font-size: 13px; }
.feedback-card .tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: #f0f0f0; margin-bottom: 6px; }
.feedback-card .tag.bug { background: #fee2e2; color: #b91c1c; }
.feedback-card .tag.confusion { background: #fef3c7; color: #92400e; }
.feedback-card .tag.idea { background: #dbeafe; color: #1e40af; }
.feedback-card .tag.praise { background: #dcfce7; color: #166534; }
.feedback-card .selector { color: #888; font-size: 11px; margin-top: 4px; font-family: monospace; }
.feedback-card .context-line { color: #666; font-size: 12px; margin-top: 6px; font-weight: 500; }
.feedback-card .participant-attribution { color: #475569; font-size: 12px; margin: 2px 0 8px; }
.feedback-card .observation-label, .followup-label { color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin: 6px 0 3px; }
.participant-summary { color: #475569; font-size: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 10px; margin: -4px 0 10px; }
.feedback-card .tech-details { margin-top: 4px; }
.feedback-card .tech-details summary { font-size: 10px; color: #bbb; cursor: pointer; }
.feedback-card .tech-details .selector { margin-top: 2px; }
.feedback-card .screenshot { display: block; max-width: 100%; border-radius: 6px; border: 1px solid #eee; margin: 8px 0; }
.feedback-card .screenshot-wrap { position: relative; margin: 8px 0; }
.feedback-card .pin {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dc2626;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #dc2626;
  transform: translate(-50%, -50%);
}
.tag.classification { background: #ede9fe; color: #5b21b6; }
.tag.classification.high, .tag.classification.critical { background: #fee2e2; color: #b91c1c; }
.tag.classifying { background: #f5f5f5; color: #aaa; font-style: italic; }
.prescription-card { border: 1px solid #ddd; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.prescription-card.evidence-gap { border-color: #fde68a; background: #fffbeb; }
.prescription-card h3 { margin: 0 0 8px; font-size: 14px; }
.prescription-card .severity { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-bottom: 8px; margin-right: 6px; }
.confidence-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-bottom: 8px; }
.confidence-badge.grounded { background: #dcfce7; color: #166534; }
.confidence-badge.provisional { background: #e5e7eb; color: #4b5563; }
.confidence-badge.gap { background: #fef3c7; color: #92400e; }
.severity.low { background: #e5e7eb; color: #374151; }
.severity.medium { background: #fef3c7; color: #92400e; }
.severity.high { background: #fed7aa; color: #9a3412; }
.severity.critical { background: #fee2e2; color: #b91c1c; }
.prescription-card .label { font-weight: 600; font-size: 12px; margin-top: 8px; }
.prescription-card p { font-size: 13px; margin: 4px 0 8px; line-height: 1.5; }
.review-panel { margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; }
.review-label { color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.review-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.review-actions button { padding: 5px 9px; font-size: 11px; }
.review-actions button.selected { background: #e0e7ff; border-color: #818cf8; color: #3730a3; }
.review-note { display: block; width: 100%; min-height: 54px; margin-top: 8px; padding: 7px 8px; border: 1px solid #ddd; border-radius: 6px; font: inherit; font-size: 12px; resize: vertical; }
.review-status { color: #64748b; font-size: 11px; margin-top: 5px; }
.synthesis-run { border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.synthesis-run.collapsed { background: #fafafa; }
.synthesis-run-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; font-size: 12px; }
.synthesis-run-meta { color: #64748b; margin-left: 7px; font-size: 11px; }
.synthesis-run-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.synthesis-run-actions button { padding: 5px 9px; font-size: 11px; }
.synthesis-run-findings { padding: 0 12px 12px; }
.synthesis-run.collapsed .synthesis-run-findings { display: none; }
.dismissed-finding { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; color: #64748b; font-size: 12px; background: #fafafa; }
.dismissed-finding button { padding: 5px 9px; font-size: 11px; }

.followup { margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; }
.followup.answered { background: #f5f5f5; }
.followup.answered .followup-q { display: block; color: #888; font-style: italic; margin-bottom: 3px; }
.followup.answered .followup-a { display: block; color: #111; font-weight: 500; }
.followup .followup-q { display: block; color: #78716c; font-style: italic; }
.followup.pending { background: #fffbeb; color: #92400e; }
.followup.skipped { background: #f5f5f5; color: #999; font-style: italic; }
pre.change-request { background: #0d1117; color: #c9d1d9; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; white-space: pre-wrap; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.top-bar-actions { display: flex; gap: 8px; align-items: center; }
button.danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

.create-session { background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.pilot-setup { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 24px; align-items: start; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.pilot-setup > div > p:last-child, .section-heading > p { margin: 7px 0 0; color: #64748b; font-size: 13px; line-height: 1.5; }
.eyebrow { margin: 0 0 5px; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pilot-steps { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; counter-reset: pilot; }
.pilot-steps li { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; align-items: start; font-size: 12px; color: #475569; line-height: 1.35; }
.pilot-steps li::before { content: counter(pilot); counter-increment: pilot; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-weight: 700; font-size: 11px; grid-row: span 2; }
.pilot-steps strong { color: #1e293b; font-size: 12px; }
.pilot-steps span { grid-column: 2; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 14px; }
.section-heading > p { max-width: 410px; }
.create-session-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.create-session label { display: block; font-size: 11px; color: #888; }
.create-session input { width: 100%; margin-top: 4px; padding: 7px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; box-sizing: border-box; }
.mode-toggle { display: flex; gap: 8px; margin-bottom: 6px; }
.mode-btn { padding: 8px 14px; border-radius: 8px; border: 1px solid #ddd; background: #f5f5f5; font-size: 13px; cursor: pointer; }
.mode-btn.selected { border: 2px solid #6366f1; background: #eef2ff; color: #4338ca; }
.mode-hint { font-size: 11px; color: #999; margin: 0 0 12px; }
.invite-result { display: flex; justify-content: space-between; align-items: center; background: #dcfce7; border-radius: 8px; padding: 10px 14px; margin-top: 10px; }
.invite-label { font-size: 11px; color: #166534; margin: 0; }
.invite-code { font-size: 18px; font-weight: 600; color: #166534; margin: 2px 0 0; letter-spacing: 1px; }
.widget-setup { margin-top: 12px; padding: 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.widget-setup-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.setup-badge { border: 1px solid #c7d2fe; border-radius: 999px; padding: 3px 8px; background: #eef2ff; color: #3730a3; font-size: 11px; font-weight: 600; white-space: nowrap; }
.widget-setup > p { max-width: 760px; margin: 8px 0; color: #475569; font-size: 13px; line-height: 1.5; }
.widget-setup code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.widget-snippet { margin: 10px 0; padding: 12px; overflow-x: auto; border-radius: 8px; background: #0d1117; color: #c9d1d9; font-size: 12px; line-height: 1.5; white-space: pre; }
.widget-setup-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: #64748b; font-size: 11px; line-height: 1.4; }
.widget-setup-actions span { max-width: 520px; }
.setup-next { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e2e8f0; color: #334155; font-size: 12px; line-height: 1.5; }
.create-status { font-size: 12px; color: #dc2626; min-height: 16px; margin: 8px 0 0; }

@media (max-width: 720px) {
  .app { padding: 16px; }
  .layout, .pilot-setup { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading > p { max-width: none; }
  .controls { width: 100%; }
  .controls input { min-width: 0; flex: 1; }
  .widget-setup-heading { align-items: start; }
}
