/* containers.css — styles for containers.js, written against the role tokens in styles.css.

   Two halves, and they never share a colour:

   - **The workspace** — the Containers rail list, the Selected tab, the forms and the list's
     menu — is website chrome, so every colour, type size, radius and control size is one of the
     roles `styles.css` declares on `:root` and again under `[data-theme="dark"]`.
   - **The device** — the navigation bar, tab bar, top tabs, drawer and the stage's screen — is
     the previewed app, so it keeps Studio's literal `appChrome*`, `deviceScreen` and `textMuted`
     colours from `app/DesignSystem.json`, chosen by `data-appearance` (the app's appearance), never
     by the website's theme (TechPlan.md § Light and dark). Its measurements are Blueprint's
     (`ui/DesignComponentUI/docs/AppChrome.md` § Chrome measurements) in points, multiplied by
     `--bc-s`, the CSS pixels per point the host draws the device at.

   Nothing here is written from script except the `--bc-*` custom properties `containers.js`
   sets through CSSOM: a design's own colours (checked `#RRGGBB`/`#RRGGBBAA` first), the scale, the
   safe area, a tab count and the menu's position. Liquid Glass cannot be drawn by a browser; a
   translucent blurred fill stands in for it (a deliberate difference). */

.bc-list [hidden],
.bc-selected [hidden],
.bc-dialog [hidden],
.bc-chrome [hidden] { display: none !important; }

/* ------------------------------------------------------- the rail list */

/* Each container type's eyebrow, its Default design, then its variants: Studio's navigator rows. */
.bc-list { display: grid; }
.bc-list-failure { margin: 8px; color: var(--muted); font: var(--type-small); }
.bc-list-section { display: grid; gap: 4px; padding-bottom: 4px; }
.bc-list-heading { margin: 0; padding: 12px 8px 0; color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; }
/* Drawn as `.feature-item` is: the name, and a neutral badge; the selected row is the raised
   neutral fill with a neutral edge. */
.bc-row {
  width: 100%; min-height: 44px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px; color: var(--ink); text-align: left;
  background: transparent; border: 0; border-radius: var(--radius-row); cursor: pointer;
}
.bc-row:hover { background: var(--hover); }
.bc-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.bc-row.active { background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.bc-row strong { flex: 1 1 auto; min-width: 0; overflow: hidden; font: var(--type-small-strong); white-space: nowrap; text-overflow: ellipsis; }
.bc-row.active strong { color: var(--selected-ink); }
.bc-status { flex: 0 0 auto; padding: 4px 8px; color: var(--ink-soft); background: var(--chip); border-radius: var(--radius-badge); font: var(--type-caption-strong); white-space: nowrap; }

/* The list's right-click menu, at the pointer. */
.bc-menu {
  position: fixed; z-index: 200;
  left: calc(var(--bc-menu-x, 0) * 1px); top: calc(var(--bc-menu-y, 0) * 1px);
  min-width: 160px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 8px 24px var(--shadow-menu);
}
.bc-menu-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-row); font: var(--type-body); text-align: left; cursor: pointer; }
.bc-menu-item:hover, .bc-menu-item:focus-visible { background: var(--hover); outline: none; }
.bc-menu-mark { width: 16px; color: var(--ink-soft); font: var(--type-label); text-align: center; }

/* ------------------------------------------------------- the Selected tab */

.bc-selected { display: grid; gap: 16px; min-width: 0; }
.bc-selected-title { margin: 0; color: var(--ink); font: var(--type-label); }
.bc-selected-message { margin: 0; color: var(--ink-soft); font: var(--type-body); }
.bc-settings { display: grid; }
/* Studio's chrome setting row: the field's name and Edit on one line, its value beneath. */
.bc-setting { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.bc-setting-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bc-setting-title { min-width: 0; color: var(--muted); font: var(--type-small); }
.bc-setting-value { margin: 0; color: var(--ink); font: var(--type-small-strong); overflow-wrap: anywhere; user-select: text; }
.bc-eyebrow { margin: 0; color: var(--muted); font: var(--type-eyebrow); letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; }
.bc-caption { margin: 0; color: var(--muted); font: var(--type-caption); }
.bc-lead { margin: 0; color: var(--ink-soft); font: var(--type-body); }
.bc-problem { margin: 0; color: var(--bad-ink); font: var(--type-caption); }

/* Studio's Secondary button at 28 points; the danger family for Archive variant. */
.bc-action {
  height: var(--control-height); padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--ink); background-color: var(--selected-fill);
  border: 1px solid var(--selected-line); border-radius: var(--radius-button);
  font: var(--type-caption-strong); white-space: nowrap; cursor: pointer;
}
.bc-action:hover:not(:disabled) { background-image: linear-gradient(var(--hover), var(--hover)); }
.bc-action:active:not(:disabled) { background-image: linear-gradient(var(--pressed), var(--pressed)); }
.bc-action:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bc-action.danger { color: var(--bad-ink); }
.bc-action:disabled { color: var(--muted); background: var(--chip); border-color: transparent; cursor: not-allowed; }
/* Set apart below everything else. */
.bc-archive { justify-self: start; margin-top: 8px; }

