/* Conversations between buyer and supplier: the account page and the supplier inbox share this look (2026-11-09).
   Each panel only sets its own colours through the variables below. */
:root {
    --oc-bg: #F2F5F7;
    --oc-theirs: #FFFFFF;
    --oc-mine: #D9F5F1;
    --oc-ink: #0F2027;
    --oc-muted: #64748B;
    --oc-mine-muted: #3F6B66;
    --oc-accent: #2ED3C6;
    --oc-accent-ink: #0F2027;
    --oc-name: #0F766E;
    --oc-focus: rgba(46, 211, 198, .25);
}

.oc-thread { background: var(--oc-bg); }

/* Day separators are written by OftChatDays in chat-photos.js */
.oc-day { display: flex; justify-content: center; margin: 16px 0 8px; }
.oc-day span {
    padding: 3px 12px; border-radius: 999px; background: rgba(15, 32, 39, .07);
    color: var(--oc-muted); font-size: .72rem; font-weight: 600;
}

.oc-msg { display: flex; margin-top: 12px; }
.oc-msg.oc-mine { justify-content: flex-end; }
/* Messages in a row from the same side read as one block */
.oc-from-buyer + .oc-from-buyer,
.oc-from-supplier + .oc-from-supplier,
.oc-from-admin + .oc-from-admin { margin-top: 3px; }
.oc-from-buyer + .oc-from-buyer .oc-name,
.oc-from-supplier + .oc-from-supplier .oc-name,
.oc-from-admin + .oc-from-admin .oc-name { display: none; }

.oc-bubble {
    max-width: min(78%, 520px); padding: 8px 12px 5px; border-radius: 16px 16px 16px 5px;
    background: var(--oc-theirs); color: var(--oc-ink); font-size: .94rem; line-height: 1.42;
    box-shadow: 0 1px 2px rgba(15, 32, 39, .1); overflow-wrap: anywhere;
}
.oc-mine .oc-bubble { border-radius: 16px 16px 5px 16px; background: var(--oc-mine); box-shadow: none; }
.oc-name { margin-bottom: 2px; color: var(--oc-name); font-size: .76rem; font-weight: 700; }
.oc-meta { display: flex; justify-content: flex-end; margin-top: 1px; }
.oc-time { color: var(--oc-muted); font-size: .68rem; white-space: nowrap; }
.oc-mine .oc-time { color: var(--oc-mine-muted); }

.oc-photos { display: grid; grid-template-columns: repeat(2, 124px); gap: 4px; margin: 2px 0 4px; }
.oc-photos a { display: block; overflow: hidden; border-radius: 10px; background: rgba(15, 32, 39, .07); }
.oc-photos img { display: block; width: 100%; height: 124px; object-fit: cover; }
.oc-photos-3, .oc-photos-5 { grid-template-columns: repeat(3, 124px); }
.oc-photos-1 { grid-template-columns: minmax(0, 260px); }
.oc-photos-1 img { height: auto; max-height: 300px; }

/* System lines inside a conversation are notices, not somebody talking */
.oc-note {
    display: flex; align-items: flex-start; gap: 8px; margin: 14px 0; padding: 8px 12px;
    border: 1px solid #A7F3D0; border-radius: 10px; background: #ECFDF5; color: #065F46; font-size: .82rem; line-height: 1.4;
}
.oc-note-text { flex: 1 1 auto; }
.oc-note .oc-time { color: #047857; padding-top: 2px; }

.oc-composer {
    display: flex; align-items: flex-end; gap: 4px; padding: 4px; border: 1px solid #CBD5E1; border-radius: 24px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.oc-composer:focus-within { border-color: var(--oc-accent); box-shadow: 0 0 0 3px var(--oc-focus); }
.oc-input {
    flex: 1 1 auto; min-width: 0; padding: 8px 4px; border: 0; outline: 0; resize: none; background: transparent;
    color: var(--oc-ink); font-size: 1rem; line-height: 1.4; max-height: 132px;
}
.oc-attach, .oc-send {
    flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    margin: 0; border: 0; border-radius: 50%; cursor: pointer; font-size: 1.05rem;
}
.oc-attach { background: transparent; color: var(--oc-muted); }
.oc-attach:hover { background: rgba(15, 32, 39, .06); color: var(--oc-ink); }
.oc-send { background: var(--oc-accent); color: var(--oc-accent-ink); }
.oc-send:disabled { opacity: .55; cursor: default; }

/* The floating help button sat on top of the conversation's buttons */
body.modal-open #oft-chat-dock { display: none !important; }

@media (max-width: 575.98px) {
    .oc-bubble { max-width: 86%; }
    .oc-photos-3, .oc-photos-5 { grid-template-columns: repeat(3, 84px); }
    .oc-photos-3 img, .oc-photos-5 img { height: 84px; }
}
