
.conn-wrap { max-width: 760px; margin: 0 auto; padding: 1.6rem 1.2rem 6rem; }
.conn-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.1rem; }
.conn-head h1 { font-size: 1.5rem; }
.conn-back { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); display: grid; place-items: center; font-size: 1.1rem; }


.conn-tabs { display: flex; gap: .3rem; background: var(--surface-2); padding: .3rem; border-radius: 12px; margin-bottom: 1.1rem; }
.conn-tab { flex: 1; padding: .55rem; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--text-muted); position: relative; }
.conn-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.conn-tab .tab-badge { position: absolute; top: 6px; right: 10px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--accent); color: #04211d; font: 700 .62rem var(--font-mono); display: grid; place-items: center; }

.conn-list { display: grid; gap: .8rem; }
.conn-empty { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.conn-empty .big { font-weight: 700; color: var(--text); margin-bottom: .4rem; }


.req-card, .chat-item { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.1rem;
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.req-card { border-left: 3px solid var(--accent); }
.chat-item { display: flex; align-items: center; gap: .9rem; cursor: pointer; }
.chat-item:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.req-top, .chat-id { display: flex; align-items: center; gap: .8rem; }
.conn-ava { width: 46px; height: 46px; border-radius: 14px; flex: none; object-fit: cover; background: var(--surface-3); }
.conn-ava.ph { display: grid; place-items: center; font: 700 1rem var(--font-display); color: var(--primary); }
.req-name { font-weight: 700; font-size: 1.02rem; }
.req-meta { font: 400 .72rem var(--font-mono); color: var(--text-faint); margin-top: 2px; }
.req-traits { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0; }
.req-traits .trait { font-size: .7rem; padding: .25rem .6rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.req-bubble { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 12px; padding: .6rem .8rem;
  font-size: .9rem; color: var(--text); margin: .2rem 0 .8rem; position: relative; }
.req-bubble::before { content: "“"; color: var(--accent); font-size: 1.3rem; line-height: 0; vertical-align: -.35rem; margin-right: .2rem; }
.req-actions { display: flex; gap: .6rem; }
.req-actions .btn { flex: 1; }
.req-when { font: 400 .68rem var(--font-mono); color: var(--text-faint); margin-top: .6rem; }
.status-pill { font: 700 .64rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 99px; }
.status-pill.pending { background: var(--primary-soft); color: var(--primary); }
.status-pill.accepted { background: var(--accent-soft); color: var(--accent); }
.status-pill.declined { background: var(--surface-3); color: var(--text-faint); }


.chat-last { flex: 1; min-width: 0; }
.chat-last .ln { font-size: .85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-last .ln b { color: var(--text); }
.chat-right { display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; }
.chat-time { font: 400 .66rem var(--font-mono); color: var(--text-faint); }
.unread-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent);
  color: #04211d; font: 700 .64rem var(--font-mono); display: grid; place-items: center; }


.thread-view { display: flex; flex-direction: column; min-height: calc(100dvh - var(--header-h) - 2rem); }
.thread-head { display: flex; align-items: center; gap: .8rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border); margin-bottom: .6rem; }
.thread-head .conn-ava { width: 42px; height: 42px; }
.thread-head .th-name { font-weight: 700; }
.thread-head .th-sub { font: 400 .72rem var(--font-mono); color: var(--text-faint); }
.thread-head .th-actions { margin-left: auto; display: flex; gap: .5rem; }
.wa-btn { display: inline-flex; align-items: center; gap: .4rem; background: #25d366; color: #06351d; font-weight: 700;
  font-size: .8rem; padding: .45rem .8rem; border-radius: 99px; }

.thread-msgs { flex: 1; overflow-y: auto; padding: .6rem .2rem 1rem; display: flex; flex-direction: column; gap: .5rem; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: 78%; padding: .6rem .85rem; border-radius: 16px; font-size: .92rem; line-height: 1.4; word-wrap: break-word; }
.bubble.theirs { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.mine { background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 5px; }
.bubble .b-time { display: block; font: 400 .6rem var(--font-mono); opacity: .7; margin-top: .25rem; }
.bubble.ice .b-tag { display: block; font: 700 .58rem var(--font-mono); letter-spacing: .1em; opacity: .7; margin-bottom: .2rem; }
.thread-date { align-self: center; font: 400 .64rem var(--font-mono); color: var(--text-faint); background: var(--surface-2); padding: .2rem .7rem; border-radius: 99px; }

.thread-input { position: sticky; bottom: 0; display: flex; gap: .6rem; align-items: flex-end;
  padding: .7rem 0 .2rem; background: linear-gradient(transparent, var(--bg) 30%); }
.thread-input textarea { flex: 1; resize: none; max-height: 120px; min-height: 44px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 14px; padding: .7rem .9rem; font-size: .92rem; }
.thread-input textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.thread-input .send-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center; flex: none; }
.thread-input .send-btn:disabled { opacity: .4; cursor: not-allowed; }
.thread-note { text-align: center; color: var(--text-muted); font-size: .85rem; padding: 1rem; background: var(--surface-2);
  border: 1px dashed var(--border-strong); border-radius: 14px; }


.ib-modal { width: min(480px, 100%); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 20px; box-shadow: var(--shadow-lift); overflow: hidden; animation: modalIn .3s var(--ease); }
.ib-head { padding: 1.2rem 1.3rem .4rem; }
.ib-head .ib-to { display: flex; align-items: center; gap: .7rem; margin-bottom: .3rem; }
.ib-head .ib-to .conn-ava { width: 40px; height: 40px; }
.ib-head h3 { font-size: 1.15rem; }
.ib-head p { color: var(--text-muted); font-size: .85rem; margin-top: .2rem; }
.ib-list { padding: .6rem 1.3rem; display: grid; gap: .55rem; }
.ib-chip { text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  padding: .75rem .9rem; font-size: .9rem; color: var(--text); transition: .15s var(--ease); }
.ib-chip:hover { border-color: var(--border-strong); transform: translateX(2px); }
.ib-chip.sel { border-color: var(--accent); background: var(--accent-soft); }
.ib-foot { padding: .8rem 1.3rem 1.3rem; display: flex; gap: .6rem; }
.ib-foot .btn { flex: 1; }


.bell-btn { position: relative; }
.bell-count { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--danger); color: #fff; font: 700 .62rem var(--font-mono); display: grid; place-items: center; border: 2px solid var(--bg); }

@media (max-width: 560px) { .bubble { max-width: 88%; } .req-actions { flex-direction: column; } }