/* Thoughts: a capture box and a stream, with the selected thought beside it.
   People carry the amber rule, agents the dashed periwinkle one. Confirmed
   connections are solid; suggested ones are dashed and labelled until a person
   confirms them. */
.thoughts-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:28px; align-items:start; }
.thought-list { display:grid; gap:14px; min-width:0; }

.thought-capture { display:grid; gap:8px; padding:16px 18px; border:1px solid var(--line); border-left:3px solid var(--human); border-radius:var(--radius-panel); background:var(--surface); }
.thought-capture>label { font-family:var(--font-display); font-size:16px; font-weight:620; }
.thought-capture textarea { min-height:84px; background:var(--surface-subtle); }
.thought-capture-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.thought-capture-actions .button.primary { margin-left:auto; }
.thought-hint { font-size:12.5px; color:var(--faint); }
.thought-capture .message { margin:0; }
.thought-files { display:flex; flex-wrap:wrap; gap:8px; margin:0; padding:0; list-style:none; }
.thought-file { display:flex; align-items:center; gap:8px; max-width:100%; padding:4px 4px 4px 6px; border:1px solid var(--line); border-radius:var(--radius-control); background:var(--surface-subtle); font-size:12.5px; }
.thought-file img { width:40px; height:40px; object-fit:cover; border-radius:6px; }
.thought-file-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:22ch; }

.thought-filters { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin-top:6px; }
.thought-filter { min-height:32px; padding:4px 12px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--muted); font-size:13px; font-weight:550; }
.thought-filter:hover { color:var(--ink); border-color:var(--line-strong); }
.thought-filter[aria-pressed="true"] { background:var(--surface-hover); color:var(--ink); border-color:var(--line-strong); }
.thought-count { margin-left:auto; font-size:12.5px; color:var(--faint); }
.thought-empty { padding:18px 0; color:var(--muted); }

.thought-stream { display:grid; gap:10px; margin:0; padding:0; list-style:none; }
.thought-card { display:grid; gap:8px; width:100%; padding:14px 16px; border:1px solid var(--line); border-left:3px solid var(--human); border-radius:var(--radius-control); background:var(--surface); color:var(--ink); text-align:left; cursor:pointer; min-width:0; }
.thought-card:hover { background:var(--surface-hover); }
.thought-card[aria-current="true"] { border-color:var(--line-strong); border-left-color:var(--human); background:var(--surface-hover); box-shadow:inset 0 0 0 1px var(--line-strong); }
.thought-row.agent .thought-card { border-left:3px dashed var(--agent); }
.thought-row.set-aside .thought-card { background:var(--surface-subtle); }
.thought-row.set-aside .thought-text { color:var(--muted); }
.thought-card-head,.thought-detail-head,.thought-message-head { display:flex; align-items:center; flex-wrap:wrap; gap:6px 10px; min-width:0; }
.thought-author { display:inline-flex; align-items:center; gap:8px; min-width:0; font-size:13px; overflow-wrap:anywhere; }
.thought-agent-label { padding:1px 8px; border-radius:999px; font-size:12px; font-weight:550; color:var(--agent); background:var(--agent-soft); }
.thought-time { font-size:12px; color:var(--faint); }
.thought-card-head .badge { margin-left:auto; }
.thought-text { font-size:14px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.thought-card-meta { display:flex; flex-wrap:wrap; gap:4px 14px; font-size:12.5px; color:var(--muted); }
.thought-connected { color:var(--done); }
.thought-suggested { color:var(--agent); }
.thought-thumbs { display:flex; flex-wrap:wrap; gap:6px; }
.thought-thumbs img { width:72px; height:54px; object-fit:cover; border-radius:6px; border:1px solid var(--line); background:var(--sunk); }
.thought-file-chip { padding:2px 8px; border-radius:6px; background:var(--surface-hover); font-size:12px; color:var(--muted); }

.thought-detail { position:sticky; top:16px; padding:20px 22px 22px; min-width:0; }
.thought-detail-body { display:grid; gap:16px; min-width:0; }
.thought-back { display:none; justify-self:start; }
.thought-detail-head .button { margin-left:auto; min-height:30px; font-size:12.5px; }
.thought-detail-text { font-family:var(--font-display); font-size:19px; line-height:1.4; font-weight:560; letter-spacing:-.01em; white-space:pre-wrap; overflow-wrap:anywhere; }
.thought-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; }
.thought-gallery img { width:100%; max-height:420px; object-fit:contain; border-radius:var(--radius-control); border:1px solid var(--line); background:var(--sunk); }
.thought-gallery .button { justify-self:start; }
.thought-detail .message { margin:0; }
.thought-detail h2 { margin-bottom:10px; }

