/* Producer Hub */

/* Phase 7: override --text-muted locally so Producer muted text meets WCAG AA (4.5:1)
   on every Producer background (bg-primary / bg-secondary / bg-tertiary).
   #98a1ab yields ≥6:1 on all three. */
.producer-hub { --text-muted: #98a1ab; position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-5); }
/* Responsive inspector track: widens on large screens, collapses to 0 when the
   desktop collapse control is toggled (Phase 5). */
.producer-layout { display: grid; grid-template-columns: 1fr clamp(320px, 28vw, 380px); gap: 0; flex: 1; min-height: 0; overflow: hidden; }
.producer-layout:has(.producer-side-panel--collapsed) { grid-template-columns: 1fr 0px; }
.page-content:has(.producer-hub) { overflow: hidden; padding: 0; }

/* Chat panel */
.producer-chat-panel { display: flex; flex-direction: column; height: 100%; min-width: 0; overflow: hidden; border-right: 1px solid var(--border); }
.producer-session-bar { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-4) var(--space-8); font-size: 12px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); flex-shrink: 0; min-height: 44px; }
.producer-session-identity { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--text-primary); font-weight: 600; }
.producer-session-avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; object-fit: cover; overflow: hidden; background: var(--accent-blue); color: #fff; font-size: 8px; font-weight: 700; }
.producer-session-meta { display: inline-flex; align-items: center; gap: var(--space-5); }
.producer-session-week { color: var(--text-muted); }
.producer-session-status { font-weight: 600; text-transform: capitalize; }
.producer-session-status.active { color: var(--accent-green); }
.producer-session-status.completed { color: var(--text-muted); }
.producer-background-status { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-3); color: var(--text-muted); font-size: 12px; }
.producer-background-status.active { color: var(--accent-blue); font-weight: 600; }
.producer-background-status.done { color: var(--accent-green); }
.producer-background-status.error { color: var(--danger); }
.producer-mode-switch { display: none; align-items: center; margin-left: auto; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-4); background: var(--bg-primary); }
.producer-mode-option { min-height: 32px; padding: var(--space-2) var(--space-5); border: 0; border-radius: var(--radius-3); background: transparent; color: var(--text-muted); font: inherit; font-weight: 600; cursor: pointer; }
.producer-mode-option:hover { color: var(--text-primary); }
/* Phase 3: all rgba(88,166,255,x) tints below derive from --accent-blue via
   color-mix so the palette retunes in one place. Values equal the previous
   literals, so there is no perceptible change. */
.producer-mode-option:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-blue) 40%, transparent); }
.producer-mode-option.active { background: var(--bg-tertiary); color: var(--text-primary); }
/* Phase 6: the session-bar [Chat | Context] toggle switch is the intended
   mobile control for switching between Chat and Context, so it stays visible
   above the drawer. The Context drawer's standalone "Chat" back button
   (#producerContextClose) is what created the duplicate, so hide it while the
   drawer is open — the toggle's "Chat" option is the single back action. */
.producer-hub--context .producer-context-close { display: none; }

/* Messages */
/* Phase 5: widened measure (was 820px) so the conversation fills the pane like
   Task List / Timeline while keeping a comfortable reading line length at 13px.
   The composer uses the same max-width (see .producer-input-row > *) so the
   column aligns top-to-bottom. margin-inline auto keeps both gutters symmetric. */
.producer-messages { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-6); background: var(--bg-primary); }
.producer-messages > * { width: 100%; max-width: min(920px, 100%); margin-inline: auto; box-sizing: border-box; }
/* producer-loading remains a layout wrapper; the spinner + text come from the shared .loading partial */
.producer-loading { font-size: 13px; padding: 20px; }
.producer-loading .loading { width: 100%; padding: 0; }
.producer-error { color: var(--danger); padding: 20px; font-size: 13px; }
.producer-empty-chat { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); flex: 1; text-align: center; padding: var(--space-8); color: var(--text-muted); }
.producer-ai-icon { display: flex; opacity: 0.45; }
.producer-ai-icon svg { width: 24px; height: 24px; }
.producer-empty-chat p { max-width: 440px; margin: 0; font-size: 13px; }

