/* chat.css - the Messages box on the profile (his order, 2026-10-29), and the
   one line on the sign-up page about invitations. Theme tokens only, so dark
   and light both follow. */

/* ---- the sign-up page: by invitation only -------------------------------- */
.invite-note{ font-size:12px; line-height:1.4; color:var(--dk-muted, var(--text-faint)); margin-top:6px; }

/* ---- the unread count on the Account button ------------------------------ */
.psec-tab{ position:relative; }
.psec-badge{ position:absolute; top:6px; right:8px; min-width:20px; height:20px; padding:0 6px;
  border-radius:10px; background:var(--dk-red); color:#fff; font:600 12px/20px Inter, system-ui, sans-serif;
  text-align:center; font-variant-numeric:tabular-nums; box-shadow:0 0 0 2px var(--dk-panel); }
.psec-tab.on .psec-badge{ box-shadow:0 0 0 2px var(--dk-text); }

/* ---- the box -------------------------------------------------------------- */
#chatCard .chat-new{ font-size:12px; font-weight:600; color:var(--dk-red); margin-left:4px; }
#chatCard .chat-body{ display:block; }
#chatCard .chat-body.is-owner{ display:grid; grid-template-columns:minmax(180px, 240px) minmax(0, 1fr); gap:14px; }
#chatCard .chat-empty{ font-size:13px; color:var(--dk-muted); padding:12px 4px; line-height:1.45; }

/* the owner's people */
#chatCard .chat-people{ display:flex; flex-direction:column; gap:6px; min-width:0; }
#chatCard .chat-person{ display:flex; flex-direction:column; gap:3px; text-align:left; cursor:pointer;
  background:var(--dk-row); color:var(--dk-text); border:0; border-radius:6px; padding:9px 11px;
  font:13px Inter, system-ui, sans-serif; min-width:0; }
#chatCard .chat-person:hover{ background:var(--dk-hover); }
#chatCard .chat-person.on{ background:var(--dk-text); color:var(--dk-page); }
#chatCard .chat-person:focus-visible{ outline:2px solid var(--dk-line-strong); outline-offset:2px; }
#chatCard .chat-person-top{ display:flex; align-items:center; gap:8px; min-width:0; }
#chatCard .chat-person-name{ flex:1; min-width:0; font-weight:600; font-size:14px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#chatCard .chat-person-unread{ flex:none; min-width:20px; height:20px; padding:0 6px; border-radius:10px;
  background:var(--dk-red); color:#fff; font:600 12px/20px Inter, system-ui, sans-serif; text-align:center; }
#chatCard .chat-person-last{ font-size:12px; color:var(--dk-muted); overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; min-width:0; }
#chatCard .chat-person.on .chat-person-last{ color:inherit; opacity:.75; }

/* the conversation */
#chatCard .chat-thread{ display:flex; flex-direction:column; min-width:0; }
#chatCard .chat-head{ margin-bottom:8px; }
#chatCard .chat-head-name{ font-size:15px; font-weight:600; color:var(--dk-text); }
#chatCard .chat-head-sub{ font-size:12px; color:var(--dk-muted); margin-top:2px; line-height:1.4; }

#chatCard .chat-money{ background:var(--dk-row); border-radius:6px; padding:9px 11px; margin-bottom:10px; }
#chatCard .chat-money-line{ display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 16px; }
#chatCard .chat-money-label{ font-size:12px; color:var(--dk-muted); flex:1 1 100%; }
#chatCard .chat-money-cell{ display:flex; align-items:baseline; gap:6px; font-size:13px; }
#chatCard .chat-money-k{ color:var(--dk-muted); }
#chatCard .chat-money-cell b{ color:var(--dk-text); font-weight:600; font-variant-numeric:tabular-nums; }
#chatCard .chat-fund{ display:flex; gap:6px; margin-top:8px; flex-wrap:wrap; }
#chatCard .chat-fund select,
#chatCard .chat-fund input{ background:var(--dk-panel); color:var(--dk-text); border:0;
  box-shadow:inset 0 0 0 1px var(--dk-field-line); border-radius:6px; padding:7px 9px;
  font:13px Inter, system-ui, sans-serif; min-width:0; }
#chatCard .chat-fund select{ flex:1 1 170px; }
#chatCard .chat-fund input{ flex:0 0 90px; font-variant-numeric:tabular-nums; }
#chatCard .chat-fund-btn{ flex:none; font-size:13px; padding:7px 12px; }

#chatCard .chat-list{ height:320px; overflow-y:auto; overscroll-behavior:contain; display:flex;
  flex-direction:column; gap:8px; padding:10px; background:var(--dk-row); border-radius:8px;
  scrollbar-width:thin; }
#chatCard .chat-msg{ display:flex; flex-direction:column; max-width:78%; }
#chatCard .chat-msg.mine{ align-self:flex-end; align-items:flex-end; }
#chatCard .chat-msg.theirs{ align-self:flex-start; align-items:flex-start; }
#chatCard .chat-bubble{ white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.45;
  padding:8px 11px; border-radius:12px; color:var(--dk-text); background:var(--dk-panel);
  box-shadow:inset 0 0 0 1px var(--dk-line); }
#chatCard .chat-msg.mine .chat-bubble{ background:var(--dk-text); color:var(--dk-page); box-shadow:none;
  border-bottom-right-radius:4px; }
#chatCard .chat-msg.theirs .chat-bubble{ border-bottom-left-radius:4px; }
#chatCard .chat-meta{ font-size:11px; color:var(--dk-muted); margin-top:3px; padding:0 3px; }
#chatCard .chat-msg.note{ align-self:center; align-items:center; max-width:92%; text-align:center; }
#chatCard .chat-note-text{ font-size:12.5px; color:var(--dk-text); background:var(--dk-green-bg);
  box-shadow:inset 0 0 0 1px var(--dk-green-line); border-radius:6px; padding:6px 10px; line-height:1.4; }

#chatCard .chat-compose{ display:flex; gap:8px; margin-top:10px; align-items:flex-end; }
#chatCard .chat-compose textarea{ flex:1; min-width:0; resize:vertical; min-height:42px; max-height:200px;
  background:var(--dk-row); color:var(--dk-text); border:0; box-shadow:inset 0 0 0 1px var(--dk-field-line);
  border-radius:8px; padding:10px 12px; font:14px/1.4 Inter, system-ui, sans-serif; }
#chatCard .chat-compose textarea:disabled{ opacity:.6; }
#chatCard .chat-send{ flex:none; padding:10px 18px; font-size:14px; }
#chatCard .chat-foot{ display:flex; justify-content:space-between; gap:10px; min-height:18px; margin-top:4px; }
#chatCard .chat-error{ color:var(--dk-red); font-size:12px; }
#chatCard .chat-count{ color:var(--dk-muted); font-size:12px; font-variant-numeric:tabular-nums; margin-left:auto; }

@media (max-width:760px){
  #chatCard .chat-body.is-owner{ grid-template-columns:1fr; }
  #chatCard .chat-people{ flex-direction:row; overflow-x:auto; gap:6px; padding-bottom:2px; }
  #chatCard .chat-person{ flex:0 0 auto; max-width:200px; }
  #chatCard .chat-list{ height:300px; }
  #chatCard .chat-msg{ max-width:88%; }
}
