/* Member messaging (dev/docs/MESSAGING.md): /account/messages and the corner chat dock on every Orbyt page.
   Design: dev/mock_ups/messaging (GPT). Every class is om-prefixed so it never collides with page or product styles. */
.om, .om-dock-root { --om-bg: #080f1b; --om-panel: #101d2d; --om-card: #152337; --om-edge: #26394c; --om-ink: #edf4fc; --om-muted: #9badc2;
  --om-cyan: #53dcef; --om-lime: #b8ed79; --om-shadow: 0 20px 70px rgba(0, 0, 0, .55); color: var(--om-ink); font: 15px/1.5 'Segoe UI', system-ui, sans-serif; }
.om *, .om-dock-root * { box-sizing: border-box; }
.om button, .om input, .om textarea, .om select, .om-dock-root button, .om-dock-root textarea, .om-dock-root input { font: inherit; }
.om button, .om-dock-root button { cursor: pointer; }
.om button:disabled, .om-dock-root button:disabled { cursor: not-allowed; opacity: .5; }
.om a, .om-dock-root a { color: var(--om-cyan); text-decoration: none; }
.om a:hover, .om-dock-root a:hover { text-decoration: underline; }
.om :focus-visible, .om-dock-root :focus-visible { outline: 2px solid var(--om-cyan); outline-offset: 3px; }
.om [hidden], .om-dock-root [hidden] { display: none !important; }
.om-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* shared pieces */
.om-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border-radius: 15px; font-weight: 800; font-size: 14px; background: #254752; color: #b1f3ea; }
.om-avatar.c1 { background: #393054; color: #dccbff; } .om-avatar.c2 { background: #503f30; color: #ffe0b7; } .om-avatar.c3 { background: #203f5a; color: #b9e6ff; } .om-avatar.c4 { background: #344324; color: var(--om-lime); }
.om-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 7px; background: #1a393c; color: #9ce6dc; font-size: 11px; font-weight: 600; white-space: nowrap; }
.om-pill.pending { background: #403923; color: #ead399; }
.om-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 7px; background: var(--om-cyan); color: #062029; font-size: 11px; font-weight: 800; padding: 0 5px; }
.om-btn { border: 1px solid var(--om-edge); border-radius: 10px; background: #1a2a3c; color: var(--om-ink); padding: 10px 15px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.om-btn:hover { border-color: #527187; text-decoration: none !important; }
.om-btn.primary { background: var(--om-lime); border-color: var(--om-lime); color: #1b2a12; }
.om-btn.cyan { background: var(--om-cyan); border-color: var(--om-cyan); color: #05232a; }
.om-btn.ghost { background: transparent; }
.om-btn.danger { color: #ffb3b3; border-color: #5a2f36; }
.om-icon-btn { border: 0; background: none; color: var(--om-muted); font-size: 18px; line-height: 1; padding: 6px 9px; border-radius: 8px; }
.om-icon-btn:hover { background: var(--om-card); color: var(--om-ink); }
.om-muted { color: var(--om-muted); }
.om-eyebrow { color: var(--om-cyan); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }
.om-note { background: #152c35; border: 1px solid #2c4b57; border-radius: 12px; padding: 14px 16px; font-size: 12px; color: #b2ced8; }
.om-empty { padding: 32px; text-align: center; color: var(--om-muted); font-size: 13px; }
.om-error { color: #ffb3b3; font-size: 12px; }

/* page */
.om-page { width: 100%; max-width: 1450px; box-sizing: border-box; margin: 0 auto; padding: 32px 3% 110px; } /* full width on every tab, not sized by its content */
.om-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.om-intro h1 { font-size: 32px; letter-spacing: -1px; margin: 4px 0; color: var(--om-ink); }
.om-intro p { font-size: 14px; color: var(--om-muted); margin: 6px 0 0; }
.om-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--om-edge); padding: 0 4px 14px; margin-bottom: 24px; flex-wrap: wrap; font-size: 14px; }
.om-tabs a { color: var(--om-muted); display: inline-flex; align-items: center; gap: 6px; }
.om-tabs a.is-active { color: var(--om-ink); font-weight: 700; }
.om-off { max-width: 640px; }

.om-messenger { display: grid; grid-template-columns: 300px minmax(0, 1fr) 236px; border: 1px solid var(--om-edge); border-radius: 20px; overflow: hidden; background: var(--om-panel); min-height: 620px; box-shadow: var(--om-shadow); }
.om-messenger > [data-om-main], .om-messenger > [data-om-side] { display: flex; min-width: 0; }
.om-messenger > div > .om-conv, .om-messenger > div > .om-profile { flex: 1; min-width: 0; }
.om-contacts { border-right: 1px solid var(--om-edge); padding: 20px 12px; min-width: 0; }
.om-contacts h2 { font-size: 21px; margin: 0 8px 6px; }
.om-contacts > p { font-size: 13px; margin: 0 8px 12px; color: var(--om-muted); }
.om-search input { width: 100%; min-width: 0; background: #0b1625; border: 1px solid var(--om-edge); color: var(--om-ink); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.om-search { margin: 0 8px; }
.om-group { font-size: 10px; letter-spacing: 1px; color: var(--om-muted); font-weight: 700; margin: 20px 10px 8px; display: flex; justify-content: space-between; text-transform: uppercase; }
.om-person { display: flex; width: 100%; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 12px; padding: 11px 9px; background: none; color: var(--om-ink); text-align: left; }
.om-person:hover { background: #1b2b40; }
.om-person.is-selected { background: #21394b; border-color: #31546b; }
.om-person-text { flex: 1; min-width: 0; }
.om-person strong { display: block; font-size: 13px; }
.om-person small { display: block; font-size: 11px; color: var(--om-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-contact-note { font-size: 11px; color: var(--om-muted); line-height: 1.6; padding: 14px 10px; }

.om-conv { display: flex; flex-direction: column; min-width: 0; min-height: 620px; }
.om-conv-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--om-edge); }
.om-conv-head strong { font-size: 15px; }
.om-conv-head small { display: block; font-size: 11px; color: var(--om-muted); }
.om-conv-head .om-spacer { flex: 1; }
.om-back-phone { display: none; }
.om-banner { background: #132e33; color: #b9dfdb; border-bottom: 1px solid #244048; padding: 10px 22px; font-size: 12px; }
.om-banner.warn { background: #302c21; color: #e4d5ac; border-color: #514834; }
.om-timeline { flex: 1; padding: 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 460px; min-height: 270px; }
.om-more { align-self: center; }
.om-msg { max-width: 85%; align-self: flex-start; }
.om-msg p { background: #223449; border-radius: 15px 15px 15px 4px; padding: 11px 14px; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 13px; }
.om-msg.mine { align-self: flex-end; }
.om-msg.mine p { background: #22434c; color: #e5ffff; border-radius: 15px 15px 4px 15px; }
.om-msg small { display: block; font-size: 10px; margin-top: 4px; padding: 0 3px; color: var(--om-muted); }
.om-msg.mine small { text-align: right; }
.om-msg.failed p { border: 1px solid #7a3a44; }
.om-msg .om-retry { border: 0; background: none; color: var(--om-cyan); font-size: 10px; padding: 0; }
.om-composer { border-top: 1px solid var(--om-edge); padding: 14px 18px; }
.om-composer label { font-size: 11px; color: var(--om-muted); display: block; margin-bottom: 6px; }
.om-compose-row { display: flex; gap: 9px; align-items: flex-end; }
.om-composer textarea { resize: vertical; min-height: 45px; max-height: 140px; width: 100%; min-width: 0; background: #0d1827; border: 1px solid var(--om-edge); color: var(--om-ink); border-radius: 11px; padding: 10px 12px; font-size: 13px; }
.om-hint { font-size: 10px; margin-top: 6px; color: var(--om-muted); }
.om-profile { border-left: 1px solid var(--om-edge); padding: 26px 18px; text-align: center; background: #0e1928; }
.om-profile .om-avatar { margin: 0 auto 12px; width: 64px; height: 64px; border-radius: 22px; font-size: 21px; }
.om-profile h3 { margin: 0 0 2px; font-size: 16px; }
.om-profile p { font-size: 12px; color: var(--om-muted); margin: 4px 0; }
.om-profile hr { border: 0; border-top: 1px solid var(--om-edge); margin: 20px 0; }
.om-profile .om-btn { width: 100%; margin-top: 8px; font-size: 12px; }

.om-two { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; }
.om-panel { border: 1px solid var(--om-edge); border-radius: 18px; background: var(--om-panel); padding: 24px; margin-bottom: 22px; }
.om-panel h2 { font-size: 20px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; color: var(--om-ink); }
.om-request { display: flex; gap: 16px; padding: 20px 0; border-top: 1px solid var(--om-edge); }
.om-request:first-of-type { border-top: 0; }
.om-request > div:last-child { flex: 1; min-width: 0; }
.om-request p { font-size: 13px; color: var(--om-muted); margin: 4px 0; overflow-wrap: anywhere; }
.om-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.om-field { display: flex; gap: 8px; margin-top: 8px; }
.om-field input, .om-panel textarea, .om-panel select, .om-dialog select, .om-dialog textarea { width: 100%; min-width: 0; background: #0b1625; border: 1px solid var(--om-edge); color: var(--om-ink); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.om-setting { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 0; border-top: 1px solid var(--om-edge); }
.om-setting:first-of-type { border-top: 0; }
.om-setting p { font-size: 12px; color: var(--om-muted); max-width: 520px; margin: 4px 0 0; }
.om-setting input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--om-lime); flex-shrink: 0; }

/* account overview tile (views/account/index.php) */
.om-acct { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; margin: 22px 0; }
.om-metric { font-size: 30px; color: var(--om-lime); font-weight: 800; margin-right: 6px; }

/* corner dock */
.om-dock-root { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 905; }
.om-launcher { border: 1px solid #6ce3ec; background: #5ddce8; color: #072c35; height: 48px; padding: 0 18px; box-shadow: 0 6px 28px rgba(2, 19, 26, .6); border-radius: 18px; display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; }
.om-launcher svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.om-launcher b { background: #112c37; color: #fff; padding: 1px 7px; border-radius: 7px; font-size: 11px; }
.om-drawer { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: 82px; width: 380px; max-width: calc(100vw - 32px); background: var(--om-panel); border: 1px solid #3a5c70; border-radius: 18px; box-shadow: var(--om-shadow); z-index: 906; max-height: calc(100dvh - 120px); display: flex; flex-direction: column; overflow: hidden; }
.om-drawer-head { padding: 14px 16px; border-bottom: 1px solid var(--om-edge); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.om-drawer-head h2 { font-size: 16px; margin: 0; color: var(--om-ink); }
.om-drawer-body { padding: 4px 8px 12px; overflow-y: auto; }
.om-drawer .om-conv { min-height: 0; flex: 1; }
.om-drawer .om-conv-head { padding: 12px; }
.om-drawer .om-conv-head .om-avatar { width: 33px; height: 33px; font-size: 12px; border-radius: 11px; }
.om-drawer .om-timeline { min-height: 180px; max-height: none; padding: 14px; flex: 1; }
.om-drawer .om-banner { padding: 8px 14px; font-size: 11px; }
.om-drawer .om-composer { padding: 10px 12px; }
.om-drawer .om-msg p { font-size: 12.5px; }
.om-drawer-foot { border-top: 1px solid var(--om-edge); padding: 10px 14px; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
/* the AI assistant shares the corner: it sits left of the chat button, one panel open at a time */
body.om-has-dock .oa-root { right: calc(max(20px, env(safe-area-inset-right)) + var(--om-dock-w, 120px) + 12px); }
body.om-has-dock .oa-root.is-open { right: max(20px, env(safe-area-inset-right)); bottom: 82px; z-index: 907; }

.om-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #e1f7d3; color: #17321a; padding: 12px 18px; border-radius: 12px; box-shadow: var(--om-shadow); z-index: 1000; max-width: calc(100vw - 32px); font-size: 13px; }
.om-dialog { max-width: 480px; width: calc(100vw - 32px); border: 1px solid var(--om-edge); border-radius: 18px; background: var(--om-panel); color: var(--om-ink); padding: 24px; box-shadow: var(--om-shadow); }
.om-dialog::backdrop { background: rgba(3, 9, 17, .75); }
.om-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.om-dialog label { display: block; font-size: 12px; color: var(--om-muted); margin: 12px 0 4px; }
.om-evidence { max-height: 180px; overflow-y: auto; border: 1px solid var(--om-edge); border-radius: 10px; padding: 6px 10px; }
.om-evidence label { display: flex; gap: 8px; align-items: flex-start; color: var(--om-ink); margin: 6px 0; font-size: 12px; }

@media (max-width: 1150px) { .om-messenger { grid-template-columns: 265px minmax(0, 1fr); } .om-messenger > [data-om-side] { display: none; } }
@media (max-width: 720px) {
  .om-page { padding: 22px 16px 100px; }
  .om-intro h1 { font-size: 27px; }
  .om-messenger { grid-template-columns: 1fr; min-height: 0; }
  .om-messenger.has-thread .om-contacts { display: none; }
  .om-back-phone { display: inline-block; }
  .om-messenger:not(.has-thread) .om-conv { display: none; }
  .om-messenger > [data-om-main], .om-messenger > [data-om-side] { display: flex; min-width: 0; }
.om-messenger > div > .om-conv, .om-messenger > div > .om-profile { flex: 1; min-width: 0; }
.om-contacts { border-right: 0; }
  .om-conv { min-height: 70vh; }
  .om-two, .om-acct { grid-template-columns: 1fr; }
  .om-panel { padding: 18px; }
  .om-dock-root { right: 14px; bottom: 14px; }
  .om-launcher { height: 46px; padding: 0 14px; }
  .om-drawer { right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; border-radius: 18px 18px 0 0; max-height: 88dvh; height: 88dvh; padding-bottom: env(safe-area-inset-bottom); }
  body.om-has-dock .oa-root { right: calc(14px + var(--om-dock-w, 110px) + 10px); bottom: 14px; }
  body.om-has-dock .oa-root.is-open { right: 0; bottom: 0; }
}
