/* LBSA UI kit — component styles. Needs lbsa-tokens.css. Every rule is scoped to .lb-* classes so the kit can sit
   beside existing page styles (Bootstrap in the back office) without fighting them. */

/* ---------- tones: components read --tone* ---------- */
.lb-tone-neutral { --tone: var(--lb-text-2); --tone-solid: #1b2533; --tone-ink: #fff; --tone-soft: var(--lb-neutral-soft); --tone-text: var(--lb-text-2); --tone-line: var(--lb-border-2); }
.lb-tone-accent { --tone: var(--lb-accent); --tone-solid: var(--lb-grad); --tone-ink: var(--lb-accent-ink); --tone-soft: var(--lb-accent-soft); --tone-text: var(--lb-accent-text); --tone-line: rgba(255, 138, 31, .45); }
.lb-tone-danger { --tone: var(--lb-danger); --tone-solid: var(--lb-danger); --tone-ink: #fff; --tone-soft: var(--lb-danger-soft); --tone-text: var(--lb-danger-ink); --tone-line: rgba(214, 69, 69, .45); }
.lb-tone-warning { --tone: var(--lb-warning); --tone-solid: #e59500; --tone-ink: #1f1300; --tone-soft: var(--lb-warning-soft); --tone-text: var(--lb-warning-ink); --tone-line: rgba(217, 138, 0, .45); }
.lb-tone-success { --tone: var(--lb-success); --tone-solid: #15804e; --tone-ink: #fff; --tone-soft: var(--lb-success-soft); --tone-text: var(--lb-success-ink); --tone-line: rgba(31, 157, 99, .45); }
.lb-tone-info { --tone: var(--lb-info); --tone-solid: #1a6fba; --tone-ink: #fff; --tone-soft: var(--lb-info-soft); --tone-text: var(--lb-info-ink); --tone-line: rgba(31, 127, 209, .45); }
[data-theme="dark"] .lb-tone-neutral { --tone-solid: #e6ebf2; --tone-ink: #0b1017; }

/* ---------- utilities ---------- */
/* visually hidden, still read by screen readers */
.lb-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- buttons ---------- */
.lb-btn, .lb-btn-reset { font: inherit; }
.lb-btn {
  --h: var(--lb-control); --px: 14px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: fit-content; min-height: var(--h); min-width: var(--h); padding: 4px var(--px); border-radius: var(--lb-radius);
  font: 600 var(--lb-text-md)/1.2 var(--lb-font-body); letter-spacing: -.005em; text-align: center; text-decoration: none;
  border: 1px solid transparent; background: transparent; color: var(--tone-text); cursor: pointer; user-select: none;
  transition: background-color var(--lb-dur-2), border-color var(--lb-dur-2), color var(--lb-dur-2), box-shadow var(--lb-dur-2), transform var(--lb-dur-1) var(--lb-ease), filter var(--lb-dur-2);
}
.lb-btn > .bi { font-size: 1.05em; line-height: 1; }
.lb-btn:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.lb-btn:disabled { cursor: not-allowed; opacity: .5; }
a.lb-btn[aria-disabled="true"] { cursor: not-allowed; opacity: .5; pointer-events: none; }
.lb-btn[aria-busy="true"] { opacity: .8; cursor: progress; }
.lb-btn--sm { --h: var(--lb-control-sm); --px: 10px; font-size: var(--lb-text-sm); border-radius: var(--lb-radius-sm); gap: 5px; }
.lb-btn--lg { --h: var(--lb-control-lg); --px: 20px; font-size: var(--lb-text-lg); border-radius: var(--lb-radius-md); }
.lb-btn--block { display: flex; width: 100%; }
.lb-btn--icon { padding: 0; width: var(--h); }
/* a label longer than the room it gets wraps inside the outline (a flex row at phone width) instead of running past it;
   inside a grid table a button stays on one line (the table scrolls sideways) unless the grid is stacked as cards */
.lb-grid__table .lb-btn { white-space: nowrap; }
.lb-btn__trail { margin-left: 2px; font-size: .85em !important; opacity: .7; }

.lb-btn--outline { background: var(--lb-surface); border-color: var(--lb-border-2); box-shadow: var(--lb-shadow-1); }
.lb-btn--outline.lb-tone-neutral { color: var(--lb-text); }
.lb-btn--outline:hover:not(:disabled) { border-color: var(--tone-line); background: var(--tone-soft); }
.lb-btn--outline.lb-tone-neutral:hover:not(:disabled) { border-color: var(--lb-border-3); background: var(--lb-surface-2); }

.lb-btn--solid { background: var(--tone-solid); color: var(--tone-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 1px 2px rgba(11, 16, 23, .12); }
.lb-btn--solid:hover:not(:disabled) { filter: brightness(1.05) saturate(1.05); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 16px -8px var(--tone); }
.lb-btn--solid.lb-tone-accent { text-shadow: 0 1px 0 rgba(255, 255, 255, .25); }

.lb-btn--soft { background: var(--tone-soft); }
.lb-btn--soft:hover:not(:disabled) { background: color-mix(in srgb, var(--tone) 22%, transparent); }

.lb-btn--ghost { color: var(--lb-text-2); }
.lb-btn--ghost:not(.lb-tone-neutral) { color: var(--tone-text); }
.lb-btn--ghost:hover:not(:disabled) { background: var(--tone-soft); color: var(--lb-text); }
.lb-btn--ghost:not(.lb-tone-neutral):hover:not(:disabled) { color: var(--tone-text); }

.lb-btn--link { height: auto; min-height: 0; min-width: 0; padding: 0; color: var(--lb-accent-text); border: 0; font-weight: 600; }
.lb-btn--link:not(.lb-tone-neutral):not(.lb-tone-accent) { color: var(--tone-text); }
.lb-btn--link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }

.lb-btn-reset { cursor: pointer; }

/* ---------- spinner ---------- */
.lb-spin {
  display: inline-block; width: 1em; height: 1em; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; opacity: .85;
  animation: lb-spin .7s linear infinite;
}
.lb-spin--sm { width: 12px; height: 12px; border-width: 2px; }
.lb-spin--lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes lb-spin { to { transform: rotate(360deg); } }

/* ---------- badges ---------- */
.lb-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--lb-radius-pill);
  font: 600 var(--lb-text-xs)/1 var(--lb-font-body); letter-spacing: .01em; white-space: nowrap; vertical-align: middle;
  background: var(--tone-soft); color: var(--tone-text);
}
.lb-badge--solid { background: var(--tone-solid); color: var(--tone-ink); }
.lb-badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--tone-line); }
.lb-badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 20%, transparent); }
.lb-badge .bi { font-size: 12px; }

/* ---------- cards ---------- */
.lb-card { background: var(--lb-surface); border: 1px solid var(--lb-border); border-radius: var(--lb-radius-md); box-shadow: var(--lb-shadow-1); min-width: 0; }
.lb-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px var(--lb-space-3); padding: 14px 18px; border-bottom: 1px solid var(--lb-border); }
/* the titles keep at least 220px; when the actions don't fit beside them (narrow cards, phones) they drop to their own row */
.lb-card__titles { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 220px; }
.lb-card__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--lb-accent-soft); color: var(--lb-accent-text); font-size: 16px; flex: none; }
.lb-card__title { margin: 0; font: 600 15px/1.25 var(--lb-font-head); letter-spacing: -.01em; color: var(--lb-text); }
.lb-card__sub { margin: 2px 0 0; font-size: var(--lb-text-sm); color: var(--lb-muted); }
.lb-card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-card__body { padding: 18px; }
.lb-card--flush > .lb-card__body { padding: 0; }
.lb-card__foot { padding: 12px 18px; border-top: 1px solid var(--lb-border); background: var(--lb-surface-2); border-radius: 0 0 var(--lb-radius-md) var(--lb-radius-md); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- empty state ---------- */
.lb-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 40px 20px; color: var(--lb-muted); }
.lb-empty--compact { padding: 26px 16px; }
.lb-empty__art { position: relative; width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 6px; }
.lb-empty--compact .lb-empty__art { width: 48px; height: 48px; }
.lb-empty__art svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--lb-accent-soft); stroke: var(--lb-accent-soft-2); stroke-width: 1.5; }
.lb-empty__art .bi { position: relative; font-size: 22px; color: var(--lb-accent-text); }
.lb-empty__title { margin: 0; font: 600 15px/1.3 var(--lb-font-head); color: var(--lb-text); }
.lb-empty__text { margin: 0; max-width: 42ch; font-size: var(--lb-text-sm); }
.lb-empty__actions { margin-top: 10px; display: flex; gap: 8px; }

/* ---------- skeleton ---------- */
.lb-skel { display: block; height: 12px; width: 100%; border-radius: 6px; background: var(--lb-skeleton); background-size: 200% 100%; animation: lb-shimmer 1.3s ease-in-out infinite; }
.lb-skel--circle { border-radius: 50%; width: 36px; height: 36px; }
.lb-skel-lines { display: grid; gap: 9px; }
@keyframes lb-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- progress ---------- */
.lb-progress { position: relative; height: 6px; border-radius: 99px; background: var(--lb-sunken); overflow: hidden; }
.lb-progress__bar { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--tone-solid); transition: width var(--lb-dur-3) var(--lb-ease); }
.lb-progress--indeterminate .lb-progress__bar { width: 38%; animation: lb-indet 1.2s var(--lb-ease) infinite; }
.lb-progress__label { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--lb-text-xs); color: var(--lb-muted); font-variant-numeric: tabular-nums; }
@keyframes lb-indet { from { transform: translateX(-100%); } to { transform: translateX(270%); } }

