/* BotPlaza bot-haven layer: bundles, For bots tag, bot activity, and the glue for Canvas's Bot view
   (.sa-viewtoggle / .sa-botview live in components.css). */

/* ---------- Human / Bot view glue ---------- */
.sa-viewtoggle[hidden] { display: none; }
.sa-botview { display: none; }
[data-view="bot"] .sa-botview { display: block; }
[data-view="bot"] main#main { display: none; }
.sa-md { max-width: 80ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.sa-md a.l { color: var(--sa-code-link); text-decoration: underline; text-underline-offset: 2px; }
.sa-md a.l:focus-visible { outline: 2px solid var(--sa-accent); outline-offset: 2px; }
.sa-nav__inner .sa-viewtoggle { flex: none; }
/* ---------- Tags and badges ---------- */
.bp-forbots { color: var(--sa-green); border-color: currentColor; font-family: var(--sa-font-mono); letter-spacing: .02em; text-transform: none; }
.bp-popular { position: absolute; top: 18px; left: 18px; z-index: 2; background: var(--sa-nav-bg); color: var(--sa-accent); border-color: var(--sa-accent); backdrop-filter: blur(6px); }
.bp-popular[hidden] { display: none; }

/* ---------- Bundles and teams ---------- */
.bp-lede { max-width: 62ch; margin: 12px 0 0; font: 400 var(--sa-fs-lead)/var(--sa-lh-lead) var(--sa-font-text); color: var(--sa-text-2); }
.bp-crumb { margin: 0 0 16px; font: 500 14px/1.4 var(--sa-font-ui); }
.bp-crumb a { color: var(--sa-text-3); text-decoration: none; }
.bp-crumb a:hover { color: var(--sa-text); }
.bp-kicker { margin: 0 0 8px; font: 600 11.5px/1 var(--sa-font-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--sa-accent); }
.bp-bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; list-style: none; margin: 28px 0 0; padding: 0; }
.bp-bundle-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--sa-surface); border: var(--sa-border); border-radius: var(--sa-radius-lg); box-shadow: var(--sa-highlight); transition: border-color var(--sa-dur) var(--sa-ease), transform var(--sa-dur) var(--sa-ease); }
.bp-bundle-card:hover { border-color: var(--sa-text-4); transform: translateY(-2px); }
.bp-bundle-card h2 { margin: 0; font: 400 28px/1.1 var(--sa-font-display); color: var(--sa-text); }
.bp-bundle-card h2 a { color: inherit; text-decoration: none; }
.bp-bundle-card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.bp-bundle-card p { margin: 0; color: var(--sa-text-2); font-size: var(--sa-fs-sm); line-height: 1.5; }
.bp-bundle-card ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: auto 0 0; padding: 8px 0 0; }
.bp-chipline { font: 500 12.5px/1 var(--sa-font-ui); color: var(--sa-text-2); padding: 7px 10px; border: 1px solid var(--sa-line-2); border-radius: var(--sa-radius-pill); }
.bp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: clamp(24px, 4vw, 56px); align-items: start; margin-top: 32px; }
@media (max-width: 960px) { .bp-layout { grid-template-columns: 1fr; } }
.bp-section { margin: 0 0 40px; }
.bp-section h2 { margin: 0 0 16px; font: 400 var(--sa-fs-h3)/var(--sa-lh-h3) var(--sa-font-display); color: var(--sa-text); }
.bp-members { counter-reset: m; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bp-member { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 4px 14px; padding: 18px 20px; background: var(--sa-surface); border: var(--sa-border); border-radius: var(--sa-radius-md); }
.bp-member::before { counter-increment: m; content: counter(m); grid-row: span 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sa-surface-3); color: var(--sa-accent); font: 600 15px/1 var(--sa-font-mono); }
.bp-member h3 { margin: 0; font: 500 18px/1.3 var(--sa-font-ui); color: var(--sa-text); }
.bp-member h3 a { color: inherit; text-decoration: none; }
.bp-member h3 a:hover { text-decoration: underline; }
.bp-member__role { margin: 0; font: 600 11.5px/1.3 var(--sa-font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--sa-text-3); }
.bp-member p { margin: 0; color: var(--sa-text-2); font-size: var(--sa-fs-sm); line-height: 1.5; }
.bp-list { margin: 0; padding-left: 20px; color: var(--sa-text-2); line-height: 1.6; }
.bp-list li + li { margin-top: 6px; }
.bp-list--warn li::marker { color: var(--sa-gold); }
.bp-install { position: sticky; top: 92px; padding: 24px; background: var(--sa-surface); border: var(--sa-border-strong); border-radius: var(--sa-radius-xl); box-shadow: var(--sa-highlight), var(--sa-shadow-md); }
@media (max-width: 960px) { .bp-install { position: static; } }
.bp-install h2 { margin: 0 0 6px; font: 400 26px/1.15 var(--sa-font-display); color: var(--sa-text); }
.bp-install__sub { margin: 0 0 16px; color: var(--sa-text-3); font-size: var(--sa-fs-sm); }
.bp-install .sa-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.bp-install__go { width: 100%; justify-content: center; }
.bp-install__status { min-height: 1.5em; margin: 10px 0 0; font: 500 14px/1.4 var(--sa-font-ui); color: var(--sa-green); }
.bp-install ol { margin: 14px 0 0; padding-left: 20px; color: var(--sa-text-2); font-size: var(--sa-fs-sm); line-height: 1.55; }
.bp-install ol li + li { margin-top: 6px; }
.bp-install details { margin-top: 16px; border-top: var(--sa-border); padding-top: 12px; }
.bp-install summary { cursor: pointer; font: 500 14px/1.4 var(--sa-font-ui); color: var(--sa-text-2); min-height: var(--sa-tap); display: flex; align-items: center; }
.bp-prompt { max-height: 320px; overflow: auto; margin: 8px 0 0; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--sa-bg); border: var(--sa-border); border-radius: var(--sa-radius-sm); font: 12.5px/1.55 var(--sa-font-mono); color: var(--sa-text-2); }
.bp-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; padding: 0; list-style: none; font: 500 13.5px/1.4 var(--sa-font-ui); }
.bp-links a { color: var(--sa-text-3); }
.bp-links a:hover { color: var(--sa-text); }

