/* blackbolt base: what the admin and the pages the app opens in its web views share (theme aliases and drawn icons,
   base type, card title, notices, buttons, form fields, the login box, rendered text .bb-prose). The web pages load
   only tokens.css and this file (WebDocument in admin/layout/Layout.tsx, A49); the admin loads admin.css after it.
   Fonts are not declared here: fonts.css for the admin, the web pages their own faces with font-display: block.
   docs/blackbolt/backend-design-system-blackbolt.md describes every rule. */

:root {
  /* Every value comes from the system (tokens.css); only aliases and drawn assets live here, for both themes. */
  --font-body: var(--font-ui);
  --page-border: var(--border);
  /* Table head and foot bands: the head on surface-subtle (DataTable), the foot plain. */
  --table-band: var(--surface-subtle);
  /* Glass of layers that float or stick over content: tooltips, menus and bars (the page head is solid since A313). */
  --glass-dark: var(--tooltip-surface-glass);
  --glass-light: var(--surface-glass-raised);
  --glass-blur: blur(var(--blur-header));
  --glass-blur-menu: blur(var(--blur-menu));
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23b0c1d7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b0c1d7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  /* Status icons of badges and alerts (Lucide circle-check, triangle-alert, circle-x, info), drawn as masks in the
     tone's text colour, so every status shows an icon and a word without changing the markup. */
  --icon-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --icon-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --icon-danger: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E");
  --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  /* StateBadge (Round 9): waiting (clock), cancelled (close) and unknown (help-circle) of the system's UI icons. */
  --icon-waiting: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E");
  --icon-cancelled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12'/%3E%3Cpath d='M18 6 6 18'/%3E%3C/svg%3E");
  --icon-unknown: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.5 9.25a2.5 2.5 0 1 1 3.5 2.15c-.6.4-1 .9-1 1.6v.5'/%3E%3Cpath d='M12 16.75h.01'/%3E%3C/svg%3E");
} /* Drawn icons in the light theme's muted grey (the block above draws them in the dark theme's). */
:root[data-theme='light'] {
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%2348586c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  --search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2348586c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
} /* Every single select: own chevron 12px from the right edge, text never runs under it. */
body.bb select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}
body.bb select:not([multiple]):disabled {
  opacity: 1;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body.bb {
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: 400;
  font-size: 13px;
  line-height: 18px;
  color: var(--text);
  background: var(--section-background);
}
a {
  color: var(--text-link);
  text-decoration: none;
}
a:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
strong,
b,
th,
label {
  font-weight: 500;
} /* Form controls and scrollbars follow the theme (tokens.css: dark on :root, light under data-theme="light"). */
:root {
  color-scheme: dark;
}
:root[data-theme='light'] {
  color-scheme: light;
}
code,
.bb-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
}
.bb-card__title {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
/* Alert: the tone's tint and border, its 20px icon in the tone's text colour, the text in --text. */
.bb-notice {
  position: relative;
  padding: 12px 16px 12px 48px;
  border-radius: var(--radius-panel);
  border: 1px solid var(--info-border);
  background: var(--info-subtle);
  color: var(--text);
  margin-bottom: 20px;
}
.bb-notice::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 11px;
  width: 20px;
  height: 20px;
  background: var(--info-text);
  -webkit-mask: var(--icon-info) center / contain no-repeat;
  mask: var(--icon-info) center / contain no-repeat;
}
.bb-notice--ok {
  border-color: var(--success-border);
  background: var(--success-subtle);
}
.bb-notice--ok::before {
  background: var(--success-text);
  -webkit-mask-image: var(--icon-ok);
  mask-image: var(--icon-ok);
}
.bb-notice--warning {
  border-color: var(--warning-border);
  background: var(--warning-subtle);
}
.bb-notice--warning::before {
  background: var(--warning-text);
  -webkit-mask-image: var(--icon-warning);
  mask-image: var(--icon-warning);
}
.bb-notice--danger {
  border-color: var(--danger-border);
  background: var(--danger-subtle);
}
.bb-notice--danger::before {
  background: var(--danger-text);
  -webkit-mask-image: var(--icon-danger);
  mask-image: var(--icon-danger);
}
.bb-muted {
  color: var(--text-muted);
}

