/* ─────────────────────────────────────────────────────────────────────────
 * Liquid glass, everywhere it fits.
 * One recipe (the one the user menu has) in two colours: neutral glass for
 * cards, bars, sheets and fields (light grey in light mode, smoked in dark
 * mode) and yellow glass for the things that carry the brand (primary buttons,
 * selected states). Loaded last, so it wins over the older flat surfaces.
 * ───────────────────────────────────────────────────────────────────────── */

:root {
  --lg-bg: linear-gradient(135deg, rgb(255 255 255 / 46%), rgb(255 255 255 / 0%) 62%), rgb(232 235 239 / 56%);
  --lg-bg-strong: linear-gradient(135deg, rgb(255 255 255 / 50%), rgb(255 255 255 / 0%) 62%), rgb(232 235 239 / 78%);
  --lg-field: rgb(255 255 255 / 44%);
  --lg-field-focus: rgb(255 255 255 / 72%);
  --lg-shadow: inset 0 1px 0 rgb(255 255 255 / 78%), 0 0 0 1px rgb(23 25 26 / 6%), 0 10px 30px rgb(20 24 30 / 9%);
  --lg-shadow-soft: inset 0 1px 0 rgb(255 255 255 / 70%), 0 0 0 1px rgb(23 25 26 / 6%), 0 4px 14px rgb(20 24 30 / 7%);
  --lg-blur: blur(26px) saturate(150%);
  --lg-hover: rgb(255 255 255 / 40%);
  --lgy-bg: linear-gradient(135deg, rgb(255 255 255 / 40%), rgb(255 255 255 / 0%) 58%), rgb(255 211 42 / 68%);
  --lgy-bg-hover: linear-gradient(135deg, rgb(255 255 255 / 46%), rgb(255 255 255 / 0%) 58%), rgb(255 219 76 / 78%);
  --lgy-soft: linear-gradient(135deg, rgb(255 255 255 / 34%), rgb(255 255 255 / 0%) 60%), rgb(255 211 42 / 34%);
  --lgy-shadow: inset 0 1px 0 rgb(255 255 255 / 62%), 0 0 0 1px rgb(205 160 0 / 28%), 0 8px 22px rgb(255 190 0 / 24%);
  --lgy-ink: #2b2100;
  --lg-ambient-a: rgb(255 211 42 / 26%);
  --lg-ambient-b: rgb(120 160 255 / 20%);
  --lg-ambient-c: rgb(255 140 170 / 16%);
}
html[data-bs-theme='dark'] {
  --lg-bg: linear-gradient(135deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 0%) 60%), rgb(26 26 29 / 58%);
  --lg-bg-strong: linear-gradient(135deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 0%) 60%), rgb(20 20 23 / 76%);
  --lg-field: rgb(255 255 255 / 7%);
  --lg-field-focus: rgb(255 255 255 / 13%);
  --lg-shadow: inset 0 1px 0 rgb(255 255 255 / 16%), 0 0 0 1px rgb(255 255 255 / 9%), 0 10px 30px rgb(0 0 0 / 34%);
  --lg-shadow-soft: inset 0 1px 0 rgb(255 255 255 / 13%), 0 0 0 1px rgb(255 255 255 / 8%), 0 4px 14px rgb(0 0 0 / 26%);
  --lg-hover: rgb(255 255 255 / 9%);
  --lgy-bg: linear-gradient(135deg, rgb(255 255 255 / 32%), rgb(255 255 255 / 0%) 55%), rgb(255 211 42 / 80%);
  --lgy-bg-hover: linear-gradient(135deg, rgb(255 255 255 / 38%), rgb(255 255 255 / 0%) 55%), rgb(255 222 90 / 88%);
  --lgy-soft: linear-gradient(135deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 0%) 60%), rgb(255 211 42 / 24%);
  --lgy-shadow: inset 0 1px 0 rgb(255 255 255 / 46%), 0 0 0 1px rgb(255 211 42 / 40%), 0 8px 24px rgb(255 190 0 / 20%);
  --lg-ambient-a: rgb(255 211 42 / 15%);
  --lg-ambient-b: rgb(110 150 255 / 14%);
  --lg-ambient-c: rgb(255 120 160 / 10%);
}