/* The button arranger: rows read the bar left to right. */
.bc-buttons { display: grid; gap: 8px; }
.bc-buttons-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bc-button-list { display: grid; }
.bc-button-row { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 0; }
.bc-button-copy { min-width: 0; display: grid; gap: 1px; }
.bc-button-copy strong { overflow: hidden; color: var(--ink); font: var(--type-small-strong); white-space: nowrap; text-overflow: ellipsis; }
.bc-button-row.marker .bc-button-copy strong { color: var(--ink-soft); }
.bc-button-copy small { display: -webkit-box; overflow: hidden; color: var(--muted); font: var(--type-caption); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bc-button-controls { display: flex; gap: 2px; }
.bc-row-glyph { width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink); }
.bc-row-glyph.text, .bc-row-glyph.back, .bc-row-glyph.title { color: var(--muted); font: var(--type-caption-strong); }
.bc-row-glyph.title::before { content: "Aa"; }
.bc-row-glyph.back::before { content: ""; width: 7px; height: 7px; margin-left: 3px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.bc-row-image { width: 20px; height: 20px; object-fit: contain; border-radius: 3px; }
.bc-row-image.loading, .bc-row-image.missing { background: var(--inset); }
/* A lock: the row is automatic and does not move. */
.bc-lock { width: 10px; height: 8px; position: relative; margin: 6px 9px 0; background: var(--muted); border-radius: 2px; }
.bc-lock::before { content: ""; position: absolute; left: 2px; top: -5px; width: 6px; height: 6px; box-sizing: border-box; border: 1.5px solid var(--muted); border-bottom: 0; border-radius: 3px 3px 0 0; }

.bc-icon-button { width: var(--icon-button); height: var(--icon-button); flex: 0 0 auto; display: grid; place-items: center; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-icon); cursor: pointer; }
.bc-icon-button:hover:not(:disabled) { background: var(--hover); }
.bc-icon-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.bc-icon-button:disabled { color: var(--muted); opacity: .48; cursor: not-allowed; }
.bc-icon { width: 14px; height: 14px; display: block; position: relative; box-sizing: border-box; }
.bc-icon-button.edit .bc-icon::before { content: "✎"; position: absolute; inset: 0; font-size: 13px; line-height: 14px; text-align: center; }
.bc-icon-button.up .bc-icon::before,
.bc-icon-button.down .bc-icon::before { content: ""; position: absolute; left: 3.5px; top: 5px; width: 6px; height: 6px; border-left: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
.bc-icon-button.down .bc-icon::before { top: 1.5px; transform: rotate(225deg); }
.bc-icon-button.remove .bc-icon { border: 1.5px solid currentColor; border-radius: 50%; }
.bc-icon-button.remove .bc-icon::before { content: ""; position: absolute; left: 2.5px; right: 2.5px; top: 50%; height: 1.5px; margin-top: -.75px; background: currentColor; }
.bc-icon-button.add .bc-icon::before,
.bc-icon-button.add .bc-icon::after { content: ""; position: absolute; left: 50%; top: 1px; bottom: 1px; width: 1.5px; margin-left: -.75px; background: currentColor; }
.bc-icon-button.add .bc-icon::after { transform: rotate(90deg); }
.bc-icon.archive { width: 12px; height: 11px; border: 1.5px solid currentColor; border-radius: 2px; }
.bc-icon.archive::before { content: ""; position: absolute; left: 2px; right: 2px; top: 2px; height: 1.5px; background: currentColor; }
.bc-icon.upload::before { content: "↑"; position: absolute; inset: 0; font-size: 12px; font-weight: 600; line-height: 14px; text-align: center; }

/* A symbol's neutral glyph in the workspace: a browser draws no SF Symbols, so it is a plain mark
   whose title names the symbol. Dashed is Studio's placeholder; with a question mark, not a name. */
.bc-glyph { width: 16px; height: 16px; flex: 0 0 auto; box-sizing: border-box; display: inline-grid; place-items: center; border: 1.5px solid currentColor; border-radius: 28%; }
.bc-glyph::after { content: ""; width: 30%; height: 30%; background: currentColor; border-radius: 50%; }
.bc-glyph.placeholder, .bc-glyph.unknown { border-style: dashed; }
.bc-glyph.placeholder::after { content: none; }
.bc-glyph.unknown::after { content: "?"; width: auto; height: auto; background: none; font: 700 9px/1 var(--font-ui); }

/* ------------------------------------------------------------- the forms */

/* Studio's form card, as `.pp-dialog` draws it: a native modal `<dialog>` centred in the top
   layer, its heading and footer still while the fields scroll. */
.bc-dialog {
  width: min(480px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  margin: auto; padding: 0; overflow: hidden;
  color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-card);
}
.bc-dialog[open] { display: flex; animation: bc-dialog-in .3s ease-in-out; }
.bc-dialog::backdrop { background: rgba(0, 0, 0, .4); }
@keyframes bc-dialog-in { from { opacity: 0; } }
.bc-dialog-frame { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.bc-dialog-head { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 24px 24px 0; }
.bc-dialog-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font: var(--type-h1); }
.bc-dialog-close { width: var(--icon-button); height: var(--icon-button); flex: 0 0 var(--icon-button); display: grid; place-items: center; padding: 0; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-icon); font-size: 17px; line-height: 1; cursor: pointer; }
.bc-dialog-close:hover:not(:disabled) { background: var(--hover); }
.bc-dialog-close:disabled { color: var(--muted); cursor: progress; }
.bc-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 16px; padding: 16px 24px; }
.bc-dialog-foot { flex: 0 0 auto; display: grid; gap: 12px; padding: 0 24px 24px; }
.bc-dialog-messages { max-height: 25vh; overflow-y: auto; display: grid; gap: 8px; }
.bc-form-error { margin: 0; padding: 12px; color: var(--bad-ink); background: var(--bad-bg); border-radius: var(--radius-button); font: var(--type-small); }
.bc-dialog-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.bc-button { height: var(--control-height); min-width: 0; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: var(--radius-button); font: var(--type-body); cursor: pointer; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.bc-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bc-button.primary { color: var(--on-primary); background: var(--primary); }
.bc-button.primary:hover:not(:disabled) { background: var(--primary-hover); }
.bc-button.primary:active:not(:disabled) { background: var(--primary-pressed); }
.bc-button.secondary { color: var(--ink); background-color: var(--panel-muted); border-color: var(--line); }
.bc-button.secondary:hover:not(:disabled) { background-image: linear-gradient(var(--hover), var(--hover)); }
.bc-button.danger { color: var(--on-danger); background: var(--danger); }
.bc-button.danger:hover:not(:disabled) { background: var(--danger-hover); }
/* After every role, so a disabled answer is the muted chip whatever its role. */
.bc-button:disabled { color: var(--muted); background: var(--chip); border-color: transparent; cursor: not-allowed; }

/* Studio's neutral progress mark, beside the close button while the form works. */
.bc-spinner { width: 12px; height: 12px; flex: 0 0 12px; display: inline-block; border: 1.5px solid var(--line-strong); border-top-color: var(--loading); border-radius: 50%; animation: bc-spin .8s linear infinite; }
@keyframes bc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .bc-spinner { animation: none; border-top-color: var(--line-strong); }
  .bc-dialog[open] { animation: none; }
}