/* ---------- buttons, forms ---------- */
/* AppButton: Inter Medium in sentence case, 36px (28px small), 8px radius. Primary is the one green action of a
   view; secondary is white with a grey outline and a --text label (A9: green stays for the primary action). */
.bb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  max-width: 100%;
  padding: 0 16px;
  font-family: var(--font-ui);
  font-size: var(--font-size-ui-md);
  line-height: 18px;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  border: 1px solid var(--action-primary);
  background: var(--action-primary);
  color: var(--action-primary-text);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--duration-instant) var(--ease-standard),
    color var(--duration-instant) var(--ease-standard),
    border-color var(--duration-instant) var(--ease-standard);
}
.bb-button:hover {
  background: var(--action-primary-hover);
  border-color: var(--action-primary-hover);
  color: var(--action-primary-text);
  text-decoration: none;
}
/* Secondary in Dolphin Blue (Round 7): light blue outline, blue label, so it differs from grey toggles; green stays
   for the one primary action. */
.bb-button--secondary {
  background: var(--surface);
  color: var(--text-brand);
  border-color: var(--button-secondary-border);
}
.bb-button--secondary:hover {
  background: var(--state-hover);
  color: var(--text-brand);
  border-color: var(--button-secondary-border);
}
.bb-button--secondary:active {
  background: var(--state-pressed);
  color: var(--text-link-hover);
}
.bb-button[aria-pressed='true'] {
  background: var(--state-selected);
  color: var(--state-selected-text);
  border-color: var(--state-selected-text-muted);
}
.bb-button--danger {
  background: transparent;
  color: var(--danger-text);
  border-color: var(--danger-text);
}
.bb-button--danger:hover {
  background: var(--danger-subtle);
  color: var(--danger-text);
  border-color: var(--danger-text);
}
.bb-button:disabled {
  background: var(--state-disabled);
  color: var(--state-disabled-text);
  border-color: transparent;
  cursor: not-allowed;
}
.bb-button--secondary:disabled,
.bb-button--danger:disabled {
  background: transparent;
  border-color: var(--border);
}
.bb-button--small {
  min-height: 28px;
  padding: 0 12px;
  gap: 4px;
  font-size: var(--font-size-ui-sm);
  line-height: 16px;
}
.bb-button--icon {
  width: 28px;
  min-height: 28px;
  padding: 0;
  justify-content: center;
}
/* Every placeholder in text-muted, as bundle.css of 8.0.1: fields of any class (search, filters, the station's panel)
   read alike, never the browser's grey. A class of a field's own still wins. */
