/* Messages — plan/pages/messages.html.

   The two-column layout is new; the thread list rows, bubbles, resize handle and reply box are
   item 3's own partials.chat-thread-list / partials.chat-thread-detail, reused as-is
   (page-inventory.md's Messages entry, "Shared components") and only resized under this page's
   own .messages-panel scope — item5-planning.md §3.5's "Settled here". */

/* The corner chat fab duplicates this whole page if left showing — an ID selector beats the
   widget's own .chat-fab class regardless of where each rule sits in the document, so this does
   not need layouts/app.blade.php or chat-widget.blade.php reopened. */
#chatFab { display: none; }

.messages-panel {
  display: flex; background: #ffffff; color: var(--color-background);
  border-radius: 8px; overflow: hidden;
  min-height: 728px; /* 560px base, 30% taller per Milan's call */
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.msg-list-col { width: 340px; flex-shrink: 0; display: flex; flex-direction: column;
  border-right: 1px solid rgba(53,67,98,0.14); background: #fafafc; }
.msg-list-head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; border-bottom: 1px solid rgba(53,67,98,0.14); flex-shrink: 0; }
.msg-list-head h2 { font-variant: small-caps; font-weight: 400; font-size: 19px; margin: 0; flex: 1; }
/* Milan's own back row above the thread list (plan/page-inventory.md, "Viewing as a student"),
   grouped with the title the same way partials/chat-widget.blade.php's own
   .chat-panel-head-left groups its back arrow with the panel's title. */
#msgBackBtn { background: none; color: var(--color-background); opacity: 0.55; margin-right: 4px; }
#msgBackBtn:hover { opacity: 1; }
.new-msg-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--color-accent);
  color: var(--color-accent-text); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.new-msg-btn:hover { opacity: 0.88; }
.new-msg-btn svg { width: 16px; height: 16px; }
.msg-list { flex: 1; overflow-y: auto; }

/* Sized up from the widget's own narrower-panel numbers, and given the .active row state the
   widget never needed (it has no two-column layout to show a currently open thread against). */
.messages-panel .chat-thread-item { padding: 14px 18px; }
.messages-panel .chat-thread-item.active { background: rgba(255,128,88,0.1); }
.messages-panel .chat-thread-subject { font-size: 13.5px; }
.messages-panel .chat-thread-snippet { font-size: 12.5px; }

.msg-detail-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#msgStateEmpty, #msgStateThread, #msgStateCompose { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#msgStateEmpty[hidden], #msgStateThread[hidden], #msgStateCompose[hidden] { display: none; }

.msg-detail-empty { flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; opacity: 0.5; text-align: center; padding: 40px; }
.msg-detail-head { padding: 18px 24px 14px; border-bottom: 1px solid rgba(53,67,98,0.14); flex-shrink: 0; }
.msg-detail-head h2 { font-variant: small-caps; font-weight: 400; font-size: 19px; margin: 0 0 4px; }
.msg-detail-meta { font-size: 12px; opacity: 0.55; }

/* The fetched detail partial's own bubbles/resize-handle/input-row fill the rest of the column;
   this widens them past components.css's own 78% messages-page default and past the widget's own
   85% (item 3's chat-panel-thread .chat-msg), since this column is wider than either.

   Scoped through .chat-panel-thread, not just .messages-panel — the widget's own docked panel
   sits on this exact page too (layouts/app.blade.php includes it on every page) and its detail
   partial carries the identical .chat-panel-thread .chat-msg rule at the same (0,2,0)
   specificity; a bare .messages-panel .chat-msg tied that rule and lost on document order (this
   page's own stylesheet loads in <head>, the widget's inline <style> later in the body), so 88%
   never actually rendered — found reviewing this item. */
.messages-panel .chat-panel-thread .chat-msg { max-width: 88%; }
.messages-panel .chat-panel-thread { padding: 18px 24px; }
.messages-panel .chat-panel-input-row { background: #fafafc; }

.msg-inline-error { padding: 6px 24px; font-size: 11px; color: #c94f4f; flex-shrink: 0; }
.msg-inline-error:empty { display: none; }

.msg-compose { flex: 1; display: flex; flex-direction: column; }
.msg-compose-subject-row { padding: 16px 24px; border-bottom: 1px solid rgba(53,67,98,0.14); flex-shrink: 0; }
.msg-compose-subject-row label { display: block; font-variant: small-caps; font-size: 11.5px;
  font-weight: 600; opacity: 0.65; letter-spacing: 0.03em; margin-bottom: 6px; }
.msg-compose-subject-row input, .msg-compose-subject-row select { width: 100%; border: 1px solid rgba(53,67,98,0.2); border-radius: 4px;
  padding: 8px 10px; font-family: inherit; font-size: 13.5px;
  color: var(--color-background); background: #fafafc; }
.msg-compose-subject-row input:focus, .msg-compose-subject-row select:focus { outline: none; border-color: var(--color-accent); }
.msg-compose-subject-row input.field-error, .msg-compose-subject-row select.field-error { border-color: #c94f4f; }
.msg-compose-error { font-size: 11.5px; color: #c94f4f; margin-top: 6px; display: none; }
.msg-compose-error.show { display: block; }
.msg-compose-body-row { flex: 1; padding: 16px 24px; display: flex; flex-direction: column; }
#msgComposeBody { flex: 1; min-height: 120px; overflow-y: auto; outline: none; border: 1px solid rgba(53,67,98,0.2);
  border-radius: 4px; padding: 10px; font-family: inherit; font-size: 13.5px; color: var(--color-background);
  background: #fafafc; white-space: pre-wrap; }
#msgComposeBody:focus { border-color: var(--color-accent); }
#msgComposeBody:empty::before { content: attr(data-placeholder); color: rgba(53,67,98,0.45); pointer-events: none; }
.msg-compose-footer { display: flex; justify-content: flex-end; padding: 14px 24px;
  border-top: 1px solid rgba(53,67,98,0.14); flex-shrink: 0; }
.msg-send-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--color-accent);
  color: var(--color-accent-text); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg-send-btn:hover { opacity: 0.88; }
.msg-send-btn svg { width: 16px; height: 16px; }
.msg-send-btn:disabled { opacity: 0.5; cursor: default; }
