/* TBC sign-in in the header of every page (web/static/login.js, docs/SITE.md): "Log in" for a guest - the one
   filled, lit control of the header - and the signed-in user's pill with its small menu. Shared by the site pages
   (site.css) and the chat page (styles.css); every colour has a fallback so it stands on either. */
[data-tbc-login] { display: inline-flex; align-items: center; position: relative; }
[data-tbc-login][hidden] { display: none; }

.tbc-login {
  --g1: #0A2550; --g2: #0B57D0; --g3: #22A6FF;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 15px 0 5px; border-radius: 999px; border: 0;
  background: linear-gradient(118deg, var(--g1) 0%, var(--g2) 56%, var(--g3) 100%);
  color: #fff; font-family: inherit; font-size: 14.5px; font-weight: 600; line-height: 1; letter-spacing: .01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30), inset 0 0 0 1px rgba(255, 255, 255, .10),
    0 1px 2px rgba(10, 37, 80, .30), 0 10px 24px -10px rgba(11, 87, 208, .75);
  transition: transform .18s ease, box-shadow .25s ease;
}
/* a band of light crosses the button once when the pointer arrives */
.tbc-login::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .42) 50%, transparent 68%);
  transform: translateX(-130%); transition: transform .75s cubic-bezier(.2, .7, .2, 1);
}
.tbc-login:hover { transform: translateY(-1px); color: #fff; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 0 0 1px rgba(255, 255, 255, .14),
    0 2px 4px rgba(10, 37, 80, .30), 0 14px 30px -10px rgba(11, 87, 208, .95); }
.tbc-login:hover::before { transform: translateX(130%); }
.tbc-login:active { transform: translateY(0) scale(.985); }
.tbc-login:focus-visible { outline: 2px solid #7CC4FF; outline-offset: 3px; }
.tbc-login-ico { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .26); }
.tbc-login-ico svg { width: 16px; height: 16px; display: block; }
.tbc-login-arrow { width: 15px; height: 15px; flex: none; margin-left: -1px; opacity: .9; transition: transform .22s ease; }
.tbc-login:hover .tbc-login-arrow { transform: translateX(3px); }
/* inside a message ("log in to continue"): the same button, a size down, no arrow */
.tbc-login.sm { height: 36px; font-size: 13.5px; padding: 0 16px 0 4px; }
.tbc-login.sm .tbc-login-ico { width: 28px; height: 28px; }
.tbc-login.sm .tbc-login-arrow { display: none; }

/* signed in: the user's initial in the brand's gradient, the name, a small menu */
.tbc-user { position: relative; display: inline-flex; }
.tbc-user-btn { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 11px 0 4px; border-radius: 999px;
  border: 1px solid var(--line, #CED3DE); background: var(--panel, #fff); color: var(--ink, #292D32);
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 43, 75, .06); transition: border-color .18s ease, box-shadow .2s ease; }
.tbc-user-btn:hover, .tbc-user-btn[aria-expanded="true"] { border-color: #0B57D0; box-shadow: 0 0 0 3px rgba(11, 87, 208, .12); }
.tbc-user-btn:focus-visible { outline: 2px solid #7CC4FF; outline-offset: 3px; }
.tbc-avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  background: linear-gradient(135deg, #0A2550, #0B57D0 58%, #22A6FF); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.tbc-avatar svg { width: 15px; height: 15px; }
.tbc-user-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.tbc-user-chev { width: 14px; height: 14px; flex: none; opacity: .6; transition: transform .2s ease; }
.tbc-user-btn[aria-expanded="true"] .tbc-user-chev { transform: rotate(180deg); }
.tbc-user-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; min-width: 250px; padding: 8px; border-radius: 16px;
  background: var(--panel, #fff); color: var(--ink, #292D32); border: 1px solid var(--line-soft, #E4E8EF);
  box-shadow: 0 22px 48px -14px rgba(16, 43, 75, .35), 0 2px 6px rgba(16, 43, 75, .08); }
.tbc-user-menu[hidden] { display: none; }
.tbc-user-head { display: flex; align-items: center; gap: 11px; padding: 8px 10px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line-soft, #E4E8EF); }
.tbc-user-head .tbc-avatar { width: 38px; height: 38px; font-size: 15px; }
.tbc-user-head b { display: block; font-size: 14.5px; font-weight: 700; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbc-user-head small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--muted, #919EB6); }
.tbc-user-menu a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--ink, #292D32);
  font-size: 14px; font-weight: 500; text-decoration: none; }
.tbc-user-menu a:hover { background: var(--panel-2, #F3F5F9); text-decoration: none; }
.tbc-user-menu a svg { width: 17px; height: 17px; opacity: .75; }
/* a sign-in that did not complete: said under the button, once */
.tbc-login-note { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; padding: 9px 13px; border-radius: 12px; white-space: nowrap;
  background: #1F2937; color: #fff; font-size: 13px; font-weight: 500; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .45); }

@media (max-width: 860px) {
  .tbc-login { height: 44px; padding: 0 14px 0 6px; font-size: 14px; gap: 8px; }
  .tbc-login.sm { height: 38px; }
  .tbc-login-ico { width: 32px; height: 32px; }
  .tbc-user-btn { height: 44px; padding: 0 6px 0 5px; }
  .tbc-user-btn .tbc-user-name { display: none; }        /* the initial alone; the name is in the menu */
  .tbc-avatar { width: 32px; height: 32px; }
}
@media (max-width: 400px) {
  .tbc-login:not(.sm) { padding: 0 12px 0 5px; gap: 7px; }
  .tbc-login:not(.sm) .tbc-login-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tbc-login, .tbc-login::before, .tbc-login-arrow, .tbc-user-chev { transition: none; }
  .tbc-login:hover { transform: none; }
}
