/* Brainery OS: Mist theme (picked by Lorenzo 2026-12-02, take A in docs/takes-2026-12-02).
   Misty sky-blue gradient, frosted glass cards, near-black pills, thin large numbers, one cool blue accent.
   Overrides the light theme tokens only. !important beats the runtime theme sheet. */
html.light {
  --t-font-family: 'Almarai', system-ui, sans-serif !important;
  --lb-serif: 'Libre Baskerville', Georgia, serif;
  --lb-mist: radial-gradient(1200px 700px at 78% -10%, #FFFFFF 0%, rgba(255,255,255,0) 60%), linear-gradient(170deg, #B9D3E8 0%, #D6E4EF 38%, #EEF1F4 75%, #F4F3F1 100%);
  --lb-glass: rgba(255, 255, 255, 0.58);
  --lb-glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 10px 30px rgba(40, 70, 100, 0.08);

  /* Surfaces: glass over the gradient. The app shell paints gray3; it must be clear so the gradient shows. */
  --t-background-primary: transparent !important;
  --t-background-secondary: rgba(255, 255, 255, 0.40) !important;
  --t-background-noisy: transparent !important;
  --t-background-tertiary: rgba(255, 255, 255, 0.55) !important;
  --t-background-quaternary: rgba(255, 255, 255, 0.70) !important;
  --t-gray-scale-gray3: transparent !important;
  --t-background-inverted-primary: #0E1116 !important;
  --t-background-inverted-secondary: #1F2630 !important;
  --t-background-primary-inverted: #0E1116 !important;
  --t-background-primary-inverted-hover: #1F2630 !important;
  --t-background-transparent-primary: rgba(255, 255, 255, 0.72) !important;
  --t-background-transparent-secondary: rgba(255, 255, 255, 0.60) !important;
  --t-background-transparent-strong: rgba(14, 17, 22, 0.12) !important;
  --t-background-transparent-medium: rgba(14, 17, 22, 0.07) !important;
  --t-background-transparent-light: rgba(14, 17, 22, 0.04) !important;
  --t-background-transparent-lighter: rgba(14, 17, 22, 0.02) !important;
  --t-background-transparent-blue: rgba(47, 111, 176, 0.12) !important;
  --t-background-overlay-primary: rgba(14, 17, 22, 0.60) !important;
  --t-background-overlay-secondary: rgba(14, 17, 22, 0.30) !important;
  --t-background-overlay-tertiary: rgba(14, 17, 22, 0.06) !important;

  /* Ink */
  --t-font-color-primary: #0E1116 !important;
  --t-font-color-secondary: #3E4A57 !important;
  --t-font-color-tertiary: #5E6B78 !important;
  --t-font-color-light: #8A95A1 !important;
  --t-font-color-extra-light: #B6BEC7 !important;
  --t-font-color-inverted: #FFFFFF !important;
  --t-font-color-on-accent: #FFFFFF !important;

  /* Rules: hairlines on an ink base */
  --t-border-color-strong: rgba(20, 40, 60, 0.14) !important;
  --t-border-color-medium: rgba(20, 40, 60, 0.10) !important;
  --t-border-color-light: rgba(20, 40, 60, 0.07) !important;
  --t-border-color-inverted: #0E1116 !important;
  --t-border-color-secondary-inverted: #1F2630 !important;
  --t-border-color-blue: #2F6FB0 !important;
  --t-border-color-transparent-strong: rgba(20, 40, 60, 0.10) !important;
  --t-box-shadow-color: rgba(40, 70, 100, 0.08) !important;

  /* Accent: one cool blue */
  --t-accent-accent1: #FAFCFE !important;
  --t-accent-accent2: #F2F7FC !important;
  --t-accent-accent3: #E3EEF8 !important;
  --t-accent-accent4: #D2E3F3 !important;
  --t-accent-accent5: #BCD4EC !important;
  --t-accent-accent6: #A2C2E2 !important;
  --t-accent-accent7: #7FA9D3 !important;
  --t-accent-accent8: #5A8EC2 !important;
  --t-accent-accent9: #2F6FB0 !important;
  --t-accent-accent10: #285F99 !important;
  --t-accent-accent11: #24578C !important;
  --t-accent-accent12: #0F2A45 !important;
  --t-accent-accent3570: #7FA9D3 !important;
  --t-accent-accent4060: #5A8EC2 !important;
  --t-accent-primary: #BCD4EC !important;
  --t-accent-secondary: #BCD4EC !important;
  --t-accent-tertiary: #E3EEF8 !important;
  --t-accent-quaternary: #F2F7FC !important;
  /* Primary buttons are near-black pills, not blue. */
  --t-color-blue: #0E1116 !important;

  /* Chart series: blue is the default series and draws in the Mist blue. */
  --t-color-blue1: #FAFCFE !important; --t-color-blue2: #F2F7FC !important; --t-color-blue3: #E3EEF8 !important; --t-color-blue4: #D2E3F3 !important; --t-color-blue5: #BCD4EC !important; --t-color-blue6: #A2C2E2 !important;
  --t-color-blue7: #7FA9D3 !important; --t-color-blue8: #2F6FB0 !important; --t-color-blue9: #2F6FB0 !important; --t-color-blue10: #285F99 !important; --t-color-blue11: #24578C !important; --t-color-blue12: #0F2A45 !important;
}

html.light, html.light body, html.light #root { background: var(--lb-mist) !important; background-attachment: fixed !important; }
html.light ::selection { background: #D2E3F3; color: #0E1116; }

/* The bundle sets Inter literally, not through the token, so set the family on every element.
   Code and editors keep their monospace face. */
html.light body,
html.light body *:not(code):not(pre):not(kbd):not(code *):not(pre *):not(.monaco-editor *) {
  font-family: 'Almarai', system-ui, sans-serif !important;
}

/* Settings covers carry a play button for the vendor's demo videos. The cover stays; the video goes. */
button[aria-label^="Watch "][aria-label$=" demo"] { display: none !important; }

/* Auth pages (sign in, sign up, invite): a compact glass card on the gradient. The shim tags the card
   (data-lb-card) and sets html.lb-auth. The workspace picture is hidden here: the mark is shown once. */
html.lb-auth [data-lb-card] {
  background: var(--lb-glass); border: 0; border-radius: 22px; box-shadow: var(--lb-glass-shadow);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  padding: 24px 28px 20px !important; width: min(360px, calc(100vw - 32px)) !important; box-sizing: border-box;
  height: auto !important; min-height: 0 !important; flex: none !important; margin: auto !important; justify-content: flex-start !important;
}
html.lb-auth [data-lb-card] [class*="_button_"][disabled], html.lb-auth [data-lb-card] button[aria-disabled="true"] { background: #0E1116 !important; color: rgba(255,255,255,.6) !important; opacity: 1 !important; }
html.lb-auth [data-lb-card] * { margin-top: 0 !important; margin-bottom: 0 !important; }
html.lb-auth [data-lb-card] img { display: none !important; }
html.lb-auth [data-lb-card] > * + * { margin-top: 12px !important; }
html.lb-auth [data-lb-card] form > * + *, html.lb-auth [data-lb-card] form > * > * + * { margin-top: 10px !important; }
html.lb-auth [data-lb-card] [style*="lb-mark"], html.lb-auth [data-lb-card] div:empty[class] { background-size: contain !important; }
/* Hint or error text under a field gets air above it; the submit button gets a clear gap from the text above. */
html.lb-auth [data-lb-card] form p,
html.lb-auth [data-lb-card] form [class*="_error_"] { margin-top: 6px !important; }
html.lb-auth [data-lb-card] form > *:has(button[type="submit"]),
html.lb-auth [data-lb-card] form > * > *:has(> button[type="submit"]) { margin-top: 20px !important; }
html.lb-auth [data-lb-card] input { background: #FFFFFF !important; height: 38px !important; }
html.lb-auth [data-lb-card] button { height: 38px !important; }
html.lb-auth [data-lb-card] button:disabled { background: #0E1116 !important; color: rgba(255,255,255,.6) !important; opacity: 1 !important; }

/* Dashboard number tiles: one grid row, so the title sits left and the number right.
   Upstream stacks them and needs two rows, which left a tall empty band. Display only. */
.react-grid-item .widget:has(h2[data-size="xxl"]) { flex-direction: row !important; align-items: center !important; gap: 12px; padding-top: 0 !important; padding-bottom: 0 !important; }
.react-grid-item .widget:has(h2[data-size="xxl"]) > .widget-card-header { flex: 1 1 auto; min-width: 0; padding: 0 !important; height: auto !important; }
.react-grid-item .widget:has(h2[data-size="xxl"]) > div:not(.widget-card-header) { flex: none !important; height: auto !important; width: auto !important; padding: 0 !important; overflow: visible !important; }
.react-grid-item .widget h2[data-size="xxl"] { font-size: 28px !important; line-height: 1 !important; margin: 0 !important; }

/* Dashboards: glass cards on the gradient (take A Mist). Display only. */
.page-layout-scroll-wrapper:has(.react-grid-layout) { background: transparent !important; }
.page-layout-scroll-wrapper:has(.react-grid-layout) .react-grid-layout { background: transparent !important; }
.react-grid-item > .widget {
  background: var(--lb-glass) !important; border: 0 !important; border-radius: 22px !important; box-shadow: var(--lb-glass-shadow) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
}
.react-grid-item .widget-card-header [dir="auto"] { font-size: 12px !important; font-weight: 500 !important; color: #5E6B78 !important; letter-spacing: .01em; }
.react-grid-item > .widget:has(h2[data-size="xxl"]) { padding-left: 18px !important; padding-right: 20px !important; }
.react-grid-item .widget h2[data-size="xxl"] { font-size: 32px !important; color: #0E1116 !important; font-weight: 300 !important; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.react-grid-item .widget svg text { fill: #8A95A1 !important; font-size: 11px !important; }
/* Yellow chart series draw in ink on dashboards. Bars draw on a canvas from these tokens. lb-dash is set by the shim. */
html.light.lb-dash { --t-color-yellow7: #0E1116 !important; --t-color-yellow8: #0E1116 !important; --t-color-yellow9: #0E1116 !important; --t-color-yellow10: #0E1116 !important; }

/* Page widgets: a bridge-app front component draws the whole dashboard (root marked data-lb-page).
   The component brings its own glass cards, so the widget frame and header stay off. Keep this block last. */
.page-layout-scroll-wrapper:has([data-lb-page]) { background: transparent !important; }
.react-grid-item > .widget:has([data-lb-page]),
.react-grid-item > .widget:has([data-lb-page]):hover { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.react-grid-item > .widget:has([data-lb-page]) > .widget-card-header { display: none !important; }
.react-grid-item > .widget:has([data-lb-page]) div:has(> div > [data-lb-page]),
.react-grid-item > .widget:has([data-lb-page]) div:has(> [data-lb-page]) { padding: 0 !important; margin: 0 !important; }