/* ---------- hex loader ---------- */
.lb-hexload { display: grid; justify-items: center; gap: 14px; padding: 24px; color: var(--lb-muted); }
.lb-hexload__art { width: 72px; height: 72px; overflow: visible; }
.lb-hexload--sm .lb-hexload__art { width: 40px; height: 40px; }
.lb-hexload--lg .lb-hexload__art { width: 110px; height: 110px; }
.lb-hexload__cell { fill: var(--lb-sunken); stroke: var(--lb-border-2); stroke-width: 1.5; animation: lb-hexpulse 1.44s var(--lb-ease) infinite; animation-delay: calc(var(--i) * .24s); transform-box: fill-box; transform-origin: center; }
.lb-hexload__core { fill: var(--lb-accent); opacity: .92; animation: lb-hexcore 1.44s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.lb-hexload__text { font: 500 var(--lb-text-sm) var(--lb-font-body); letter-spacing: .01em; }
.lb-hexload__progress { width: 180px; }
@keyframes lb-hexpulse { 0%, 100% { fill: var(--lb-sunken); stroke: var(--lb-border-2); scale: .92; } 18% { fill: var(--lb-orange-2); stroke: var(--lb-orange); scale: 1.04; } 40% { fill: var(--lb-accent-soft-2); stroke: var(--lb-border-2); scale: .96; } }
@keyframes lb-hexcore { 0%, 100% { scale: .82; opacity: .75; } 50% { scale: 1; opacity: 1; } }

/* boot loader (inline markup in App.razor; hidden by LBSA.UI.lib.module.js) */
#lb-boot { position: fixed; inset: 0; z-index: var(--lb-z-loader); display: grid; place-items: center; background: var(--lb-bg); transition: opacity .45s var(--lb-ease), visibility .45s; }
#lb-boot.is-done { opacity: 0; visibility: hidden; }

/* ---------- fields ---------- */
.lb-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.lb-field__label { font: 600 var(--lb-text-sm)/1.2 var(--lb-font-body); color: var(--lb-text-2); }
.lb-field__req { color: var(--lb-danger); margin-left: 3px; }
.lb-field__hint { font-size: var(--lb-text-xs); color: var(--lb-muted); }
.lb-field__error { font-size: var(--lb-text-xs); color: var(--lb-danger-ink); display: flex; gap: 5px; align-items: center; }
.lb-field__error::before { content: "\F33A"; font-family: "bootstrap-icons"; }

.lb-input, .lb-inputwrap, .lb-select, .lb-range {
  --h: var(--lb-control);
  width: 100%; min-width: 0; border: 1px solid var(--lb-border-2); border-radius: var(--lb-radius); background: var(--lb-surface); color: var(--lb-text);
  font: 400 var(--lb-text-md)/1.4 var(--lb-font-body); box-shadow: 0 1px 1px rgba(11, 16, 23, .03);
  transition: border-color var(--lb-dur-2), box-shadow var(--lb-dur-2), background-color var(--lb-dur-2);
}
.lb-input { height: var(--h); padding: 0 12px; }
.lb-textarea { height: auto; min-height: calc(var(--h) * 2); padding: 9px 12px; resize: vertical; line-height: 1.5; }
.lb-input--sm, .lb-inputwrap--sm, .lb-select--sm { --h: var(--lb-control-sm); font-size: var(--lb-text-sm); border-radius: var(--lb-radius-sm); }
.lb-input--lg, .lb-inputwrap--lg, .lb-select--lg { --h: var(--lb-control-lg); font-size: var(--lb-text-lg); }
.lb-input::placeholder, .lb-inputwrap__input::placeholder { color: var(--lb-dim); }
.lb-input:hover:not(:disabled), .lb-inputwrap:hover:not(.is-disabled), .lb-select:hover:not(.is-disabled), .lb-range:hover:not(.is-disabled) { border-color: var(--lb-border-3); }
.lb-input:focus, .lb-inputwrap:focus-within, .lb-select:focus-within, .lb-select.is-open, .lb-range:focus-within { outline: none; border-color: var(--lb-accent); box-shadow: var(--lb-focus); }
.lb-input:disabled, .lb-inputwrap.is-disabled, .lb-select.is-disabled, .lb-range.is-disabled { background: var(--lb-surface-3); color: var(--lb-muted); cursor: not-allowed; box-shadow: none; }
.lb-input.is-invalid, .lb-inputwrap.is-invalid, .lb-select.is-invalid, .lb-range.is-invalid { border-color: var(--lb-danger); }
.lb-input.is-invalid:focus, .lb-inputwrap.is-invalid:focus-within, .lb-select.is-invalid:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lb-danger) 22%, transparent); }

.lb-inputwrap { display: flex; align-items: center; height: var(--h); padding: 0 4px 0 0; }
.lb-inputwrap__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; padding: 0 0 0 12px; }
.lb-inputwrap__icon { flex: none; margin-left: 11px; color: var(--lb-dim); font-size: 14px; }
.lb-inputwrap__icon + .lb-inputwrap__input { padding-left: 8px; }
.lb-inputwrap__affix { flex: none; padding: 0 8px 0 12px; color: var(--lb-muted); font-weight: 500; font-size: var(--lb-text-sm); }
.lb-inputwrap__input + .lb-inputwrap__affix { padding: 0 8px 0 4px; }
.lb-inputwrap__clear { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--lb-dim); cursor: pointer; font-size: 11px; }
.lb-inputwrap__clear:hover { background: var(--lb-surface-3); color: var(--lb-text); }
.lb-number .lb-inputwrap__input { font-variant-numeric: tabular-nums; text-align: right; padding-right: 10px; width: 100%; }
.lb-number__steps { display: grid; grid-template-rows: 1fr 1fr; height: calc(100% - 6px); border-left: 1px solid var(--lb-border); margin-left: 2px; }
.lb-number__steps button { border: 0; background: transparent; color: var(--lb-dim); width: 22px; font-size: 10px; cursor: pointer; padding: 0; }
.lb-number__steps button:hover { color: var(--lb-accent-text); background: var(--lb-accent-soft); }
.lb-number__btn { flex: none; display: grid; place-items: center; width: 44px; align-self: stretch; border: 0; background: transparent; color: var(--lb-text-2); font-size: 18px; cursor: pointer; }
.lb-number__btn:hover { background: var(--lb-accent-soft); color: var(--lb-accent-text); }
.lb-date .lb-inputwrap__input, .lb-range .lb-inputwrap__input { font-variant-numeric: tabular-nums; }
.lb-date input::-webkit-calendar-picker-indicator, .lb-range input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.lb-range__icon { color: var(--lb-dim); font-size: 14px; }
/* .lb-pop (later in the file) sets display, padding and max-width: these popovers need the higher specificity */
.lb-pop.lb-range__pop { display: grid; grid-template-columns: 150px auto; padding: 0; max-width: min(760px, calc(100vw - 16px)); overflow: auto; }
.lb-pop.lb-range__pop--plain { grid-template-columns: auto; }
.lb-range__presets { display: grid; align-content: start; gap: 2px; padding: 8px; border-right: 1px solid var(--lb-border); background: var(--lb-surface-2); }
.lb-range__preset { text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 7px 10px; font: 500 var(--lb-text-sm) var(--lb-font-body); color: var(--lb-text-2); cursor: pointer; }
.lb-range__preset:hover { background: var(--lb-surface-3); color: var(--lb-text); }
.lb-range__preset:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-range__preset.is-active { background: var(--lb-accent-soft); color: var(--lb-accent-text); font-weight: 600; }
.lb-range__main { display: grid; gap: 10px; padding: 12px; align-content: start; }
.lb-range__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lb-range__fields .lb-input { font-variant-numeric: tabular-nums; }
.lb-range__count { font-size: var(--lb-text-sm); color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lb-range__actions { display: flex; justify-content: flex-end; gap: 6px; margin-left: auto; }

/* calendar (LbCalendar, the date pickers' popovers) */
.lb-cal { display: grid; gap: 8px; user-select: none; }
.lb-cal__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.lb-cal__title { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 6px 8px; font: 600 var(--lb-text-md) var(--lb-font-head); color: var(--lb-text); cursor: pointer; }
.lb-cal__title:hover, .lb-cal__nav:hover { background: var(--lb-surface-2); color: var(--lb-text); }
.lb-cal__nav { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--lb-muted); cursor: pointer; }
.lb-cal__title:focus-visible, .lb-cal__nav:focus-visible, .lb-cal__day:focus-visible, .lb-cal__cell:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-cal__months { display: flex; gap: 16px; }
.lb-cal__grid { border-collapse: separate; border-spacing: 2px; }
.lb-cal__grid caption { caption-side: top; }
.lb-cal__caption { padding: 0 0 4px; text-align: center; font: 600 var(--lb-text-sm) var(--lb-font-body); color: var(--lb-text-2); }
.lb-cal__grid th { width: 36px; height: 28px; font: 600 11px var(--lb-font-body); color: var(--lb-dim); text-transform: uppercase; }
.lb-cal__grid td { padding: 0; text-align: center; }
.lb-cal__day { width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--lb-text); font: 500 var(--lb-text-sm) var(--lb-font-body); font-variant-numeric: tabular-nums; cursor: pointer; }
.lb-cal__day:hover:not(:disabled) { background: var(--lb-surface-2); }
.lb-cal__day.is-outside { color: var(--lb-dim); }
.lb-cal__day.is-today { box-shadow: inset 0 0 0 1px var(--lb-accent); }
.lb-cal__day.is-inrange, .lb-cal__day.is-preview { background: var(--lb-accent-soft); border-radius: 4px; }
.lb-cal__day.is-selected, .lb-cal__day.is-start, .lb-cal__day.is-end { background: var(--lb-accent); color: var(--lb-accent-ink); }
.lb-cal__day:disabled { opacity: .4; cursor: not-allowed; }
.lb-cal__cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.lb-cal__cell { height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--lb-text); font: 500 var(--lb-text-sm) var(--lb-font-body); cursor: pointer; }
.lb-cal__cell:hover:not(:disabled) { background: var(--lb-surface-2); }
.lb-cal__cell.is-outside { color: var(--lb-dim); }
.lb-cal__cell.is-selected { background: var(--lb-accent); color: var(--lb-accent-ink); }
.lb-cal__cell:disabled { opacity: .4; cursor: not-allowed; }
.lb-cal__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lb-date { position: relative; }
.lb-date .lb-select__clear { position: static; flex: none; }
.lb-date__toggle { flex: none; display: grid; place-items: center; width: 32px; height: 100%; border: 0; background: transparent; color: var(--lb-dim); cursor: pointer; border-radius: var(--lb-radius-sm); }
.lb-date__toggle:hover:not(:disabled) { color: var(--lb-accent-text); }
.lb-date__toggle:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-date__toggle:disabled { cursor: not-allowed; }
/* sized to the calendar, not the field: popover.open sets an inline min-width (the anchor's) that would beat max-width */
.lb-pop.lb-date__pop { padding: 10px; width: max-content; min-width: 0 !important; max-width: min(340px, calc(100vw - 16px)); overflow: auto; }
/* phones stack the months (none is hidden: the keyboard cursor and a preset's end can sit in the second one) */
@media (max-width: 560px) { .lb-pop.lb-range__pop { grid-template-columns: 1fr; } .lb-cal__months { flex-direction: column; } }
@media (max-width: 480px) { .lb-pop.lb-range__pop { grid-template-columns: 1fr; } .lb-range__presets { grid-template-columns: 1fr 1fr; border-right: 0; border-bottom: 1px solid var(--lb-border); } }

/* checkbox + switch */
.lb-check, .lb-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--lb-text-md); color: var(--lb-text); vertical-align: middle; user-select: none; }
.lb-check.is-disabled, .lb-switch.is-disabled { cursor: not-allowed; opacity: .55; }
.lb-check__input, .lb-switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.lb-check__box { flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--lb-border-3); background: var(--lb-surface); display: grid; place-items: center; transition: background-color var(--lb-dur-2), border-color var(--lb-dur-2), box-shadow var(--lb-dur-2); }
.lb-check__box svg { width: 13px; height: 13px; fill: none; stroke: var(--lb-accent-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 14; stroke-dashoffset: 14; transition: stroke-dashoffset var(--lb-dur-3) var(--lb-ease-out); }
.lb-check__input:checked + .lb-check__box { background: var(--lb-accent); border-color: var(--lb-accent); }
.lb-check__input:checked + .lb-check__box svg { stroke-dashoffset: 0; }
.lb-check:hover .lb-check__input:not(:disabled) + .lb-check__box { border-color: var(--lb-accent); }
.lb-check__input:focus-visible + .lb-check__box, .lb-switch__input:focus-visible + .lb-switch__track { box-shadow: var(--lb-focus); }
.lb-check--top, .lb-switch--top { align-items: flex-start; }
.lb-check__desc, .lb-switch__desc { display: block; margin-top: 2px; font-size: var(--lb-text-sm); font-weight: 400; color: var(--lb-muted); }
.lb-check__input:indeterminate + .lb-check__box { background: var(--lb-accent); border-color: var(--lb-accent); }
.lb-check__input:indeterminate + .lb-check__box svg { display: none; }
.lb-check__input:indeterminate + .lb-check__box::after { content: ""; width: 8px; height: 2px; border-radius: 1px; background: var(--lb-accent-ink); }
.lb-switch__track { flex: none; position: relative; width: 36px; height: 20px; border-radius: 99px; background: var(--lb-border-3); transition: background-color var(--lb-dur-2); }
.lb-switch__thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--lb-dur-3) var(--lb-spring); }
.lb-switch__input:checked + .lb-switch__track { background: var(--lb-accent); }
.lb-switch__input:checked + .lb-switch__track .lb-switch__thumb { transform: translateX(16px); }