.producer-message { display: flex; gap: var(--space-5); align-items: flex-start; animation: producerMsgIn 0.18s ease; }
@keyframes producerMsgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.producer-message-mine { flex-direction: row-reverse; }
.producer-message-mine .producer-message-body { align-items: flex-end; }
.producer-message-continuation { margin-top: calc(-1 * var(--space-3)); }
.producer-message-continuation .producer-message-avatar { visibility: hidden; }
/* Phase 4 (final): surface tint + ring only. The left-edge accent was tried
   and rejected — it reads as a generic "AI system marker" because it's the
   same motif used by observation cards, knowledge entries, and reply quotes
   elsewhere in the panel. Tints are slightly richer than the original
   Phase-1 values so each type is clearly distinguishable at a glance. */
.producer-message-mine .producer-message-text { background: color-mix(in srgb, var(--accent-blue) 10%, transparent); color: var(--text-primary); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-blue) 35%, transparent) inset; }

.producer-message-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; overflow: hidden; }
/* AI identity gradient — intentional brand for the AI avatar, kept as a literal
   blend of the accent-purple / accent-blue tokens' current values (Phase 3). */
.producer-ai-avatar { background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue)); }
.producer-user-avatar { object-fit: cover; }
.producer-message-body { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: calc(100% - 42px); }
.producer-message-meta { display: flex; align-items: baseline; gap: var(--space-4); }
.producer-message-meta-continuation { position: absolute; top: 50%; right: calc(100% + var(--space-2)); transform: translateY(-50%); z-index: 1; }
.producer-message-mine .producer-message-meta-continuation { right: auto; left: calc(100% + var(--space-2)); }
.producer-message-meta-continuation .producer-msg-reply-btn { margin-left: 0; }
.producer-message-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.producer-message-time { font-size: 11px; color: var(--text-muted); }
.producer-message-text { background: var(--bg-secondary); border-radius: var(--radius-6); padding: var(--space-4) var(--space-6); font-size: 13px; line-height: 1.5; color: var(--text-primary); overflow-wrap: anywhere; }
.producer-message-ai .producer-message-body .md-content { min-width: 0; max-width: 100%; background: var(--bg-secondary); border: 0; border-radius: var(--radius-6); padding: var(--space-4) var(--space-6); font-size: 13px; overflow-wrap: anywhere; }
.producer-message-body .md-content pre { max-width: 100%; overflow-x: auto; }
.producer-message-body .md-content img,
.producer-message-body .message-image-gallery { max-width: 100%; }
/* Streaming — live "writing now" ring, distinct from the static type tints. */
.producer-message-streaming .producer-message-body .md-content { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-blue) 34%, transparent) inset; }
/* Phase 4 (final): surface tint + ring per message type (no left-edge accent). */
.producer-message-standup .producer-message-body .md-content { background: color-mix(in srgb, var(--accent-purple) 9%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-purple) 50%, transparent) inset; }
.producer-message-system .producer-message-body .md-content { background: color-mix(in srgb, var(--accent-blue) 7%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-blue) 40%, transparent) inset; }
.producer-message-for-me .producer-message-body .md-content { background: color-mix(in srgb, var(--accent-highlight) 8%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-highlight) 55%, transparent) inset; }

.producer-typing-indicator { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-5) 14px; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--radius-6); }
.producer-typing-indicator span { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; animation: producerTyping 1.2s infinite; }
.producer-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.producer-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes producerTyping { 0%, 60%, 100% { opacity: 0.3; transform: scale(1); } 30% { opacity: 1; transform: scale(1.3); } }

/* Input */
/* Composer: one visible surface. The textarea sits directly on the composer
   background — no nested bordered field — and a single :focus-within ring marks
   the active state. */