/* ---------- Bot activity ---------- */
.bp-activity { width: 100%; margin-top: 24px; border-collapse: collapse; font: 400 15px/1.4 var(--sa-font-ui); }
.bp-activity th, .bp-activity td { padding: 12px 14px; text-align: left; border-bottom: var(--sa-border); }
.bp-activity th { font: 600 12px/1.2 var(--sa-font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--sa-text-3); }
.bp-activity td.n, .bp-activity th.n { text-align: right; font-family: var(--sa-font-mono); font-variant-numeric: tabular-nums; }
.bp-activity td a { color: var(--sa-text); }
.bp-activity__wrap { overflow-x: visible; }
.bp-safety-h { margin-top: 20px; }
.bp-safety-lines { margin: 0 0 12px; }
.bp-note { margin: 16px 0 0; color: var(--sa-text-3); font-size: var(--sa-fs-sm); line-height: 1.55; max-width: 70ch; }
.bp-note code { font-family: var(--sa-font-mono); color: var(--sa-text-2); }

/* Narrow phones: keep logo, toggle, Sign in and menu on one row (search stays on the home page). */
@media (max-width: 760px) { .sa-nav__inner > .sa-logo { flex: none; } .sa-nav__inner > nav[aria-label="Primary"] { flex: 0 1 0; min-width: 0; } .sa-viewtoggle { margin-left: auto; } }
@media (max-width: 480px) {
  .sa-viewtoggle button { min-height: var(--sa-tap); padding: 0 9px; font-size: 13px; }
  .bp-activity thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
  .bp-activity, .bp-activity tbody, .bp-activity tr, .bp-activity th, .bp-activity td { display: block; width: auto; }
  .bp-activity tr { padding: 12px 0 14px; border-bottom: var(--sa-border); }
  .bp-activity th, .bp-activity td { border: 0; padding: 2px 0; text-align: left; }
  .bp-activity td::before { content: attr(data-label); display: block; font: 600 11px/1.3 var(--sa-font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--sa-text-3); }
  .sa-viewtoggle button[data-view="bot"][aria-pressed="true"] { font-size: 12.5px; }
  .sa-nav__inner:has(.sa-viewtoggle:not([hidden])) .sa-nav__mobile > a.sa-btn--icon { display: none; }
  .sa-logo__wm { height: 26px; }
}
.sa-footer nav[aria-label="Footer"] { display: flex; flex-wrap: wrap; gap: 4px 20px; max-width: 100%; }
@media (max-width: 380px) { .sa-nav__inner { gap: 6px; } .sa-viewtoggle button { padding: 0 7px; } }

/* Home hero has no visible headline: the lead line carries the hero. */
.sa-hero__copy > h1 + .sa-hero__lead { margin-top: 0; font-size: clamp(1.375rem, 1.05rem + 1.4vw, 2.125rem); line-height: 1.25; color: var(--sa-text); text-wrap: balance; }
