.binfo-tg-popover{
  display:none;
  position:fixed;
  right:16px;
  top:72px;
  z-index:9999;
  width:min(360px, calc(100vw - 24px));
  max-width:calc(100vw - 24px);
  border-radius:16px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(11,14,20,0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  color:#fff;
}
.binfo-tg-popover.is-open{ display:block; }
.binfo-tg-popover__inner{ padding:12px; }
.binfo-tg-popover__title{ font-size:14px; font-weight:800; margin:0 0 8px 0; }
.binfo-tg-popover__text{ font-size:13px; opacity:0.92; margin:0 0 10px 0; }
.binfo-tg-popover__muted{ font-size:12px; opacity:0.7; margin-top:8px; }
.binfo-tg-popover__actions{ margin-top:10px; display:flex; justify-content:flex-end; }
.binfo-tg-popover__link{ font-size:13px; font-weight:700; color:rgba(255,255,255,0.9); text-decoration:none; border:1px solid rgba(255,255,255,0.14); padding:8px 10px; border-radius:12px; background:rgba(255,255,255,0.06); }
.binfo-tg-popover__link:hover{ background:rgba(255,255,255,0.10); }

@media (max-width: 640px){
  .binfo-tg-popover{
    left:12px;
    right:12px;
    top:calc(env(safe-area-inset-top) + 64px);
    width:auto;
    max-width:none;
    max-height:calc(100vh - (env(safe-area-inset-top) + 84px));
    overflow:auto;
  }
}

/* Centered login modal (used for auth prompts from content) */
.binfo-tg-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:100000;
  padding:16px;
  align-items:center;
  justify-content:center;
}
.binfo-tg-modal.is-open{ display:flex; }
.binfo-tg-modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
}
.binfo-tg-popover.binfo-tg-popover--modal{
  display:block;
  position:relative;
  left:auto;
  right:auto;
  top:auto;
  width:min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: min(520px, calc(100vh - 32px));
  overflow:auto;
}
.binfo-tg-modal__close{
  position:absolute;
  top:10px;
  right:10px;
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.binfo-tg-modal__close:hover{ background: rgba(255,255,255,0.10); }

body.binfo-tg-auth-modal-open{
  overflow:hidden;
}

/* Account settings page */
.binfo-account{
  --binfo-accent:#f3d21b;
  color:#fff;
}
.binfo-account__layout{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:24px;
  align-items:start;
  padding:24px 0;
}
.binfo-account__sidebar{
  position:sticky;
  top:92px;
}
.binfo-account__navItem{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border-radius:10px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.10);
  font-weight:800;
  color:rgba(255,255,255,0.92);
}
.binfo-account__navItem.is-active{
  background:var(--binfo-accent);
  border-color:rgba(0,0,0,0.12);
}
.binfo-account__navIcon{
  display:inline-flex;
  width:28px;
  height:28px;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background:rgba(0,0,0,0.10);
}
.binfo-account__content{ min-width:0; }
.binfo-account__h1{
  font-size:34px;
  font-weight:900;
  letter-spacing:0.04em;
  margin:0 0 18px 0;
}
.binfo-account__flash{
  border-radius:12px;
  padding:12px 14px;
  margin:0 0 14px 0;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
}
.binfo-account__flash--ok{ border-color:rgba(34,197,94,0.35); }
.binfo-account__flash--err{ border-color:rgba(239,68,68,0.45); }
.binfo-account__card{
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.06);
  padding:16px;
  margin:0 0 18px 0;
}
.binfo-account__cardHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.binfo-account__title{ margin:0; font-size:18px; font-weight:900; }
.binfo-account__subtitle{ margin-top:4px; font-size:12px; opacity:0.75; }
.binfo-account__edit{
  border:0;
  background:transparent;
  color:rgba(255,255,255,0.86);
  font-weight:800;
  cursor:pointer;
  text-decoration:underline;
}
.binfo-account__rows{ display:flex; flex-direction:column; gap:10px; }
.binfo-account__row{
  display:grid;
  grid-template-columns: 140px 1fr;
  gap:12px;
  padding:8px 0;
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.binfo-account__row:last-child{ border-bottom:0; }
.binfo-account__key{ opacity:0.75; font-size:13px; }
.binfo-account__val{ font-size:13px; font-weight:700; }
.binfo-account__row--input .binfo-account__val{ font-weight:400; }
.binfo-account__row input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  background:rgba(11,14,20,0.7);
  border:1px solid rgba(255,255,255,0.12);
  color:#fff;
}
.binfo-account__row input::placeholder{ color:rgba(255,255,255,0.55); }
.binfo-account__form{ margin-top:12px; }
.binfo-account__form.is-hidden{ display:none; }
.binfo-account__grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-bottom:12px;
}
.binfo-account__field{ display:flex; flex-direction:column; gap:6px; font-size:12px; opacity:0.9; }
.binfo-account__field input{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  background:rgba(11,14,20,0.7);
  border:1px solid rgba(255,255,255,0.12);
  color:#fff;
}
.binfo-account__field input::placeholder{ color:rgba(255,255,255,0.55); }
.binfo-account__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 18px;
  border-radius:10px;
  border:1px solid rgba(0,0,0,0.14);
  background:var(--binfo-accent);
  color:#0b0e14;
  font-weight:900;
  cursor:pointer;
}
.binfo-account__btn:hover{ filter:brightness(1.02); }
.binfo-account__btn--danger{ background:#f3d21b; }
.binfo-account__muted{ font-size:12px; opacity:0.72; }
.binfo-account__check{
  display:flex;
  align-items:flex-start;
  gap:10px;
  font-size:13px;
  opacity:0.92;
}
.binfo-account__check input{ margin-top:2px; }
.binfo-account__tags{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}
.binfo-account__tag{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(11,14,20,0.35);
  font-size:12px;
}

/* Favorite button on category pages */
.binfoFavBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.06);
  color:rgba(255,255,255,0.92);
  font-weight:800;
  cursor:pointer;
}
.binfoFavBtn:hover{ background:rgba(255,255,255,0.10); }
.binfoFavBtn.is-active{
  border-color:rgba(243,210,27,0.55);
  background:rgba(243,210,27,0.16);
  color:#fff;
}
.binfoFavBtn:disabled{ opacity:0.65; cursor:wait; }