/* Phase 5: align the composer to the same measure as the message column so the
   whole conversation reads as one column (see .producer-messages > *). The
   16px padding matches .producer-messages exactly so both columns line up. */
.producer-input-row { padding: var(--space-8); flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.producer-input-row > * { width: 100%; max-width: min(920px, 100%); box-sizing: border-box; }
.producer-input-wrap { position: relative; display: flex; flex-direction: column; gap: var(--space-3); flex: 1; min-width: 0; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-5); padding: var(--space-4); transition: border-color 0.15s, box-shadow 0.15s; }
.producer-input-wrap:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 18%, transparent); }
/* Composer row: [attach icon] [flat textarea] [send] — all in one surface */
.producer-input-wrap .producer-composer-row { display: flex; gap: var(--space-3); align-items: flex-end; min-width: 0; }
/* Shared icon-only control look for the attachment and send buttons */
.producer-composer-icon-btn { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: var(--radius-4); color: var(--text-muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.producer-composer-icon-btn:hover { background: var(--bg-primary); color: var(--text-primary); }
.producer-composer-icon-btn:focus-visible { outline: none; color: var(--text-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 30%, transparent); }
.producer-composer-icon-btn svg { display: block; }
/* Flat textarea — sits directly on the composer surface */
.producer-input { flex: 1; min-width: 0; background: transparent; border: none; border-radius: 0; padding: 0; font-size: 13px; color: var(--text-primary); resize: none; min-height: 36px; max-height: 120px; line-height: 1.5; font-family: inherit; }
.producer-input:focus { outline: none; }
/* Phase 6 (primary-action reconciliation, 2026-08-30): the send button is
   aligned to the shared green primary (--btn-primary-bg / --btn-primary-bg-hover)
   so the composer's main action matches the Start Standup page-primary instead
   of splitting the "primary action" signal. One green primary, no third color. */
.producer-send-btn { width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--btn-primary-bg); color: #fff; border: none; border-radius: var(--radius-4); cursor: pointer; transition: background 0.15s, box-shadow 0.15s, opacity 0.15s; }
.producer-send-btn:hover { background: var(--btn-primary-bg-hover); }
.producer-send-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn-primary-bg) 35%, transparent); }
.producer-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.producer-presence-row { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; margin-left: calc(32px + var(--space-5)); color: var(--text-muted); font-size: 12px; padding: 3px 0; }
.producer-presence-ai { color: var(--accent-blue); }
.producer-presence-ai-read { align-self: flex-end; margin-left: auto; margin-right: var(--space-4); gap: 5px; }
/* AI identity gradient — same intentional brand blend as .producer-ai-avatar. */
.producer-presence-read-avatar { width: 14px; height: 14px; border-radius: 50%; font-size: 5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue)); color: #fff; flex-shrink: 0; }
.producer-presence-read-label { font-size: 11px; color: var(--text-muted); }
.producer-presence-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: producerPresencePulse 1.2s ease-in-out infinite; }
.producer-presence-tools { margin-left: var(--space-3); padding: 1px 7px; border-radius: var(--radius-5); background: rgba(52, 152, 219, 0.14); color: var(--accent-blue); font-size: 11px; font-weight: 500; white-space: nowrap; }
.producer-presence-avatars { gap: var(--space-2); margin-left: 44px; }
.producer-presence-avatar { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 700; object-fit: cover; border: 1px solid var(--border-light); }
.producer-read-receipts { display: flex; justify-content: flex-end; gap: 3px; margin-top: var(--space-2); min-height: 16px; }
.producer-read-avatar { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 7px; font-weight: 700; object-fit: cover; border: 1px solid var(--bg-secondary); box-shadow: 0 0 0 1px var(--border-light); }
@keyframes producerPresencePulse { 0%, 100% { opacity: 0.35; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.2); } }

/* Scoped under .producer-hub (higher specificity) so these rules win over the
   later side-panel/drawer rules at equal specificity. */