/* Something to see through: one fixed stage behind every page. The canvas colour and
   the soft ambient light never scroll; only the cards move over them. html and body
   paint nothing of their own, so no band appears where one box ends and the next
   colour starts (body is only a screen tall while the page scrolls past it), and the
   stage spans the large viewport so a collapsing mobile toolbar never uncovers an edge. */
html:has(> body.bk-frame) { background: var(--bc-canvas); overscroll-behavior-y: none; }
body.bk-frame { position: relative; isolation: isolate; min-height: 100%; background: transparent; }
body.bk-frame::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; height: 100vh; height: 100lvh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(62% 38% at 92% 2%, var(--lg-ambient-a), transparent 72%),
    radial-gradient(54% 36% at 0% 46%, var(--lg-ambient-b), transparent 72%),
    radial-gradient(60% 38% at 86% 100%, var(--lg-ambient-c), transparent 72%),
    var(--bc-canvas);
}
body.bk-frame .page, body.bk-frame .page-wrapper, body.bk-frame.brand-app .page-wrapper { background: transparent; }
body.bk-frame.bc-body .page--chat .bc-app, body.bk-frame.bc-body .page--chat .bc-shell { background: transparent; }

/* ── Neutral glass: cards, panels, bars, fields ──────────────────────────── */
body.bc-body.bk-frame :is(
  .robin-panel, .b2-panel, .b2-card, .card, .robin-operation-card, .b3-card, .b2-shortcut, .b2-day-plan, .b2-metric,
  .b2-finance-summary, .b2-lesson-card, .b2-create-panel, .b2-selected-student, .b2-empty, .b2-attention,
  .bc-card, .bc-task, .bc-ap-card, .bc-composer, .bc-chat-pill, .bc-connect, .dropdown-menu
) {
  background: var(--lg-bg); border: 0; box-shadow: var(--lg-shadow);
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
}
body.bc-body.bk-frame :is(.b2-shortcut, .b2-day-plan, .b2-metric, .b2-finance-summary, .b2-lesson-card, .b2-create-panel):hover { background: var(--lg-bg-strong); }

/* Bars */
body.bc-body.bk-frame .personal-sidebar { background: var(--lg-bg-strong); box-shadow: inset -1px 0 0 rgb(255 255 255 / 30%); border-right: 1px solid var(--bc-line); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); }
body.bc-body.bk-frame .broder-toolbar, body.bc-body.bk-frame .bk-topbar { background: var(--lg-bg); box-shadow: inset 0 -1px 0 var(--bc-line); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); }
body.bc-body.bk-frame .broder-bottom-nav { background: var(--lg-bg-strong); box-shadow: var(--lg-shadow); border: 0; }
body.bc-body.bk-frame .bc-chat-head, body.bc-body.bk-frame .bc-dock { background: none; }
body.bc-body.bk-frame .bc-topbar:not(.bk-topbar) { background: none; }
body.bc-body.bk-frame .footer.personal-footer { -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); }

/* Fields and small controls are glass inlays */
body.bc-body.bk-frame :is(.form-control, .form-select, input[type='text'], input[type='email'], input[type='search'], input[type='tel'], input[type='number'], input[type='date'], input[type='time'], input[type='datetime-local'], input[type='password'], select, textarea, .bc-search-input, .bc-rename-row input) {
  background-color: var(--lg-field) !important; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 34%), inset 0 1px 2px rgb(20 24 30 / 6%);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
html[data-bs-theme='dark'] body.bc-body.bk-frame :is(.form-control, .form-select, input, select, textarea, .bc-search-input) { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 9%); }
body.bc-body.bk-frame :is(.form-control, .form-select, input, select, textarea, .bc-search-input):focus { background-color: var(--lg-field-focus) !important; box-shadow: inset 0 0 0 1px rgb(255 211 42 / 70%), 0 0 0 2px rgb(255 211 42 / 10%); }
/* The composer is the field; its textarea stays visually continuous with it. */
body.bc-body.bk-frame .bc-composer { cursor: text; }
body.bc-body.bk-frame .bc-composer:focus-within { box-shadow: var(--lg-shadow), 0 0 0 1px rgb(255 211 42 / 70%); }
/* The textarea draws no box of its own in any theme or state (the dark field rule is
   more specific than the plain one, hence the theme attribute here). */
