/* Inbox — Demo tokens, Messenger-style working on Vot.Chat's own backend */
.inbox-mini-stats { display: flex; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }
.mini-stat { font-size: 13px; color: var(--muted); }
.mini-stat strong { font-size: 21px; font-weight: 800; color: var(--ink); margin-right: 4px; }
.inbox-layout { display: grid; grid-template-columns: 340px 1fr 300px; gap: 14px; align-items: start; }
.inbox-list-card { padding: 14px; }
.inbox-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border-2); border-radius: 999px; padding: 0 16px; height: 42px; margin-bottom: 12px; }
.inbox-search input { border: 0; background: transparent; height: auto; padding: 0; }
.inbox-search input:focus { box-shadow: none; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-pill { border: 0; background: transparent; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.filter-pill.active { background: var(--primary); color: #fff; }
.filter-more-wrap { position: relative; }
.filter-more-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: var(--raised); border: 1px solid var(--card-border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 30; min-width: 150px; }
.filter-more-menu.open { display: block; }
.filter-more-menu .filter-pill { display: block; width: 100%; text-align: left; }
.inbox-row { display: flex; gap: 11px; padding: 12px 10px; border-radius: 12px; cursor: pointer; align-items: center; border-left: 3px solid transparent; }
.inbox-row:hover { background: var(--mint-wash-2); }
.inbox-row.selected { background: var(--mint-wash); border-left-color: var(--primary); }
.inbox-row-main { flex: 1; min-width: 0; }
.inbox-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.inbox-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-time { font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.inbox-time.unread { color: var(--green-text); font-weight: 700; }
.inbox-preview { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.unread-circle { background: var(--badge-green); color: #fff; font-size: 12px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.waiting-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.inbox-row-tags { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.chat-pane { background: var(--mint-wash-2); border-radius: var(--radius-lg); border: 1px solid var(--card-border); overflow: hidden; display: flex; flex-direction: column; min-height: 560px; }
.chat-pane-dotted { background-color: var(--surface-2); background-image: radial-gradient(color-mix(in srgb, var(--primary) 10%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.chat-header { background: var(--raised); border-bottom: 1px solid var(--hairline); padding: 14px 18px; display: flex; align-items: center; gap: 12px; }
.chat-header h3 { font-size: 16px; font-weight: 700; margin: 0; }
.chat-header-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.chat-msgs { flex: 1; padding: 18px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 62vh; }
.msg-row { display: flex; }
.msg-row.own { justify-content: flex-end; }
.bubble { max-width: min(78%, 520px); border-radius: 14px; padding: 7px 10px 6px 11px; font-size: 14px; line-height: 1.42; box-shadow: 0 1px 1px #10231f14; }
.bubble.other { background: var(--raised); border: 0; border-bottom-left-radius: 4px; }
.bubble.own { background: color-mix(in srgb, var(--mint) 26%, var(--raised)); border-bottom-right-radius: 4px; }
.bubble-time { font-size: 11px; color: var(--muted-2); margin-top: 4px; display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.ticks { font-size: 13px; letter-spacing: -1px; }
.ticks.sent, .ticks.delivered { color: var(--tick-grey); }
.ticks.read { color: var(--tick-blue); }
.ticks.failed { color: var(--missed); letter-spacing: 0; }
.reply-quote { border-left: 3px solid var(--primary-action); background: rgba(255, 255, 255, 0.6); border-radius: 6px; padding: 6px 9px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tpl-bubble { background: var(--raised); border: 1px solid var(--card-border); border-radius: 14px; padding: 0; overflow: hidden; max-width: 78%; }
.tpl-bubble-head { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); padding: 10px 12px 4px; }
.tpl-bubble-title { font-weight: 700; padding: 0 12px 8px; }
.tpl-bubble-action { display: block; width: 100%; text-align: center; border: 0; border-top: 1px solid var(--hairline); background: var(--raised); color: var(--blue-action); font-weight: 700; padding: 10px; font-size: 13px; }
.replying-bar { display: flex; justify-content: space-between; align-items: center; background: var(--mint-wash-2); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 0 14px; }
.composer { display: flex; gap: 10px; padding: 14px; align-items: center; background: transparent; }
.composer input { border-radius: 999px; background: var(--raised); }
.send-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grey-tint); color: var(--muted); font-size: 18px; flex: none; }
.send-btn.active { background: var(--primary); color: #fff; }
.quick-picker { background: var(--raised); border: 1px solid var(--card-border); border-radius: 14px; margin: 0 14px; padding: 8px; box-shadow: var(--shadow); }
.quick-picker button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.quick-picker button:hover { background: var(--mint-wash-2); }
.quick-picker b { color: var(--primary-action); }
.details-rail { padding: 18px; }
.details-rail h3 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.sub-card { background: var(--col-bg); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.sub-card h4 { font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.detail-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; }
.detail-row span:first-child { color: var(--muted); }
@media (max-width: 1100px) {
  .inbox-layout { grid-template-columns: 300px 1fr; }
  .details-rail { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .inbox-layout { grid-template-columns: 1fr; }
  .chat-pane { min-height: 480px; }
}

/* Inbox rail: custom tags + customer reminders (own styles, Tend-aligned tokens). */
.rail-tag { display: inline-flex; align-items: center; gap: 4px; }
.rail-tag-x { border: 0; background: transparent; font-size: 16px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 2px; }
.rail-tag-x:hover { color: var(--missed); }
.rail-tag-row { display: flex; gap: 8px; margin-top: 10px; }
.rail-tag-row input { flex: 1; min-width: 0; }
.rem-form-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.rem-form-row input[type="date"], .rem-form-row input[type="time"] { flex: 1; min-width: 130px; }
.rem-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.rem-item:last-child { border-bottom: 0; }
.rem-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rem-item-msg { font-size: 13px; font-weight: 600; word-break: break-word; }

/* Direct broadcast modal (Inbox topbar) — scoped .bc-* classes. */
.bc-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 8px 0; }
.bc-opt input[type="radio"] { width: auto; height: auto; accent-color: var(--primary); }
.bc-opt select { height: 42px; border: 1px solid var(--border-2); border-radius: 999px; padding: 0 16px; margin-left: auto; min-width: 180px; background: var(--raised); font-size: 14px; }
.bc-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-2); border-radius: 12px; padding: 6px; margin-top: 8px; }
.bc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.bc-row:hover { background: var(--mint-wash-2); }
.bc-row input[type="checkbox"] { width: auto; height: auto; accent-color: var(--primary); }
.bc-row.disabled { opacity: 0.55; cursor: default; }
.bc-row .bc-sub { font-size: 12px; color: var(--muted-2); margin-left: auto; }
.bc-empty { padding: 12px; font-size: 14px; color: var(--muted); }

/* Collapsible details rail (desktop only; narrow widths keep the stacked rail). */
.inbox-layout { position: relative; }
.rail-col { min-width: 0; }
.rail-collapse-btn { display: block; margin: 0 0 8px auto; border: 1px solid var(--card-border); background: var(--raised); color: var(--muted); border-radius: 999px; width: 32px; height: 32px; font-size: 18px; line-height: 1; cursor: pointer; }
.rail-expand-tab { display: none; }
@media (min-width: 1101px) {
  .inbox-layout.rail-collapsed { grid-template-columns: 340px 1fr; }
  .inbox-layout.rail-collapsed .rail-col { display: none; }
  .inbox-layout.rail-collapsed .rail-expand-tab { display: inline-flex; position: absolute; right: 0; top: 0; z-index: 20; align-items: center; gap: 4px; background: var(--raised); color: var(--ink); border: 1px solid var(--card-border); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
}
@media (max-width: 1100px) {
  .inbox-layout .rail-col { grid-column: 1 / -1; }
  .rail-collapse-btn, .rail-expand-tab { display: none; }
}

/* Message actions: per-bubble menu, reaction chips, voice bubbles, edit box, recorder. */
.bubble { position: relative; }
.msg-action-btn { position: absolute; top: 2px; right: 6px; border: 0; background: transparent; color: var(--muted-2); font-size: 16px; line-height: 1; padding: 2px 4px; cursor: pointer; opacity: 0; }
.msg-row:hover .msg-action-btn, .msg-action-btn:focus { opacity: 1; }
.msg-menu { margin-top: 8px; background: var(--raised); border: 1px solid var(--card-border); border-radius: 12px; padding: 6px; box-shadow: 0 4px 16px #10231f22; }
.msg-menu-react { display: flex; gap: 2px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--hairline); }
.msg-react-btn { border: 0; background: transparent; font-size: 20px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.msg-react-btn:hover { background: var(--grey-tint); }
.msg-menu-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--ink); border-radius: 8px; cursor: pointer; }
.msg-menu-item:hover { background: var(--grey-tint); }
.msg-menu-item.danger { color: #cf4429; }
.reaction-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.reaction-chip { border: 1px solid var(--card-border); background: var(--raised); border-radius: 999px; padding: 1px 8px; font-size: 13px; cursor: pointer; }
.reaction-chip.mine { border-color: var(--primary); background: color-mix(in srgb, var(--mint) 30%, var(--raised)); }
.edited-mark { font-size: 11px; color: var(--muted-2); font-style: italic; }
.voice-bubble { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.voice-bubble audio { max-width: 240px; height: 36px; }
.voice-dur { font-size: 12px; color: var(--muted-2); }
.msg-edit-box { display: flex; gap: 6px; margin-top: 8px; }
.msg-edit-box input { flex: 1; min-width: 0; border-radius: 8px; border: 1px solid var(--card-border); padding: 6px 8px; font-size: 14px; }
.mic-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--grey-tint); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.mic-btn svg { width: 20px; height: 20px; fill: currentColor; }
.mic-btn:hover { background: var(--mint); color: var(--ink); }
.rec-bar { display: flex; gap: 10px; align-items: center; padding: 0 14px 12px; font-size: 13px; color: var(--muted); }
.rec-bar[hidden] { display: none; }
.attach-bar { display: flex; gap: 10px; align-items: center; padding: 0 14px 12px; font-size: 13px; color: var(--muted); }
.attach-bar[hidden] { display: none; }
.attach-bar .attach-name { max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.attach-bar input[type="text"] { flex: 1; min-width: 0; border-radius: 999px; background: var(--raised); border: 1px solid var(--card-border); padding: 8px 12px; font-size: 13px; color: var(--ink); outline: none; }
.media-unavailable { font-size: 13px; color: var(--muted); font-style: italic; margin-top: 6px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #cf4429; flex: none; }