@media (prefers-reduced-motion: reduce) {
  .producer-message { animation: none; }
  .producer-hub .producer-presence-dot { animation: none; }
  .producer-hub .producer-typing-indicator span { animation: none; }
  .producer-hub .producer-inspector-collapse svg { transition: none; }
  .producer-hub .producer-side-panel,
  .producer-hub .producer-side-panel--collapsed { transition: none; }
}

/* ── Project Context inspector (Phase 5) ──────────────────────
   The inspector stays visually subordinate to the conversation: one quiet
   heading + segmented tab control above a single scrolling content surface.
   The desktop collapse control lives in the head and drives the grid track. */
.producer-side-panel { display: flex; flex-direction: column; height: 100%; overflow: hidden; min-width: 0; background: var(--bg-secondary); }
.producer-side-panel--collapsed { min-width: 0; overflow: visible; }
.producer-inspector-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.producer-inspector-title { flex: 1; min-width: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.producer-inspector-collapse { width: 32px; height: 32px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: var(--radius-3); color: var(--text-muted); cursor: pointer; transition: background 0.15s, color 0.15s; }
.producer-inspector-collapse:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.producer-inspector-collapse:focus-visible { outline: none; color: var(--text-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 30%, transparent); }
.producer-inspector-collapse svg { display: block; transition: transform 0.18s ease; }
.producer-side-panel--collapsed .producer-inspector-collapse svg { transform: rotate(-90deg); }
.producer-side-panel--collapsed .producer-inspector-head { position: relative; overflow: visible; padding: 0; border: 0; }
.producer-side-panel--collapsed .producer-inspector-title,
.producer-side-panel--collapsed .producer-inspector-body { display: none; }
.producer-side-panel--collapsed .producer-inspector-collapse { position: absolute; top: var(--space-4); right: var(--space-4); z-index: 2; background: var(--bg-secondary); border: 1px solid var(--border); }
.producer-context-close { display: none; min-height: 32px; padding: var(--space-2) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-3); background: var(--bg-primary); color: var(--text-secondary); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.producer-context-close:hover { color: var(--text-primary); border-color: var(--border-light); }
.producer-context-close:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 30%, transparent); }
.producer-inspector-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
/* Segmented tab control: stable dimensions, clear active state, keyboard focus. */
.producer-tabs { display: flex; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.producer-tab { flex: 1 1 0; min-width: 0; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: var(--space-2) var(--space-3); background: transparent; border: 1px solid transparent; border-radius: var(--radius-3); font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--text-muted); cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s; }
.producer-tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.producer-tab:focus-visible { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-blue) 35%, transparent); }
.producer-tab.active { color: var(--text-primary); background: var(--bg-tertiary); border-color: var(--accent-blue); font-weight: 600; box-shadow: inset 0 -2px 0 0 var(--accent-blue); }
.producer-tab.active:focus-visible { box-shadow: inset 0 -2px 0 0 var(--accent-blue), 0 0 0 2px color-mix(in srgb, var(--accent-blue) 35%, transparent); }
/* Keep the final context item scrollable above the global 52px FABs and their
   24px viewport offset without changing either global control. */
.producer-tab-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--space-5); padding-bottom: calc(var(--space-5) + 76px); display: flex; flex-direction: column; }
/* Shared empty state fits the narrow inspector: quieter icon + centered copy. */
.producer-tab-content .empty-state { align-items: center; text-align: center; padding: var(--space-8) var(--space-4); margin: auto; }
.producer-tab-content .empty-state-icon { font-size: 30px; margin-bottom: var(--space-4); }
.producer-tab-content .empty-state h3 { font-size: 13px; margin-bottom: var(--space-2); }
.producer-tab-content .empty-state p { font-size: 12px; max-width: 220px; }

