/* ready-chat.css - the proposal chat beside the files on Ready (ready-chat.js).
   Two panes on a wide screen: the files, checks and recommendation on the left, the conversation
   on the right, held in view while the page scrolls. One column on a narrow screen. Tokens only. */

.ready .ready-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 26px; align-items: start; }
.ready .ready-main { min-width: 0; }
.ready .ready-chat {
  position: sticky; top: calc(var(--topbar-h) + 16px);
  /* Ends above the PRISM Helper button (24px + 56px + 12px), which floats at the bottom right. */
  height: calc(100vh - var(--topbar-h) - 16px - 92px); min-height: 520px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--sh-2); overflow: hidden;
}
.ready .ready-chat.pc-drop { border-color: var(--primary); box-shadow: var(--sh-2), var(--ring-primary); }

.ready .pc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.ready .pc-title { display: flex; gap: 11px; align-items: flex-start; min-width: 0; }
.ready .pc-title h2 { font-size: 16px; letter-spacing: -.01em; }
.ready .pc-title p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ready .pc-spark { width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ready .pc-spark .ic { width: 18px; height: 18px; }
.ready .pc-version { flex: none; position: relative; }
.ready .pc-chip-ver { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ready .pc-versions summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; border-radius: var(--r-pill); }
.ready .pc-versions summary .pc-chip-ver { padding-right: 7px; transition: border-color var(--dur-2) var(--ease); }
.ready .pc-versions summary:hover .pc-chip-ver, .ready .pc-versions[open] summary .pc-chip-ver { border-color: var(--primary); color: var(--primary-text); }
.ready .pc-versions summary:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.ready .pc-versions summary::-webkit-details-marker { display: none; }
.ready .pc-versions summary .ic { width: 14px; height: 14px; color: currentColor; transition: transform var(--dur-1) var(--ease); }
.ready .pc-versions[open] summary .ic { transform: rotate(180deg); }
.ready .pc-ver-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 340px; max-height: 360px; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--sh-3); padding: 6px 12px; }
.ready .pc-ver { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.ready .pc-ver:first-child { border-top: 0; }
.ready .pc-ver strong { display: block; font-size: 13px; color: var(--ink); }
.ready .pc-ver span, .ready .pc-ver em { color: var(--muted); font-style: normal; }
.ready .pc-ver em { display: block; margin-top: 4px; }
.ready .pc-ver ul { margin: 6px 0 0; padding-left: 16px; color: var(--ink-2); line-height: 1.45; }
.ready .pc-ver ul.pc-ver-no { color: var(--warn-text); }

.ready .pc-status:empty { display: none; }
.ready .pc-status { padding: 10px 14px 0; }
.ready .pc-status .note { margin: 0; align-items: center; font-size: 12.5px; }
.ready .pc-status .note .btn { margin-left: auto; }
.ready .pc-updating { background: var(--info-bg); color: var(--info-text); }

.ready .pc-log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.ready .pc-empty { color: var(--muted); font-size: 13px; line-height: 1.55; display: flex; flex-direction: column; gap: 12px; }
.ready .pc-empty p { margin: 0; }
.ready .pc-starters { display: flex; flex-direction: column; gap: 7px; }
.ready .pc-starter { text-align: left; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2); font-size: 13px; line-height: 1.4; cursor: pointer; transition: border-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.ready .pc-starter:hover { border-color: var(--primary); color: var(--primary-text); }

.ready .pc-msg { display: flex; flex-direction: column; gap: 5px; max-width: 94%; }
.ready .pc-msg.mine { align-self: flex-end; align-items: flex-end; }
.ready .pc-msg.prism { align-self: flex-start; }
.ready .pc-meta { display: flex; gap: 8px; font-size: 11.5px; color: var(--faint); text-transform: capitalize; }
.ready .pc-meta span + span { text-transform: none; }
.ready .pc-bubble { padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.ready .pc-msg.mine .pc-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.ready .pc-msg.prism .pc-bubble { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 5px; }
.ready .pc-typing { display: inline-flex; align-items: flex-start; gap: 10px; color: var(--muted); min-width: 220px; }
.ready .pc-typing .spinner { margin-top: 3px; color: var(--primary); }
.ready .pc-progress { display: flex; flex-direction: column; gap: 2px; }
.ready .pc-progress strong { font-weight: 600; color: var(--ink); }
.ready .pc-elapsed { font-size: 12px; line-height: 1.45; color: var(--muted); }
.ready .pc-typing .pc-stop { margin-left: auto; align-self: center; flex: none; }
.ready .pc-queued { margin: 4px 2px 0; font-size: 12px; line-height: 1.45; color: var(--muted); text-align: right; }
.ready .pc-msg.prism .pc-bubble.pc-failed { display: flex; gap: 9px; align-items: flex-start; background: var(--warn-bg); border-color: transparent; color: var(--warn-text); }
.ready .pc-failed .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.ready .pc-notice { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 8px 11px; border-radius: var(--r-md); background: var(--info-bg); color: var(--info-text); font-size: 12.5px; line-height: 1.45; }
.ready .pc-notice .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.ready .pc-att { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.ready .pc-card { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 11px 13px; background: var(--surface); display: flex; flex-direction: column; gap: 7px; }
.ready .pc-card.is-proposed { border-color: var(--primary); box-shadow: var(--ring-primary); }
.ready .pc-card.is-discarded { opacity: .7; }
.ready .pc-card.is-proposed.is-stale { border-color: var(--line-strong); box-shadow: none; }
.ready .pc-card-h { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ready .pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ready .pc-list li { display: flex; gap: 8px; font-size: 12.8px; line-height: 1.45; color: var(--ink-2); }
.ready .pc-list .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.ready .pc-list.ok .ic { color: var(--ok); }
.ready .pc-list.no .ic { color: var(--warn); }
.ready .pc-thumbnails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 1px 0 2px; }
.ready .pc-thumbnails.one { grid-template-columns: minmax(0, 1fr); }
.ready .pc-thumb { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--muted); text-decoration: none; font-size: 12px; line-height: 1.3; border-radius: var(--r-sm); }
.ready .pc-thumb img { display: block; width: 100%; aspect-ratio: 8 / 5; object-fit: cover; object-position: top; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); transition: border-color var(--dur-2) var(--ease); }
.ready .pc-thumb:hover img { border-color: var(--primary); }
.ready .pc-thumb:hover span { color: var(--primary-text); }
.ready .pc-thumb:focus-visible { outline: none; box-shadow: var(--ring-primary); }
.ready .pc-more { align-self: flex-start; border: 0; background: transparent; padding: 2px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--primary-text); cursor: pointer; }
.ready .pc-more:hover { text-decoration: underline; }
.ready .pc-question { display: flex; gap: 8px; margin: 2px 0 0; font-size: 12.8px; line-height: 1.45; color: var(--info-text); }
.ready .pc-question .ic { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.ready .pc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 3px; }
.ready .pc-applied { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ok-text); }
.ready .pc-applied .ic { width: 15px; height: 15px; }
.ready .pc-muted { margin: 0; font-size: 12.5px; color: var(--muted); }