/* `StudioLabeledFieldView`: an eyebrow over a one-line field. */
.bc-field { min-width: 0; display: grid; gap: 8px; }
.bc-input { width: 100%; height: var(--control-height); padding: 0 12px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-button); font: var(--type-body); }
.bc-input:focus { border-color: var(--selected-line-strong); outline: none; }
.bc-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.bc-input::placeholder { color: var(--muted); }
.bc-input:disabled { color: var(--muted); background: var(--chip); cursor: progress; }
.bc-section { min-width: 0; display: grid; gap: 8px; }
.bc-color-fields { display: grid; gap: 8px; }
.bc-hex, .bc-symbol-row { display: grid; grid-template-columns: minmax(0, 1fr) var(--control-height); align-items: end; gap: 8px; }
/* The colour as typed, once it reads as one. */
.bc-swatch { width: var(--control-height); height: var(--control-height); box-sizing: border-box; background: var(--bc-swatch, transparent); border: 1px solid var(--line); border-radius: var(--radius-button); }
.bc-symbol-preview { width: var(--control-height); height: var(--control-height); display: grid; place-items: center; color: var(--ink); }
.bc-symbol-preview .bc-glyph { width: 20px; height: 20px; }
.bc-symbol-block, .bc-image-block { display: grid; gap: 8px; }