.thought-state:empty { display:none; }
.thought-aside { display:grid; gap:4px; padding:12px 14px; border-left:3px solid var(--line-strong); border-radius:var(--radius-control); background:var(--surface-subtle); }
.thought-aside p { white-space:pre-wrap; overflow-wrap:anywhere; }
.thought-aside .button { justify-self:start; margin-top:6px; }
.thought-set-aside>summary,.thought-connect>summary { width:fit-content; cursor:pointer; font-size:13px; color:var(--muted); }
.thought-set-aside[open]>summary,.thought-connect[open]>summary { color:var(--ink); margin-bottom:8px; }
.thought-set-aside { display:grid; gap:6px; }
.thought-set-aside[open] { display:grid; }
.thought-set-aside .button { justify-self:start; }

.thought-connections,.thought-discussion { padding-top:16px; border-top:1px solid var(--line); }
.thought-links { display:grid; gap:8px; margin:0 0 12px; padding:0; list-style:none; }
.thought-link { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; align-items:center; padding:10px 12px; border-radius:var(--radius-control); border:1px solid var(--line); border-left:3px solid var(--done); background:var(--surface-subtle); }
.thought-link.suggested { border:1px dashed var(--agent); border-left:3px dashed var(--agent); background:var(--agent-soft); }
.thought-link-target { grid-column:1; justify-self:start; max-width:100%; padding:0; border:0; background:transparent; color:var(--ink); font-size:14px; font-weight:560; text-align:left; overflow-wrap:anywhere; cursor:pointer; }
.thought-link-target:hover:not(:disabled) { text-decoration:underline; }
.thought-link-target:disabled { cursor:default; }
.thought-link-meta { grid-column:1; display:flex; flex-wrap:wrap; gap:2px 10px; font-size:12.5px; color:var(--muted); }
.thought-link-verb { font-weight:550; color:var(--ink); }
.thought-link.suggested .thought-link-meta { color:var(--agent); }
.thought-link-actions { grid-column:2; grid-row:1 / span 2; display:flex; gap:6px; }
.thought-link-actions .button { min-height:30px; font-size:12.5px; }
.thought-connect-row { display:grid; grid-template-columns:minmax(0,.6fr) minmax(0,1.4fr) auto; gap:8px; align-items:end; }
.thought-connect-row label { display:grid; gap:4px; font-size:12.5px; color:var(--muted); min-width:0; }
.thought-connect-row select { width:100%; }

.thought-messages { display:grid; margin:0 0 12px; padding:0; list-style:none; }
.thought-message { padding:12px 0 12px 14px; border-left:2px solid var(--human); }
.thought-message+.thought-message { border-top:1px solid var(--line); }
.thought-message.agent { border-left:2px dashed var(--agent); }
.thought-message-text { margin:6px 0 0 28px; white-space:pre-wrap; line-height:1.6; overflow-wrap:anywhere; }
.thought-reply { display:grid; gap:8px; justify-items:start; }
.thought-reply textarea { min-height:72px; }

@media (max-width:960px) {
  .thoughts-layout { grid-template-columns:minmax(0,1fr); }
  .thought-detail { position:static; }
  .thoughts.thought-selected .thought-list { display:none; }
  .thought-back { display:inline-flex; }
}
@media (max-width:560px) {
  .thought-capture,.thought-detail { padding:14px; }
  .thought-capture-actions .button.primary { width:100%; margin-left:0; }
  .thought-count { margin-left:0; flex-basis:100%; }
  .thought-link { grid-template-columns:minmax(0,1fr); }
  .thought-link-actions { grid-column:1; grid-row:auto; }
  .thought-connect-row { grid-template-columns:minmax(0,1fr); }
  .thought-message-text { margin-left:0; }
  .thought-filter { min-height:44px; }
}