/* ---------- select / combobox ---------- */
.lb-select { position: relative; display: flex; align-items: center; height: var(--h); }
.lb-select__trigger { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 34px 0 12px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: inherit; }
.lb-select__trigger:focus-visible { outline: none; }
.lb-select.is-disabled .lb-select__trigger { cursor: not-allowed; }
.lb-select__value, .lb-select__placeholder { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-select__placeholder { color: var(--lb-dim); }
.lb-select__chev { position: absolute; right: 11px; pointer-events: none; color: var(--lb-dim); font-size: 12px; transition: transform var(--lb-dur-2) var(--lb-ease); }
.lb-select.is-open .lb-select__chev { transform: rotate(180deg); color: var(--lb-accent-text); }
.lb-select__clear { position: absolute; right: 28px; display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--lb-dim); cursor: pointer; font-size: 10px; }
.lb-select__clear:hover { background: var(--lb-surface-3); color: var(--lb-text); }
.lb-select:has(.lb-select__clear) .lb-select__trigger { padding-right: 56px; }

.lb-pop {
  position: fixed; inset: auto; margin: 0; padding: 0; z-index: var(--lb-z-popover);
  min-width: 180px; width: var(--lb-pop-width, auto); max-width: min(520px, calc(100vw - 16px));
  background: var(--lb-surface); color: var(--lb-text); border: 1px solid var(--lb-border-2); border-radius: var(--lb-radius-md); box-shadow: var(--lb-shadow-pop);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(-4px) scale(.985); transform-origin: top center; transition: opacity var(--lb-dur-2) var(--lb-ease), transform var(--lb-dur-2) var(--lb-ease-out);
}
.lb-pop[data-side="top"] { transform-origin: bottom center; transform: translateY(4px) scale(.985); }
.lb-pop.is-in { opacity: 1; transform: none; }
.lb-select__search { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--lb-border); color: var(--lb-dim); }
.lb-select__search input { flex: 1; min-width: 0; height: 30px; border: 0; outline: 0; background: transparent; color: var(--lb-text); font: 400 var(--lb-text-md) var(--lb-font-body); }
.lb-select__list { list-style: none; margin: 0; padding: 5px; overflow: auto; max-height: var(--lb-pop-max, 320px); overscroll-behavior: contain; }
.lb-select__opt { position: relative; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 30px 6px 10px; border-radius: 8px; cursor: pointer; font-size: var(--lb-text-md); line-height: 1.35; }
.lb-select__opt.is-active { background: var(--lb-surface-3); }
.lb-select__opt.is-selected { color: var(--lb-accent-text); font-weight: 600; }
.lb-select__tick { position: absolute; right: 9px; color: var(--lb-accent-text); }
.lb-select__none, .lb-select__more { padding: 12px 10px; color: var(--lb-muted); font-size: var(--lb-text-sm); }
.lb-select__more { border-top: 1px dashed var(--lb-border); font-size: var(--lb-text-xs); }
.lb-select__none[role="alert"] { color: var(--lb-danger-ink); }
.lb-select__foot { border-top: 1px solid var(--lb-border); padding: 4px; background: var(--lb-surface-2); }

/* ---------- menus ---------- */
.lb-menu { display: inline-flex; position: relative; }
.lb-menu__pop { padding: 5px; min-width: 200px; }
.lb-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--lb-text); font: 500 var(--lb-text-md) var(--lb-font-body); text-align: left; cursor: pointer; }
.lb-menu__item .bi { color: var(--lb-muted); width: 16px; }
.lb-menu__item:hover:not(:disabled), .lb-menu__item:focus-visible { background: var(--lb-surface-3); outline: none; }
.lb-menu__item.lb-tone-danger { color: var(--lb-danger-ink); }
.lb-menu__item.lb-tone-danger .bi { color: var(--lb-danger); }
.lb-menu__item.lb-tone-danger:hover:not(:disabled) { background: var(--lb-danger-soft); }
.lb-menu__item:disabled { opacity: .45; cursor: not-allowed; }
.lb-menu__item kbd { margin-left: auto; }
.lb-menu__sep { height: 1px; margin: 5px 6px; background: var(--lb-border); }

kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--lb-border-2); border-bottom-width: 2px; background: var(--lb-surface-2); color: var(--lb-muted); font: 600 10.5px/1 var(--lb-font-body); }

/* ---------- dialogs ---------- */
html.lb-modal-open { overflow: hidden; }
.lb-dialog {
  --w: var(--lb-dialog-w, 560px);
  width: min(var(--w), calc(100vw - 32px)); max-width: none; max-height: min(88vh, 960px); padding: 0; margin: auto;
  border: 1px solid var(--lb-border); border-radius: var(--lb-radius-lg); background: var(--lb-surface); color: var(--lb-text);
  box-shadow: var(--lb-shadow-3); overflow: hidden; display: none; flex-direction: column;
}
.lb-dialog[open] { display: flex; animation: lb-dlg-in var(--lb-dur-3) var(--lb-ease-out); }
.lb-dialog.is-closing { animation: lb-dlg-out var(--lb-dur-2) var(--lb-ease) forwards; }
.lb-dialog::backdrop { background: var(--lb-overlay); backdrop-filter: blur(3px); animation: lb-fade var(--lb-dur-3) var(--lb-ease); }
.lb-dialog.is-closing::backdrop { animation: lb-fade-out var(--lb-dur-2) var(--lb-ease) forwards; }
.lb-dialog--sm { --w: 440px; }
.lb-dialog--lg { --w: 820px; }
.lb-dialog--xl { --w: 1140px; }
.lb-dialog--full { --w: 1600px; max-height: 94vh; }
.lb-dialog--top { margin-top: 9vh; }
/* a fixed height (Height="70vh"), capped to the viewport; the body scrolls */
.lb-dialog--h { height: min(var(--lb-dialog-h), calc(100vh - 32px)); height: min(var(--lb-dialog-h), calc(100dvh - 32px)); max-height: none; }
.lb-dialog__actions { display: flex; align-items: center; gap: 6px; height: 32px; margin: -4px 0 0 auto; }   /* the X's box (32 px, lifted 4 px): actions centre on the X's line */
.lb-dialog__actions + .lb-dialog__x { margin-left: 0; }
.lb-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--lb-border); }
.lb-dialog__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lb-dialog__title h2, .lb-dialog__title > div > :first-child { margin: 0; font: 600 17px/1.3 var(--lb-font-head); letter-spacing: -.01em; }
.lb-dialog__sub { margin: 3px 0 0; font-size: var(--lb-text-sm); color: var(--lb-muted); }
.lb-dialog__icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--tone-soft); color: var(--tone-text); font-size: 18px; }
.lb-dialog__x { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin: -4px -6px 0 0; border: 0; border-radius: 9px; background: transparent; color: var(--lb-muted); cursor: pointer; transition: background-color var(--lb-dur-2), color var(--lb-dur-2), transform var(--lb-dur-2) var(--lb-ease); }
.lb-dialog__x:hover { background: var(--lb-surface-3); color: var(--lb-text); transform: rotate(90deg); }
.lb-dialog__x:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-dialog__body { padding: 18px 20px; overflow: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.lb-dialog__foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--lb-border); background: var(--lb-surface-2); }
.lb-dialog__subhead { flex: none; padding: 10px 20px; border-bottom: 1px solid var(--lb-border); background: var(--lb-surface-2); }
.lb-dialog__busy { flex: none; display: grid; gap: 4px; padding: 8px 20px 0; }
.lb-dialog__busybar { height: 3px; }
.lb-dialog__busytext { font-size: var(--lb-text-sm); color: var(--lb-muted); }
.lb-dialog__x:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.lb-dialog__foot-start { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-right: auto; }
.lb-dialog__body--flush { padding: 0; }
.lb-dialog__body--flush > :is(img, video, canvas) { display: block; max-width: 100%; max-height: min(78vh, 900px); margin: 0 auto; object-fit: contain; }
.lb-dialog--drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; border-radius: var(--lb-radius-lg) 0 0 var(--lb-radius-lg); --w: var(--lb-dialog-w, 520px); }
.lb-dialog--drawer[open] { animation: lb-drawer-in var(--lb-dur-3) var(--lb-ease-out); }
.lb-dialog--drawer.is-closing { animation: lb-drawer-out var(--lb-dur-2) var(--lb-ease) forwards; }
.lb-confirm__msg { margin: 0; color: var(--lb-text-2); line-height: 1.55; }
@keyframes lb-dlg-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes lb-dlg-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes lb-drawer-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes lb-drawer-out { to { transform: translateX(40px); opacity: 0; } }
@keyframes lb-fade { from { opacity: 0; } }
@keyframes lb-fade-out { to { opacity: 0; } }
@media (max-width: 640px) {
  .lb-dialog:not(.lb-dialog--drawer) { margin: auto 0 0; width: 100vw; max-height: 92vh; border-radius: 20px 20px 0 0; border-bottom: 0; }
  .lb-dialog:not(.lb-dialog--drawer)[open] { animation: lb-sheet-in var(--lb-dur-3) var(--lb-ease-out); }
  .lb-dialog:not(.lb-dialog--drawer).is-closing { animation: lb-sheet-out var(--lb-dur-2) var(--lb-ease) forwards; }
  .lb-dialog__foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .lb-dialog__foot > .lb-btn { flex: 1; }
  .lb-dialog--drawer { width: 100vw; border-radius: 0; }
  .lb-dialog--h:not(.lb-dialog--drawer) { height: min(var(--lb-dialog-h), 92vh); height: min(var(--lb-dialog-h), 92dvh); }
  .lb-dialog__foot-start { flex: 1 1 100%; margin-right: 0; }
  .lb-dialog__foot-start > .lb-btn { flex: 1; }
  .lb-dialog--phone-full:not(.lb-dialog--drawer) { margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .lb-dialog--phone-full .lb-dialog__head { padding-top: max(18px, env(safe-area-inset-top)); }
  @keyframes lb-sheet-in { from { transform: translateY(100%); } }
  @keyframes lb-sheet-out { to { transform: translateY(100%); } }
}

/* ---------- toasts ---------- */
.lb-toasts { position: fixed; top: 16px; right: 16px; z-index: var(--lb-z-toast); display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.lb-toast {
  position: relative; pointer-events: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px;
  padding: 12px 12px 12px 14px; border-radius: var(--lb-radius-md); background: var(--lb-surface); border: 1px solid var(--lb-border); box-shadow: var(--lb-shadow-pop); overflow: hidden;
  animation: lb-toast-in var(--lb-dur-3) var(--lb-spring);
}
.lb-toast__icon { color: var(--tone); font-size: 17px; margin-top: 1px; }
.lb-toast__text { display: grid; gap: 2px; font-size: var(--lb-text-sm); line-height: 1.45; color: var(--lb-text-2); }
.lb-toast__text strong { color: var(--lb-text); font-size: var(--lb-text-md); }
.lb-toast__x { border: 0; background: transparent; color: var(--lb-dim); cursor: pointer; width: 24px; height: 24px; border-radius: 6px; font-size: 11px; }
.lb-toast__x:hover { background: var(--lb-surface-3); color: var(--lb-text); }
.lb-toast__timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--tone); transform-origin: left; animation: lb-toast-timer var(--lb-toast-dur) linear forwards; opacity: .6; }
.lb-toast:hover .lb-toast__timer { animation-play-state: paused; }
@keyframes lb-toast-in { from { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes lb-toast-timer { to { transform: scaleX(0); } }
@media (max-width: 640px) { .lb-toasts { top: auto; bottom: 16px; left: 16px; right: 16px; width: auto; } }
/* the host is a manual popover (top layer, above open dialogs): undo the UA [popover] box so it stays where it was */
.lb-toasts[popover] { inset: 16px 16px auto auto; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; overflow: visible; }
@media (max-width: 640px) { .lb-toasts[popover] { inset: auto 16px 16px 16px; } }

/* ---------- tabs ---------- */
.lb-tabs__list { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--lb-border); overflow-x: auto; scrollbar-width: none; }
.lb-tabs__tab { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--lb-muted); font: 600 var(--lb-text-md) var(--lb-font-body); cursor: pointer; white-space: nowrap; transition: color var(--lb-dur-2); }
.lb-tabs__tab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--lb-accent); transform: scaleX(0); transition: transform var(--lb-dur-3) var(--lb-ease-out); }
.lb-tabs__tab:hover:not(:disabled) { color: var(--lb-text); }
.lb-tabs__tab.is-active { color: var(--lb-text); }
.lb-tabs__tab.is-active::after { transform: scaleX(1); }
.lb-tabs__tab:focus-visible { outline: none; box-shadow: inset var(--lb-focus); border-radius: 8px; }
.lb-tabs__tab:disabled { opacity: .45; cursor: not-allowed; }
.lb-tabs__count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 99px; background: var(--lb-surface-3); color: var(--lb-muted); font-size: 11px; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.lb-tabs__tab.is-active .lb-tabs__count { background: var(--lb-accent-soft); color: var(--lb-accent-text); }
.lb-tabs__tools { margin-left: auto; display: flex; gap: 8px; padding-left: 8px; }
.lb-tabs__panel { padding-top: 16px; animation: lb-fade var(--lb-dur-2) var(--lb-ease); }
.lb-tabs__panel:focus-visible { outline: none; }
/* a narrow tab row scrolls: fade its end so the hidden tabs are hinted at */
@media (max-width: 640px) {
  .lb-tabs__list { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 24px; }
  .lb-tabs__tab { padding: 0 10px; }
}
.lb-tabs--pills .lb-tabs__list { border: 0; background: var(--lb-sunken); padding: 3px; border-radius: 11px; display: inline-flex; }
.lb-tabs--pills .lb-tabs__tab { height: 32px; border-radius: 8px; }
.lb-tabs--pills .lb-tabs__tab::after { display: none; }
.lb-tabs--pills .lb-tabs__tab.is-active { background: var(--lb-surface); box-shadow: var(--lb-shadow-1); }