/* `StudioChoiceRowView`: a row per option, a filled mark on the chosen one. */
.bc-choices { display: grid; gap: 8px; }
.bc-choice { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; color: var(--ink); text-align: left; background: var(--panel-muted); border: 1px solid transparent; border-radius: var(--radius-button); cursor: pointer; }
.bc-choice:hover:not(:disabled) { background-image: linear-gradient(var(--hover), var(--hover)); }
.bc-choice:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bc-choice.selected { background: var(--selected-fill); border-color: var(--selected-line-strong); }
.bc-choice:disabled { cursor: progress; opacity: .7; }
.bc-choice-copy { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; }
.bc-choice-copy strong { font: var(--type-label); }
.bc-choice.selected .bc-choice-copy strong { color: var(--selected-ink); }
.bc-choice-copy small { color: var(--muted); font: var(--type-caption); }
.bc-choice.selected .bc-choice-copy small { color: var(--ink-soft); }
.bc-choice-mark { width: 16px; height: 16px; flex: 0 0 16px; box-sizing: border-box; border: 1.5px solid var(--muted); border-radius: 50%; }
.bc-choice.selected .bc-choice-mark { border: 5px solid var(--selected-ink); }

/* Studio's segmented control, as `.segmented` draws it. */
.bc-segmented { justify-self: start; display: inline-flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: var(--radius-button); box-shadow: inset 0 0 0 1px var(--line); }
.bc-segmented button { min-height: 20px; padding: 0 12px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 3px; font: var(--type-body); white-space: nowrap; cursor: pointer; }
.bc-segmented button:hover:not(:disabled) { background: var(--hover); }
.bc-segmented button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.bc-segmented button[aria-pressed="true"] { color: var(--selected-ink); background: var(--selected-fill); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.bc-segmented button:disabled { cursor: progress; }

/* The project's images: a box two rows tall that scrolls when there are more. */
.bc-image-picker {
  height: 168px; position: relative; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); align-content: start; gap: 8px; padding: 8px;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius-button);
}
.bc-tile { min-width: 0; display: grid; justify-items: center; gap: 4px; padding: 8px; color: var(--ink-soft); background: var(--panel-muted); border: 1px solid var(--line); border-radius: var(--radius-card); cursor: pointer; }
.bc-tile:hover:not(:disabled) { background-image: linear-gradient(var(--hover), var(--hover)); }
.bc-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.bc-tile.selected { background: var(--raised); border-color: var(--line-strong); box-shadow: inset 0 0 0 1px var(--selected-line-strong); }
.bc-tile:disabled { cursor: progress; }
.bc-tile-image { width: 28px; height: 28px; object-fit: contain; }
.bc-tile-image.loading, .bc-tile-image.missing { background: var(--inset); border-radius: 4px; }
.bc-tile-name { max-width: 100%; overflow: hidden; font: var(--type-caption); white-space: nowrap; text-overflow: ellipsis; }
.bc-upload-row { display: flex; align-items: center; gap: 8px; }

@media (max-width: 560px) {
  .bc-dialog-head { padding: 20px 16px 0; }
  .bc-dialog-body { padding: 12px 16px; }
  .bc-dialog-foot { padding: 0 16px 20px; }
}

