/* GUB account add-on (helper and guide pages). Uses each page's own color
   tokens: the helper's (--text, --btn-bg, --panel-line) or the guide's
   (--ink, --quiet-bg, --quiet-line), so it fits either look. All sizes in rem. */

/* nav account button (both pages) */
.gub-acct {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.25rem; max-width: 12rem;
  padding: 0.2rem 0.75rem 0.2rem 0.2rem; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.9rem;
  color: var(--text, var(--ink));
  background: var(--quiet-bg, var(--btn-bg));
  border: 1px solid var(--quiet-line, var(--panel-line));
}
.gub-acct:hover { filter: brightness(1.08); }
.gub-face {
  flex: none; width: 1.85rem; height: 1.85rem; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7e22ce 55%, #be185d);
}
.gub-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gub-acct-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* message counter beside the "N messages" chip (helper page) */
.gub-chiprow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; }
.gub-chiprow .count-chip { align-self: auto; }
.gub-credits { margin: 0; font-size: 0.78rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--btn-bg); color: var(--text); }
.gub-credits:empty { display: none; }
.gub-credits.is-low { background: transparent; border: 1px solid var(--coral); }
.gub-credits.is-low a { color: var(--coral); font-weight: 700; }
@media (max-width: 699.98px) { .gub-chiprow { justify-content: center; } }

/* out-of-messages dialog (helper page) */
.gub-dialog {
  width: min(calc(100% - 2rem), 28rem); max-height: calc(100% - 2rem); overflow: auto;
  border: 1px solid var(--panel-line); border-radius: 1.1rem; padding: 1.25rem;
  color: var(--text); background: var(--panel); box-shadow: var(--shadow);
  text-align: center;
}
.gub-dialog::backdrop { background: rgba(6, 8, 24, 0.6); }
.gub-dialog h2 { font-family: var(--font-head); font-size: 1.3rem; margin: 0 0 0.5rem; }
.gub-dialog p { margin: 0 0 0.75rem; line-height: 1.5; }
.gub-dialog-note { font-size: 0.85rem; color: var(--muted); }
.gub-dialog-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.gub-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.45rem 1.1rem;
  border-radius: 999px; font: inherit; font-weight: 700; font-size: 0.95rem; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--btn-bg); border: 1px solid var(--panel-line);
}
.gub-btn:hover { background: var(--btn-bg-hover); }
.gub-btn.primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #4f46e5, #7e22ce); }

/* small confirmation toast (helper page) */
.gub-toast {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 80;
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  max-width: calc(100% - 2rem); margin: 0; padding: 0.6rem 1rem; border-radius: 999px;
  font-weight: 600; font-size: 0.9rem; color: #fff; background: #312e81; box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.gub-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.gub-toast.is-bad { background: #9f1d0f; }
@media (prefers-reduced-motion: reduce) { .gub-toast { transition: none; } }