.producer-session-list { display: flex; flex-direction: column; gap: var(--space-4); }
.producer-session-row { display: flex; flex-direction: column; gap: var(--space-2); }
.producer-session-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-4); text-align: left; padding: var(--space-5) var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-4); background: var(--bg-primary); color: var(--text-primary); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.producer-session-item:hover { border-color: var(--accent-blue); background: var(--bg-tertiary); }
.producer-session-item:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-blue) 35%, transparent); }
.producer-session-item.active { border-color: var(--accent-blue); background: color-mix(in srgb, var(--accent-blue) 8%, transparent); }
.producer-session-item-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); grid-column: 1 / -1; }
.producer-session-item-title { font-size: 12px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.producer-session-item-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.producer-session-item-status.active { color: var(--accent-green); }
.producer-session-item-status.completed { color: var(--text-muted); }
.producer-session-item-summary { grid-column: 1 / -1; color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.producer-session-item-meta { grid-column: 1 / -1; color: var(--text-muted); font-size: 11px; }
.producer-session-summary-btn { align-self: flex-start; min-height: 32px; font-size: 11px; padding: var(--space-1) var(--space-4); }
.producer-summary-modal-inner { max-width: 640px; width: 92%; max-height: 80vh; display: flex; flex-direction: column; }
.producer-summary-modal-body { overflow-y: auto; flex: 1; padding: var(--space-8) var(--space-12); }
.producer-summary-section { margin-bottom: var(--space-8); }
.producer-summary-section h4 { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin: var(--space-6) 0 var(--space-3); text-transform: uppercase; letter-spacing: 0.5px; }

/* Observations — severity is an edge accent, not a saturated card. The quiet
   resolve action stays subdued but is always reachable on focus and touch. */
.producer-observations-list { display: flex; flex-direction: column; gap: var(--space-4); }
.producer-observation { border: 1px solid var(--border); border-radius: var(--radius-5); padding: var(--space-5) var(--space-6); background: var(--bg-primary); overflow-wrap: anywhere; }
/* Phase 3: severity accents mapped to the shared accent tokens per the
   roadmap (warning→orange, critical→red, info→blue). */
/* .producer-daily-checkin-banner rules removed (intelligent-producer roadmap Phase 10). */
.producer-observation.warning { border-left: 3px solid var(--accent-orange); }
.producer-observation.critical { border-left: 3px solid var(--accent-red); }
.producer-observation.info { border-left: 3px solid var(--accent-blue); }
.producer-obs-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.producer-obs-icon { font-size: 14px; }
.producer-obs-type { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; flex: 1; }
.producer-obs-resolve { min-width: 32px; min-height: 32px; justify-content: center; padding: var(--space-1) var(--space-4); font-size: 11px; opacity: 0.85; transition: opacity 0.15s, background 0.15s; }
.producer-obs-resolve:hover,
.producer-obs-resolve:focus-visible { opacity: 1; background: var(--bg-hover); }
@media (hover: none) { .producer-obs-resolve { opacity: 1; } }
.producer-obs-desc { font-size: 12px; color: var(--text-primary); line-height: 1.4; }
/* Phase 5 (CONTEXT-REFINEMENT): the Watchlist caps the default view; older
   items sit behind a quiet toggle and render slightly recessed so the list
   reads as "what needs an eye now", not an ever-growing chore. */
.producer-obs-older-toggle { align-self: flex-start; margin-top: var(--space-1); color: var(--text-muted); }
.producer-obs-older-toggle:hover,
.producer-obs-older-toggle:focus-visible { color: var(--text-primary); background: var(--bg-hover); }
.producer-observations-older { display: flex; flex-direction: column; gap: var(--space-4); padding-left: var(--space-4); border-left: 2px solid var(--border); }

/* Knowledge */
.producer-knowledge-panel { display: flex; flex-direction: column; gap: var(--space-6); }
.producer-knowledge-add { display: flex; flex-direction: column; gap: var(--space-3); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border); }
.producer-knowledge-list { display: flex; flex-direction: column; gap: var(--space-4); }
.producer-knowledge-entry { border: 1px solid var(--border); border-left: 3px solid color-mix(in srgb, var(--accent-blue) 40%, transparent); border-radius: var(--radius-5); padding: var(--space-5) var(--space-6); background: var(--bg-primary); }
.producer-k-header { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.producer-k-icon { font-size: 13px; flex-shrink: 0; }
.producer-k-source { font-size: 10px; font-weight: 600; color: var(--accent-blue); text-transform: uppercase; letter-spacing: 0.5px; flex: 1; }
.producer-k-date { font-size: 10px; color: var(--text-muted); }
.producer-k-delete { min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: var(--space-1) var(--space-3); font-size: 15px; opacity: 0.85; line-height: 1; border-radius: var(--radius-2); background: transparent; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.producer-k-delete:hover,
.producer-k-delete:focus-visible { opacity: 1; color: var(--danger); background: var(--bg-hover); }
@media (hover: none) { .producer-k-delete { opacity: 1; } }
.producer-k-title { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-2); }
.producer-k-body { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* Social */
.producer-social-list { display: flex; flex-direction: column; gap: var(--space-5); }
.producer-social-card { border: 1px solid var(--border); border-radius: var(--radius-5); padding: var(--space-6); background: var(--bg-primary); }
.producer-sc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.producer-sc-category { font-size: 10px; font-weight: 600; color: var(--accent-blue); text-transform: uppercase; letter-spacing: 0.5px; }
.producer-sc-confidence { font-size: 11px; color: var(--accent-green); font-weight: 600; }
.producer-sc-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-3); }
.producer-sc-post { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: var(--space-4); background: var(--bg-tertiary); padding: var(--space-4); border-radius: var(--radius-3); }
.producer-sc-actions { display: flex; gap: var(--space-3); }

/* Reply preview rendered inside the composer surface as a quiet leading row */
.producer-reply-bar { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3); background: var(--bg-tertiary); border-radius: var(--radius-4); border-left: 3px solid var(--accent-blue); font-size: 12px; min-width: 0; }
.producer-reply-bar-content { flex: 1; min-width: 0; }
.producer-reply-bar-label { color: var(--text-secondary); display: block; font-weight: 600; }
.producer-reply-bar-preview { color: var(--text-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.producer-reply-bar-cancel { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: var(--space-1) var(--space-3); opacity: 0.6; font-size: 18px; line-height: 1; flex-shrink: 0; }
.producer-reply-bar-cancel:hover { opacity: 1; }
/* Reply quote in messages */
.producer-reply-quote { border-left: 3px solid var(--accent-blue); background: var(--bg-tertiary); border-radius: 0 var(--radius-3) var(--radius-3) 0; padding: var(--space-2) var(--space-4); margin-bottom: var(--space-3); max-width: 100%; }
.producer-reply-quote-name { font-size: 11px; font-weight: 700; color: var(--accent-blue); margin-bottom: var(--space-1); }
.producer-reply-quote-text { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Reply button on messages */
.producer-msg-reply-btn { opacity: 0; min-height: 32px; display: inline-flex; align-items: center; padding: var(--space-1) var(--space-3); font-size: 11px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-2); cursor: pointer; color: var(--text-muted); transition: opacity 0.15s; margin-left: auto; }
.producer-message:hover .producer-msg-reply-btn,
.producer-msg-reply-btn:focus-visible { opacity: 1; }
.producer-msg-reply-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.producer-msg-reply-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-blue) 35%, transparent); }
/* Soft handoff stays visually subordinate to the producer reply while giving
   the private-chat action a deliberate, easy-to-scan target. */