:root[data-theme="light"] .binfoFavBtn{
  border-color: rgba(0,0,0,0.14);
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.88);
}
:root[data-theme="light"] .binfoFavBtn:hover{
  background: rgba(0,0,0,0.10);
}
:root[data-theme="light"] .binfoFavBtn.is-active{
  border-color: rgba(243,210,27,0.75);
  background: rgba(243,210,27,0.60);
  color: rgba(0,0,0,0.92);
}

/* Light theme: account + modals */
:root[data-theme="light"] .binfo-account{
  color: rgba(11,14,20,0.92);
}
:root[data-theme="light"] .binfo-account__navItem{
  background: rgba(255,255,255,0.82);
  border-color: rgba(0,0,0,0.12);
  color: rgba(11,14,20,0.92);
}
:root[data-theme="light"] .binfo-account__navItem.is-active{
  background: var(--binfo-accent);
  border-color: rgba(0,0,0,0.14);
  color: rgba(11,14,20,0.92);
}
:root[data-theme="light"] .binfo-account__navIcon{
  background: rgba(0,0,0,0.06);
}
:root[data-theme="light"] .binfo-account__flash,
:root[data-theme="light"] .binfo-account__card{
  background: rgba(255,255,255,0.86);
  border-color: rgba(0,0,0,0.10);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
:root[data-theme="light"] .binfo-account__row{
  border-bottom-color: rgba(0,0,0,0.08);
}
:root[data-theme="light"] .binfo-account__edit{
  color: rgba(11,14,20,0.86);
}
:root[data-theme="light"] .binfo-account__row input,
:root[data-theme="light"] .binfo-account__field input{
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.12);
  color: rgba(11,14,20,0.92);
}
:root[data-theme="light"] .binfo-account__row input::placeholder,
:root[data-theme="light"] .binfo-account__field input::placeholder{
  color: rgba(11,14,20,0.52);
}
:root[data-theme="light"] .binfo-account__tag{
  background: rgba(255,255,255,0.82);
  border-color: rgba(0,0,0,0.10);
  color: rgba(11,14,20,0.92);
}

:root[data-theme="light"] .binfo-modal__panel{
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.12);
  color: rgba(11,14,20,0.92);
}
:root[data-theme="light"] .binfo-modal__head{
  border-bottom-color: rgba(0,0,0,0.10);
}
:root[data-theme="light"] .binfo-modal__close{
  color: rgba(11,14,20,0.82);
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
}
:root[data-theme="light"] .binfo-modal__close:hover{
  background: rgba(0,0,0,0.06);
}

:root[data-theme="light"] .binfo-tg-popover{
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.12);
  color: rgba(11,14,20,0.92);
}
:root[data-theme="light"] .binfo-tg-popover__link{
  color: rgba(11,14,20,0.92);
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
}
:root[data-theme="light"] .binfo-tg-popover__link:hover{
  background: rgba(0,0,0,0.07);
}

@media (max-width: 980px){
  .binfo-account__layout{ grid-template-columns: 1fr; }
  .binfo-account__sidebar{ position:static; top:auto; }
  .binfo-account__row{ grid-template-columns: 1fr; }
  .binfo-account__grid{ grid-template-columns: 1fr; }
}

/* Modal */
.binfo-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:10000;
}
.binfo-modal.is-open{ display:block; }
.binfo-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.70);
  backdrop-filter: blur(4px);
}
.binfo-modal__panel{
  position:relative;
  width:min(560px, calc(100vw - 24px));
  margin:calc(env(safe-area-inset-top) + 80px) auto 24px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(11,14,20,0.96);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  overflow:hidden;
}
.binfo-modal__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,0.10);
}
.binfo-modal__title{
  font-size:16px;
  font-weight:900;
}
.binfo-modal__close{
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:#fff;
  cursor:pointer;
  font-size:22px;
  line-height:34px;
}
.binfo-modal__close:hover{ background:rgba(255,255,255,0.10); }
.binfo-modal__body{ padding:16px; }
.binfo-modal__form .binfo-account__btn{ margin-top: 4px; }

html.binfo-modal-open,
body.binfo-modal-open{
  overflow:hidden;
}
