/* A task's thread on its page (steps, updates, quiet checks and comments in time order). */
.thread .tl .body { flex: 1; gap: 6px; }
.thread .tl .av { flex: none; }
.th-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.thread .tl .body .th-meta b { font-size: 13px; font-weight: 600; color: var(--ink); }
.thread .tl .body .th-meta time, .thread .tl .body .th-meta .th-queued { font-size: 12px; color: var(--ink-3); }
.thread .tl .body .th-meta .th-tag { font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 18px; padding: 0 8px; border-radius: 999px; background: var(--paper); color: var(--ink-2); border: 1px solid var(--line); }
.thread .tl .body .th-meta .th-tag-step { background: var(--mint); color: var(--mint-ink); border-color: transparent; }
.thread .tl .body .th-meta .th-tag-stale { background: var(--peach); color: var(--peach-ink); border-color: transparent; }
.thread .tl .body .th-meta .th-tag-now { background: var(--butter); color: var(--on-butter); border-color: transparent; }
.th-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.thread .tl .body .proof-link span { font-size: 13px; color: inherit; }

/* Every entry reads as a comment in a soft bubble; his own sit on butter so his voice stands out from the crew's. */
.th-bubble { align-self: flex-start; max-width: min(100%, 560px); display: flex; flex-direction: column; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 10px 14px; }
.th-bubble.mine { background: var(--butter-soft); border-color: var(--butter-line); }
.th-bubble.quiet { background: var(--peach-soft); border-color: var(--peach-line); }
.th-bubble .th-text { color: var(--ink); }
.th-bubble.quiet .th-text { color: var(--peach-ink); }
.th-bubble .bubble-shots { margin: 0; }

.tl .node.node-you { background: var(--ink); color: var(--on-ink); font-size: 12px; font-weight: 700; }
.tl .node.node-quiet { background: var(--peach); box-shadow: inset 0 0 0 1px var(--peach-line); }
.tl .node.node-quiet i { width: 7px; height: 7px; border-radius: 50%; background: var(--rust); animation: ember 2.8s var(--ease) infinite; }

.th-shots { display: flex; flex-wrap: wrap; gap: 8px; }
.th-shot { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.th-shot:hover { transform: translateY(-2px); box-shadow: var(--lift); }
.th-shot img { width: 132px; height: 84px; object-fit: cover; }

/* The comment box at the foot of the thread. */
.thread-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px 10px; background: var(--card); border: 1px solid var(--line-2); border-radius: 20px; padding: 8px 8px 10px 16px; transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.thread-box:focus-within { border-color: var(--ink-3); box-shadow: var(--lift); }
.thread-box textarea { min-width: 0; border: 0; outline: none; background: transparent; font-size: 15px; line-height: 22px; padding: 7px 0; resize: none; overflow-y: auto; max-height: 176px; color: var(--ink); }
.thread-box textarea::placeholder { color: var(--ink-3); }
.thread-box .send { width: 38px; height: 38px; border: 0; background: var(--ink); color: var(--on-ink); transition: transform .3s var(--ease); }
.thread-box .send:not(:disabled):hover { transform: translateX(2px); }
.thread-box .send:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }
.thread-hint { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }

@media (max-width: 860px) {
  .thread-box .send { width: 44px; height: 44px; }
  .thread-box textarea { font-size: 16px; }
  .th-shot img { width: 112px; height: 72px; }
}

/* A question card's "See updates · 7" button: a quiet pill in the card's header row, clear of the answer buttons. */
.note .who { flex-wrap: wrap; }
.note .who-label { flex: 1 1 auto; min-width: 0; }
.note-thread { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1; color: var(--butter-ink); font-variant-numeric: tabular-nums; background: rgba(var(--card-rgb), .55); border: 1px solid rgba(58,42,0,.18); border-radius: 999px; padding: 7px 12px; transition: background .2s var(--ease), border-color .2s var(--ease), transform .3s var(--ease); }
.note-thread:hover { background: rgba(var(--card-rgb), .9); border-color: var(--butter-ink); transform: translateY(-1px); }
.note-thread:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; }

/* The sheet the card's thread opens in: from the right on a computer, from the bottom on a phone. */
.sheet { margin: 0 0 0 auto; width: min(480px, 100vw); height: 100vh; height: 100dvh; max-width: none; max-height: none; padding: 0; border: 0; background: transparent; overflow: visible; }
.sheet::backdrop { background: rgba(29, 26, 22, .42); }
html:has(.sheet[open]) { overflow: hidden; }
.sheet-panel { height: 100%; display: flex; flex-direction: column; background: var(--card); border-radius: 22px 0 0 22px; box-shadow: -24px 0 48px -32px rgba(29, 26, 22, .55); }
.sheet[open] .sheet-panel { animation: sheet-in .45s var(--ease) both; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: calc(20px + env(safe-area-inset-top)) 20px 14px 24px; border-bottom: 1px solid var(--line); }
.sheet-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sheet-kicker { font-family: var(--hand); font-size: 20px; line-height: 1; color: var(--pen); }
.sheet-title { font-family: var(--hand); font-size: 30px; line-height: 1.02; font-weight: 700; letter-spacing: 0; color: var(--ink); overflow-wrap: anywhere; }
.sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--ink-2); }
.sheet-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 20px 4px 24px; }
.sheet-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)) 24px; border-top: 1px solid var(--line); background: var(--paper); }
.sheet-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-decoration: none; }
.sheet-link:hover { text-decoration: underline; }
@keyframes sheet-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 860px) {
  .note-thread { min-height: 44px; padding: 0 14px; }
  .sheet { margin: auto 0 0; width: 100vw; height: 90vh; height: 90dvh; }
  .sheet-panel { border-radius: 22px 22px 0 0; box-shadow: 0 -24px 48px -32px rgba(29, 26, 22, .55); }
  .sheet[open] .sheet-panel { animation-name: sheet-up; }
  .sheet-head { padding: 18px 16px 12px; }
  .sheet-title { font-size: 27px; }
  .sheet-list { padding: 16px 16px 4px; }
  .sheet-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .sheet[open] .sheet-panel { animation: none; }
  .note-thread:hover { transform: none; }
}
