/* El desplegable de la casa (t184, `bb-drop.js`): hacia abajo, anclado a su
   campo, buscador arriba y lista acotada con scroll; en el móvil, hoja
   inferior. Sólo tokens de `blockboard.css`; probado en los dos temas. */
.bbd-host { position: relative; }
.bbd {
  position: absolute; z-index: 40; display: flex; flex-direction: column;
  max-height: min(380px, 62vh); padding: 6px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); text-align: left; cursor: default;
}
.bbd[hidden], .bbd-scrim[hidden] { display: none !important; }
.bbd-head { display: none; }
.bbd-qbox { flex: none; padding: 0 0 6px; }
.bbd-q { width: 100%; min-height: 36px; font-size: var(--size-sm); }
.bbd-list {
  list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain;
  flex: 1 1 auto; min-height: 0;
}
.bbd-group {
  position: sticky; top: 0; z-index: 1; padding: 8px var(--s2) 4px; background: var(--surface);
  font-size: var(--size-2xs); font-weight: 650; color: var(--text-faint);
}
.bbd-it {
  display: flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 6px var(--s2);
  border-radius: 6px; cursor: pointer; font-size: var(--size-sm);
}
.bbd-it:hover, .bbd-it.on { background: var(--surface-hover); }
.bbd-it.sub { padding-left: calc(var(--s2) + 22px); }
.bbd-it.fam .bbd-l { font-weight: 650; }
.bbd-it[aria-selected="true"] .bbd-l { color: var(--accent); }
.bbd-logo, .bbd-mark { width: 20px; height: 20px; border-radius: 50%; flex: none; object-fit: contain; background: var(--surface-sunken); }
.bbd-mark {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; color: #fff; letter-spacing: -.02em;
}
.bbd-tx { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.25; }
.bbd-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbd-sub { font-size: var(--size-2xs); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbd-n { flex: none; font-size: var(--size-2xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.bbd-pill {
  flex: none; padding: 1px 7px; border-radius: var(--radius-pill); font-size: var(--size-2xs);
  color: var(--text-muted); border: 1px solid var(--line-strong); white-space: nowrap;
}
.bbd-box {
  width: 16px; height: 16px; flex: none; border-radius: 4px; border: 1.5px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
}
.bbd-box.on { background: var(--accent); border-color: var(--accent); }
.bbd-box.on::after {
  content: ""; width: 8px; height: 4px; margin-top: -2px;
  border-left: 2px solid var(--bg); border-bottom: 2px solid var(--bg); transform: rotate(-45deg);
}
.bbd-none { padding: 10px var(--s2); color: var(--text-faint); font-size: var(--size-sm); }
.bbd-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: 6px var(--s2) 0; margin-top: 4px; border-top: 1px solid var(--line);
  font-size: var(--size-xs); color: var(--text-muted);
}
.bbd-clear { min-height: 28px; padding: 0 10px; font-size: var(--size-xs); background: transparent; box-shadow: none; }
.bbd.bbd-busy .bbd-list { opacity: .6; }
.bbd-scrim { display: none; }

@media (max-width: 480px) { .bbd-pill { display: none; } }

/* Móvil: hoja inferior con su velo. */
@media (max-width: 720px) {
  .bbd.bbd-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto !important;
    max-height: 78dvh; padding: var(--s2) var(--s3) calc(var(--s3) + env(safe-area-inset-bottom));
    border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; z-index: 1001;
  }
  .bbd.bbd-sheet .bbd-head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
    padding: 2px 0 var(--s2);
  }
  .bbd.bbd-sheet .bbd-head::before {
    content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px;
    border-radius: 2px; background: var(--line-strong);
  }
  .bbd-title { font-size: var(--size-base); padding-top: 8px; }
  .bbd-done { min-height: 34px; margin-top: 6px; }
  .bbd.bbd-sheet .bbd-it { min-height: 44px; }
  .bbd.bbd-sheet .bbd-q { font-size: 16px; }
  .bbd-scrim { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .45); }
}