/* ---------- accordion ---------- */
.lb-accordion { display: grid; gap: 8px; }
.lb-acc { border: 1px solid var(--lb-border); border-radius: var(--lb-radius-md); background: var(--lb-surface); overflow: hidden; transition: box-shadow var(--lb-dur-2), border-color var(--lb-dur-2); }
.lb-acc.is-open { box-shadow: var(--lb-shadow-2); border-color: var(--lb-border-2); }
.lb-acc__head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; border: 0; background: transparent; color: var(--lb-text); font: 600 var(--lb-text-md) var(--lb-font-body); text-align: left; cursor: pointer; }
.lb-acc__head:hover { background: var(--lb-surface-2); }
.lb-acc__head:focus-visible { outline: none; box-shadow: inset var(--lb-focus); }
.lb-acc__title { flex: 1; min-width: 0; }
.lb-acc__title--custom { font-weight: 400; }
.lb-acc__chev { color: var(--lb-dim); transition: transform var(--lb-dur-3) var(--lb-ease); }
.lb-acc.is-open .lb-acc__chev { transform: rotate(180deg); color: var(--lb-accent-text); }
.lb-acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--lb-dur-3) var(--lb-ease-out); }
.lb-acc.is-open .lb-acc__panel { grid-template-rows: 1fr; }
.lb-acc__inner { overflow: hidden; min-height: 0; }
.lb-acc__body { padding: 4px 16px 16px; border-top: 1px solid var(--lb-border); padding-top: 14px; }

/* ---------- grid ---------- */
.lb-grid__defs { display: none; }
.lb-grid { border: 1px solid var(--lb-border); border-radius: var(--lb-radius-md); background: var(--lb-surface); overflow: hidden; box-shadow: var(--lb-shadow-1); }
.lb-grid__toolbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--lb-border); background: var(--lb-surface-2); }
.lb-grid__search { max-width: 280px; }
.lb-grid__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lb-grid__scroll { overflow: auto; position: relative; }
.lb-grid__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--lb-text-md); color: var(--lb-text); }
.lb-grid__table th { position: sticky; top: 0; z-index: 1; background: var(--lb-surface-2); color: var(--lb-muted); font: 600 11.5px/1.2 var(--lb-font-body); letter-spacing: .04em; text-transform: uppercase; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--lb-border); white-space: nowrap; }
.lb-grid__table td { padding: 11px 14px; border-bottom: 1px solid var(--lb-border); vertical-align: middle; }
.lb-grid__table tbody tr:last-child td { border-bottom: 0; }
.lb-grid__table tbody tr { transition: background-color var(--lb-dur-1); }
.lb-grid__table tbody tr:hover { background: var(--lb-surface-2); }
.lb-grid--striped .lb-grid__table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--lb-surface-2) 70%, transparent); }
.lb-grid--dense .lb-grid__table td { padding-top: 7px; padding-bottom: 7px; }
.lb-grid--dense .lb-grid__table th { padding-top: 8px; padding-bottom: 8px; }
.lb-grid--clickable tbody tr { cursor: pointer; }
.lb-grid__table .is-right { text-align: right; font-variant-numeric: tabular-nums; }
.lb-grid__table .is-center { text-align: center; }
.lb-grid__table th.is-right .lb-grid__sortbtn { flex-direction: row-reverse; }
.lb-grid__sortbtn { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.lb-grid__sortbtn:hover { color: var(--lb-text); }
.lb-grid__sortbtn:focus-visible { outline: none; box-shadow: var(--lb-focus); border-radius: 4px; }
.lb-grid__sorticon { font-size: 11px; opacity: 0; transition: opacity var(--lb-dur-2); }
th.is-sortable:hover .lb-grid__sorticon { opacity: .6; }
th.is-sorted { color: var(--lb-text); }
th.is-sorted .lb-grid__sorticon { opacity: 1; color: var(--lb-accent-text); }
.lb-grid__sel { width: 44px; }
.lb-grid__table .is-pin-right, .lb-grid__table .is-pin-left { position: sticky; z-index: 1; background: var(--lb-surface); }
.lb-grid__table th.is-pin-right, .lb-grid__table th.is-pin-left { z-index: 2; background: var(--lb-surface-2); }
.lb-grid__table .is-pin-right { right: 0; box-shadow: inset 1px 0 0 var(--lb-border); }
.lb-grid__table .is-pin-left { left: 0; box-shadow: inset -1px 0 0 var(--lb-border); }
.lb-grid__table tbody tr:hover .is-pin-right, .lb-grid__table tbody tr:hover .is-pin-left { background: var(--lb-surface-2); }
tr.is-selected { background: var(--lb-accent-soft) !important; }
/* RowTone: the tint is layered over an opaque surface, so pinned cells stay opaque (dark mode) and hover still shows */
.lb-grid__table tbody tr.lb-grid__row--info    { --lb-row-tint: var(--lb-info-soft); }
.lb-grid__table tbody tr.lb-grid__row--success { --lb-row-tint: var(--lb-success-soft); }
.lb-grid__table tbody tr.lb-grid__row--danger  { --lb-row-tint: var(--lb-danger-soft); }
.lb-grid__table tbody tr.lb-grid__row--warning { --lb-row-tint: var(--lb-warning-soft); }
.lb-grid__table tbody tr.lb-grid__row--accent  { --lb-row-tint: var(--lb-accent-soft); }
.lb-grid__table tbody tr.lb-grid__row--neutral { --lb-row-tint: var(--lb-neutral-soft); }
.lb-grid__table tbody tr[class*="lb-grid__row--"] > td       { background: linear-gradient(var(--lb-row-tint), var(--lb-row-tint)), var(--lb-surface); }
.lb-grid__table tbody tr[class*="lb-grid__row--"]:hover > td { background: linear-gradient(var(--lb-row-tint), var(--lb-row-tint)), var(--lb-surface-2); }
/* a selected toned row shows the selection tint instead of its tone (same specificity as the tones, so after them) */
.lb-grid__table tbody tr.is-selected { --lb-row-tint: var(--lb-accent-soft); }
.lb-grid__table tbody tr[tabindex]:focus-visible { outline: none; box-shadow: inset var(--lb-focus); }
.lb-grid__empty { border-top: 1px solid var(--lb-border); }
/* Stack: rows become cards on a narrow grid (the first column is the title, the rest label + value pairs) */
.lb-grid--stack { container: lbgrid / inline-size; }
@container lbgrid (max-width: 620px) {
  .lb-grid--stack .lb-grid__table, .lb-grid--stack .lb-grid__table tbody { display: block; }
  .lb-grid--stack .lb-grid__table thead { display: none; }
  .lb-grid--stack .lb-grid__table tbody tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px 14px; border-bottom: 1px solid var(--lb-border); }
  .lb-grid--stack .lb-grid__table tbody tr:last-child { border-bottom: 0; }
  .lb-grid--stack .lb-grid__table td { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; overflow-wrap: anywhere; padding: 0 !important; border: 0; text-align: left; position: static; background: none; box-shadow: none; }
  .lb-grid--stack .lb-grid__table td::before { content: attr(data-label); font: 600 10.5px/1.2 var(--lb-font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--lb-dim); }
  .lb-grid--stack .lb-grid__table td[data-label=""]::before { display: none; }
  .lb-grid--stack .lb-grid__table td:first-child:not(.lb-grid__sel), .lb-grid--stack .lb-grid__table td.lb-grid__sel + td { grid-column: 1 / -1; font-size: var(--lb-text-md); }
  .lb-grid--stack .lb-grid__table td:first-child:not(.lb-grid__sel)::before, .lb-grid--stack .lb-grid__table td.lb-grid__sel + td::before { display: none; }
  .lb-grid--stack .lb-grid__table td.lb-grid__sel { position: absolute; top: 12px; right: 12px; width: auto; }
  .lb-grid--stack.lb-grid--selectable .lb-grid__table td.lb-grid__sel + td { padding-right: 34px !important; }
  .lb-grid--stack .lb-grid__table td:empty { display: none; }
  .lb-grid--stack .lb-grid__table td.lb-stack-wide { grid-column: 1 / -1; }
  .lb-grid--stack .lb-grid__table .lb-btn { white-space: normal; }
  .lb-grid--stack .lb-grid__skelrow td { grid-column: 1 / -1; }
}
.lb-grid__skelrow td .lb-skel { max-width: 140px; }
.lb-grid__pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--lb-border); background: var(--lb-surface-2); font-size: var(--lb-text-sm); color: var(--lb-muted); }
.lb-grid__count { font-variant-numeric: tabular-nums; }
.lb-grid__pages { display: flex; align-items: center; gap: 3px; }
.lb-grid__pbtn { min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--lb-text-2); font: 600 var(--lb-text-sm) var(--lb-font-body); cursor: pointer; font-variant-numeric: tabular-nums; }
.lb-grid__pbtn:hover:not(:disabled) { background: var(--lb-surface); border-color: var(--lb-border-2); }
.lb-grid__pbtn.is-current { background: var(--lb-text); color: var(--lb-surface); }
.lb-grid__pbtn:disabled { opacity: .35; cursor: default; }
.lb-grid__gap { padding: 0 4px; }
.lb-grid__size { display: flex; align-items: center; gap: 8px; margin: 0; }
.lb-grid__size select { height: 30px; border: 1px solid var(--lb-border-2); border-radius: 8px; background: var(--lb-surface); color: var(--lb-text); font: 500 var(--lb-text-sm) var(--lb-font-body); padding: 0 6px; }
@media (max-width: 720px) {
  .lb-grid__pager { justify-content: center; }
  .lb-grid__size { display: none; }
}
/* server mode: a status bar instead of the pager, append skeletons, an error row and the "N new" pill */
.lb-grid__status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--lb-border); background: var(--lb-surface-2); font-size: var(--lb-text-sm); color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lb-grid__skelrow.is-append td { opacity: .7; }
.lb-grid__errrow td { background: var(--lb-danger-soft); color: var(--lb-danger-ink); }
.lb-grid__more--auto:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lb-grid__newbar { position: sticky; top: 0; left: 0; z-index: 3; display: flex; justify-content: center; align-items: flex-start; height: 0; overflow: visible; }
.lb-grid__newbar > .lb-feed__new { position: relative; top: 8px; }