.producer-handoff { margin-top: var(--space-3); }
.producer-handoff-btn { min-height: 32px; display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border: 1px solid color-mix(in srgb, var(--accent-blue) 45%, var(--border)); border-radius: var(--radius-3); background: color-mix(in srgb, var(--accent-blue) 10%, var(--bg-tertiary)); color: var(--accent-blue); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.25; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s; }
.producer-handoff-btn:hover { background: color-mix(in srgb, var(--accent-blue) 18%, var(--bg-tertiary)); border-color: var(--accent-blue); color: var(--text-primary); }
.producer-handoff-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 30%, transparent); }
.producer-handoff-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: color-mix(in srgb, var(--accent-blue) 20%, transparent); font-size: 13px; line-height: 1; }
/* Session day grouping */
.producer-session-group { display: flex; flex-direction: column; gap: var(--space-1); }
.producer-session-days { padding-left: var(--space-8); display: flex; flex-direction: column; gap: 1px; margin-top: var(--space-1); }
.producer-session-day-item { display: flex; align-items: center; min-height: 32px; gap: var(--space-3); padding: var(--space-2) var(--space-4); border-radius: var(--radius-3); font-size: 11px; color: var(--text-secondary); background: transparent; border: none; cursor: pointer; text-align: left; width: 100%; }
.producer-session-day-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.producer-session-day-item:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-blue) 35%, transparent); }
.producer-day-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
/* Transient notice messages */
.producer-message-transient { opacity: 0.75; }
.producer-message-transient .producer-message-body { font-style: italic; }