/* ------------------------------------------------------------ the device */

/* A chrome component's root: the app's appearance, the platform's measurements in points, and the
   scale. `--bc-u` is one point in CSS pixels. */
.bc-chrome {
  --bc-s: 1;
  --bc-u: calc(var(--bc-s) * 1px);
  --bc-safe-top: 0; --bc-safe-bottom: 0; --bc-safe-leading: 0; --bc-safe-trailing: 0;
  /* iOS: AppChrome.md § Chrome measurements. */
  --bc-bar-h: 54; --bc-bar-inset: 16; --bc-button: 44; --bc-icon: 20; --bc-title-size: 17;
  --bc-large-size: 34; --bc-large-line: 41; --bc-button-title: 17;
  --bc-tab-h: 62; --bc-tab-inset: 20; --bc-tab-icon: 24; --bc-tab-bottom-min: 8;
  --bc-top-h: 44; --bc-top-title-size: 15;
  /* Studio's appChrome colours, light. */
  --bc-surface: #FFFFFF; --bc-line: #C6C6C8; --bc-text: #000000; --bc-text-secondary: #404040;
  --bc-selection: #000000; --bc-lens: rgba(0, 0, 0, .1); --bc-chip: #EBEBEB;
  --bc-scrim: rgba(0, 0, 0, .38); --bc-shadow: rgba(0, 0, 0, .22);
  --bc-screen: #FFFFFF; --bc-screen-text: #67676F;
  /* The glass approximation. */
  --bc-glass: rgba(255, 255, 255, .72); --bc-glass-edge: rgba(0, 0, 0, .08); --bc-glass-shadow: rgba(0, 0, 0, .12);
  color: var(--bc-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.bc-chrome[data-platform="mac"] {
  --bc-bar-h: 44; --bc-bar-inset: 12; --bc-button: 28; --bc-icon: 14; --bc-title-size: 13;
  --bc-large-size: 26; --bc-large-line: 31; --bc-button-title: 13;
  --bc-tab-h: 52; --bc-tab-inset: 16; --bc-tab-icon: 20; --bc-tab-bottom-min: 12;
  --bc-top-h: 32; --bc-top-title-size: 13;
}
.bc-chrome[data-appearance="dark"] {
  --bc-surface: #000000; --bc-line: #38383A; --bc-text: #FFFFFF; --bc-text-secondary: #BFBFBF;
  --bc-selection: #FFFFFF; --bc-lens: rgba(255, 255, 255, .16); --bc-chip: #262626;
  --bc-screen: #111113; --bc-screen-text: #8E8E97;
  --bc-glass: rgba(38, 38, 40, .72); --bc-glass-edge: rgba(255, 255, 255, .12); --bc-glass-shadow: rgba(0, 0, 0, .36);
}

/* The overlay fills the device screen below the status bar; only tabs take clicks. */
.bc-app-chrome { position: absolute; inset: 0; z-index: 7; overflow: hidden; pointer-events: none; }
.bc-app-chrome button { pointer-events: auto; }
.bc-app-top { position: absolute; top: 0; left: 0; right: 0; display: flex; flex-direction: column; padding-top: calc(var(--bc-safe-top) * var(--bc-u)); }
.bc-app-bottom { position: absolute; left: 0; right: 0; bottom: 0; }

/* Liquid Glass, approximated: a translucent fill, a hairline edge and a soft shadow. */
.bc-glass {
  background: var(--bc-glass);
  box-shadow: 0 0 0 calc(.5 * var(--bc-u)) var(--bc-glass-edge), 0 calc(2 * var(--bc-u)) calc(10 * var(--bc-u)) var(--bc-glass-shadow);
  -webkit-backdrop-filter: blur(calc(12 * var(--bc-u))) saturate(1.8);
  backdrop-filter: blur(calc(12 * var(--bc-u))) saturate(1.8);
}

/* A symbol's glyph on the device takes the icon frame and the tint. */
.bc-chrome .bc-glyph { width: calc(var(--bc-icon) * var(--bc-u)); height: calc(var(--bc-icon) * var(--bc-u)); border-width: calc(1.6 * var(--bc-u)); }
.bc-chrome .bc-glyph.unknown::after { font-size: calc(var(--bc-icon) * .45 * var(--bc-u)); }

/* --- Navigation bar */
.bc-nav {
  position: relative; isolation: isolate;
  padding: 0 calc((var(--bc-bar-inset) + var(--bc-safe-trailing)) * var(--bc-u)) 0 calc((var(--bc-bar-inset) + var(--bc-safe-leading)) * var(--bc-u));
  color: var(--bc-nav-tint, var(--bc-text));
}
/* A solid bar's fill, reaching up into the top safe area when nothing sits above it. */
.bc-nav.solid::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; top: calc(var(--bc-nav-extend, 0) * -1 * var(--bc-u)); background: var(--bc-nav-bg, var(--bc-surface)); }
.bc-nav-row { height: calc(var(--bc-bar-h) * var(--bc-u)); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.bc-nav-row.has-sides { column-gap: calc(8 * var(--bc-u)); }
/* Each side is as wide as the wider of the two, so the title is centred in the bar. */
.bc-nav-side { display: grid; align-items: center; }
.bc-nav-side > * { grid-area: 1 / 1; }
.bc-nav-side.lead > .bc-nav-groups { justify-self: start; }
.bc-nav-side.trail > .bc-nav-groups { justify-self: end; }
.bc-ghost { visibility: hidden; }
.bc-nav-groups { display: flex; align-items: center; gap: calc(8 * var(--bc-u)); }
.bc-nav-group { display: inline-flex; align-items: center; border-radius: 999px; }
.bc-nav-item { min-width: calc(var(--bc-button) * var(--bc-u)); min-height: calc(var(--bc-button) * var(--bc-u)); box-sizing: border-box; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(2 * var(--bc-u)); }
.bc-nav-item.round { width: calc(var(--bc-button) * var(--bc-u)); height: calc(var(--bc-button) * var(--bc-u)); }
.bc-nav-item.captioned { padding: calc(4 * var(--bc-u)) calc(8 * var(--bc-u)); }
.bc-nav-item.text { padding: 0 calc(12 * var(--bc-u)); }
.bc-nav-text { font-size: calc(var(--bc-button-title) * var(--bc-u)); font-weight: 400; line-height: 1.2; white-space: nowrap; }
.bc-nav-caption { font-size: calc(10 * var(--bc-u)); font-weight: 500; line-height: 1.2; white-space: nowrap; }
.bc-nav-image { width: calc(var(--bc-icon) * var(--bc-u)); height: calc(var(--bc-icon) * var(--bc-u)); object-fit: contain; }
.bc-nav-image.loading, .bc-nav-image.missing { background: var(--bc-chip); border-radius: calc(4 * var(--bc-u)); }
.bc-chevron { width: calc(var(--bc-icon) * .5 * var(--bc-u)); height: calc(var(--bc-icon) * .5 * var(--bc-u)); box-sizing: border-box; border-left: calc(2.2 * var(--bc-u)) solid currentColor; border-bottom: calc(2.2 * var(--bc-u)) solid currentColor; transform: translateX(calc(2 * var(--bc-u))) rotate(45deg); }
.bc-ellipsis { font-size: calc(var(--bc-icon) * .42 * var(--bc-u)); letter-spacing: calc(1 * var(--bc-u)); line-height: 1; }
.bc-nav-title { min-width: 0; overflow: hidden; color: var(--bc-nav-title, var(--bc-text)); font-size: calc(var(--bc-title-size) * var(--bc-u)); font-weight: 600; line-height: 1.2; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.bc-nav-large { height: calc(var(--bc-large-line) * var(--bc-u)); margin-bottom: calc(8 * var(--bc-u)); overflow: hidden; color: var(--bc-nav-title, var(--bc-text)); font-size: calc(var(--bc-large-size) * var(--bc-u)); font-weight: 700; line-height: calc(var(--bc-large-line) * var(--bc-u)); white-space: nowrap; text-overflow: ellipsis; }

/* --- Floating tab bar */
.bc-tab-bar-wrap {
  display: flex; justify-content: center;
  padding: 0 calc((var(--bc-tab-inset) + var(--bc-safe-trailing)) * var(--bc-u)) calc(max(var(--bc-safe-bottom), var(--bc-tab-bottom-min)) * var(--bc-u)) calc((var(--bc-tab-inset) + var(--bc-safe-leading)) * var(--bc-u));
}
.bc-tab-bar { width: 100%; max-width: calc((var(--bc-tab-count, 3) * 96 + 8) * var(--bc-u)); height: calc(var(--bc-tab-h) * var(--bc-u)); box-sizing: border-box; display: flex; padding: calc(4 * var(--bc-u)); border-radius: 999px; }
.bc-tab-bar.solid { background: var(--bc-tab-bg, var(--bc-surface)); box-shadow: 0 calc(4 * var(--bc-u)) calc(16 * var(--bc-u)) var(--bc-shadow); }
.bc-tab {
  flex: 1 1 0; min-width: 0; height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(4 * var(--bc-u));
  padding: 0 calc(8 * var(--bc-u)); margin: 0;
  color: var(--bc-tab-unselected, var(--bc-text-secondary)); background: transparent; border: 0; border-radius: 999px;
  font: inherit; cursor: pointer;
}
button.bc-tab:focus-visible { outline: 2px solid var(--focus, #FF6B33); outline-offset: -2px; }
.bc-tab.selected { color: var(--bc-tab-selected, var(--bc-selection)); background: var(--bc-lens); }
.bc-chrome .bc-tab .bc-glyph { width: calc(var(--bc-tab-icon) * var(--bc-u)); height: calc(var(--bc-tab-icon) * var(--bc-u)); }
.bc-tab-title { max-width: 100%; overflow: hidden; font-size: calc(10 * var(--bc-u)); font-weight: 500; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }

/* --- Top tabs */
.bc-top-selector { display: flex; padding: 0 calc(var(--bc-safe-trailing) * var(--bc-u)) 0 calc(var(--bc-safe-leading) * var(--bc-u)); }
.bc-top-tabs.scrolling .bc-top-selector { overflow-x: auto; scrollbar-width: none; }
.bc-top-tabs.scrolling .bc-top-selector::-webkit-scrollbar { display: none; }
.bc-top-tab {
  flex: 1 1 0; min-width: 0; min-height: calc(var(--bc-top-h) * var(--bc-u)); position: relative; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  padding: 0 calc(12 * var(--bc-u)); margin: 0;
  color: var(--bc-top-unselected, var(--bc-text-secondary)); background: transparent; border: 0;
  font: inherit; cursor: pointer;
}
.bc-top-tabs.scrolling .bc-top-tab { flex: 0 0 auto; }
button.bc-top-tab:focus-visible { outline: 2px solid var(--focus, #FF6B33); outline-offset: -2px; }
.bc-top-tab.selected { color: var(--bc-top-selected, var(--bc-selection)); }
.bc-top-title { position: relative; overflow: hidden; font-size: calc(var(--bc-top-title-size) * var(--bc-u)); font-weight: 600; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; }
.bc-top-tabs.underline .bc-top-tab.selected::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(2 * var(--bc-u)); background: var(--bc-top-selected, var(--bc-selection)); }
.bc-top-tabs.capsule .bc-top-tab.selected::before { content: ""; position: absolute; left: 0; right: 0; top: calc(4 * var(--bc-u)); bottom: calc(4 * var(--bc-u)); background: var(--bc-chip); border-radius: 999px; }
.bc-top-divider { height: calc(1 * var(--bc-u)); background: var(--bc-line); }

/* --- Open drawer */
.bc-drawer { position: absolute; inset: 0; }
.bc-drawer-scrim { position: absolute; inset: 0; background: var(--bc-scrim); }
.bc-drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: calc(min(84%, 360 * var(--bc-u)) + var(--bc-safe-leading) * var(--bc-u));
  background: var(--bc-drawer-bg, var(--bc-surface));
  box-shadow: calc(6 * var(--bc-u)) 0 calc(18 * var(--bc-u)) var(--bc-shadow);
}

/* --- The Containers stage's screen: the device's own colour, and the chrome alone. */
.bc-stage-screen { position: absolute; inset: 0; overflow: hidden; background: var(--bc-screen); color: var(--bc-screen-text); }
.bc-stage-content {
  position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--bc-content-top, 0) * var(--bc-u));
  margin: 0; display: flex; align-items: center; justify-content: center;
  font-size: calc(12 * var(--bc-u)); line-height: calc(16 * var(--bc-u));
}