/* ---------- chart ---------- */
.lb-chart { margin: 0; display: grid; gap: 12px; }
.lb-chart__title { font: 600 14px var(--lb-font-head); color: var(--lb-text); }
.lb-chart__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; font-size: var(--lb-text-sm); color: var(--lb-text-2); }
.lb-chart__legend li { display: inline-flex; align-items: center; gap: 7px; }
.lb-chart__legend button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.lb-chart__legend button:focus-visible, .lb-chart__plot:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-chart__legend .is-off { opacity: .45; text-decoration: line-through; }
.lb-chart__legend svg { flex: none; }
.lb-chart__swatch { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.lb-chart__swatch.is-column { height: 10px; width: 10px; border-radius: 3px; opacity: .8; }
.lb-chart__swatch.is-scatter { width: 9px; height: 9px; border-radius: 50%; }
.lb-chart__ytitle { font-size: var(--lb-text-sm); font-weight: 600; color: var(--lb-muted); margin: 0 0 4px; }
.lb-chart__empty { display: grid; place-items: center; height: var(--lb-chart-h); color: var(--lb-muted); font-size: var(--lb-text-sm); border: 1px dashed var(--lb-border-2); border-radius: var(--lb-radius-md); }
.lb-chart__frame { display: grid; grid-template-columns: auto 1fr; grid-template-rows: var(--lb-chart-h) auto; column-gap: 10px; }
.lb-chart__yaxis { position: relative; min-width: 40px; font-size: 11px; color: var(--lb-dim); font-variant-numeric: tabular-nums; }
.lb-chart__yaxis span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.lb-chart__plot { position: relative; border-bottom: 1px solid var(--lb-border-2); }
.lb-chart__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lb-chart__grid { stroke: var(--lb-border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lb-chart__line { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lb-chart__area { opacity: .14; }
.lb-chart__col { rx: 2; }
.lb-chart__dot { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--lb-surface); pointer-events: none; }
.lb-chart__hover { position: absolute; inset: 0; display: grid; }
.lb-chart__band { position: relative; }
.lb-chart__band:hover { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--lb-accent) 8%, transparent)); box-shadow: inset 1px 0 0 color-mix(in srgb, var(--lb-accent) 30%, transparent); }
.lb-chart__tip { position: absolute; top: 8px; left: calc(100% + 6px); z-index: 2; display: none; gap: 4px; min-width: 170px; padding: 9px 11px; border-radius: 10px; background: var(--lb-surface); border: 1px solid var(--lb-border-2); box-shadow: var(--lb-shadow-pop); font-size: 12px; color: var(--lb-text-2); pointer-events: none; }
.lb-chart__band.is-right .lb-chart__tip { left: auto; right: calc(100% + 6px); }
.lb-chart__band:hover .lb-chart__tip { display: grid; }
.lb-chart__hover--linear { position: absolute; inset: 0; display: block; }
.lb-chart__hover--linear .lb-chart__band { position: absolute; top: 0; bottom: 0; }
.lb-chart__band.is-active, .lb-chart__band:focus { background: var(--lb-accent-soft); background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--lb-accent) 8%, transparent)); outline: none; }
.lb-chart__band.is-active .lb-chart__tip, .lb-chart__band:focus .lb-chart__tip { display: grid; }
.lb-chart__hover:hover .lb-chart__band:not(:hover) .lb-chart__tip { display: none; }
.lb-chart__tip small { display: block; color: var(--lb-muted); }
.lb-chart__tip strong { color: var(--lb-text); font-size: 12.5px; }
.lb-chart__tip span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.lb-chart__tip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.lb-chart__tip b { margin-left: auto; padding-left: 12px; color: var(--lb-text); font-variant-numeric: tabular-nums; }
.lb-chart__xaxis { grid-column: 2; position: relative; height: 24px; font-size: 11px; color: var(--lb-dim); }
.lb-chart__xaxis span { position: absolute; top: 6px; transform: translateX(-50%); white-space: nowrap; }
@media (max-width: 640px) {
  .lb-chart__xaxis span.is-odd { display: none; }
  /* phones: tips sit centred at the top of the plot, so a tapped band's tip never runs off the screen */
  .lb-chart__band, .lb-chart__hover--linear .lb-chart__band { position: static; }
  .lb-chart__hover--linear { display: flex; }   /* bands are contiguous from 0, so their widths alone place them */
  .lb-chart__hover--linear .lb-chart__band { flex: none; }
  .lb-chart__tip, .lb-chart__band.is-right .lb-chart__tip { left: 0; right: 0; margin-inline: auto; width: max-content; max-width: 100%; }
}

/* ---------- rich text ---------- */
.lb-rte { border: 1px solid var(--lb-border-2); border-radius: var(--lb-radius); background: var(--lb-surface); overflow: hidden; transition: border-color var(--lb-dur-2), box-shadow var(--lb-dur-2); }
.lb-rte:focus-within { border-color: var(--lb-accent); box-shadow: var(--lb-focus); }
.lb-rte__bar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 5px 6px; border-bottom: 1px solid var(--lb-border); background: var(--lb-surface-2); }
.lb-rte__btn { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--lb-text-2); cursor: pointer; font-size: 15px; }
.lb-rte__btn:hover:not(:disabled) { background: var(--lb-surface-3); color: var(--lb-text); }
.lb-rte__sep { width: 1px; height: 18px; margin: 0 4px; background: var(--lb-border-2); }
.lb-rte { position: relative; }
.lb-rte__count { position: absolute; right: 10px; bottom: 8px; padding: 2px 6px; border-radius: 6px; background: var(--lb-surface-2); font-size: 11px; color: var(--lb-dim); font-variant-numeric: tabular-nums; pointer-events: none; }
.lb-rte__count.is-over { color: var(--lb-danger); font-weight: 600; }
.lb-rte__area { height: var(--lb-rte-h, 280px); overflow: auto; padding: 14px 16px; outline: none; font-size: var(--lb-text-md); line-height: 1.6; color: var(--lb-text); }
.lb-rte__area:empty::before { content: attr(data-placeholder); color: var(--lb-dim); }
.lb-rte__area h3 { font: 600 16px var(--lb-font-head); margin: 12px 0 6px; }
.lb-rte__area p { margin: 0 0 8px; }
.lb-rte__area blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--lb-accent); background: var(--lb-surface-2); border-radius: 0 8px 8px 0; }
.lb-rte__area a { color: var(--lb-accent-text); }
.lb-rte.is-disabled .lb-rte__area { background: var(--lb-surface-3); color: var(--lb-muted); }
.lb-rte__fmt { height: 30px; border: 1px solid var(--lb-border-2); border-radius: 8px; background: var(--lb-surface); color: var(--lb-text); font: 500 var(--lb-text-sm) var(--lb-font-body); padding: 0 8px; }
.lb-rte__btn[aria-pressed="true"] { background: var(--lb-accent-soft); color: var(--lb-accent-text); }
.lb-rte__link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--lb-border); background: var(--lb-surface-2); }
.lb-rte__link[hidden] { display: none; }
.lb-rte__link input { flex: 1 1 220px; }
.lb-rte__area.is-empty::before { content: attr(data-placeholder); color: var(--lb-dim); pointer-events: none; }
.lb-rte__area h2 { font: 600 19px var(--lb-font-head); margin: 14px 0 6px; }
.lb-rte__area h4 { font: 600 14px var(--lb-font-head); margin: 10px 0 4px; }
.lb-rte__area pre { padding: 8px 10px; border-radius: 8px; background: var(--lb-surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.lb-rte__area ul, .lb-rte__area ol { margin: 0 0 8px; padding-left: 22px; }

/* ---------- command palette ---------- */
.lb-cmdk .lb-dialog__body { padding: 0; }
.lb-cmdk__search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--lb-border); color: var(--lb-dim); font-size: 17px; }
.lb-cmdk__search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--lb-text); font: 400 16px var(--lb-font-body); }
.lb-cmdk__list { list-style: none; margin: 0; padding: 6px; max-height: min(56vh, 460px); overflow: auto; }
.lb-cmdk__group { padding: 10px 10px 4px; font: 600 11px var(--lb-font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--lb-dim); }
.lb-cmdk__item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer; color: var(--lb-text-2); }
.lb-cmdk__item .bi { color: var(--lb-dim); width: 18px; text-align: center; }
.lb-cmdk__item.is-active { background: var(--lb-accent-soft); color: var(--lb-text); }
.lb-cmdk__item.is-active .bi { color: var(--lb-accent-text); }
.lb-cmdk__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lb-cmdk__hint { font-size: 12px; color: var(--lb-dim); }
.lb-cmdk__status { display: flex; align-items: center; gap: 8px; padding: 18px 12px; color: var(--lb-muted); font-size: var(--lb-text-sm); }
.lb-cmdk__foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--lb-border); background: var(--lb-surface-2); font-size: 11.5px; color: var(--lb-dim); }
.lb-cmdk__foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- tooltips: add data-tip="…" to anything ---------- */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: var(--lb-z-popover);
  transform: translate(-50%, 4px); opacity: 0; pointer-events: none; white-space: nowrap;
  padding: 6px 9px; border-radius: 7px; background: #0b1017; color: #fff; font: 500 12px/1.2 var(--lb-font-body); box-shadow: var(--lb-shadow-pop);
  transition: opacity var(--lb-dur-2), transform var(--lb-dur-2) var(--lb-ease-out);
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }

