.chip { border: 1px solid var(--border-control); color: #cfd3ef; padding: 9px 16px; border-radius: 20px; font-size: 14px; line-height: 21px; white-space: nowrap; }
.chip:hover { border-color: var(--accent); }
.chip.selected { background: var(--active); border-color: var(--active-border); }
.form-error { color: var(--rose); font-size: 13px; line-height: 19.5px; }
.form-error:empty { display: none; }
.capture-grid,.detective-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 20px; min-width: 0; }
.capture-editor { position: relative; min-height: 765.5px; padding: 22px; }
.capture-body { padding-top: 245.5px; padding-bottom: 115px; }
.capture-mic { position: absolute; top: 36px; left: calc(50% - 55px); width: 110px; height: 110px; border: 1px solid var(--accent); border-radius: 55px; display: grid; place-items: center; box-shadow: 0 0 0 12px rgba(174,149,246,.1); }
.capture-mic:hover { background: rgba(174,149,246,.08); }
.waveform { position: absolute; top: 172px; left: 22px; right: 22px; height: 50px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.waveform i { width: 4px; height: var(--bar-height); background: var(--accent); border-radius: 3px; }
.waveform.is-running i { animation: wave .9s ease-in-out var(--bar-delay) infinite alternate; }
@keyframes wave { from { transform: scaleY(.45); } to { transform: scaleY(1); } }
.capture-clock { position: absolute; top: 233px; left: 22px; right: 22px; text-align: center; }
.transcript { display: block; width: 100%; min-height: 83px; padding: 16px; border: 0; border-radius: 10px; resize: vertical; font: italic 400 17px/25.5px var(--heading); color: var(--text); }
.capture-feelings { margin-top: 12px; min-height: 27.5px; }
.feeling { padding: 0; border-radius: 20px; }
.feeling:hover { outline: 1px solid var(--accent); }
.feeling-picker { position: relative; }
.feeling-picker summary { list-style: none; cursor: pointer; }
.feeling-picker summary::-webkit-details-marker { display: none; }
.feeling-picker .filter-options { left: 0; right: auto; top: 30px; min-width: 140px; }
.analyze-button { margin-top: 12px; min-height: 45px; }
.capture-footer { position: absolute; bottom: 18px; left: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; }
.capture-footer .row { gap: 18px; flex-wrap: wrap; }
.capture-save { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; }
.capture-save label { font-size: 13px; color: var(--muted); }
.capture-save input { border-radius: 10px; padding: 12px 16px; width: 100%; }
.interviewer { display: flex; flex-direction: column; gap: 12px; }
.interview-question { font: 500 20px var(--heading); }
.interview-choices { flex-wrap: wrap; }
.possible-themes { min-height: 170.5px; display: flex; flex-direction: column; gap: 12px; }
.possible-themes .tags { row-gap: 8px; }
.possible-themes .tag:nth-child(3) { background: #143b45; color: var(--teal); }
.possible-themes .tag:nth-child(4) { background: #1f2f66; color: #9db6ff; }
.possible-link .source { border: 0; padding: 0; flex-direction: row; }
.possible-link .source-thumb { width: 60px; height: 60px; }
.possible-link .source-copy { display: flex; flex-direction: column-reverse; }
.possible-link .source-title { font-weight: 600; font-size: 15px; }
/* Constellation's natural-size asset and all node coordinates come from Figma. */
.constellation-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 20px; }
.graph-panel { position: relative; height: 704px; overflow: hidden; background: radial-gradient(ellipse 528px 528px at 50% 50%,#1a2250,#141b3a 70%); }
.graph-viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.graph-viewport.dragging { cursor: grabbing; }
.graph-plane { position: absolute; left: 0; top: 0; width: 788px; height: 704px; transform-origin: 0 0; will-change: transform; }
.graph-connectors { position: absolute; left: 0; top: 0; pointer-events: none; }
.graph-plane.filtered .graph-connectors { opacity: .13; }
.graph-filtered-lines { position: absolute; top: 0; left: 0; display: none; pointer-events: none; }
.graph-plane.filtered .graph-filtered-lines { display: block; }
.graph-node { position: absolute; width: 120px; display: flex; flex-direction: column; align-items: center; padding: 0; font-size: 13px; line-height: 19.5px; color: var(--text); }
.graph-node[hidden] { display: none; }
.graph-node-image { width: var(--node-size); height: var(--node-size); position: relative; overflow: hidden; flex-shrink: 0; }
.graph-node-image img { position: absolute; height: 100%; width: auto; left: 50%; top: 0; transform: translateX(-50%); }
.graph-node.selected .graph-node-image { border-color: var(--accent); box-shadow: 0 0 0 8px rgba(174,149,246,.16); }
.graph-node .graph-label { margin-top: 8px; font-weight: 500; }
.graph-node .graph-label { font-size: clamp(13px,calc(11px / var(--graph-fit,1)),24px); line-height: 1.5; }
.graph-count { color: var(--muted); font-size: clamp(13px,calc(10px / var(--graph-fit,1)),24px); line-height: 1.5; }
.graph-dot { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,255,255,.06); }
.graph-node.dot-node .graph-label { margin-top: 6px; font-size: clamp(12px,calc(10px / var(--graph-fit,1)),24px); line-height: 1.5; font-weight: 400; color: var(--muted); }
.graph-node.dot-node { min-height: calc(44px / var(--graph-fit,1)); }
.graph-node.dot-node.selected .graph-dot { outline: 2px solid white; outline-offset: 4px; }
.lavender { background: var(--accent); }
.rose { background: var(--rose); }
.teal { background: var(--teal); }
.graph-header { position: absolute; top: 0; left: 0; right: 0; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; gap: 12px; background: var(--surface); border-bottom: 1px solid #232c5a; }
.graph-header h3 { white-space: nowrap; }
.graph-header .row { gap: 8px; }
.graph-legend { position: absolute; left: 24px; bottom: 17px; display: flex; gap: 20px; font-size: 12px; line-height: 18px; color: var(--muted); pointer-events: none; }
.graph-legend span { display: flex; align-items: center; gap: 6px; }
.graph-legend i { width: 8px; height: 8px; border-radius: 50%; }
.graph-zoom { position: absolute; right: 20px; bottom: 18px; border: 1px solid var(--border-control); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.graph-zoom button { width: 34px; height: 34px; background: var(--inset); }
.graph-zoom button:hover { background: var(--active); }
.graph-reset { position: absolute; top: 68px; right: 16px; font-size: 11px; opacity: .7; }
.graph-evidence { height: 704px; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.graph-evidence > * { flex-shrink: 0; }
.graph-evidence-image { height: 120px; width: 100%; object-fit: cover; border-radius: 10px; }
.emotion-arc { gap: 8px; }
.emotion-arc .tag { padding-left: 14px; padding-right: 14px; }
.tone-note { margin-top: -4.75px; min-height: 35px; }
.graph-sources { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; flex: 1 1 auto; }
.graph-source { padding: 8px; min-height: 66px; flex-shrink: 0; }
.graph-source .source-thumb { width: 48px; height: 48px; border-radius: 6px; }
.graph-source .source-copy { font-size: 13px; line-height: 19.5px; }
.graph-evidence-actions { display: flex; flex-direction: column; gap: 18px; }
.graph-demo-note { margin-top: -8px; }
/* Detective — the initial conversation exactly follows the supplied screen. */
.detective-grid { height: max(620px,calc(100svh - 134.5px)); }
.chat-panel { padding: 22px; display: flex; flex-direction: column; gap: 16px; min-height: 0; position: relative; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding-right: 0; scrollbar-width: thin; }
.message-user { align-self: flex-end; padding: 12px 18px; border-radius: 14px 14px 2px 14px; background: var(--active); max-width: 94%; }
.message-assistant { padding: 17.25px 18px 18px; border-radius: 14px; background: var(--inset); display: flex; flex-direction: column; gap: 12px; }
.chat-citations { flex-wrap: wrap; }
.citation-pill:hover { outline: 1px solid var(--accent); }
.chat-followup { font: 500 20px var(--heading); }
.chat-composer { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border-control); padding: 13px 16px; border-radius: 10px; background: var(--inset); min-height: 64px; }
.chat-composer input { min-width: 0; width: 100%; border: 0; background: transparent; outline: none; }
.chat-composer:focus-within { border-color: var(--accent); }
.chat-send { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); }
.cited-entries { display: flex; flex-direction: column; gap: 18px; min-width: 0; overflow-y: auto; }
.cited-entry { display: flex; align-items: center; gap: 12px; padding: 22px; min-height: 107.5px; }
.cited-entry:hover,.cited-entry.highlighted { border-color: var(--accent); background: #1c234a; }
.cited-entry > img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.cited-entry > div { min-width: 0; }
.cited-entry strong { font-weight: 700; }
.detective-demo-note { position: absolute; bottom: 3px; left: 22px; right: 22px; font-size: 10px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-actions { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.local-entry-note { color: var(--muted); font-size: 13px; }
.local-reading { height: auto; min-height: 160.5px; }
.message-user,.message-assistant,.source-copy,.cited-entry strong { overflow-wrap: anywhere; }
.topbar > div:first-child,.page-title,h1 { min-width: 0; }
h1 { overflow-wrap: anywhere; }
.original p { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width:1250px) {
  .constellation-layout { grid-template-columns: minmax(0,1fr) 300px; }
  .graph-header { padding: 0 16px; flex-wrap: wrap; height: auto; min-height: 60px; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .graph-header .chip { padding: 6px 10px; font-size: 12px; }
  .graph-header h3 { font-size: 16px; }
  .graph-legend { gap: 12px; left: 14px; font-size: 10px; }
  .graph-evidence { padding: 16px; }
  .emotion-arc { gap: 5px; }
  .emotion-arc .tag { padding-left: 10px; padding-right: 10px; }
  .interview-choices .chip { padding: 7px 11px; font-size: 12px; }
}
@media (max-width:1000px) {
  .capture-grid,.detective-grid { grid-template-columns: 1fr; }
  .capture-editor { min-height: 700px; }
  .capture-sidebar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .possible-link { grid-column: 1 / -1; }
  .detective-grid { height: auto; }
  .chat-panel { height: 650px; }
  .cited-entries { overflow: visible; }
  .constellation-layout { grid-template-columns: minmax(0,1fr); }
  .graph-panel { height: 660px; }
  .graph-evidence { height: auto; overflow: visible; }
  .graph-sources { max-height: 380px; flex: auto; }
  .graph-evidence-image { height: 180px; }
  .graph-header { flex-wrap: nowrap; }
  .graph-legend { font-size: 12px; gap: 20px; }
}
@media (max-width:600px) {
  .capture-editor { padding: 18px; }
  .capture-body { padding-top: 245.5px; }
  .capture-sidebar { display: flex; }
  .capture-footer { left: 18px; right: 18px; }
  .capture-mic { width: 100px; height: 100px; left: calc(50% - 50px); }
  .capture-feelings { gap: 6px; }
  .capture-feelings .tag { padding-left: 10px; padding-right: 10px; }
  .capture-save { padding-bottom: 40px; }
  .graph-panel { height: 490px; }
  .graph-plane { top: 55px; }
  .graph-header { flex-wrap: wrap; justify-content: flex-start; padding: 12px 16px; }
  .graph-header h3 { width: 100%; }
  .graph-header .row { gap: 6px; }
  .graph-header .chip { padding: 7px 11px; }
  .graph-reset { top: 100px; }
  .graph-legend { left: 12px; bottom: 14px; gap: 10px; font-size: 10px; }
  .graph-zoom { bottom: 44px; right: 12px; }
  .graph-zoom button { width: 40px; height: 40px; }
  .graph-evidence { padding: 18px; }
  .chat-panel { padding: 18px; height: 620px; }
  .chat-followup { font-size: 18px; }
  .chat-composer { padding: 12px; }
  .message-assistant { padding: 16px; }
  .cited-entry { padding: 18px; }
  .detective-demo-note { left: 18px; right: 18px; font-size: 9px; }
}
@media (prefers-reduced-motion:reduce) { .waveform.is-running i { animation: none; } }