html body.bc-body.bk-frame .bc-composer .bc-input,
html[data-bs-theme] body.bc-body.bk-frame .bc-composer .bc-input,
html[data-bs-theme] body.bc-body.bk-frame .bc-composer .bc-input:is(:hover, :focus, :focus-visible) {
  background: transparent !important; border: 0; outline: 0; box-shadow: none !important;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.bc-body.bk-frame :is(.b2-segmented, .bc-theme, .bc-sheet-links, .bs-summary) { background: var(--lg-field); box-shadow: var(--lg-shadow-soft); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
body.bc-body.bk-frame :is(.bc-chip, .bc-iconbtn--ring, .bc-avatar, .b3-student-level-nav a, .b2-status, .bc-badge, .b2-icon-button, .bc-pill--muted, .b2-today-button, .b2-week-day, .btn-outline-secondary, .btn-secondary, .btn-outline-primary, .robin-check, .robin-count) { background: var(--lg-bg); box-shadow: var(--lg-shadow-soft); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
body.bc-body.bk-frame .bc-chip:hover, body.bc-body.bk-frame .b2-icon-button:hover { background: var(--lg-bg-strong); }
body.bc-body.bk-frame .bc-bubble { background: var(--lg-bg); box-shadow: var(--lg-shadow-soft); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
body.bc-body.bk-frame :is(.b2-student-row, .b2-group-row):hover { background: var(--lg-hover); }
body.bc-body.bk-frame .bc-agent-row:hover, body.bc-body.bk-frame .bc-agent-item.is-current .bc-agent-row { background: var(--lg-bg); box-shadow: var(--lg-shadow-soft); }
body.bc-body.bk-frame .bc-card-bar, body.bc-body.bk-frame .bc-card-foot, body.bc-body.bk-frame .bc-ap-foot { border-color: var(--bc-line); }

/* ── Yellow glass: the brand colour, lit from behind ─────────────────────── */
body.bc-body.bk-frame :is(
  .btn-primary, .b2-button:not(.btn-outline-secondary), .bc-btn--primary, .bc-send, .bc-iconbtn--plus,
  .personal-nav-link.active, .b2-segmented a.is-selected, .b2-week-day.is-selected, .b3-student-level-nav a.is-selected, .bs-tile.is-on, .bs-card.is-on
) {
  background: var(--lgy-bg); color: var(--lgy-ink); border: 0; box-shadow: var(--lgy-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
}
body.bc-body.bk-frame :is(.btn-primary, .b2-button:not(.btn-outline-secondary), .bc-btn--primary, .bc-iconbtn--plus):hover { background: var(--lgy-bg-hover); color: var(--lgy-ink); }
body.bc-body.bk-frame .bc-send[disabled] { background: var(--lg-bg); color: var(--bc-ink-3); box-shadow: var(--lg-shadow-soft); }
body.bc-body.bk-frame .bc-send.is-stop { background: var(--lg-bg-strong); color: var(--bc-ink); box-shadow: var(--lg-shadow); }
body.bc-body.bk-frame .personal-nav-link.active .broder-icon, body.bc-body.bk-frame .b2-segmented a.is-selected { color: var(--lgy-ink); }
body.bc-body.bk-frame :is(.bc-team-card, .b2-attention--active, .bc-sheet-link-icon) { background: var(--lgy-soft); box-shadow: var(--lgy-shadow); }
body.bc-body.bk-frame .bc-team-card { -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); }
body.bc-body.bk-frame .broder-bottom-nav .broder-nav-link.active { background: var(--lgy-bg) !important; color: var(--bc-ink); box-shadow: var(--lgy-shadow); }
body.bc-body.bk-frame .broder-bottom-nav .broder-nav-link.active .broder-icon { color: var(--bc-ink); }

/* ── Sheets and dialogs: the user-menu glass, in both colours ────────────── */
.bc-sheet, .bc-sheet--glass {
  --bc-ink: #17191a; --bc-ink-2: rgb(23 25 26 / 70%); --bc-ink-3: rgb(23 25 26 / 50%);
  color: var(--bc-ink); border: 1px solid rgb(255 255 255 / 60%); border-bottom: 0;
  background: var(--lg-bg-strong);
  -webkit-backdrop-filter: blur(44px) saturate(160%); backdrop-filter: blur(44px) saturate(160%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%), 0 -18px 60px rgb(20 24 30 / 22%);
}
.bc-sheet { --bc-inset: rgb(255 255 255 / 40%); --bc-line: rgb(23 25 26 / 9%); --bc-hover: rgb(23 25 26 / 5%); --bc-surface: rgb(255 255 255 / 62%); }
html[data-bs-theme='dark'] .bc-sheet, html[data-bs-theme='dark'] .bc-sheet--glass {
  --bc-ink: #f4f3f1; --bc-ink-2: rgb(244 243 241 / 72%); --bc-ink-3: rgb(244 243 241 / 52%);
  --bc-line: rgb(255 255 255 / 10%); --bc-line-strong: rgb(255 255 255 / 18%); --bc-hover: rgb(255 255 255 / 7%); --bc-hover-2: rgb(255 255 255 / 11%);
  --bc-inset: rgb(255 255 255 / 8%); --bc-surface: rgb(255 255 255 / 14%);
  border-color: rgb(255 255 255 / 16%); background: linear-gradient(160deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 0%) 55%), rgb(16 16 18 / 66%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 22%), 0 -18px 60px rgb(0 0 0 / 40%);
}
.bc-sheet::backdrop { background: rgb(20 24 30 / 28%); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
html[data-bs-theme='dark'] .bc-sheet::backdrop { background: rgb(6 8 10 / 46%); }
@media (min-width: 900px) { .bc-sheet { border-bottom: 1px solid rgb(255 255 255 / 40%); } }
/* In the sheets the neutral controls follow the glass, the yellow ones stay yellow. */
.bc-sheet .bc-theme, .bc-sheet .bc-sheet-links { background: var(--bc-inset); }
.bc-sheet-icon--solid { display: none; }
html:not([data-bs-theme='dark']) #bc-account .bc-sheet-link-icon { color: var(--bc-ink); }
html:not([data-bs-theme='dark']) #bc-account .bc-sheet-icon--line { display: none; }
html:not([data-bs-theme='dark']) #bc-account .bc-sheet-icon--solid { display: block; }
.bc-sheet .bc-theme-option[aria-pressed='true'] { background: rgb(255 255 255 / 70%); color: var(--bc-ink); box-shadow: var(--lg-shadow-soft); }
html[data-bs-theme='dark'] .bc-sheet .bc-theme-option[aria-pressed='true'] { background: rgb(255 255 255 / 16%); }
.bc-sheet .bc-btn--glass { background: rgb(255 255 255 / 46%); color: var(--bc-ink); box-shadow: var(--lg-shadow-soft); }
html[data-bs-theme='dark'] .bc-sheet .bc-btn--glass { background: rgb(255 255 255 / 9%); }
.bc-sheet .bc-btn--ghost, .bc-sheet .bc-btn:not(.bc-btn--primary):not(.bc-btn--quiet) { background: rgb(255 255 255 / 46%); color: var(--bc-ink); box-shadow: var(--lg-shadow-soft); }
html[data-bs-theme='dark'] .bc-sheet .bc-btn--ghost, html[data-bs-theme='dark'] .bc-sheet .bc-btn:not(.bc-btn--primary):not(.bc-btn--quiet) { background: rgb(255 255 255 / 9%); }
.bc-sheet .bc-btn--primary { background: var(--lgy-bg); color: var(--lgy-ink); box-shadow: var(--lgy-shadow); }
.bc-sheet .bc-btn--quiet { background: transparent; box-shadow: none; }
.bc-sheet-language select, .bc-sheet--glass .bc-sheet-language select { color: var(--bc-ink); }
html[data-bs-theme='dark'] .bc-sheet--glass .bc-sheet-language select option { background: #1b1b1d; color: #f4f3f1; }
.bc-sheet .bs-input, .bc-sheet input { background-color: rgb(255 255 255 / 50%); color: var(--bc-ink); }
html[data-bs-theme='dark'] .bc-sheet .bs-input, html[data-bs-theme='dark'] .bc-sheet input { background-color: rgb(255 255 255 / 8%); }

/* Tour card and approval cards on the same glass */
.broder-tour-card { background: var(--lg-bg-strong); color: var(--bc-ink); -webkit-backdrop-filter: blur(36px) saturate(160%); backdrop-filter: blur(36px) saturate(160%); box-shadow: var(--lg-shadow), 0 18px 48px rgb(0 0 0 / 22%); }
.broder-tour-card .bc-btn--primary { background: var(--lgy-bg); color: var(--lgy-ink); box-shadow: var(--lgy-shadow); }

/* The public onboarding uses the same material without the workspace frame. */
body.bs-body .bc-btn--primary { background: var(--lgy-bg); color: var(--lgy-ink); box-shadow: var(--lgy-shadow); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }
body.bs-body .bc-btn--primary:hover:not(:disabled) { background: var(--lgy-bg-hover); }
body.bs-body .bs-btn-glass { background: var(--lg-bg); color: var(--bc-ink); box-shadow: var(--lg-shadow-soft); -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur); }
body.bs-body .bs-btn-glass:hover { background: var(--lg-bg-strong); }
body.bs-body .bc-btn--primary:disabled { background: var(--lg-bg); color: var(--bc-ink-3); box-shadow: var(--lg-shadow-soft); opacity: 0.65; }
body.bs-body .bs-input { background-color: var(--lg-field); box-shadow: inset 0 0 0 1px var(--bc-line); }
body.bs-body .bs-input:focus { background-color: var(--lg-field-focus); box-shadow: inset 0 0 0 1px rgb(255 211 42 / 70%), 0 0 0 2px rgb(255 211 42 / 10%); }
body.bs-body .bs-input[aria-invalid='true'] { box-shadow: inset 0 0 0 1px var(--bc-red); }

body.bc-body.bk-frame .broder-tour-mark { background: var(--lgy-bg); color: var(--lgy-ink); box-shadow: var(--lgy-shadow); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); }

body.bc-body.bk-frame #broder-agent-access .broder-access-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; cursor: pointer; }
body.bc-body.bk-frame #broder-agent-access .broder-access-check input[type='checkbox'] {
  appearance: auto; flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px !important; padding: 0; margin: 2px 0 0;
  border-radius: 4px !important; background: transparent !important; box-shadow: none; accent-color: var(--bc-accent); -webkit-backdrop-filter: none; backdrop-filter: none;
}
.broder-access-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.broder-access-heading h2 { margin: 0; }
.broder-access-brands { display: inline-flex; align-items: center; gap: 10px; color: var(--bc-ink-2); }
.broder-access-brands svg { display: block; width: 22px; height: 22px; fill: currentColor; }

@media (prefers-reduced-transparency: reduce) {
  body.bc-body.bk-frame *, .bc-sheet, .broder-tour-card { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  :root { --lg-bg: rgb(236 238 241); --lg-bg-strong: rgb(236 238 241); --lg-field: #f3f4f5; }
  html[data-bs-theme='dark'] { --lg-bg: #1d1d20; --lg-bg-strong: #19191b; --lg-field: #262629; }
}
@media (forced-colors: active) {
  body.bc-body.bk-frame * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}

body.bc-body.bk-frame .personal-sidebar .personal-nav-link.active, body.bc-body.bk-frame .personal-sidebar .personal-nav-link.active:hover { background: var(--lgy-bg) !important; color: var(--lgy-ink); box-shadow: var(--lgy-shadow); }
body.bc-body.bk-frame .personal-sidebar .personal-nav-link.active .broder-icon { color: var(--lgy-ink); }

/* Touch screens (docs/product/MOBILE_BEHAVIOR.md). iOS zooms the page into any field whose
   text is under 16px and does not zoom back; no grey flash on tap; no double-tap zoom
   delay on controls. */
@media (pointer: coarse) {
  body.bc-body :is(input, select, textarea) { font-size: max(16px, 1em); }
}
body.bc-body { -webkit-tap-highlight-color: transparent; }
body.bc-body :is(a, button, [role='button'], label, summary, select) { touch-action: manipulation; }