/* ---------- misc ---------- */
.lb-module-error { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: var(--lb-radius); background: var(--lb-danger-soft); color: var(--lb-danger-ink); }

/* ---------- motion: quick, purposeful, never bouncy for its own sake ---------- */
/* buttons: trailing arrows nudge forward, icons settle on press */
.lb-btn__trail { transition: transform var(--lb-dur-2) var(--lb-ease); }
.lb-btn:hover:not(:disabled) .lb-btn__trail { transform: translateX(2px); }
.lb-btn--solid:hover:not(:disabled) { transform: translateY(-1px); }
.lb-btn--solid:active:not(:disabled) { transform: translateY(0) scale(.985); }

/* checkbox: the box gives a small pop when ticked */
.lb-check__input:checked + .lb-check__box { animation: lb-pop var(--lb-dur-3) var(--lb-spring); }
@keyframes lb-pop { 0% { transform: scale(.82); } 100% { transform: scale(1); } }

/* select options arrive in a short cascade */
.lb-pop.is-in .lb-select__opt { animation: lb-rise var(--lb-dur-3) var(--lb-ease-out) both; animation-delay: calc(var(--i, 0) * 14ms); }
.lb-select__tick { animation: lb-pop var(--lb-dur-3) var(--lb-spring); }
@keyframes lb-rise { from { opacity: 0; transform: translateY(4px); } }

/* menus: items cascade */
.lb-pop.is-in .lb-menu__item { animation: lb-rise var(--lb-dur-3) var(--lb-ease-out) both; }
.lb-pop.is-in .lb-menu__item:nth-child(2) { animation-delay: 15ms; }
.lb-pop.is-in .lb-menu__item:nth-child(3) { animation-delay: 30ms; }
.lb-pop.is-in .lb-menu__item:nth-child(4) { animation-delay: 45ms; }
.lb-pop.is-in .lb-menu__item:nth-child(n+5) { animation-delay: 60ms; }

/* dialogs: content follows the panel in */
.lb-dialog[open] .lb-dialog__body > *, .lb-dialog[open] .lb-dialog__foot { animation: lb-rise var(--lb-dur-4) var(--lb-ease-out) both; animation-delay: 60ms; }
.lb-dialog__icon { animation: lb-pop var(--lb-dur-4) var(--lb-spring) both; animation-delay: 80ms; }

/* toasts leave the way they came */
.lb-toast.is-leaving { animation: lb-toast-out 220ms var(--lb-ease) forwards; }
@keyframes lb-toast-out { to { opacity: 0; transform: translateX(28px) scale(.97); } }
.lb-toast__icon { animation: lb-pop var(--lb-dur-4) var(--lb-spring) both; animation-delay: 90ms; }

/* tabs: the panel slides up a touch */
.lb-tabs__panel { animation: lb-rise var(--lb-dur-3) var(--lb-ease-out); }
.lb-tabs__count { transition: background-color var(--lb-dur-2), color var(--lb-dur-2); }

/* accordion: content fades as it opens */
.lb-acc__body { opacity: 0; transition: opacity var(--lb-dur-3) var(--lb-ease); }
.lb-acc.is-open .lb-acc__body { opacity: 1; transition-delay: 60ms; }

/* grid: rows replay a short cascade when the page, sort or page size changes */
.lb-grid__table tbody tr { animation: lb-row-in var(--lb-dur-3) var(--lb-ease-out) both; animation-delay: calc(var(--i, 0) * 16ms); }
@keyframes lb-row-in { from { opacity: 0; transform: translateY(3px); } }
.lb-grid__sorticon { transition: opacity var(--lb-dur-2), transform var(--lb-dur-3) var(--lb-ease); }
th.is-sorted .lb-grid__sorticon { animation: lb-pop var(--lb-dur-3) var(--lb-spring); }
.lb-grid__pbtn { transition: background-color var(--lb-dur-2), color var(--lb-dur-2), border-color var(--lb-dur-2); }

/* charts draw themselves in */
.lb-chart__line--draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: lb-draw 900ms var(--lb-ease-out) forwards 120ms; }
.lb-chart__line--dash, .lb-chart__area { animation: lb-fade 700ms var(--lb-ease) both 300ms; }
.lb-chart__col { transform-box: fill-box; transform-origin: bottom; animation: lb-grow 600ms var(--lb-ease-out) both; animation-delay: var(--d, 0ms); }
.lb-chart__dot { animation: lb-pop 420ms var(--lb-spring) both 700ms; }
@keyframes lb-draw { to { stroke-dashoffset: 0; } }
@keyframes lb-grow { from { transform: scaleY(0); } }
.lb-chart__band .lb-chart__tip { animation: lb-rise var(--lb-dur-2) var(--lb-ease-out); }

/* empty states and loaders */
.lb-empty__art { animation: lb-float 4s ease-in-out infinite; }
@keyframes lb-float { 50% { transform: translateY(-3px); } }
.lb-empty__title, .lb-empty__text, .lb-empty__actions { animation: lb-rise var(--lb-dur-4) var(--lb-ease-out) both; }
.lb-empty__text { animation-delay: 40ms; }
.lb-empty__actions { animation-delay: 80ms; }

/* command palette results */
.lb-cmdk__item { transition: background-color var(--lb-dur-1), color var(--lb-dur-1); }
.lb-cmdk__item .bi { transition: transform var(--lb-dur-2) var(--lb-ease), color var(--lb-dur-1); }
.lb-cmdk__item.is-active .bi { transform: translateX(2px); }

/* ---------- tag input ---------- */
.lb-tags { --h: var(--lb-control); display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: var(--h); padding: 4px 8px;
  border: 1px solid var(--lb-border-2); border-radius: var(--lb-radius); background: var(--lb-surface); cursor: text;
  transition: border-color var(--lb-dur-1), box-shadow var(--lb-dur-2); }
.lb-tags--sm { --h: var(--lb-control-sm); font-size: var(--lb-text-sm); }
.lb-tags:hover:not(.is-disabled) { border-color: var(--lb-border-3); }
.lb-tags:focus-within { border-color: var(--lb-accent); box-shadow: var(--lb-focus); }
.lb-tags.is-invalid { border-color: var(--lb-danger); }
.lb-tags.is-disabled { background: var(--lb-surface-3); cursor: not-allowed; }
.lb-tags__chip { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 4px 0 9px; border-radius: var(--lb-radius-pill);
  background: var(--lb-accent-soft); color: var(--lb-accent-text); font: 600 var(--lb-text-sm)/1 var(--lb-font-body); animation: lb-chip-in var(--lb-dur-2) var(--lb-ease-out) both; }
.lb-tags.is-disabled .lb-tags__chip { padding-right: 9px; }
.lb-tags__x { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: .7;
  transition: background-color var(--lb-dur-1), opacity var(--lb-dur-1); }
.lb-tags__x:hover { background: color-mix(in srgb, var(--lb-accent) 22%, transparent); opacity: 1; }
.lb-tags__input { flex: 1 1 90px; min-width: 90px; height: calc(var(--h) - 10px); border: 0; outline: 0; background: transparent; color: var(--lb-text); font: inherit; }
.lb-tags__input::placeholder { color: var(--lb-dim); }
@keyframes lb-chip-in { from { opacity: 0; transform: scale(.85); } }

/* ---------- file drop zone ---------- */
.lb-drop { position: relative; display: grid; place-items: center; min-height: 132px; padding: 18px; border: 1.5px dashed var(--lb-border-3); border-radius: var(--lb-radius-md);
  background: var(--lb-surface-2); color: var(--lb-text-2); text-align: center; transition: border-color var(--lb-dur-2), background-color var(--lb-dur-2), transform var(--lb-dur-2) var(--lb-ease); }
.lb-drop--compact { min-height: 76px; padding: 12px; }
.lb-drop:hover:not(.is-disabled):not(.is-busy) { border-color: var(--lb-accent); background: var(--lb-accent-soft); }
.lb-drop.is-over { border-color: var(--lb-accent); background: var(--lb-accent-soft); transform: scale(1.01); }
.lb-drop.is-disabled { opacity: .55; }
.lb-drop__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.lb-drop.is-busy .lb-drop__input, .lb-drop.is-disabled .lb-drop__input { cursor: default; }
.lb-drop__input:focus-visible + .lb-drop__body { outline: 2px solid var(--lb-accent); outline-offset: 6px; border-radius: 8px; }
.lb-drop__body { display: grid; justify-items: center; gap: 6px; pointer-events: none; }
.lb-drop__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--lb-surface); color: var(--lb-accent-text); font-size: 20px;
  box-shadow: var(--lb-shadow-1); transition: transform var(--lb-dur-3) var(--lb-ease-out); }
.lb-drop--compact .lb-drop__icon { width: 32px; height: 32px; font-size: 16px; }
.lb-drop:hover .lb-drop__icon, .lb-drop.is-over .lb-drop__icon { transform: translateY(-3px); }
.lb-drop__title { font-weight: 600; color: var(--lb-text); }
.lb-drop__hint { font-size: var(--lb-text-xs); color: var(--lb-muted); }
.lb-drop__bar { width: min(260px, 70vw); }

/* ---------- segmented control ---------- */
.lb-seg { --h: var(--lb-control); position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: var(--lb-radius);
  background: var(--lb-surface-3); isolation: isolate; }