.ready .pc-foot { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 7px; background: var(--surface); }
.ready .pc-files:empty { display: none; }
.ready .pc-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ready .pc-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 9px; border-radius: var(--r-pill); background: var(--brand-tint); color: var(--primary-text); font-size: 12px; }
.ready .pc-chip.small { padding: 3px 9px; }
.ready .pc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.ready .pc-chip .ic { width: 13px; height: 13px; flex: none; }
.ready .pc-chip button { border: 0; background: transparent; color: inherit; padding: 2px; display: inline-flex; cursor: pointer; border-radius: 50%; }
.ready .pc-chip button:hover { background: var(--surface); }
.ready .pc-error { margin: 0; font-size: 12.5px; color: var(--danger-text); }
.ready .pc-composer { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 6px; background: var(--surface-2); transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.ready .pc-composer:focus-within { border-color: var(--primary); box-shadow: var(--ring-primary); }
.ready .pc-composer textarea, .ready .pc-composer textarea:focus { box-shadow: none; }
.ready .pc-composer textarea { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; resize: none; font: inherit; font-size: 13.5px; line-height: 1.45; padding: 7px 4px; color: var(--ink); min-height: 34px; }
.ready .pc-attach { width: 34px; height: 34px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ready .pc-attach:hover:not(:disabled) { background: var(--surface); color: var(--primary); }
.ready .pc-attach .ic { width: 18px; height: 18px; }
.ready .pc-send { width: 36px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ready .pc-send .ic { width: 17px; height: 17px; }
.ready .pc-hint { margin: 0; font-size: 11.5px; color: var(--faint); line-height: 1.4; }
/* The composer stays fully usable while PRISM works. */

@media (max-width: 1100px) {
  .ready .ready-grid { grid-template-columns: minmax(0, 1fr); }
  .ready .ready-chat { position: relative; top: 0; height: 640px; order: -1; }
}
@media (max-width: 600px) {
  .ready .ready-chat { height: 78vh; min-height: 460px; border-radius: var(--r-md); }
  .ready .pc-ver-list { width: calc(100vw - 48px); right: 8px; }
  .ready .pc-msg { max-width: 100%; }
}
