/* header_widget_v1.css - all rules scoped under .bdw-auth.
   Authorship: drafted by Sage A1.5; scoping and small-screen padding added in review. */

.bdw-auth {
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 14px;
  line-height: 1;
}

.bdw-auth * {
  box-sizing: border-box;
}

/* ---- shared pill button ---- */

.bdw-auth .bdw-auth-btn,
.bdw-auth .bdw-auth-me {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.bdw-auth .bdw-auth-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: currentColor;
  color: inherit;
}

/* ---- signed out ---- */

.bdw-auth .bdw-auth-btn {
  background-color: #e8eaf0;
  color: #0b0d12;
  border: 1px solid transparent;
}

.bdw-auth .bdw-auth-btn:hover {
  background-color: #ffffff;
  color: #0b0d12;
}

/* ---- signed in ---- */

.bdw-auth .bdw-auth-me {
  background-color: #141822;
  border: 1px solid #232838;
  color: #e8eaf0;
}

.bdw-auth .bdw-auth-me:hover {
  border-color: #7c5cff;
  color: #e8eaf0;
}

.bdw-auth .bdw-avatar {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.bdw-auth .bdw-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #7c5cff;
  color: #0b0d12;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.bdw-auth .bdw-handle {
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- focus ---- */

.bdw-auth .bdw-auth-btn:focus-visible,
.bdw-auth .bdw-auth-me:focus-visible {
  outline: 2px solid #22d3a6;
  outline-offset: 2px;
}

/* ---- visually hidden (screen readers only) ---- */

.bdw-auth .bdw-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- responsive: hide handle text at small widths ---- */

@media (max-width: 480px) {
  .bdw-auth .bdw-auth-btn {
    padding: 0 10px;
  }

  .bdw-auth .bdw-auth-me {
    padding: 0 4px;
  }

  .bdw-auth .bdw-handle {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .bdw-auth .bdw-auth-btn .bdw-auth-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ---- reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
  .bdw-auth .bdw-auth-btn,
  .bdw-auth .bdw-auth-me {
    transition: none;
  }
}


/* ---- v2 additions (Grok Bot) ---- */
.bdw-auth { vertical-align: middle; }
.bdw-verified { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: #00A88F; }
.bdw-verified::before { content: "\2713  "; }
input.bdw-verified-input { opacity: .9; cursor: default; }

/* v2b: on small screens keep a short text label so the sign-in button is not mistaken for a share-on-X icon */
@media (max-width: 480px) {
  .bdw-auth .bdw-auth-btn { width: auto !important; padding: 0 10px !important; font-size: 13px; }
  .bdw-auth .bdw-auth-btn svg { display: none; }
  .bdw-auth .bdw-auth-btn .bdw-auth-text { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  .bdw-auth .bdw-auth-btn .bdw-auth-text { font-size: 0; }
  .bdw-auth .bdw-auth-btn .bdw-auth-text::after { content: "Sign in"; font-size: 13px; }
}


.nav-item.bdw-li { display: flex; align-items: center; }
header.topbar:has(> .bdw-auth) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .bdw-auth .bdw-auth-btn, .topbar .bdw-auth .bdw-auth-me { height: 34px; }
@media (max-width: 480px) { .topbar .bdw-auth .bdw-auth-btn { width: 34px; padding: 0; } }

/* me_v1.css - /me "My Bots" page. All rules scoped under #me-page.
   Authorship: drafted by Sage A1.5; scoping, [hidden] fix and button variants added in review. */
/* NOTE: no inline styles, no inline scripts, no on* attributes. */

#me-page {
  background-color: #0b0d12;
  color: #e8eaf0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

#me-page * {
  box-sizing: border-box;
}

#me-page button, #me-page a, #me-page input {
  font-family: inherit;
}

#me-page h1, #me-page h2 {
  margin: 0;
}

/* the hidden attribute must win over display:flex below */
#me-page [hidden] {
  display: none !important;
}

#me-page .me-id {
  min-width: 0;
}

#me-page #me-name {
  overflow-wrap: anywhere;
}

#me-page .tabs {
  overflow-x: auto;
}

#me-page .btn-primary {
  background: #7c5cff;
  color: #0b0d12;
}

#me-page .btn-ghost {
  background: transparent;
  color: #9aa3b2;
  border: 1px solid #232838;
}

#me-page .card-link .chip {
  white-space: nowrap;
}

/* loading / error */

#me-page #me-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: #e8eaf0;
  font-size: 1.125rem;
}

#me-page #me-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  gap: 1rem;
}

#me-page #me-error p {
  margin: 0;
  color: #e8eaf0;
}

#me-page #me-error button {
  background: #7c5cff;
  color: #0b0d12;
  border: none;
  border-radius: 12px;
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
  cursor: pointer;
}

#me-page #me-error button:hover {
  background: #6b4ff0;
}

#me-page #me-error button:focus-visible {
  outline: 2px solid #22d3a6;
  outline-offset: 2px;
}