.lb-seg--sm { --h: var(--lb-control-sm); font-size: var(--lb-text-sm); }
.lb-seg--block { display: grid; width: 100%; grid-auto-columns: minmax(0, 1fr); container-type: inline-size; }
.lb-seg--block > .lb-seg__opt { min-width: 0; }
.lb-seg--block > .lb-seg__opt > span { overflow: hidden; text-overflow: ellipsis; }
/* a narrow block control drops its icons before it cuts any words (the width each option gets depends on how many there are) */
@container (max-width: 220px) {
  .lb-seg--block > .lb-seg__opt { padding-inline: 6px; }
  .lb-seg--block > .lb-seg__opt > .bi { display: none; }
}
@container (max-width: 340px) {
  .lb-seg--block:has(> .lb-seg__opt:nth-of-type(3)) > .lb-seg__opt { padding-inline: 6px; }
  .lb-seg--block:has(> .lb-seg__opt:nth-of-type(3)) > .lb-seg__opt > .bi { display: none; }
}
@container (max-width: 460px) {
  .lb-seg--block:has(> .lb-seg__opt:nth-of-type(4)) > .lb-seg__opt { padding-inline: 6px; }
  .lb-seg--block:has(> .lb-seg__opt:nth-of-type(4)) > .lb-seg__opt > .bi { display: none; }
}
.lb-seg__thumb { position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--seg-n)); border-radius: calc(var(--lb-radius) - 3px);
  background: var(--lb-surface); box-shadow: var(--lb-shadow-1), 0 0 0 1px var(--lb-border); transform: translateX(calc(100% * var(--seg-i)));
  transition: transform var(--lb-dur-3) var(--lb-ease-out); }
.lb-seg[data-selected="false"] .lb-seg__thumb { opacity: 0; }
.lb-seg__opt { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: calc(var(--h) - 6px); padding: 0 14px; border: 0; border-radius: calc(var(--lb-radius) - 3px);
  background: transparent; color: var(--lb-muted); font: 600 var(--lb-text-sm)/1 var(--lb-font-body); white-space: nowrap; cursor: pointer; transition: color var(--lb-dur-2); }
.lb-seg__opt:hover:not(:disabled) { color: var(--lb-text); }
.lb-seg__opt.is-active { color: var(--lb-text); }
.lb-seg__opt.is-active .bi { color: var(--lb-accent-text); }
.lb-seg__opt:disabled { opacity: .45; cursor: not-allowed; }
.lb-seg__opt:focus-visible { outline: none; box-shadow: var(--lb-focus); }

/* ---------- sortable ---------- */
.lb-sort { display: grid; gap: 8px; }
.lb-sort--grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lb-sort__item { position: relative; display: flex; align-items: stretch; gap: 6px; border-radius: var(--lb-radius); transition: box-shadow var(--lb-dur-2), opacity var(--lb-dur-2); }
.lb-sort--grid .lb-sort__item { display: block; }
.lb-sort__body { flex: 1; min-width: 0; }
.lb-sort__handle { display: grid; place-items: center; flex: 0 0 26px; border: 0; border-radius: var(--lb-radius-sm); background: transparent; color: var(--lb-dim);
  cursor: grab; touch-action: none; transition: color var(--lb-dur-1), background-color var(--lb-dur-1); }
.lb-sort--grid .lb-sort__handle { position: absolute; z-index: 2; top: 6px; left: 6px; width: 26px; height: 26px; background: color-mix(in srgb, var(--lb-surface) 88%, transparent);
  box-shadow: var(--lb-shadow-1); opacity: 0; }
.lb-sort--grid .lb-sort__item:hover .lb-sort__handle, .lb-sort--grid .lb-sort__handle:focus-visible { opacity: 1; }
.lb-sort__handle:hover { color: var(--lb-text); background: var(--lb-surface-3); }
.lb-sort__handle:focus-visible { outline: none; box-shadow: var(--lb-focus); color: var(--lb-text); }
.lb-sort__item.is-dragging { z-index: 20; opacity: .92; box-shadow: var(--lb-shadow-3); transition: none; pointer-events: none; }
.lb-sort__item.is-dragging .lb-sort__handle { cursor: grabbing; }
.lb-sort.is-sorting { user-select: none; }
.lb-sort__item.is-drop-before::before, .lb-sort__item.is-drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 3px; background: var(--lb-accent);
  box-shadow: 0 0 0 3px var(--lb-accent-soft); animation: lb-fade var(--lb-dur-1); }
.lb-sort__item.is-drop-before::before { top: -6px; }
.lb-sort__item.is-drop-after::after { bottom: -6px; }
.lb-sort--grid .lb-sort__item.is-drop-before::before, .lb-sort--grid .lb-sort__item.is-drop-after::after { top: 0; bottom: 0; width: 3px; height: auto; left: auto; right: auto; }
.lb-sort--grid .lb-sort__item.is-drop-before::before { left: -8px; }
.lb-sort--grid .lb-sort__item.is-drop-after::after { right: -8px; }

/* ---------- stat ---------- */
.lb-stat { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--lb-border); border-radius: var(--lb-radius-md); background: var(--lb-surface);
  box-shadow: var(--lb-shadow-1); animation: lb-rise var(--lb-dur-3) var(--lb-ease-out) both; }
.lb-stat__icon { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: var(--lb-radius); background: var(--tone-soft); color: var(--tone-text); font-size: 17px; }
.lb-stat__text { display: grid; gap: 3px; min-width: 0; }
.lb-stat__label { font: 600 var(--lb-text-xs)/1.2 var(--lb-font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--lb-muted); }
.lb-stat__value { font: 700 22px/1.15 var(--lb-font-head); color: var(--lb-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lb-stat.lb-tone-accent .lb-stat__value, .lb-stat.lb-tone-success .lb-stat__value, .lb-stat.lb-tone-danger .lb-stat__value, .lb-stat.lb-tone-warning .lb-stat__value { color: var(--tone-text); }
.lb-stat__hint { font-size: var(--lb-text-xs); color: var(--lb-muted); }

/* ---------- slider ---------- */
@property --lb-slider-pct { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
.lb-slider { display: grid; gap: 8px; min-width: 0; transition: --lb-slider-pct 180ms var(--lb-ease-out); }
.lb-slider.is-disabled { opacity: .55; }
.lb-slider__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lb-slider__label { font-size: var(--lb-text-sm); font-weight: 600; color: var(--lb-text-2); }
.lb-slider__value { font: 700 var(--lb-text-md)/1 var(--lb-font-head); font-variant-numeric: tabular-nums; color: var(--lb-text); }
.lb-slider__row { display: flex; align-items: center; gap: 10px; }
.lb-slider__track { position: relative; flex: 1; height: 28px; display: flex; align-items: center; }
.lb-slider__track::before { content: ""; position: absolute; left: 0; right: 0; height: 6px; border-radius: 99px; background: var(--lb-surface-3); box-shadow: inset 0 1px 2px rgba(11, 16, 23, .08); }
.lb-slider__fill { position: absolute; left: 0; height: 6px; width: var(--lb-slider-pct); border-radius: 99px; background: var(--lb-grad); pointer-events: none; }
.lb-slider__input { position: relative; z-index: 1; width: 100%; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.lb-slider__input:disabled { cursor: not-allowed; }
.lb-slider__input::-webkit-slider-runnable-track { height: 6px; background: transparent; }
.lb-slider__input::-moz-range-track { height: 6px; background: transparent; }
.lb-slider__input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--lb-surface); border: 2px solid var(--lb-accent);
  box-shadow: 0 2px 6px rgba(11, 16, 23, .18); transition: transform var(--lb-dur-1) var(--lb-ease), box-shadow var(--lb-dur-2) var(--lb-ease); }
.lb-slider__input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--lb-surface); border: 2px solid var(--lb-accent); box-shadow: 0 2px 6px rgba(11, 16, 23, .18); }
.lb-slider__input:hover::-webkit-slider-thumb { transform: scale(1.1); }
.lb-slider__input:active::-webkit-slider-thumb { transform: scale(1.18); box-shadow: 0 0 0 6px color-mix(in srgb, var(--lb-accent) 18%, transparent), 0 2px 6px rgba(11, 16, 23, .18); }
.lb-slider__input:focus-visible { outline: none; }
.lb-slider__input:focus-visible::-webkit-slider-thumb { box-shadow: var(--lb-focus); }
.lb-slider__input:focus-visible::-moz-range-thumb { box-shadow: var(--lb-focus); }
.lb-slider__step { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 1px solid var(--lb-border-2); border-radius: 50%; background: var(--lb-surface);
  color: var(--lb-text-2); cursor: pointer; transition: background var(--lb-dur-1), border-color var(--lb-dur-1), transform var(--lb-dur-1) var(--lb-ease); }
.lb-slider__step:hover:not(:disabled) { border-color: var(--lb-accent); color: var(--lb-accent-text); background: var(--lb-accent-soft); }
.lb-slider__step:active:not(:disabled) { transform: scale(.9); }
.lb-slider__step:disabled { opacity: .45; cursor: not-allowed; }
.lb-slider__step:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-slider__marks { display: flex; justify-content: space-between; font-size: var(--lb-text-xs); color: var(--lb-muted); font-variant-numeric: tabular-nums; }
.lb-slider__row:has(.lb-slider__step) + .lb-slider__marks { padding: 0 40px; }

/* people who asked their OS for less motion get almost none */
@media (prefers-reduced-motion: reduce) {
  .lb-select__opt, .lb-menu__item, .lb-grid__table tbody tr, .lb-tabs__panel, .lb-dialog__body > *, .lb-dialog__foot,
  .lb-empty__art, .lb-empty__title, .lb-empty__text, .lb-empty__actions, .lb-chart__col, .lb-chart__dot, .lb-chart__area, .lb-chart__line--dash,
  .lb-tags__chip, .lb-stat, .lb-feed__item { animation: none !important; }
  .lb-seg__thumb, .lb-drop, .lb-drop__icon, .lb-slider, .lb-slider__step { transition: none; }
  .lb-chart__line--draw { animation: none; stroke-dashoffset: 0; }
  .lb-btn--solid:hover:not(:disabled) { transform: none; }
}

/* ---------- infinite list (LbInfiniteList) and filter chips (LbChipGroup) ---------- */
.lb-feed { position: relative; display: grid; gap: 10px; }
.lb-feed__items { display: grid; gap: var(--lb-feed-gap, 8px); }
.lb-feed__item { animation: lb-row-in var(--lb-dur-3) var(--lb-ease-out) both; animation-delay: calc(var(--i, 0) * 16ms); }
.lb-feed__item.is-skeleton { animation: none; }
.lb-feed__search { max-width: 360px; }
.lb-feed__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--lb-muted); font-size: var(--lb-text-sm); font-variant-numeric: tabular-nums; }
.lb-feed__foot:empty { display: none; }
.lb-feed__status--top { color: var(--lb-muted); font-size: var(--lb-text-sm); font-variant-numeric: tabular-nums; }
.lb-feed__end { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--lb-dim); font-size: var(--lb-text-sm); }
.lb-feed__end::before, .lb-feed__end::after { content: ""; flex: 1; height: 1px; background: var(--lb-border); }
.lb-feed__error { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--lb-radius); background: var(--lb-danger-soft); color: var(--lb-danger-ink); }
.lb-feed__errmsg { flex: 1 1 100%; font-size: var(--lb-text-sm); opacity: .85; }
.lb-feed__new { position: sticky; top: 8px; z-index: 2; justify-self: center; border: 0; border-radius: 999px; padding: 6px 14px; background: var(--lb-accent); color: var(--lb-accent-ink); font: 600 var(--lb-text-sm) var(--lb-font-body); box-shadow: var(--lb-shadow-pop); cursor: pointer; }
.lb-feed__new:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-feed__more--auto:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lb-feed__sentinel { height: 1px; margin-top: -1px; }
.lb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lb-chips__label { font-size: var(--lb-text-sm); color: var(--lb-muted); margin-right: 2px; }
.lb-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--lb-border-2); background: var(--lb-surface); color: var(--lb-text-2); font: 500 var(--lb-text-sm) var(--lb-font-body); cursor: pointer; transition: background-color var(--lb-dur-2), border-color var(--lb-dur-2), color var(--lb-dur-2); }
.lb-chip:hover:not(:disabled) { border-color: var(--lb-border-3); color: var(--lb-text); }
.lb-chip:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-chip.is-active { background: var(--lb-accent-soft); border-color: var(--lb-accent); color: var(--lb-accent-text); }
.lb-chip:disabled { opacity: .5; cursor: not-allowed; }
.lb-chip__count { min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--lb-surface-3); color: var(--lb-muted); font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.lb-chip.is-active .lb-chip__count { background: var(--lb-accent); color: var(--lb-accent-ink); }
.lb-chips--sm .lb-chip { height: 28px; padding: 0 10px; }
.lb-chips--lg .lb-chip { height: 40px; padding: 0 16px; }

