/* =========================================================
   Learning Rewired Lab — The Lab · Builders directory + DMs
   File: /assets/css/builders.css
   Pairs with: /builders/index.html + /assets/js/builders.js
   ========================================================= */

.bld-page { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 24px; align-items: start; max-width: 1200px; margin: 0 auto; }
@media (max-width: 1080px) { .bld-page { grid-template-columns: 1fr; } }

.bld-search {
  display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--lab-line);
  border-radius: 14px; padding: 13px 16px; margin-bottom: 18px; box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.bld-search__ic { font-size: 15px; color: #94a3b8; flex: none; }
.bld-search input { flex: 1; border: none; outline: none; background: transparent; font-family: inherit; font-size: 14px; color: var(--lab-ink); }
.bld-search input::placeholder { color: #9aa6b6; }

.bld-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

.bld-card { background: #fff; border: 1px solid var(--lab-line); border-radius: 18px; padding: 20px 18px; box-shadow: 0 8px 20px rgba(15,23,42,.05); transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease; }
.bld-card:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(15,23,42,.09); }
.bld-card__top { display: flex; align-items: flex-start; justify-content: space-between; }
.bld-card__av { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #fff; margin-bottom: 12px; }
.bld-card__flag { font-size: 24px; line-height: 1; filter: drop-shadow(0 1px 3px rgba(0,0,0,.2)); }
.bld-card__name { font-weight: 800; font-size: 14.5px; color: var(--lab-ink); letter-spacing: -.01em; }
.bld-card__role { font-size: 12px; color: var(--lab-slate); margin-top: 2px; min-height: 15px; }
.bld-card__loc { font-size: 11.5px; color: var(--lab-teal-d); font-weight: 700; margin-top: 6px; }
.bld-card__tagline { font-size: 12px; color: #64748b; margin-top: 8px; line-height: 1.5; min-height: 18px; }
.bld-card__msgbtn {
  width: 100%; margin-top: 14px; font-family: inherit; font-weight: 800; font-size: 12.5px; color: #fff;
  background: var(--lab-teal-d); border: none; border-radius: 10px; padding: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.bld-card__msgbtn:hover { background: #0c5e57; }

.bld-empty { grid-column: 1/-1; text-align: center; padding: 40px 20px; color: #64748b; font-size: 13.5px; }

/* ---- inbox rail ---- */
.bld-railstack { display: grid; gap: 16px; position: sticky; top: 92px; }
.bld-inbox { border: 1px solid var(--lab-line); border-radius: 18px; background: #fff; box-shadow: 0 8px 20px rgba(15,23,42,.05); padding: 16px; }
.bld-inbox__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.bld-inbox__head h3 { margin: 0; font-size: 14px; font-weight: 800; color: var(--lab-ink); }
.bld-inbox__list { display: flex; flex-direction: column; gap: 4px; }
.bld-inbox__empty { font-size: 12.5px; color: #94a3b8; padding: 10px 4px; line-height: 1.5; }
.bld-inbox__item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: transparent; border: none; text-align: left; cursor: pointer; width: 100%; font-family: inherit; }
.bld-inbox__item:hover { background: var(--lab-bg, #f8fafc); }
.bld-inbox__av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: 12px; color: #fff; flex: none; }
.bld-inbox__body { min-width: 0; }
.bld-inbox__name { font-weight: 750; font-size: 12.5px; color: var(--lab-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bld-inbox__snippet { font-size: 11.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- builders around the world ---- */
.bld-worldcard { border: 1px solid var(--lab-line); border-radius: 18px; background: linear-gradient(165deg,#f0fdfa,#fff); border-color: rgba(20,184,166,.2); box-shadow: 0 8px 20px rgba(15,23,42,.05); padding: 16px; }
.bld-worldcard__ic { font-size: 15px; }
.bld-worldcard__list { display: flex; flex-direction: column; gap: 2px; }
.bld-worldcard__row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; }
.bld-worldcard__flag { font-size: 20px; line-height: 1; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
.bld-worldcard__name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--lab-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bld-worldcard__bar { flex: none; width: 60px; height: 5px; border-radius: 999px; background: #eef2f4; overflow: hidden; }
.bld-worldcard__bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,#14b8a6,#0f766e); }
.bld-worldcard__count { flex: none; font-size: 11.5px; font-weight: 800; color: var(--lab-teal-d); min-width: 16px; text-align: right; }
.bld-worldcard__foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(20,184,166,.15); font-size: 11.5px; color: var(--lab-slate); text-align: center; font-weight: 600; }
.bld-worldcard__empty { font-size: 12.5px; color: #94a3b8; padding: 8px 4px; }

/* ---- chat drawer ---- */
.bld-chat[hidden] { display: none; }
.bld-chat { position: fixed; inset: 0; z-index: 400; }
.bld-chat__backdrop { position: absolute; inset: 0; background: rgba(7,17,31,.32); }
.bld-chat__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: #fff;
  display: flex; flex-direction: column; box-shadow: -20px 0 50px rgba(7,17,31,.24);
  animation: bld-slide-in .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes bld-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.bld-chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--lab-line); }
.bld-chat__av { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #fff; background: linear-gradient(140deg,var(--lab-teal-d),var(--lab-ink)); flex: none; }
.bld-chat__id { flex: 1; min-width: 0; line-height: 1.25; }
.bld-chat__id strong { display: block; font-size: 14px; font-weight: 800; color: var(--lab-ink); }
.bld-chat__id span { display: block; font-size: 11.5px; color: #94a3b8; }
.bld-chat__close { width: 30px; height: 30px; border-radius: 9px; border: none; background: transparent; color: #94a3b8; font-size: 18px; cursor: pointer; }
.bld-chat__close:hover { background: #f1f5f9; color: var(--lab-ink); }
.bld-chat__thread { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.bld-msg { max-width: 78%; padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.45; }
.bld-msg--them { align-self: flex-start; background: #f1f5f9; color: #1e293b; border-bottom-left-radius: 4px; }
.bld-msg--me { align-self: flex-end; background: var(--lab-teal-d); color: #fff; border-bottom-right-radius: 4px; }
.bld-chat__empty { text-align: center; color: #94a3b8; font-size: 13px; margin: auto; padding: 20px; }
.bld-chat__composer { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--lab-line); }
.bld-chat__composer input { flex: 1; border: 1px solid var(--lab-line); border-radius: 12px; padding: 11px 14px; font-family: inherit; font-size: 13.5px; outline: none; }
.bld-chat__composer input:focus { border-color: rgba(20,184,166,.4); }
.bld-chat__composer button { width: 42px; height: 42px; border-radius: 12px; border: none; background: var(--lab-teal-d); color: #fff; font-size: 16px; cursor: pointer; flex: none; }
.bld-chat__composer button:hover { background: #0c5e57; }
.bld-chat__emoji-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--lab-line); background: #fff; font-size: 18px; cursor: pointer; flex: none; display: grid; place-items: center; line-height: 1; }
.bld-chat__emoji-btn:hover { background: #f8fafc; border-color: #cbd5e1; }

/* ---------------- emoji picker popover (shared component) ---------- */
.lab-emoji-panel {
  z-index: 900;
  width: 300px;
  background: #fff;
  border: 1px solid var(--lab-line, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(7,17,31,.18);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lab-emoji-panel__tabs { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 6px; border-bottom: 1px solid #edf1f4; }
.lab-emoji-panel__tab {
  flex: none; width: 32px; height: 32px; border-radius: 9px; border: none; background: transparent;
  font-size: 16px; cursor: pointer; display: grid; place-items: center; opacity: .6;
}
.lab-emoji-panel__tab:hover { background: #f1f5f9; opacity: 1; }
.lab-emoji-panel__tab.is-active { background: rgba(20,184,166,.12); opacity: 1; }
.lab-emoji-panel__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
}
.lab-emoji-panel__em {
  border: none; background: transparent; font-size: 19px; line-height: 1;
  width: 100%; aspect-ratio: 1; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center;
}
.lab-emoji-panel__em:hover { background: #f1f5f9; }
.lab-emoji-panel__empty { grid-column: 1 / -1; text-align: center; color: #94a3b8; font-size: 12px; padding: 20px 0; }