html input::placeholder,
html textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.bb-form {
  display: grid;
  /* minmax(0, …): a wide child (the tab bar, a toolbar) scrolls inside the form instead of widening the page (A313:
     at 390px the reward form was 773px wide and its save bar out of view). */
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.bb-form > .bb-field,
.bb-form > .bb-form__section {
  max-width: 640px;
}
.bb-form > .bb-field--wide {
  max-width: none;
}
.bb-field label {
  display: block;
  font-weight: 500;
  font-size: var(--font-size-ui-md);
  line-height: 18px;
  margin-bottom: 4px;
}
/* The red "*" after a required field's label (Round 9, dl-field-required): 2px, Medium. */
.bb-field__required {
  margin-left: 2px;
  color: var(--danger-text);
  font-weight: 500;
}
.bb-field__help {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 16px;
  margin-bottom: 6px;
}
.bb-field input[type='text'],
.bb-field input[type='email'],
.bb-field input[type='password'],
.bb-field input[type='number'],
.bb-field input[type='date'],
.bb-field input[type='datetime-local'],
.bb-field select,
.bb-field textarea {
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 18px;
  transition: border-color var(--duration-instant) var(--ease-standard);
}
.bb-field textarea {
  min-height: 120px;
  padding: 8px 12px;
}
.bb-field input:hover,
.bb-field select:hover,
.bb-field textarea:hover {
  border-color: var(--text-muted);
}
.bb-field input:focus-visible,
.bb-field select:focus-visible,
.bb-field textarea:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
.bb-field input:disabled,
.bb-field select:disabled,
.bb-field textarea:disabled {
  background: var(--state-disabled);
  color: var(--state-disabled-text);
  border-color: var(--border);
  cursor: not-allowed;
}
.bb-field--check label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
.bb-field--check input {
  width: 18px;
  height: 18px;
  accent-color: var(--state-selected-indicator);
}
.bb-field__error {
  display: block;
  color: var(--danger-text);
  font-size: 12px;
  line-height: 16px;
  margin-top: 4px;
}
.bb-field--invalid input,
.bb-field--invalid select,
.bb-field--invalid textarea {
  border-color: var(--danger-text);
}
.bb-field--check + .bb-field--check {
  margin-top: -10px;
}
.bb-field__inline-help {
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- login ----------
   SignIn and AuthCard (Round 8, H9): the app page colour instead of Dolphin Blue, a 400px white card outlined like
   every app container (no shadow), the mark 24px beside the name in MB Empire caps, the sign-in a full-width primary
   button. The admin login has the brand line on top (body.bb-admin); the account pages of the mails use the same card. */
.bb-login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--surface-subtle);
}
.bb-login__box {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 32px;
}
.bb-login__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--font-size-ui-lg);
  line-height: 20px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-brand);
  margin-bottom: 24px;
}
/* The brand line (sidebar and login box): the ™ stands raised without changing the line height. */
.bb-brandname {
  white-space: nowrap;
}
.bb-brandname__tm {
  font-size: 0.5em;
  line-height: 0;
  vertical-align: 0.9em;
  margin-left: 0.1em;
  letter-spacing: 0;
}
.bb-login__brand img {
  width: auto;
  height: 24px;
}
.bb-login .bb-form {
  max-width: none;
}
.bb-login .bb-button {
  width: 100%;
}
.bb-login__hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-muted);
  text-align: center;
}
/* "oder": a line on both sides that fades out (lines may fade). */
.bb-login__or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.bb-login__or::before,
.bb-login__or::after {
  content: '';
  flex: 1;
  height: 1px;
}
.bb-login__or::before {
  background: linear-gradient(90deg, transparent, var(--divider));
}
.bb-login__or::after {
  background: linear-gradient(90deg, var(--divider), transparent);
}

/* ---------- rendered text (legal texts, messages: prose, B21) ----------
   14/21px Inter, headings Inter Medium 20, 17 and 15px, 12px between blocks, at most 760px wide. */
.bb-prose {
  max-width: 760px;
  font-size: var(--font-size-ui-lg);
  line-height: 21px;
}
.bb-prose > * {
  margin: 0 0 12px;
}
.bb-prose > :first-child {
  margin-top: 0;
}
.bb-prose > :last-child {
  margin-bottom: 0;
}
.bb-prose h1,
.bb-prose h2 {
  margin-top: 24px;
  font-weight: 500;
  font-size: 20px;
  line-height: 28px;
}
.bb-prose h3 {
  margin-top: 24px;
  font-weight: 500;
  font-size: 17px;
  line-height: 24px;
}
.bb-prose h4 {
  margin-top: 16px;
  font-weight: 500;
  font-size: 15px;
  line-height: 22px;
}
.bb-prose strong,
.bb-prose b {
  font-weight: 700;
}
.bb-prose ul,
.bb-prose ol {
  padding-left: 24px;
}
.bb-prose li + li {
  margin-top: 4px;
}
.bb-prose blockquote {
  margin-left: 0;
  padding-left: 16px;
  color: var(--text-muted);
  border-left: var(--border-width-strong) solid var(--border);
}
.bb-prose a {
  word-break: break-word;
}
/* Images in message templates (A133): the column's width at most, centred, 8px corners. */
.bb-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

