/* OnBuy Hunter · Team Chat — dark-first theme (2026 redesign).
   Dark slate surfaces separated by hairline borders, one electric
   blue accent; green and red are semantic only. */
:root {
    color-scheme: dark;
    --obh-blue: #3B82F6;
    --obh-blue-dark: #1D4ED8;
    --obh-ink: #E2E8F0;
    --obh-muted: #94A3B8;
    --obh-line: rgba(148, 163, 184, 0.18);
    --obh-bg: #0F172A;
    --obh-card: #1E293B;
    --obh-raised: #273549;
    --obh-inset: #131E33;
    --obh-radius: 14px;
    --obh-shadow: 0 1px 3px rgba(2, 6, 17, 0.45);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--obh-bg);
    color: var(--obh-ink);
}

.obh-chat-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 16px 16px;
    gap: 10px;
}

/* ── Header ── */
.obh-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    color: var(--obh-ink);
    background: var(--obh-card);
    border: 1px solid var(--obh-line);
    border-radius: var(--obh-radius);
    box-shadow: var(--obh-shadow);
    flex: none;
}

.obh-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    letter-spacing: 0.2px;
}

.obh-conn {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.obh-conn-on { background: rgba(34, 197, 94, 0.16); color: #4ADE80; }
.obh-conn-off { background: rgba(239, 68, 68, 0.14); color: #FCA5A5; }

.obh-header-actions { display: flex; gap: 8px; }

.obh-header-actions .obh-btn {
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid var(--obh-line);
    color: var(--obh-ink);
}

.obh-header-actions .obh-btn:hover { background: rgba(148, 163, 184, 0.24); }

/* ── Buttons ── */
.obh-btn {
    padding: 8px 16px;
    color: #ffffff;
    background: var(--obh-blue);
    border: 1px solid var(--obh-blue);
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: background 120ms ease, transform 60ms ease;
}

.obh-btn:hover { background: #60A5FA; border-color: #60A5FA; }
.obh-btn:active { transform: scale(0.97); }

.obh-btn-light {
    color: var(--obh-ink);
    background: var(--obh-raised);
    border-color: var(--obh-line);
}

.obh-btn-light:hover { background: #2F4258; border-color: var(--obh-line); }

.obh-btn-danger {
    color: #ffffff;
    background: #D64541;
    border-color: #D64541;
}

.obh-btn-danger:hover { background: #BE3833; border-color: #BE3833; }

/* ── Banners ── */
/* The announcement banner must catch the eye from across the
   room (user order, v3.8): a strong amber gradient, large bold
   white text, and the author's name as a dark chip. */
.obh-announce {
    padding: 12px 16px;
    color: #ffffff;
    background: linear-gradient(120deg, #92400e, #b45309 55%, #d97706);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: var(--obh-radius);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.22);
    flex: none;
}

.obh-announce-name {
    display: inline-block;
    padding: 1px 9px;
    color: #fff7e0;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
    font-weight: 900;
    white-space: nowrap;
}

.obh-notice {
    padding: 10px 14px;
    color: #FCA5A5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--obh-radius);
    font-size: 13px;
    font-weight: 600;
    flex: none;
}

/* ── Panels (settings, members, admin) ── */
.obh-settings {
    padding: 16px 16px 26px;
    background: var(--obh-card);
    border: 1px solid var(--obh-line);
    border-radius: var(--obh-radius);
    box-shadow: var(--obh-shadow);
    scroll-margin-top: 10px;
    scroll-padding-bottom: 26px;
    flex: none;
    max-height: 42vh;
    overflow-y: auto;
}

.obh-panel-title {
    display: block;
    margin: 2px 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--obh-muted);
}

.obh-settings label {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #CBD5E1;
}

.obh-settings input[type="text"],
.obh-settings input[type="password"] {
    width: 100%;
    margin-top: 5px;
    padding: 9px 12px;
    border: 1px solid var(--obh-line);
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    color: var(--obh-ink);
    background: var(--obh-inset);
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.obh-settings input:focus {
    border-color: var(--obh-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.obh-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--obh-muted);
}

.obh-room-line {
    margin-top: 8px;
    font-size: 12.5px;
    color: #CBD5E1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.obh-owner-note {
    margin-top: 10px;
    padding: 9px 12px;
    color: #FCD34D;
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
}

.obh-settings-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.obh-settings-msg { font-size: 12px; color: #4ADE80; font-weight: 600; }

/* ── Members ── */
.obh-members-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.obh-members-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: var(--obh-raised);
    border: 1px solid var(--obh-line);
    border-radius: 10px;
    font-size: 13px;
}

.obh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    flex: none;
}

.obh-member-name { font-weight: 700; }

.obh-member-you { font-size: 11px; color: var(--obh-muted); }

.obh-kick {
    margin-left: auto;
    padding: 4px 11px;
    color: #FCA5A5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
}

.obh-kick:hover { background: rgba(239, 68, 68, 0.22); }

.obh-lock-btn {
    margin-left: 6px;
    color: #FCD34D;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

.obh-lock-btn:hover { background: rgba(245, 158, 11, 0.22); }

/* ── Messages ── */
.obh-messages {
    flex: 1;
    min-height: 40vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--obh-card);
    border: 1px solid var(--obh-line);
    border-radius: var(--obh-radius);
    box-shadow: var(--obh-shadow);
}

.obh-msg {
    max-width: 78%;
    padding: 9px 13px;
    background: var(--obh-raised);
    border: 1px solid var(--obh-line);
    border-radius: 16px;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(2, 6, 17, 0.35);
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.obh-msg-own {
    align-self: flex-end;
    color: #ffffff;
    background: var(--obh-blue);
    border-color: transparent;
    border-radius: 16px;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 16px;
}

.obh-msg-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}

.obh-msg-name { font-size: 12px; font-weight: 700; }

.obh-msg-own .obh-msg-name { color: #DBEAFE; }

.obh-msg-time { font-size: 10px; color: var(--obh-muted); }

.obh-msg-own .obh-msg-time { color: rgba(255, 255, 255, 0.75); }

.obh-msg-text { white-space: pre-wrap; }

.obh-msg-text a { color: var(--obh-blue); }

.obh-msg-own .obh-msg-text a { color: #DBEAFE; }

.obh-msg-announce {
    background: #fff6da;
    border-color: #f0d48a;
}

/* Announcement messages keep dark, readable text on their pale
   background even when they are the viewer's own messages: the
   own-message white (0,1,0) must never win over the announce
   background. These selectors outrank .obh-msg-own on purpose. */
.obh-msg.obh-msg-announce {
    color: #54390a;
}

.obh-msg.obh-msg-announce .obh-msg-time {
    color: #8a6a1c;
}

.obh-msg.obh-msg-announce .obh-msg-text a {
    color: var(--obh-blue-dark);
}

.obh-msg-share { border-color: rgba(59, 130, 246, 0.45); background: rgba(59, 130, 246, 0.08); }

.obh-msg-share .obh-msg-text a {
    color: var(--obh-blue);
    word-break: break-all;
    font-weight: 600;
}

.obh-system-line {
    align-self: center;
    padding: 3px 12px;
    color: var(--obh-muted);
    background: var(--obh-raised);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.obh-empty {
    margin: auto;
    max-width: 420px;
    color: var(--obh-muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

/* ── Composer ── */
.obh-composer {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--obh-card);
    border: 1px solid var(--obh-line);
    border-radius: 999px;
    box-shadow: var(--obh-shadow);
    flex: none;
}

.obh-composer input {
    flex: 1;
    padding: 9px 14px;
    border: none;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    outline: none;
    background: transparent;
}

/* ── Panel sections: clearer separation between the Members,
   Super Admin and room admin blocks ── */
.obh-settings .obh-panel-title {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--obh-line);
}

.obh-members-list + .obh-panel-title,
.obh-super-block + .obh-panel-title {
    margin-top: 18px;
}

/* ── Super Admin blocks: brand reports and the user registry ── */
.obh-super-block {
    margin-top: 14px;
    padding: 12px;
    background: #16233A;
    border: 1px solid var(--obh-line);
    border-radius: 12px;
}

.obh-super-block .obh-panel-title { border-bottom: none; padding-bottom: 0; }

.obh-btn-sm {
    padding: 4px 12px;
    font-size: 11px;
}

.obh-report-item {
    padding: 9px 11px;
    margin-bottom: 7px;
    background: var(--obh-raised);
    border: 1px solid var(--obh-line);
    border-radius: 10px;
    font-size: 12.5px;
}

.obh-report-brand { font-weight: 700; font-size: 13px; }

.obh-report-meta { margin-top: 2px; color: var(--obh-muted); font-size: 11px; }

.obh-report-title { margin-top: 3px; word-break: break-word; }

.obh-report-title a { color: var(--obh-blue); font-weight: 600; }

.obh-report-note { margin-top: 3px; color: #CBD5E1; font-style: italic; }

.obh-report-actions {
    display: flex;
    gap: 7px;
    margin-top: 8px;
}

.obh-member-seen {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--obh-muted);
    white-space: nowrap;
}

/* The room admin tools block gets the same breathing room as the
   other panel sections. */
#obh-admin-tools { margin-top: 18px; }

/* ── Conversation switcher (team chat / private chats, v3.8) ── */
.obh-convo-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: none;
}

/* The switcher is shown and hidden through the hidden
   attribute; without this guard the flex rule above would
   keep an empty box (and its column gap) in the layout. */
.obh-convo-switch[hidden] {
    display: none;
}

.obh-convo-active {
    color: #ffffff;
    background: var(--obh-blue);
    border-color: var(--obh-blue);
}

.obh-convo-active:hover { background: #60A5FA; border-color: #60A5FA; }

/* ── Price Check view (v3.10) ── */
.obh-price-view {
    flex: 1;
    min-height: 40vh;
    overflow-y: auto;
    padding: 16px;
    background: var(--obh-card);
    border: 1px solid var(--obh-line);
    border-radius: var(--obh-radius);
    box-shadow: var(--obh-shadow);
}

.obh-price-view[hidden] { display: none; }

.obh-price-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.obh-price-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.obh-price-form input[type="text"] { text-transform: uppercase; }

/* v3.11: the eBay item number is digits only, no uppercasing. */
#obh-price-ebay { text-transform: none; }

.obh-price-list .obh-report-item { background: var(--obh-raised); }

/* ── Saved Products view (v3.12) ── */
.obh-saved-list .obh-report-item { background: var(--obh-raised); }

.obh-saved-item {
    display: flex;
    gap: 11px;
}

.obh-saved-thumb {
    width: 58px;
    height: 58px;
    flex: none;
    object-fit: cover;
    background: var(--obh-inset);
    border: 1px solid var(--obh-line);
    border-radius: 8px;
}

.obh-saved-main { flex: 1; min-width: 0; }

.obh-saved-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.obh-saved-form input[type="text"] {
    width: 170px;
    padding: 6px 9px;
    border: 1px solid var(--obh-line);
    border-radius: 8px;
    font: inherit;
    font-size: 12.5px;
    color: var(--obh-ink);
    background: var(--obh-inset);
    outline: none;
}

.obh-saved-form input[type="text"]:focus {
    border-color: var(--obh-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.obh-saved-asin { text-transform: uppercase; }

.obh-saved-form select {
    padding: 6px 8px;
    border: 1px solid var(--obh-line);
    border-radius: 8px;
    font: inherit;
    font-size: 12.5px;
    color: var(--obh-ink);
    background: var(--obh-inset);
}

.obh-saved-actions {
    display: flex;
    gap: 7px;
    margin-top: 9px;
}

/* ── Private chat blocks (v3.8) ── */
.obh-dm-status { margin-top: 8px; }

#obh-dm-approved-list li { cursor: pointer; }

#obh-dm-approved-list li:hover { background: #2F4258; }

.obh-dot-off {
    background: #64748B;
    box-shadow: none;
}

/* ── Team settings editor (admin) ── */
.obh-admin-block {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--obh-line);
}

.obh-admin-block textarea {
    width: 100%;
    margin-top: 5px;
    padding: 9px 12px;
    border: 1px solid var(--obh-line);
    border-radius: 10px;
    font: inherit;
    font-size: 12.5px;
    color: var(--obh-ink);
    background: var(--obh-inset);
    resize: vertical;
    outline: none;
}

.obh-admin-block textarea:focus {
    border-color: var(--obh-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28);
}

.obh-inline { display: flex; gap: 6px; margin-top: 5px; }
.obh-inline input { flex: 1; }

.obh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.obh-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--obh-raised);
    border: 1px solid var(--obh-line);
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
}

.obh-chip-x {
    padding: 0 2px;
    color: #FCA5A5;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
}

/* ── Scrollbars ── */
.obh-messages::-webkit-scrollbar,
.obh-settings::-webkit-scrollbar { width: 8px; }

.obh-messages::-webkit-scrollbar-thumb,
.obh-settings::-webkit-scrollbar-thumb {
    background: #3D5478;
    border-radius: 999px;
}

/* Placeholder text stays muted on the dark inset inputs. */
.obh-chat-app input::placeholder,
.obh-chat-app textarea::placeholder {
    color: #64748B;
}
