/* style-chat-view.css - the DESIGN of: inside a chat. Part of the old single style.css (split 2026-11-03); loaded in the order listed in index.html. */
/* --- chat view --- */
#chat-view { display: flex; flex-direction: column; height: 100%; }
#messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #121212; }
.msg-row { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.msg-row.mine { flex-direction: row-reverse; }
/* calc() against the row's own width, not a fixed vw guess, so the bubble
   always claims exactly "row minus the ~28px avatar+gap" regardless of
   screen size - no leftover slack, and no double-shrinking either. */
.msg { max-width: calc(100% - 28px); padding: 9px 12px; border-radius: 16px; font-size: var(--chat-font-size); line-height: 1.35; }
/* Line breaks in the original text were being silently collapsed into one
   run-on paragraph - `pre-wrap` keeps real newlines/paragraph breaks while
   still wrapping long lines normally. */
.msg .body, .msg .original-text { white-space: pre-wrap; }
.msg .body strong { font-weight: 700; }
.msg-row .avatar { flex-shrink: 0; }
.msg .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: #9A9A9A; margin-bottom: 3px; }
.msg .meta-name { display: flex; align-items: center; }
.msg .meta-time { flex-shrink: 0; opacity: 0.8; }
#typing-indicator { padding: 2px 14px 4px; font-size: 12.5px; color: #9A9A9A; font-style: italic; }
/* Bumped up from the meta text's own 11px and given its own brighter
   color so it actually reads as a tappable control at a glance, without
   making the meta line itself any taller. */
.read-aloud-btn { font-size: 15px; margin-left: 6px; cursor: pointer; color: #7FCB9C; line-height: 1; vertical-align: middle; }
.read-aloud-btn:active { opacity: 0.7; }
.read-aloud-btn.playing { color: #FF6B60; }
/* The translation is the primary .body text (see app.js's _bodyHTML) -
   the original the sender actually typed/said is a small, collapsed
   detail underneath, there to double-check against, not to compete with
   the translation for attention. */
.msg .original-toggle {
  margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11.5px; opacity: 0.65; cursor: pointer; user-select: none;
}
.msg .original-text { margin-top: 4px; font-size: 12.5px; opacity: 0.75; }
.msg .body.pending-translation { font-style: italic; opacity: 0.6; }
.msg.mine { background: #1E7A42; color: #EAFBE9; border-bottom-right-radius: 4px; }
.msg.theirs { background: #232325; color: #EDEDED; box-shadow: 0 1px 2px rgba(0,0,0,0.3); border-bottom-left-radius: 4px; }
.msg.kappy { background: #3A2A55; color: #E4D2FF; font-style: italic; border-bottom-left-radius: 4px; }
.msg.claude { background: #1F3A5C; color: #BFE0FF; border-bottom-left-radius: 4px; }
.msg.hermes { background: #3D2A1F; color: #FFD9A8; border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: transparent; color: #7A7A7A; font-size: 13px; text-align: center; margin: 0 auto; }
.msg img.attachment { max-width: 100%; max-height: 260px; border-radius: 10px; display: block; margin-top: 4px; cursor: pointer; }
#image-lightbox {
  position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center; padding: 0; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
#image-lightbox img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0;
  touch-action: none; transform-origin: center center; will-change: transform; cursor: zoom-in;
  -webkit-user-drag: none;
}
#image-lightbox.zoomed img { cursor: grab; }
#image-lightbox-close {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; z-index: 2;
  width: 44px; height: 44px; border: 0; border-radius: 22px; font-size: 30px; line-height: 40px;
  color: #fff; background: rgba(255,255,255,0.16); cursor: pointer;
}
#image-lightbox-hint {
  position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,0.55); font-size: 12.5px; pointer-events: none; transition: opacity .6s;
}
#image-lightbox-hint.faded { opacity: 0; }
.msg video.attachment {
  max-width: 100%; max-height: 300px; border-radius: 10px; display: block; margin-top: 4px; background: #000;
}
.msg .attachment-pdf {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
  padding: 8px 10px; background: rgba(255,255,255,0.08); border-radius: 8px;
  color: inherit; text-decoration: none; font-size: 13.5px;
}

.send-bar {
  display: flex; gap: 6px; padding: 10px; background: #1C1C1E;
  border-top: 1px solid #2C2C2E; position: sticky; bottom: 0; align-items: flex-end;
}
.send-bar textarea {
  flex: 1; resize: none; max-height: 140px; overflow-y: auto;
  line-height: 1.35; font-family: inherit; font-size: 16px;
  padding: 10px 12px; border-radius: 8px; background: #2A2A2C;
  border: 1px solid #3A3A3C; color: #EDEDED;
}
.send-bar button { flex-shrink: 0; }
.send-bar .icon-btn { font-size: 17px; padding: 3px 5px; }
.send-bar button[type=submit] { padding: 9px 12px; font-size: 14px; }
@keyframes mic-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
/* Compose bar collapses to emoji+clip+Send by default; focusing the
   textarea swaps to a single back arrow so the textarea gets more room -
   the back button only shows in that expanded state. */
#btn-compose-back { display: none; }
.send-bar.expanded #btn-emoji, .send-bar.expanded #btn-attach, .send-bar.expanded #btn-mic { display: none; }
.send-bar.expanded #btn-compose-back { display: inline-flex; }
.send-bar.expanded #btn-send { padding: 9px 14px; min-width: 0; }
/* Voice mode: the whole middle of the bar becomes one big surface instead
   of a textarea+separate send button - back arrow (from .expanded,
   reused) is the only other control, and it's the only way out. Sticky
   across multiple record/stop/send cycles (see app.js) - stopping a
   recording does not leave this screen, it just goes back to the ready
   (non-pulsing) look, waiting for the next tap to record again. */
.send-bar.voice-mode #message-input, .send-bar.voice-mode #btn-send { display: none; }
/* Green = ready to tap and start (matches the app's standard "go" green
   used everywhere else), red = actually recording right now - a clear,
   conventional color swap so it's obvious which state you're in at a
   glance. Text itself stays fully opaque at all times in both states (an
   earlier version pulsed the whole surface's opacity, which made small
   text on a dark background nearly disappear mid-pulse); the "live" feel
   comes from the dot instead, and only while actually recording. */
#recording-surface {
  display: none; flex: 1; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: 8px; background: #06C755; color: #08170D;
  font-size: 15px; font-weight: 700; cursor: pointer; user-select: none;
}
.send-bar.voice-mode #recording-surface { display: flex; }
#recording-surface.active { background: #FF6B60; color: #1C1C1E; }
#recording-surface .dot { display: none; width: 10px; height: 10px; border-radius: 50%; background: #1C1C1E; }
#recording-surface.active .dot { display: block; animation: mic-pulse 1s ease-in-out infinite; }

#emoji-picker {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  padding: 10px; background: #1C1C1E; border-top: 1px solid #2C2C2E;
  max-height: 160px; overflow-y: auto;
}
#emoji-picker span { font-size: 22px; text-align: center; cursor: pointer; padding: 4px; border-radius: 6px; }
#emoji-picker span:active { background: #2A2A2C; }

/* the home icons inside a chat (2026-10-31): small round buttons, the same height as the bar */
.topbar span#chat-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 6px; }
.chat-quick { display: flex; gap: 4px; flex-shrink: 0; }
.cq-btn { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid #3A3A3C; background: #2C2C2E; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; }


/* Kappy's ORDER CARD in a bar's host chat */
.host-card { min-width: 230px; }
.host-card-head { font-weight: 700; margin-bottom: 6px; }
.host-card-lines { list-style: none; margin: 0 0 6px; padding: 0; } .host-card-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid #ffffff22; }
.host-card-total { display: flex; justify-content: space-between; font-size: 18px; margin: 6px 0 8px; }
.host-card-btns { display: flex; flex-direction: column; gap: 6px; } .host-card-btns button { width: 100%; }
.host-card small { display: block; margin-top: 6px; opacity: .75; font-size: 11px; }
.host-card-done { font-weight: 700; color: #2FDE76; margin-top: 4px; } .host-card-done.off { color: #9A9A9A; }