/* Link rows with an image (app pages with features.appPageImages, Safeline): a list of links that each carry a small
   arrow image becomes a row list, the image at the right (the tiles of the legacy app's help pages). The arrow is white
   in the file: darkened on a light page. */
.bb-prose--tiles li:has(> a > img) {
  list-style: none;
  margin-left: -1.2em;
  border-bottom: 1px solid var(--border, rgba(127, 127, 127, 0.35));
}
.bb-prose--tiles li > a:has(> img) {
  display: block;
  padding: 0.9em 0.4em;
}
.bb-prose--tiles a > img {
  display: inline;
  float: right;
  height: 1em;
  width: auto;
  margin: 0.15em 0;
  border-radius: 0;
  filter: brightness(0) opacity(0.45);
}
@media (prefers-color-scheme: dark) {
  .bb-prose--tiles a > img {
    filter: opacity(0.6);
  }
}

/* ---------- link page (/app/... without the app, A189) ----------
   In the project's look, not Dolphin's: the page sets --al-* from the app theme (app-pages.values.ts linkPageCss), light
   and dark. Centred column of 320-430px: app icon and name, a card with text and the action, store badges on a computer. */
body.bb-applink {
  color-scheme: light dark;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: var(--al-regular);
  font-size: 16px;
  line-height: 24px;
  color: var(--al-text);
  background: var(--al-bg);
}
.bb-applink__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 20px;
  text-align: center;
}
.bb-applink__column {
  width: 100%;
  max-width: 400px;
}
.bb-applink__icon {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 22%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.bb-applink__name {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: var(--al-headline);
  color: var(--al-heading);
  overflow-wrap: anywhere;
}
.bb-applink__tagline {
  margin: 8px 0 0;
  color: var(--al-muted);
}
.bb-applink__card {
  margin-top: 28px;
  padding: 24px 20px;
  background: var(--al-surface);
  border-radius: var(--al-radius);
}
.bb-applink__text {
  margin: 0 0 20px;
}
.bb-applink__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 20px;
  font-weight: var(--al-regular);
  text-align: left;
  cursor: pointer;
}
.bb-applink__check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--al-primary);
}
/* The app's button: outlined in the brand colour on the button fill, as in the app. */
.bb-applink__button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid var(--al-primary);
  border-radius: var(--al-radius-button);
  background: var(--al-button-bg);
  color: var(--al-button-text);
  font: inherit;
  font-size: 17px;
  line-height: 22px;
  font-weight: var(--al-bold);
  text-decoration: none;
  cursor: pointer;
}
.bb-applink__button:hover {
  color: var(--al-button-text);
  text-decoration: none;
}
.bb-applink__button small {
  font-size: 13px;
  line-height: 18px;
  font-weight: var(--al-regular);
}
.bb-applink__hint {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--al-muted);
}
/* The QR code stays dark on white, also in the dark variant (scanners need the contrast). */
.bb-applink__qr {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: var(--al-radius);
  line-height: 0;
}
.bb-applink__qr svg {
  width: 200px;
  height: 200px;
}
/* Official store badges (Apple: at least 40px high; Google: the PNG holds its clear space, so it is taller to look as
   large). Files in images/badges/, never from the stores' servers. */
.bb-applink__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin-top: 20px;
}
.bb-applink__badges a {
  line-height: 0;
}
.bb-applink__badge--apple {
  height: 44px;
  width: auto;
}
.bb-applink__badge--google {
  height: 64px;
  width: auto;
}