/* Phase 6 medium mode: conversation fills the workspace and Context opens as
    an in-workspace drawer. The panel remains mounted so tab and scroll state
    survive every switch. Short landscape enters this mode at 1024px as well. */
@media (max-width: 1023px), (max-width: 1024px) and (max-height: 500px) {
   .producer-session-bar { flex-wrap: wrap; gap: var(--space-3) var(--space-5); padding-inline: var(--space-5); }
   .producer-background-status { order: 3; flex-basis: 100%; margin-left: 0; }
   .producer-mode-switch { display: inline-flex; }
   .producer-layout { position: relative; display: block; }
   .producer-chat-panel { width: 100%; border-right: 0; }
   .producer-side-panel,
   .producer-side-panel--collapsed { position: absolute; inset: 0 0 0 auto; z-index: 3; width: min(380px, 100%); min-width: 0; border-left: 1px solid var(--border); box-shadow: -12px 0 30px rgba(0,0,0,0.28); transform: translateX(100%); visibility: hidden; transition: transform 0.18s ease, visibility 0s linear 0.18s; }
   .producer-hub--context .producer-side-panel { transform: translateX(0); visibility: visible; transition-delay: 0s; }
   .producer-inspector-collapse { display: none; }
   /* The "Project Context" header row is redundant here: the session-bar
      Chat/Context switch already provides the view toggle and a way back,
      so the whole row (title + "Chat" close button) stays hidden. */
   .producer-inspector-head { display: none; }
}

/* Mobile and short-landscape mode: Chat and Context are full-workspace panes,
    with the status-bar switch always reachable in one explicit action. */
@media (max-width: 768px), (max-width: 1024px) and (max-height: 500px) {
   .main-content:has(.producer-hub) #pageActions { flex-wrap: wrap; }
   .producer-session-bar { min-height: 48px; padding-block: var(--space-3); }
   .producer-session-identity { min-width: 0; }
   .producer-session-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
   .producer-session-meta { gap: var(--space-3); }
   .producer-mode-switch { order: 2; }
   .producer-background-status { order: 4; }
   .producer-side-panel,
   .producer-side-panel--collapsed { width: 100%; border-left: 0; box-shadow: none; }
   .producer-hub--context .producer-chat-panel { visibility: hidden; }
   .producer-messages { padding: var(--space-5); gap: var(--space-5); }
   /* Phase 5: mobile composer uses the same horizontal padding as the message
      list so the column edges align exactly on small screens too. The
      bottom padding keeps --space-4 (safe-area clearance, not column align). */
   .producer-input-row { padding: var(--space-5); padding-bottom: 8px; }
   .producer-input-wrap { padding: var(--space-3); }
}

@media (max-width: 440px) {
   .producer-session-week { display: none; }
   .producer-session-bar { gap: var(--space-2) var(--space-3); }
   .producer-mode-option { padding-inline: var(--space-4); }
}