/* ---------- signature pad ---------- */
.lb-sign { --lb-sign-ink: #10151c; display: grid; gap: 6px; }
[data-theme="dark"] .lb-sign { --lb-sign-ink: #e9eef6; }
.lb-sign__label { font-size: var(--lb-text-sm); font-weight: 600; color: var(--lb-text-2); }
.lb-sign__pad {
  position: relative; border-radius: var(--lb-radius-md); border: 1px dashed var(--lb-border-3); overflow: hidden;
  background: repeating-linear-gradient(0deg, transparent 0 27px, color-mix(in srgb, var(--lb-border) 45%, transparent) 27px 28px), var(--lb-surface);
  transition: border-color var(--lb-dur-2), box-shadow var(--lb-dur-2), background-color var(--lb-dur-2);
}
.lb-sign__pad:hover { border-color: var(--lb-accent); }
.lb-sign.has-ink .lb-sign__pad { border-style: solid; border-color: var(--lb-border-2); box-shadow: var(--lb-shadow-1); }
.lb-sign__canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; transition: opacity 180ms var(--lb-ease), filter 180ms var(--lb-ease); }
.lb-sign.is-clearing .lb-sign__canvas { opacity: 0; filter: blur(3px); }
.lb-sign.is-disabled .lb-sign__canvas { cursor: not-allowed; }
.lb-sign__line { position: absolute; left: 18px; right: 18px; bottom: 34px; height: 1px; background: var(--lb-border-3); pointer-events: none; }
.lb-sign__x { position: absolute; left: 20px; bottom: 36px; font: 600 18px/1 var(--lb-font-body); color: var(--lb-muted); pointer-events: none; }
.lb-sign__hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; pointer-events: none;
  color: var(--lb-muted); font-size: var(--lb-text-md); transition: opacity var(--lb-dur-2) var(--lb-ease), transform var(--lb-dur-2) var(--lb-ease);
}
.lb-sign.has-ink .lb-sign__hint { opacity: 0; transform: translateY(-6px); }
.lb-sign__clear {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border: 1px solid var(--lb-border-2); border-radius: 999px; background: var(--lb-surface); color: var(--lb-text-2);
  font: 600 var(--lb-text-xs)/1 var(--lb-font-body); cursor: pointer; box-shadow: var(--lb-shadow-1);
  opacity: 0; transform: scale(.9); transition: opacity var(--lb-dur-2) var(--lb-ease), transform var(--lb-dur-2) var(--lb-ease), background-color var(--lb-dur-2);
}
.lb-sign.has-ink .lb-sign__clear { opacity: 1; transform: none; }
.lb-sign__clear:hover:not(:disabled) { background: var(--lb-surface-2); }
.lb-sign__clear:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-sign__clear:disabled { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .lb-sign__canvas, .lb-sign__hint, .lb-sign__clear { transition: none; } }

/* ---------- theme toggle: the icon follows <html data-theme>, so every toggle on the page agrees at once ---------- */
.lb-theme-toggle { color: var(--lb-text-2); }
.lb-theme-toggle:hover:not(:disabled) { background: var(--lb-surface-3); color: var(--lb-text); }
.lb-theme-toggle__icons { position: relative; display: inline-grid; width: 1.15em; height: 1.15em; font-size: 1.05em; }
.lb-theme-toggle__icons > .bi { grid-area: 1 / 1; display: grid; place-items: center; line-height: 1; transition: opacity var(--lb-dur-3) var(--lb-ease), transform var(--lb-dur-4) var(--lb-spring); }
.lb-theme-toggle__moon, .lb-theme-toggle__auto { opacity: 0; transform: rotate(-90deg) scale(.4); }
.lb-theme-toggle__sun { opacity: 1; transform: none; }
[data-theme="dark"] .lb-theme-toggle__moon { opacity: 1; transform: none; }
[data-theme="dark"] .lb-theme-toggle__sun { opacity: 0; transform: rotate(90deg) scale(.4); }
.lb-theme-toggle[data-pref="system"] .lb-theme-toggle__icons > .bi { opacity: 0; transform: scale(.4); }
.lb-theme-toggle[data-pref="system"] .lb-theme-toggle__icons > .lb-theme-toggle__auto { opacity: 1; transform: none; }

/* the switch (lbsa-ui.js theme.set): a circle grows from the toggle over the old page (View Transitions), or a short
   colour cross-fade where those are missing; nothing under reduced motion */
html.lb-theme-vt::view-transition-old(root), html.lb-theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.lb-theme-vt::view-transition-old(root) { z-index: 1; }
html.lb-theme-vt::view-transition-new(root) { z-index: 2; }
html.lb-theme-fade, html.lb-theme-fade *, html.lb-theme-fade *::before, html.lb-theme-fade *::after {
  transition: background-color .3s var(--lb-ease), color .3s var(--lb-ease), border-color .3s var(--lb-ease), fill .3s var(--lb-ease), stroke .3s var(--lb-ease), box-shadow .3s var(--lb-ease) !important;
}
@media (prefers-reduced-motion: reduce) {
  .lb-theme-toggle__icons > .bi { transition: none; }
  html.lb-theme-fade, html.lb-theme-fade *, html.lb-theme-fade *::before, html.lb-theme-fade *::after { transition: none !important; }
}

/* ---------- kit gallery (Components/Gallery/LbKitGallery.razor) ---------- */
.lb-gallery__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 18px; }
.lb-gallery__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.lb-gallery__item { padding: 10px 14px; border: 1px solid var(--lb-border); border-radius: var(--lb-radius); background: var(--lb-surface); color: var(--lb-text); }
@media (max-width: 640px) { .lb-gallery__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---------- month calendar with events (LbMonthCalendar) ---------- */
.lb-mcal { display: grid; gap: 10px; container: lbmcal / inline-size; }
.lb-mcal__head { display: flex; align-items: center; gap: 6px; }
.lb-mcal__title { flex: 1; font: 600 var(--lb-text-lg) var(--lb-font-head); color: var(--lb-text); }
.lb-mcal__nav { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--lb-muted); cursor: pointer; }
.lb-mcal__nav:hover { background: var(--lb-surface-2); color: var(--lb-text); }
.lb-mcal__nav:focus-visible, .lb-mcal__day:focus-visible, .lb-mcal__event:focus-visible, .lb-mcal__more:focus-visible { outline: none; box-shadow: var(--lb-focus); }
.lb-mcal__grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid var(--lb-border); border-radius: var(--lb-radius); overflow: hidden; background: var(--lb-surface); }
.lb-mcal__grid th { padding: 8px 6px; font: 600 11px var(--lb-font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--lb-dim); text-align: left; border-bottom: 1px solid var(--lb-border); background: var(--lb-surface-2); }
.lb-mcal__dow-short { display: none; }
.lb-mcal__cell { height: 104px; padding: 4px; vertical-align: top; border-right: 1px solid var(--lb-border); border-bottom: 1px solid var(--lb-border); }
.lb-mcal__grid tr > .lb-mcal__cell:last-child { border-right: 0; }
.lb-mcal__grid tbody tr:last-child > .lb-mcal__cell { border-bottom: 0; }
.lb-mcal__cell.is-outside { background: var(--lb-sunken); }
.lb-mcal__cell.is-selected { background: var(--lb-accent-soft); }
.lb-mcal__day { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 4px; padding: 3px 6px; border: 0; border-radius: 7px; background: transparent; color: var(--lb-text); font: 600 var(--lb-text-sm) var(--lb-font-body); font-variant-numeric: tabular-nums; cursor: pointer; }
.lb-mcal__day:hover { background: var(--lb-surface-2); }
.lb-mcal__cell.is-outside .lb-mcal__day { color: var(--lb-dim); }
.lb-mcal__cell.is-today .lb-mcal__num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 999px; background: var(--lb-accent); color: var(--lb-accent-ink); }
.lb-mcal__count { display: none; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--lb-accent); color: var(--lb-accent-ink); font-size: 11px; line-height: 18px; text-align: center; }
.lb-mcal__events { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.lb-mcal__event, .lb-mcal__more { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; padding: 2px 6px; border: 0; border-radius: 6px; font: 500 12px/1.35 var(--lb-font-body); text-align: left; cursor: pointer; }
.lb-mcal__event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-mcal__event.is-accent { background: var(--lb-accent-soft); color: var(--lb-accent-text); }
.lb-mcal__event.is-success { background: var(--lb-success-soft); color: var(--lb-success); }
.lb-mcal__event.is-warning { background: var(--lb-warning-soft); color: var(--lb-warning); }
.lb-mcal__event.is-danger { background: var(--lb-danger-soft); color: var(--lb-danger); }
.lb-mcal__event.is-info { background: var(--lb-info-soft); color: var(--lb-info); }
.lb-mcal__event.is-neutral { background: var(--lb-neutral-soft); color: var(--lb-text-2); }
.lb-mcal__event:hover { filter: brightness(1.08); }
.lb-mcal__more { background: transparent; color: var(--lb-muted); }
.lb-mcal__more:hover { color: var(--lb-text); background: var(--lb-surface-2); }
/* phones: the chips become a count on the day */
@container lbmcal (max-width: 560px) {
  .lb-mcal__dow { display: none; }
  .lb-mcal__dow-short { display: inline; }
  .lb-mcal__grid th { text-align: center; padding: 6px 2px; }
  .lb-mcal__cell { height: 52px; padding: 2px; }
  .lb-mcal__day { flex-direction: column; justify-content: center; height: 100%; padding: 2px; }
  .lb-mcal__events { display: none; }
  .lb-mcal__count { display: inline-block; }
}

/* ---------- token text box (LbTokenTextArea) ---------- */
.lb-tokens { display: grid; gap: 8px; }
.lb-tokens__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-tokens__chip { height: 28px; padding: 0 10px 0 6px; cursor: grab; }
.lb-tokens__chip:active { cursor: grabbing; }
.lb-tokens__grip { color: var(--lb-dim); }