/* signed out */

#me-page #me-signedout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
  text-align: center;
  gap: 1.25rem;
}

#me-page #me-signedout h2 {
  font-size: 1.5rem;
  color: #e8eaf0;
}

#me-page #me-signedout p {
  color: #9aa3b2;
  margin: 0;
}


/* app */

#me-page #me-app {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}


#me-page .me-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #232838;
}

#me-page #me-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #232838;
}

#me-page #me-initial {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #141822;
  border: 2px solid #232838;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #7c5cff;
}

#me-page #me-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e8eaf0;
}

#me-page #me-handle {
  color: #9aa3b2;
  font-size: 0.95rem;
  margin: 0.25rem 0 0 0;
}

#me-page #me-signout {
  margin-left: auto;
  background: transparent;
  color: #9aa3b2;
  border: 1px solid #232838;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
}

#me-page #me-signout:hover {
  color: #e8eaf0;
  border-color: #232838;
}

#me-page #me-signout:focus-visible {
  outline: 2px solid #22d3a6;
  outline-offset: 2px;
}

/* tiles */

#me-page .tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

#me-page .tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: #141822;
  border: 1px solid #232838;
  border-radius: 16px;
  padding: 1.25rem 0.75rem;
  cursor: pointer;
  color: #e8eaf0;
  transition: border-color 150ms ease, background-color 150ms ease;
}

#me-page .tile:hover {
  border-color: #7c5cff;
  background: #1a1f2e;
}

#me-page .tile:focus-visible {
  outline: 2px solid #22d3a6;
  outline-offset: 2px;
}

#me-page .tile[aria-pressed="true"] {
  border-color: #7c5cff;
  background: #1a1f2e;
}

#me-page .tile-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: #7c5cff;
  line-height: 1;
}

#me-page .tile-label {
  font-size: 0.8125rem;
  color: #9aa3b2;
}

/* tabs */

#me-page [role="tablist"] {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid #232838;
}

#me-page [role="tab"] {
  background: transparent;
  color: #9aa3b2;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

#me-page [role="tab"]:hover {
  color: #e8eaf0;
}

#me-page [role="tab"]:focus-visible {
  outline: 2px solid #22d3a6;
  outline-offset: 2px;
}

#me-page [role="tab"][aria-selected="true"] {
  color: #e8eaf0;
  border-bottom-color: #7c5cff;
}

/* panel */

#me-page #panel {
  margin-top: 1rem;
}

#me-page .cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#me-page .card {
  background: #141822;
  border: 1px solid #232838;
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 150ms ease;
}

#me-page .card:hover {
  border-color: #7c5cff;
}

#me-page a.card-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  text-decoration: none;
  color: #e8eaf0;
}

#me-page .a-card-link:focus-visible, #me-page a.card-link:focus-visible {
  outline: 2px solid #22d3a6;
  outline-offset: 2px;
}

#me-page .card-name {
  font-size: 1rem;
  font-weight: 500;
  color: #e8eaf0;
}

#me-page .chip {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

#me-page .chip-pending {
  background: #2f2600;
  color: #fbbf24;
}

#me-page .chip-published {
  background: #064e3b;
  color: #22d3a6;
}

#me-page .card-created {
  font-size: 0.75rem;
  color: #9aa3b2;
  margin-left: auto;
}

#me-page .stars {
  font-size: 1rem;
  color: #7c5cff;
  letter-spacing: 0.125rem;
}

/* empty state */

#me-page #me-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  gap: 1rem;
}

#me-page #me-empty p {
  color: #9aa3b2;
  margin: 0;
}

/* buttons */

#me-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

#me-page .btn:focus-visible {
  outline: 2px solid #22d3a6;
  outline-offset: 2px;
}

#me-page .btn-x {
  background: #e8eaf0;
  color: #0b0d12;
}

#me-page .btn-x:hover {
  background: #ffffff;
}

#me-page .btn-share {
  background: transparent;
  color: #22d3a6;
  border: 1px solid #232838;
  align-self: flex-start;
}

#me-page .btn-share:hover {
  border-color: #22d3a6;
}

/* svg glyph */

#me-page .x-glyph {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  vertical-align: -0.125rem;
}

/* msg */

#me-page #me-msg {
  color: #22d3a6;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* share link */

#me-page #me-share {
  align-self: flex-start;
}

/* responsive */

@media (max-width: 600px) {
  #me-page .tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  #me-page #me-app {
    padding: 1rem;
  }

  #me-page .me-head {
    flex-wrap: wrap;
  }

  #me-page #me-signout {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 360px) {
  #me-page .tiles {
    grid-template-columns: 1fr;
  }

  #me-page .card-name {
    font-size: 0.9375rem;
  }
}

/* reduced motion */

@media (prefers-reduced-motion: reduce) {
  #me-page .tile, #me-page .card, #me-page [role="tab"], #me-page .btn {
    transition: none;
  }
}
