/* ===== 00-foundation.css ===== */
@import url("https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");
/* ==========================================================================
   Lumen iOS Kit — bundle.css
   Load order: tokens.css → bundle.css → bundle.js
   Every value comes from tokens.json (via tokens.css). Do not hard-code colors.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Responsive semantic spacing (mobile-first)
   Mobile < 768 · Tablet 768–1199 · Desktop ≥ 1200
   -------------------------------------------------------------------------- */
:root {
  --screen-margin: var(--screen-margin-mobile, 16px);
  --card-padding: var(--card-padding-mobile, 12px);
  --field-gap: var(--field-gap-mobile, 12px);
  --group-gap: var(--group-gap-mobile, 14px);
  --section-gap: var(--section-gap-mobile, 16px);
  --card-gap: var(--card-gap-mobile, 12px);
  --grid-columns: var(--grid-columns-mobile, 4);
  --page-title-size: var(--fs-large-title, 34px);
  --page-title-line: var(--lh-large-title, 41px);
  --row-height: var(--control-md, 44px);
}
@media (min-width: 768px) {
  :root {
    --screen-margin: var(--screen-margin-tablet, 24px);
    --card-padding: var(--card-padding-tablet, 16px);
    --field-gap: var(--field-gap-tablet, 14px);
    --group-gap: var(--group-gap-tablet, 18px);
    --section-gap: var(--section-gap-tablet, 24px);
    --card-gap: var(--card-gap-tablet, 16px);
    --grid-columns: var(--grid-columns-tablet, 8);
    --page-title-size: var(--fs-display-tablet, 40px);
    --page-title-line: var(--lh-display-tablet, 48px);
  }
}
@media (min-width: 1200px) {
  :root {
    --screen-margin: var(--screen-margin-desktop, 32px);
    --card-padding: var(--card-padding-desktop, 20px);
    --field-gap: var(--field-gap-desktop, 16px);
    --group-gap: var(--group-gap-desktop, 24px);
    --section-gap: var(--section-gap-desktop, 32px);
    --card-gap: var(--card-gap-desktop, 20px);
    --grid-columns: var(--grid-columns-desktop, 12);
    --page-title-size: var(--fs-display-desktop, 48px);
    --page-title-line: var(--lh-display-desktop, 56px);
  }
}
/* Force a breakpoint on a subtree (docs, device frames, embedded widgets) */
.lm-bp-mobile {
  --screen-margin: var(--screen-margin-mobile); --card-padding: var(--card-padding-mobile);
  --field-gap: var(--field-gap-mobile); --group-gap: var(--group-gap-mobile);
  --section-gap: var(--section-gap-mobile); --card-gap: var(--card-gap-mobile);
  --grid-columns: var(--grid-columns-mobile);
  --page-title-size: var(--fs-large-title); --page-title-line: var(--lh-large-title);
}
.lm-bp-tablet {
  --screen-margin: var(--screen-margin-tablet); --card-padding: var(--card-padding-tablet);
  --field-gap: var(--field-gap-tablet); --group-gap: var(--group-gap-tablet);
  --section-gap: var(--section-gap-tablet); --card-gap: var(--card-gap-tablet);
  --grid-columns: var(--grid-columns-tablet);
  --page-title-size: var(--fs-display-tablet); --page-title-line: var(--lh-display-tablet);
}
.lm-bp-desktop {
  --screen-margin: var(--screen-margin-desktop); --card-padding: var(--card-padding-desktop);
  --field-gap: var(--field-gap-desktop); --group-gap: var(--group-gap-desktop);
  --section-gap: var(--section-gap-desktop); --card-gap: var(--card-gap-desktop);
  --grid-columns: var(--grid-columns-desktop);
  --page-title-size: var(--fs-display-desktop); --page-title-line: var(--lh-display-desktop);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  color: var(--label);
  background: var(--bg-grouped);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video { max-width: 100%; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
:where(button, [role="button"], a) { touch-action: manipulation; }
:focus-visible { outline: var(--ring-width, 2px) solid var(--focus-ring); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--accent-soft); }

/* App root: put on the outermost element of every screen */
.lm-app {
  overflow-x: clip; /* closed popups never cause sideways scroll; clip keeps position: sticky working */
  min-height: 100dvh;
  background: var(--bg-grouped);
  color: var(--label);
  font-family: var(--font-sans);
}
.lm-app--plain { background: var(--bg); }

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.lm-container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--screen-margin));
  margin-inline: auto;
  padding-left: max(var(--screen-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--screen-margin), env(safe-area-inset-right, 0px));
}
/* Page = vertical rhythm of sections */
.lm-page { display: flex; flex-direction: column; gap: var(--section-gap); padding-block: var(--section-gap); }
.lm-section { display: flex; flex-direction: column; gap: var(--group-gap); min-width: 0; }
.lm-section__header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); }
.lm-section__title { margin: 0; font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); font-weight: var(--fw-bold); }
.lm-section__action { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--link); text-decoration: none; }
.lm-page-title {
  margin: 0;
  font-size: var(--page-title-size); line-height: var(--page-title-line);
  font-weight: var(--fw-bold); letter-spacing: var(--ls-large-title);
  text-wrap: balance;
}
/* Stacks — gap semantics follow the spacing rules */
.lm-stack { display: flex; flex-direction: column; gap: var(--group-gap); min-width: 0; }
.lm-stack--field { gap: var(--field-gap); }
.lm-stack--group { gap: var(--group-gap); }
.lm-stack--section { gap: var(--section-gap); }
.lm-stack--card { gap: var(--card-gap); }
.lm-stack--4 { gap: var(--space-4); }
.lm-stack--8 { gap: var(--space-8); }
.lm-inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }
/* Card list: 1 col mobile → 2 tablet → 3 desktop → 4 wide */
.lm-card-grid { display: grid; gap: var(--card-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .lm-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .lm-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1440px) { .lm-card-grid--wide { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* --------------------------------------------------------------------------
   4. Icon (Lumen glyphs — hydrated by bundle.js from <i class="lm-icon" data-icon="name">)
   -------------------------------------------------------------------------- */
.lm-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--lm-icon-size, 1.25em); height: var(--lm-icon-size, 1.25em);
  flex: none; vertical-align: -0.25em; color: inherit; font-style: normal;
}
.lm-icon > svg { width: 100%; height: 100%; display: block; overflow: visible; }
.lm-icon--sm { --lm-icon-size: var(--icon-sm); }
.lm-icon--md { --lm-icon-size: var(--icon-md); }
.lm-icon--lg { --lm-icon-size: var(--icon-lg); }

/* iOS activity indicator (8 spokes) — shared by Button, Spin, Select, Upload… */
.lm-spinner {
  display: inline-block; flex: none;
  width: var(--lm-spinner-size, 20px); height: var(--lm-spinner-size, 20px);
  color: var(--lm-spinner-color, var(--gray));
  background: conic-gradient(from 22.5deg, transparent 0 12.5%, currentColor 100%);
  -webkit-mask-image: repeating-conic-gradient(from -9deg, #000 0 18deg, transparent 18deg 45deg), radial-gradient(circle, transparent 0 34%, #000 35%);
  -webkit-mask-composite: source-in;
  mask-image: repeating-conic-gradient(from -9deg, #000 0 18deg, transparent 18deg 45deg), radial-gradient(circle, transparent 0 34%, #000 35%);
  mask-composite: intersect;
  border-radius: 50%;
  animation: lm-spin 0.8s steps(8) infinite;
}
.lm-spinner--sm { --lm-spinner-size: 16px; }
.lm-spinner--lg { --lm-spinner-size: 37px; }
@keyframes lm-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   5. Shared control box — the iOS filled input shell
   Used by Input, Select, DatePicker, TimePicker, Cascader, AutoComplete,
   TreeSelect, InputNumber, Mentions, ColorPicker.
   <label class="lm-control"> [prefix] <input class="lm-control__input"> [suffix] </label>
   -------------------------------------------------------------------------- */
.lm-control {
  position: relative;
  display: flex; align-items: center; gap: var(--space-8);
  width: 100%; min-width: 0;
  min-height: var(--control-md);
  margin: 0;
  padding: 0 var(--space-12);
  border: 0; border-radius: var(--radius-10);
  text-align: start;
  background: var(--fill-tertiary);
  color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  transition: box-shadow var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
  cursor: text;
}
.lm-control:focus-within { box-shadow: 0 0 0 var(--ring-width) var(--accent); }
.lm-control__input {
  flex: 1 1 auto; min-width: 0; width: 100%;
  border: 0; outline: 0; background: transparent; padding: 0;
  height: var(--control-md);
  font: inherit; color: inherit; text-overflow: ellipsis;
  -webkit-appearance: none; appearance: none;
}
textarea.lm-control__input { height: auto; min-height: 88px; padding-block: var(--space-10); resize: vertical; }
.lm-control__input::placeholder { color: var(--placeholder); opacity: 1; }
.lm-control__prefix, .lm-control__suffix { display: inline-flex; align-items: center; gap: var(--space-6); flex: none; color: var(--label-secondary); }
.lm-control__clear { display: inline-flex; border: 0; padding: 0; background: none; color: var(--gray-2); cursor: pointer; }
.lm-control__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-control__value:empty::before, .lm-control__value.is-placeholder { color: var(--placeholder); }
.lm-control__value:empty::before { content: attr(data-placeholder); }
/* sizes */
.lm-control--sm { min-height: var(--control-sm); border-radius: var(--radius-8); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); padding: 0 var(--space-10); }
.lm-control--sm .lm-control__input { height: var(--control-sm); }
.lm-control--lg { min-height: var(--control-lg); border-radius: var(--radius-12); padding: 0 var(--space-16); }
.lm-control--lg .lm-control__input { height: var(--control-lg); }
/* variants */
.lm-control--outlined { background: var(--bg-elevated); box-shadow: inset 0 0 0 1px var(--separator-opaque); }
.lm-control--outlined:focus-within { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 var(--ring-width) var(--accent-soft); }
.lm-control--plain { background: transparent; padding-inline: 0; border-radius: 0; }
.lm-control--plain:focus-within { box-shadow: none; }
.lm-control--on-card { background: var(--bg-grouped-tertiary); }
/* states */
.lm-control.is-error, .lm-control[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--danger); background: var(--danger-soft); }
.lm-control.is-warning { box-shadow: inset 0 0 0 1px var(--warning); background: var(--warning-soft); }
.lm-control.is-disabled, .lm-control:has(.lm-control__input:disabled) { opacity: var(--opacity-disabled); cursor: not-allowed; }
.lm-control.is-readonly { background: transparent; box-shadow: inset 0 0 0 1px var(--separator); }
.lm-control--select { cursor: pointer; user-select: none; }
@media (hover: hover) {
  .lm-control:not(.lm-control--plain):not(.is-disabled):hover { background: var(--fill-secondary); }
  .lm-control--outlined:not(.is-disabled):hover { background: var(--bg-elevated); box-shadow: inset 0 0 0 1px var(--gray); }
}

/* --------------------------------------------------------------------------
   6. Floating layer — anchor + panel + option rows
   <div class="lm-anchor"> trigger <div class="lm-floating lm-floating--bottom-start"> <div class="lm-panel">…</div> </div> </div>
   Open with .is-open on .lm-anchor (bundle.js: data-lm-toggle). Hover mode: .lm-anchor--hover.
   -------------------------------------------------------------------------- */
.lm-anchor { position: relative; display: inline-flex; vertical-align: top; }
.lm-anchor--block { display: flex; width: 100%; }
.lm-anchor--block > :first-child { flex: 1 1 auto; min-width: 0; }
.lm-floating {
  position: absolute; z-index: var(--z-popover);
  top: calc(100% + var(--space-6)); left: 0;
  min-width: 100%;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(0.96); transform-origin: top left;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-spring), visibility 0s linear var(--duration-fast);
}
.lm-anchor.is-open > .lm-floating,
.lm-anchor--hover:hover > .lm-floating,
.lm-anchor--hover:focus-within > .lm-floating,
.lm-floating.is-open {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-base) var(--ease-spring), visibility 0s;
}
.lm-floating--bottom-end { left: auto; right: 0; transform-origin: top right; }
.lm-floating--bottom { left: 50%; translate: -50% 0; transform-origin: top center; min-width: max-content; }
.lm-floating--top-start { top: auto; bottom: calc(100% + var(--space-6)); transform-origin: bottom left; }
.lm-floating--top-end { top: auto; bottom: calc(100% + var(--space-6)); left: auto; right: 0; transform-origin: bottom right; }
.lm-floating--top { top: auto; bottom: calc(100% + var(--space-6)); left: 50%; translate: -50% 0; transform-origin: bottom center; min-width: max-content; }
.lm-floating--left { top: 50%; left: auto; right: calc(100% + var(--space-6)); translate: 0 -50%; transform-origin: center right; min-width: max-content; }
.lm-floating--right { top: 50%; left: calc(100% + var(--space-6)); translate: 0 -50%; transform-origin: center left; min-width: max-content; }
.lm-floating--auto-width { min-width: max-content; }
/* Collision handling (bundle.js adds these when a panel would leave the viewport) */
.lm-floating.is-flipped { top: auto; bottom: calc(100% + var(--space-6)); transform-origin: bottom left; }
/* Static: render an open panel inline (docs, embedded pickers) */
.lm-floating--static { position: static; opacity: 1; visibility: visible; pointer-events: auto; transform: none; translate: none; min-width: 0; }
.lm-anchor:has(> .lm-floating--static) { flex-direction: column; align-items: stretch; gap: var(--space-6); }
.lm-anchor:has(> .lm-floating--static) > .lm-floating--static > .lm-panel { max-width: 100%; }

.lm-panel {
  background: var(--material-thick);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-popover);
  padding: var(--space-6) 0;
  min-width: 220px; max-width: min(360px, calc(100vw - 2 * var(--screen-margin)));
  max-height: 320px; overflow: auto; overscroll-behavior: contain;
  color: var(--label);
}
.lm-panel--solid { background: var(--bg-elevated); -webkit-backdrop-filter: none; backdrop-filter: none; }
.lm-panel--padded { padding: var(--space-12); }
.lm-panel__label { padding: var(--space-6) var(--space-16) var(--space-4); font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); }
.lm-panel__divider { height: var(--space-8); background: var(--fill-quaternary); border: 0; margin: var(--space-6) 0; }
.lm-panel__separator { height: var(--hairline); background: var(--separator); border: 0; margin: var(--space-4) 0 var(--space-4) var(--space-16); }

/* Option row — Dropdown items, Select options, Cascader, AutoComplete, Menu */
.lm-option {
  display: flex; align-items: center; gap: var(--space-12);
  width: 100%; min-height: var(--control-md);
  padding: var(--space-10) var(--space-16);
  border: 0; background: transparent; color: var(--label); text-align: left; text-decoration: none;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  cursor: pointer; user-select: none;
}
.lm-option__icon { display: inline-flex; flex: none; color: inherit; --lm-icon-size: var(--icon-md); }
.lm-option__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-option__desc { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); white-space: normal; }
.lm-option__check { flex: none; color: var(--accent); visibility: hidden; --lm-icon-size: var(--icon-md); }
.lm-option__extra { flex: none; color: var(--label-secondary); font-size: var(--fs-subheadline); }
.lm-option[aria-selected="true"] .lm-option__check, .lm-option.is-selected .lm-option__check { visibility: visible; }
.lm-option.is-active { background: var(--fill-quaternary); }
.lm-option:active { background: var(--row-pressed); }
.lm-option--danger { color: var(--danger); }
.lm-option[aria-disabled="true"], .lm-option:disabled, .lm-option.is-disabled { color: var(--label-tertiary); cursor: not-allowed; background: transparent; }
@media (hover: hover) { .lm-option:not([aria-disabled="true"]):not(:disabled):not(.is-disabled):hover { background: var(--fill-quaternary); } }
@media (min-width: 1200px) and (pointer: fine) {
  .lm-option { min-height: 36px; padding: var(--space-6) var(--space-12); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); }
  .lm-panel { padding: var(--space-4); }
  .lm-option { border-radius: var(--radius-6); }
}

/* --------------------------------------------------------------------------
   7. Overlay layer — Modal, Drawer/Sheet, Tour, Image preview
   <div class="lm-layer" id="x" data-lm-overlay> <div class="lm-overlay" data-lm-close></div> …surface… </div>
   -------------------------------------------------------------------------- */
.lm-layer { position: fixed; inset: 0; z-index: var(--z-overlay); display: flex; visibility: hidden; pointer-events: none; transition: visibility 0s linear var(--duration-slow); }
.lm-layer.is-open { visibility: visible; pointer-events: auto; transition: visibility 0s; }
.lm-overlay { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity var(--duration-slow) var(--ease-spring); }
.lm-layer.is-open > .lm-overlay { opacity: 1; }
/* Inline: show a layer's surface in normal flow (docs / embedded previews) */
.lm-layer--inline { position: relative; inset: auto; z-index: auto; visibility: visible; pointer-events: auto; min-height: 100%; }
.lm-layer--inline > .lm-overlay { opacity: 1; }
html.lm-scroll-lock, html.lm-scroll-lock body { overflow: hidden; }

/* --------------------------------------------------------------------------
   8. Utilities (see Util)
   -------------------------------------------------------------------------- */
.lm-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lm-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lm-clamp-2, .lm-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.lm-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.lm-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.lm-tabular { font-variant-numeric: tabular-nums; }
.lm-text-primary { color: var(--label); }
.lm-text-secondary { color: var(--label-secondary); }
.lm-text-tertiary { color: var(--label-tertiary); }
.lm-text-accent { color: var(--accent); }
.lm-text-success { color: var(--success-text); }
.lm-text-warning { color: var(--warning-text); }
.lm-text-danger { color: var(--danger-text); }
.lm-hairline-top { border-top: var(--hairline) solid var(--separator); }
.lm-hairline-bottom { border-bottom: var(--hairline) solid var(--separator); }
.lm-safe-top { padding-top: env(safe-area-inset-top, 0px); }
.lm-safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }
.lm-safe-x { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.lm-pressable { transition: opacity var(--duration-instant) var(--ease-standard); }
.lm-pressable:active { opacity: var(--opacity-pressed); }
.lm-blur { -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); }
@media (max-width: 767.98px) { .lm-hide-mobile { display: none !important; } }
@media (min-width: 768px) and (max-width: 1199.98px) { .lm-hide-tablet { display: none !important; } }
@media (min-width: 1200px) { .lm-hide-desktop { display: none !important; } }
@media (min-width: 768px) { .lm-only-mobile { display: none !important; } }
@media (max-width: 767.98px), (min-width: 1200px) { .lm-only-tablet { display: none !important; } }
@media (max-width: 1199.98px) { .lm-only-desktop { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   9. Docs helpers (preview pages only — not for product UI)
   -------------------------------------------------------------------------- */
.lm-demo { display: flex; flex-direction: column; gap: var(--space-20); padding: var(--space-16); min-width: 0; overflow-x: clip; }
.lm-demo__block { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.lm-demo__label { margin: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); text-transform: uppercase; }
.lm-demo__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12); min-width: 0; }
.lm-demo__cols { display: grid; gap: var(--space-16); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.lm-demo__surface { background: var(--bg-grouped-secondary); border-radius: var(--radius-12); padding: var(--card-padding); }
.lm-demo__stage { position: relative; min-height: 240px; overflow: hidden; border-radius: var(--radius-12); background: var(--bg-grouped); }

/* ===== Button.css ===== */
/* ==========================================================================
   Button — UIButton.Configuration (filled · tinted · gray · plain) + Ant types
   ========================================================================== */
.lm-btn {
  --btn-tone: var(--accent);
  --btn-on-tone: var(--on-accent);
  --btn-soft: var(--accent-soft);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-6);
  min-width: var(--hit-target);
  height: var(--control-md);
  padding: 0 var(--space-16);
  border: 0; border-radius: var(--radius-10);
  background: var(--fill-secondary);
  color: var(--btn-tone);
  font-family: inherit;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); font-weight: var(--fw-semibold);
  text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: opacity var(--duration-instant) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-spring);
}
.lm-btn .lm-icon { --lm-icon-size: 20px; }
.lm-btn:active:not(:disabled):not(.is-disabled):not(.is-loading) { opacity: var(--opacity-pressed); }

/* Variants (iOS name · Ant equivalent) */
.lm-btn--filled { background: var(--btn-tone); color: var(--btn-on-tone); }            /* type="primary" */
.lm-btn--tinted { background: var(--btn-soft); color: var(--btn-tone); }                /* iOS tinted */
.lm-btn--gray { background: var(--fill-secondary); color: var(--btn-tone); }            /* type="default" (iOS) */
.lm-btn--bordered { background: transparent; box-shadow: inset 0 0 0 1px var(--separator-opaque); color: var(--btn-tone); } /* type="default" (web) */
.lm-btn--dashed { background: transparent; border: 1px dashed var(--separator-opaque); color: var(--btn-tone); }            /* type="dashed" */
.lm-btn--plain { background: transparent; color: var(--btn-tone); }                     /* type="text" */
.lm-btn--link { background: transparent; color: var(--link); height: auto; min-width: 0; padding: 0; font-weight: var(--fw-regular); } /* type="link" */
.lm-btn--glass { background: var(--material-thin); color: var(--label); -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate)); }

/* Tones */
.lm-btn--danger { --btn-tone: var(--danger); --btn-soft: var(--danger-soft); }          /* danger */
.lm-btn--neutral { --btn-tone: var(--label); --btn-soft: var(--fill-secondary); --btn-on-tone: var(--bg); }
.lm-btn--success { --btn-tone: var(--success); --btn-soft: var(--success-soft); }

/* Sizes */
.lm-btn--sm { height: var(--control-sm); min-width: var(--control-sm); padding: 0 var(--space-12); border-radius: var(--radius-8); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); gap: var(--space-4); }
.lm-btn--sm .lm-icon { --lm-icon-size: 16px; }
.lm-btn--lg { height: var(--control-lg); padding: 0 var(--space-20); border-radius: var(--radius-12); }
.lm-btn--lg .lm-icon { --lm-icon-size: 22px; }

/* Shapes */
.lm-btn--pill { border-radius: var(--radius-full); }
.lm-btn--icon { width: var(--control-md); padding: 0; }
.lm-btn--icon.lm-btn--sm { width: var(--control-sm); }
.lm-btn--icon.lm-btn--lg { width: var(--control-lg); }
.lm-btn--circle { border-radius: var(--radius-full); width: var(--control-md); padding: 0; }
.lm-btn--circle.lm-btn--sm { width: var(--control-sm); }
.lm-btn--block { display: flex; width: 100%; }
@media (max-width: 767.98px) { .lm-btn--block-mobile { display: flex; width: 100%; } }

/* States */
.lm-btn:disabled, .lm-btn.is-disabled { cursor: not-allowed; color: var(--label-tertiary); }
.lm-btn--filled:disabled, .lm-btn--filled.is-disabled,
.lm-btn--tinted:disabled, .lm-btn--tinted.is-disabled { background: var(--fill-tertiary); }
.lm-btn.is-loading { cursor: progress; }
.lm-btn.is-loading .lm-spinner { --lm-spinner-color: currentColor; --lm-spinner-size: 18px; }
.lm-btn.is-loading > .lm-icon { display: none; }
@media (hover: hover) and (pointer: fine) {
  .lm-btn:not(:disabled):not(.is-disabled):hover { opacity: var(--opacity-hover); }
  .lm-btn--plain:not(:disabled):hover, .lm-btn--bordered:not(:disabled):hover, .lm-btn--dashed:not(:disabled):hover { opacity: 1; background: var(--fill-quaternary); }
  .lm-btn--link:not(:disabled):hover { opacity: 1; text-decoration: underline; background: transparent; }
}

/* Group (Ant Space.Compact / Button.Group) */
.lm-btn-group { display: inline-flex; isolation: isolate; }
.lm-btn-group > .lm-btn { border-radius: 0; }
.lm-btn-group > .lm-btn:first-child { border-top-left-radius: var(--radius-10); border-bottom-left-radius: var(--radius-10); }
.lm-btn-group > .lm-btn:last-child { border-top-right-radius: var(--radius-10); border-bottom-right-radius: var(--radius-10); }
.lm-btn-group > .lm-btn + .lm-btn { box-shadow: inset var(--hairline) 0 0 var(--separator); }
.lm-btn-group > .lm-btn--bordered + .lm-btn--bordered { margin-left: -1px; }

/* ===== FloatButton.css ===== */
/* ==========================================================================
   FloatButton — nút nổi (FAB), nhóm mở rộng, BackTop
   Mặc định position: fixed góc phải dưới; trên mobile nằm trên Tab bar.
   ========================================================================== */
.lm-float-btn,
.lm-float-btn-group {
  --fab-size: 56px;
  --fab-bottom: calc(var(--tabbar-height) + var(--space-16) + env(safe-area-inset-bottom, 0px));
  --fab-right: max(var(--screen-margin), env(safe-area-inset-right, 0px));
  position: fixed;
  right: var(--fab-right);
  bottom: var(--fab-bottom);
  z-index: var(--z-float);
}
@media (min-width: 768px) {
  .lm-float-btn,
  .lm-float-btn-group { --fab-bottom: calc(var(--screen-margin) + env(safe-area-inset-bottom, 0px)); }
}
/* Màn hình mobile không có Tab bar */
.lm-float-btn--no-tabbar,
.lm-float-btn-group--no-tabbar { --fab-bottom: calc(var(--space-16) + env(safe-area-inset-bottom, 0px)); }
/* Vị trí: bên trái */
.lm-float-btn--left,
.lm-float-btn-group--left { right: auto; left: max(var(--screen-margin), env(safe-area-inset-left, 0px)); }
/* Nằm trong khối cha (position: relative) — bản đồ, card, preview */
.lm-float-btn--contained,
.lm-float-btn-group--contained { position: absolute; --fab-bottom: var(--space-16); --fab-right: var(--space-16); }
/* Nằm trong luồng nội dung */
.lm-float-btn--static,
.lm-float-btn-group--static { position: relative; right: auto; bottom: auto; left: auto; }

.lm-float-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  width: var(--fab-size); height: var(--fab-size);
  padding: 0;
  border: 0; border-radius: var(--radius-full);
  background: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-raised);
  font-family: inherit; font-size: var(--fs-caption-2); line-height: var(--lh-caption-2); font-weight: var(--fw-semibold);
  text-decoration: none; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: opacity var(--duration-instant) var(--ease-standard), transform var(--duration-fast) var(--ease-spring), visibility 0s;
}
.lm-float-btn .lm-icon { --lm-icon-size: 24px; transition: transform var(--duration-base) var(--ease-spring); }
.lm-float-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .lm-float-btn:hover { opacity: var(--opacity-hover); } }

/* Biến thể */
.lm-float-btn--glass {
  background: var(--material-thin); color: var(--label);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
}
.lm-float-btn--default { background: var(--bg-elevated); color: var(--accent); }   /* Ant type="default" */
.lm-float-btn--danger { background: var(--danger); color: var(--on-accent); }
.lm-float-btn--square { border-radius: var(--radius-16); }
.lm-float-btn--sm { --fab-size: var(--control-md); }
.lm-float-btn--sm .lm-icon { --lm-icon-size: 20px; }
/* Extended FAB: icon + nhãn (capsule) */
.lm-float-btn--extended {
  flex-direction: row; gap: var(--space-8);
  width: auto; padding: 0 var(--space-20);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
}
.lm-float-btn__desc { display: block; max-width: calc(var(--fab-size) - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Badge trên FAB */
.lm-float-btn__badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 20px; height: 20px; padding: 0 var(--space-6);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--red); color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--bg-grouped);
  font-size: var(--fs-caption-2); line-height: 1; font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.lm-float-btn__badge:empty { min-width: 12px; height: 12px; padding: 0; }

/* BackTop: ẩn cho tới khi cuộn (bundle.js thêm .is-visible) */
.lm-float-btn--backtop:not(.lm-float-btn--static) { opacity: 0; visibility: hidden; transform: translateY(8px) scale(0.9); }
.lm-float-btn--backtop.is-visible { opacity: 1; visibility: visible; transform: none; }

/* --------------------------------------------------------------------------
   Group — trigger + menu nút nhỏ (dùng .lm-anchor / data-lm-toggle)
   <div class="lm-float-btn-group lm-anchor"> <div class="lm-floating lm-floating--top lm-float-btn-group__menu">…</div> <button class="lm-float-btn" data-lm-toggle>…</button> </div>
   -------------------------------------------------------------------------- */
.lm-float-btn-group { display: inline-flex; flex-direction: column; align-items: center; gap: var(--space-12); }
.lm-float-btn-group .lm-float-btn { position: relative; right: auto; bottom: auto; }
.lm-float-btn-group__menu {
  display: flex; flex-direction: column-reverse; align-items: center; gap: var(--space-12);
  min-width: 0; padding-bottom: var(--space-6);
}
.lm-float-btn-group__menu.lm-floating--top { bottom: calc(100% + var(--space-6)); }
.lm-float-btn-group.is-open > .lm-float-btn .lm-icon[data-icon="plus"] { transform: rotate(45deg); }
.lm-float-btn-group__item { display: inline-flex; align-items: center; gap: var(--space-8); }
.lm-float-btn-group__label {
  padding: var(--space-4) var(--space-10);
  border-radius: var(--radius-8);
  background: var(--material-regular);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate));
  box-shadow: var(--shadow-raised);
  color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); white-space: nowrap;
}
/* Trên nhóm canh phải: nhãn nằm bên trái nút */
.lm-float-btn-group__menu .lm-float-btn-group__item { flex-direction: row; justify-content: flex-end; }
.lm-float-btn-group__menu { align-items: flex-end; left: auto; right: calc((var(--fab-size) - var(--control-md)) / 2); translate: none; transform-origin: bottom right; }

/* Square group: các nút ghép thành một khối dọc (Ant shape="square") */
.lm-float-btn-group--square {
  gap: 0;
  border-radius: var(--radius-16);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
}
.lm-float-btn-group--square > .lm-float-btn {
  --fab-size: 48px;
  border-radius: 0; box-shadow: none;
  background: transparent; color: var(--accent);
}
.lm-float-btn-group--square > .lm-float-btn + .lm-float-btn { border-top: var(--hairline) solid var(--separator); }
.lm-float-btn-group--square > .lm-float-btn:active { transform: none; background: var(--row-pressed); }

/* ===== Icon.css ===== */
/* ==========================================================================
   Icon — Lumen glyphs (.lm-icon nằm trong foundation) + Settings icon tile + icon grid
   ========================================================================== */
.lm-icon--xl { --lm-icon-size: 36px; }
.lm-icon--spin > svg { animation: lm-spin 1s linear infinite; }

/* Ô icon màu kiểu Settings: 29×29, radius-6, glyph trắng 18px */
.lm-icon-tile {
  --tile-bg: var(--gray);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--icon-tile); height: var(--icon-tile);
  border-radius: var(--radius-6);
  background: var(--tile-bg);
  color: var(--on-accent);
}
.lm-icon-tile > .lm-icon { --lm-icon-size: 18px; }
.lm-icon-tile--lg { width: 40px; height: 40px; border-radius: var(--radius-8); }
.lm-icon-tile--lg > .lm-icon { --lm-icon-size: 24px; }
.lm-icon-tile--xl { width: 60px; height: 60px; border-radius: var(--radius-14); }
.lm-icon-tile--xl > .lm-icon { --lm-icon-size: 34px; }
.lm-icon-tile--blue { --tile-bg: var(--blue); }
.lm-icon-tile--green { --tile-bg: var(--green); }
.lm-icon-tile--orange { --tile-bg: var(--orange); }
.lm-icon-tile--red { --tile-bg: var(--red); }
.lm-icon-tile--gray { --tile-bg: var(--gray); }
.lm-icon-tile--indigo { --tile-bg: var(--indigo); }
.lm-icon-tile--pink { --tile-bg: var(--pink); }
.lm-icon-tile--purple { --tile-bg: var(--purple); }
.lm-icon-tile--teal { --tile-bg: var(--teal); }
.lm-icon-tile--yellow { --tile-bg: var(--yellow); }
.lm-icon-tile--cyan { --tile-bg: var(--cyan); }
.lm-icon-tile--mint { --tile-bg: var(--mint); }
.lm-icon-tile--brown { --tile-bg: var(--brown); }
.lm-icon-tile--accent { --tile-bg: var(--accent); }
/* Tile mềm: nền nhạt, glyph màu (dùng trong Card, Empty) */
.lm-icon-tile--soft { background: var(--accent-soft); color: var(--accent); }

/* Lưới icon (icon picker / thư viện) */
.lm-icon-grid {
  display: grid; gap: var(--space-8);
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.lm-icon-grid__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-6);
  min-height: 84px; padding: var(--space-10) var(--space-6);
  border: 0; border-radius: var(--radius-10);
  background: var(--bg-grouped-secondary); color: var(--label);
  font-family: inherit; text-align: center; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.lm-icon-grid__item > .lm-icon { --lm-icon-size: 26px; }
.lm-icon-grid__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-caption-2); line-height: var(--lh-caption-2); color: var(--label-secondary); }
.lm-icon-grid__item:active { background: var(--row-pressed); }
.lm-icon-grid__item.is-copied { background: var(--accent-soft); color: var(--accent); }
@media (hover: hover) { .lm-icon-grid__item:hover { background: var(--fill-quaternary); } }
@media (min-width: 768px) { .lm-icon-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); } }

/* ===== Typography.css ===== */
/* ==========================================================================
   Typography — Title (1–5), Text, Paragraph, Link, Code, Kbd, Mark,
   copyable, ellipsis/expandable, editable. Thang chữ iOS Dynamic Type.
   ========================================================================== */
.lm-title { margin: 0; color: var(--label); text-wrap: balance; font-weight: var(--fw-bold); }
.lm-title--1 { font-size: var(--page-title-size); line-height: var(--page-title-line); letter-spacing: var(--ls-large-title); }
.lm-title--2 { font-size: var(--fs-title-1); line-height: var(--lh-title-1); letter-spacing: var(--ls-title-1); }
.lm-title--3 { font-size: var(--fs-title-2); line-height: var(--lh-title-2); letter-spacing: var(--ls-title-2); }
.lm-title--4 { font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); font-weight: var(--fw-semibold); }
.lm-title--5 { font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold); }
.lm-eyebrow { margin: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: 0.02em; font-weight: var(--fw-semibold); text-transform: uppercase; color: var(--label-secondary); }

/* Text (inline) */
.lm-text { color: var(--label); }
.lm-text--secondary { color: var(--label-secondary); }
.lm-text--tertiary { color: var(--label-tertiary); }
.lm-text--success { color: var(--success-text); }
.lm-text--warning { color: var(--warning-text); }
.lm-text--danger { color: var(--danger-text); }
.lm-text--disabled { color: var(--label-tertiary); cursor: not-allowed; user-select: none; }
.lm-text--strong, .lm-text strong { font-weight: var(--fw-semibold); }
.lm-text--italic { font-style: italic; }
.lm-text--underline { text-decoration: underline; text-underline-offset: 0.15em; }
.lm-text--delete { text-decoration: line-through; }
.lm-text--sm { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
.lm-text--xs { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); }
.lm-mark { padding: 0 0.15em; border-radius: var(--radius-4); background: var(--warning-soft); color: inherit; }
.lm-code {
  padding: 0.1em 0.35em; border-radius: var(--radius-4);
  background: var(--fill-tertiary); color: var(--label);
  font-family: var(--font-mono); font-size: 0.88em; letter-spacing: 0;
}
.lm-kbd {
  display: inline-block; min-width: 1.6em; padding: 0 0.4em;
  border-radius: var(--radius-6);
  background: var(--bg-elevated); color: var(--label);
  box-shadow: inset 0 0 0 1px var(--separator-opaque), inset 0 -1px 0 1px var(--separator-opaque);
  font-family: var(--font-sans); font-size: 0.82em; line-height: 1.7; text-align: center; letter-spacing: 0;
}
.lm-link { color: var(--link); text-decoration: none; cursor: pointer; border-radius: var(--radius-4); }
.lm-link--underline { text-decoration: underline; text-underline-offset: 0.15em; }
.lm-link:active { opacity: var(--opacity-pressed); }
.lm-link[aria-disabled="true"] { color: var(--label-tertiary); pointer-events: none; }
@media (hover: hover) { .lm-link:hover { text-decoration: underline; text-underline-offset: 0.15em; } }

/* Paragraph */
.lm-paragraph { margin: 0; max-width: 65ch; color: var(--label); font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); text-wrap: pretty; }
.lm-paragraph--callout { font-size: var(--fs-callout); line-height: var(--lh-callout); letter-spacing: var(--ls-callout); }
.lm-paragraph--secondary { color: var(--label-secondary); }
.lm-paragraph--sm { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
.lm-paragraph--full { max-width: none; }
.lm-prose { display: flex; flex-direction: column; gap: var(--space-12); max-width: 65ch; }
.lm-prose > :where(h1, h2, h3, h4) { margin: var(--space-8) 0 0; }

/* Copyable */
.lm-copyable { display: inline-flex; align-items: baseline; gap: var(--space-4); max-width: 100%; }
.lm-copyable__text { min-width: 0; overflow-wrap: anywhere; }
.lm-copyable__btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; align-self: center;
  width: 28px; height: 28px; margin: -4px 0; padding: 0;
  border: 0; border-radius: var(--radius-full); background: transparent; color: var(--accent);
  cursor: pointer;
}
.lm-copyable__btn .lm-icon { --lm-icon-size: 18px; }
.lm-copyable__btn .lm-icon + .lm-icon { display: none; }
.is-copied > .lm-copyable__btn .lm-icon:first-child, .lm-copyable__btn.is-copied .lm-icon:first-child { display: none; }
.is-copied > .lm-copyable__btn .lm-icon + .lm-icon, .lm-copyable__btn.is-copied .lm-icon + .lm-icon { display: inline-flex; color: var(--success); }
.lm-copyable__btn:active { opacity: var(--opacity-pressed); }
@media (hover: hover) { .lm-copyable__btn:hover { background: var(--fill-quaternary); } }

/* Ellipsis + expandable (Ant ellipsis={{ rows, expandable }}) */
.lm-expandable { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.lm-expandable__content {
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--lm-lines, 3); line-clamp: var(--lm-lines, 3);
  overflow: hidden;
}
.lm-expandable.is-expanded .lm-expandable__content { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.lm-expandable__toggle {
  padding: 0; border: 0; background: none; color: var(--link);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-semibold); cursor: pointer;
}

/* Editable */
.lm-editable { display: inline-flex; align-items: center; gap: var(--space-6); max-width: 100%; }
.lm-editable__text { min-width: 1ch; border-radius: var(--radius-6); outline: 0; overflow-wrap: anywhere; transition: box-shadow var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }
.lm-editable__text[contenteditable="true"] { padding: 0 var(--space-4); margin: 0 calc(-1 * var(--space-4)); background: var(--fill-tertiary); box-shadow: 0 0 0 var(--ring-width) var(--accent); }
.lm-editable__btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--accent); cursor: pointer;
}
.lm-editable__btn .lm-icon { --lm-icon-size: 18px; }
.lm-editable.is-editing .lm-editable__btn { visibility: hidden; }
@media (hover: hover) { .lm-editable__btn:hover { background: var(--fill-quaternary); } }

/* Type scale specimen (docs) */
.lm-type-specimen { display: flex; flex-direction: column; border-radius: var(--radius-12); background: var(--bg-grouped-secondary); overflow: hidden; }
.lm-type-specimen__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); padding: var(--space-10) var(--card-padding); min-width: 0; }
.lm-type-specimen__row + .lm-type-specimen__row { border-top: var(--hairline) solid var(--separator); }
.lm-type-specimen__sample { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-type-specimen__meta { flex: none; font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); color: var(--label-secondary); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
  .lm-type-specimen__row { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .lm-type-specimen__sample { max-width: 100%; }
}

/* ===== Divider.css ===== */
/* ==========================================================================
   Divider — hairline iOS (0.5px), inset, có chữ, dọc, nét đứt
   <hr class="lm-divider">  ·  <div class="lm-divider lm-divider--text" role="separator"><span class="lm-divider__text">Hoặc</span></div>
   ========================================================================== */
.lm-divider {
  --lm-divider-space: var(--space-16);
  flex: none;
  width: 100%; height: var(--hairline);
  margin: var(--lm-divider-space) 0;
  border: 0; padding: 0;
  background: var(--separator);
}
.lm-divider--sm { --lm-divider-space: var(--space-8); }
.lm-divider--lg { --lm-divider-space: var(--space-24); }
.lm-divider--flush { --lm-divider-space: 0px; }
/* Inset: bắt đầu sau lề 16px như separator của List */
.lm-divider--inset { width: auto; margin-left: var(--space-16); }
.lm-divider--inset-icon { width: auto; margin-left: calc(var(--space-16) + var(--icon-tile) + var(--space-12)); }
/* Nét đứt */
.lm-divider--dashed { height: 0; background: none; border-top: 1px dashed var(--separator-opaque); }
/* Đậm (phân khối lớn kiểu iOS grouped) */
.lm-divider--thick { height: var(--space-8); background: var(--fill-quaternary); }

/* Có chữ */
.lm-divider--text {
  display: flex; align-items: center; gap: var(--space-12);
  height: auto; background: none;
  color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.lm-divider--text::before,
.lm-divider--text::after { content: ""; flex: 1 1 0; height: var(--hairline); background: var(--separator); }
.lm-divider--text.lm-divider--dashed { border-top: 0; }
.lm-divider--text.lm-divider--dashed::before,
.lm-divider--text.lm-divider--dashed::after { height: 0; background: none; border-top: 1px dashed var(--separator-opaque); }
.lm-divider--left::before { flex: 0 0 var(--space-16); }
.lm-divider--right::after { flex: 0 0 var(--space-16); }
.lm-divider--plain { color: var(--label-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); font-weight: var(--fw-regular); }
.lm-divider__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Dọc (giữa các phần tử inline) */
.lm-divider--vertical {
  display: inline-block; flex: none;
  width: 1px; height: 0.9em;
  margin: 0 var(--space-8);
  vertical-align: middle;
  background: var(--separator-opaque);
}
.lm-divider--vertical.lm-divider--dashed { width: 0; background: none; border-top: 0; border-left: 1px dashed var(--separator-opaque); }

/* ===== Flex.css ===== */
/* ==========================================================================
   Flex — tiện ích flexbox với gap theo spacing ngữ nghĩa
   ========================================================================== */
.lm-flex { display: flex; gap: var(--lm-gap, 0px); min-width: 0; }
.lm-flex--inline { display: inline-flex; }
.lm-flex--vertical { flex-direction: column; }
.lm-flex--wrap { flex-wrap: wrap; }
.lm-flex--wrap-reverse { flex-wrap: wrap-reverse; }
.lm-flex--reverse { flex-direction: row-reverse; }
.lm-flex--vertical.lm-flex--reverse { flex-direction: column-reverse; }

/* Gap: số cố định + spacing ngữ nghĩa (responsive) */
.lm-flex--gap-xs { --lm-gap: var(--space-4); }
.lm-flex--gap-sm { --lm-gap: var(--space-8); }
.lm-flex--gap-md { --lm-gap: var(--space-12); }
.lm-flex--gap-lg { --lm-gap: var(--space-16); }
.lm-flex--gap-xl { --lm-gap: var(--space-24); }
.lm-flex--gap-field { --lm-gap: var(--field-gap); }
.lm-flex--gap-group { --lm-gap: var(--group-gap); }
.lm-flex--gap-card { --lm-gap: var(--card-gap); }
.lm-flex--gap-section { --lm-gap: var(--section-gap); }

/* Căn chỉnh */
.lm-flex--justify-start { justify-content: flex-start; }
.lm-flex--justify-center { justify-content: center; }
.lm-flex--justify-end { justify-content: flex-end; }
.lm-flex--justify-between { justify-content: space-between; }
.lm-flex--justify-around { justify-content: space-around; }
.lm-flex--justify-evenly { justify-content: space-evenly; }
.lm-flex--align-start { align-items: flex-start; }
.lm-flex--align-center { align-items: center; }
.lm-flex--align-end { align-items: flex-end; }
.lm-flex--align-baseline { align-items: baseline; }
.lm-flex--align-stretch { align-items: stretch; }

/* Phần tử con */
.lm-flex__grow { flex: 1 1 0; min-width: 0; }
.lm-flex__auto { flex: 1 1 auto; min-width: 0; }
.lm-flex__none { flex: none; }
.lm-flex__push { margin-left: auto; }

/* Responsive: xếp dọc trên mobile, ngang từ tablet */
@media (max-width: 767.98px) {
  .lm-flex--stack-mobile { flex-direction: column; align-items: stretch; }
  .lm-flex--stack-mobile > .lm-flex__push { margin-left: 0; }
}
@media (max-width: 1199.98px) {
  .lm-flex--stack-tablet { flex-direction: column; align-items: stretch; }
}

/* ===== Grid.css ===== */
/* ==========================================================================
   Grid — lưới 4 / 8 / 12 cột (mobile / tablet / desktop), gutter = --card-gap
   Con mặc định chiếm cả hàng. Span theo breakpoint:
   lm-col-{1..4} (mobile, giữ tỉ lệ ở tablet/desktop) · lm-col-t-{1..8} (≥768) · lm-col-d-{1..12} (≥1200)
   ========================================================================== */
.lm-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  gap: var(--lm-grid-gap, var(--card-gap));
  min-width: 0;
}
.lm-grid > * { grid-column: 1 / -1; min-width: 0; }
.lm-grid--gap-field { --lm-grid-gap: var(--field-gap); }
.lm-grid--gap-group { --lm-grid-gap: var(--group-gap); }
.lm-grid--gap-section { --lm-grid-gap: var(--section-gap); }
.lm-grid--gap-sm { --lm-grid-gap: var(--space-8); }
.lm-grid--gap-none { --lm-grid-gap: 0px; }
.lm-grid--row-gap-section { row-gap: var(--section-gap); }
.lm-grid--align-start { align-items: start; }
.lm-grid--align-center { align-items: center; }
.lm-grid--align-end { align-items: end; }

/* Số cột cố định, con tự xếp từng ô (danh sách thẻ, gallery) */
.lm-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lm-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lm-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lm-grid--auto { grid-template-columns: repeat(auto-fill, minmax(var(--lm-grid-min, 160px), 1fr)); }
:is(.lm-grid--cols-2, .lm-grid--cols-3, .lm-grid--cols-4, .lm-grid--auto) > * { grid-column: auto; }

/* Mobile (4 cột) */
.lm-col-1 { grid-column: auto / span 1; }
.lm-col-2 { grid-column: auto / span 2; }
.lm-col-3 { grid-column: auto / span 3; }
.lm-col-4 { grid-column: auto / span 4; }
.lm-col-full { grid-column: 1 / -1; }

/* Tablet (8 cột): lm-col-n giữ tỉ lệ (×2), lm-col-t-n ghi đè */
@media (min-width: 768px) {
  .lm-col-1 { grid-column: auto / span 2; }
  .lm-col-2 { grid-column: auto / span 4; }
  .lm-col-3 { grid-column: auto / span 6; }
  .lm-col-4 { grid-column: auto / span 8; }
  .lm-col-t-1 { grid-column: auto / span 1; }
  .lm-col-t-2 { grid-column: auto / span 2; }
  .lm-col-t-3 { grid-column: auto / span 3; }
  .lm-col-t-4 { grid-column: auto / span 4; }
  .lm-col-t-5 { grid-column: auto / span 5; }
  .lm-col-t-6 { grid-column: auto / span 6; }
  .lm-col-t-7 { grid-column: auto / span 7; }
  .lm-col-t-8 { grid-column: auto / span 8; }
  .lm-col-t-full { grid-column: 1 / -1; }
  .lm-offset-t-1 { grid-column-start: 2; }
  .lm-offset-t-2 { grid-column-start: 3; }
  .lm-offset-t-3 { grid-column-start: 4; }
  .lm-offset-t-4 { grid-column-start: 5; }
  .lm-offset-t-5 { grid-column-start: 6; }
  .lm-offset-t-6 { grid-column-start: 7; }
  .lm-offset-t-7 { grid-column-start: 8; }
}

/* Desktop (12 cột): lm-col-n ×3, lm-col-t-n ×1.5 (làm tròn), lm-col-d-n ghi đè */
@media (min-width: 1200px) {
  .lm-col-1 { grid-column: auto / span 3; }
  .lm-col-2 { grid-column: auto / span 6; }
  .lm-col-3 { grid-column: auto / span 9; }
  .lm-col-4 { grid-column: auto / span 12; }
  .lm-col-t-1 { grid-column: auto / span 2; }
  .lm-col-t-2 { grid-column: auto / span 3; }
  .lm-col-t-3 { grid-column: auto / span 5; }
  .lm-col-t-4 { grid-column: auto / span 6; }
  .lm-col-t-5 { grid-column: auto / span 8; }
  .lm-col-t-6 { grid-column: auto / span 9; }
  .lm-col-t-7 { grid-column: auto / span 11; }
  .lm-col-t-8 { grid-column: auto / span 12; }
  .lm-col-d-1 { grid-column: auto / span 1; }
  .lm-col-d-2 { grid-column: auto / span 2; }
  .lm-col-d-3 { grid-column: auto / span 3; }
  .lm-col-d-4 { grid-column: auto / span 4; }
  .lm-col-d-5 { grid-column: auto / span 5; }
  .lm-col-d-6 { grid-column: auto / span 6; }
  .lm-col-d-7 { grid-column: auto / span 7; }
  .lm-col-d-8 { grid-column: auto / span 8; }
  .lm-col-d-9 { grid-column: auto / span 9; }
  .lm-col-d-10 { grid-column: auto / span 10; }
  .lm-col-d-11 { grid-column: auto / span 11; }
  .lm-col-d-12 { grid-column: auto / span 12; }
  .lm-col-d-full { grid-column: 1 / -1; }
  .lm-offset-t-1, .lm-offset-t-2, .lm-offset-t-3, .lm-offset-t-4, .lm-offset-t-5, .lm-offset-t-6, .lm-offset-t-7 { grid-column-start: auto; }
  .lm-offset-d-1 { grid-column-start: 2; }
  .lm-offset-d-2 { grid-column-start: 3; }
  .lm-offset-d-3 { grid-column-start: 4; }
  .lm-offset-d-4 { grid-column-start: 5; }
  .lm-offset-d-5 { grid-column-start: 6; }
  .lm-offset-d-6 { grid-column-start: 7; }
  .lm-offset-d-7 { grid-column-start: 8; }
  .lm-offset-d-8 { grid-column-start: 9; }
  .lm-offset-d-9 { grid-column-start: 10; }
  .lm-offset-d-10 { grid-column-start: 11; }
  .lm-offset-d-11 { grid-column-start: 12; }
}

/* Ẩn/hiện ô theo breakpoint */
@media (max-width: 767.98px) { .lm-col-hide-mobile { display: none; } }
@media (min-width: 768px) and (max-width: 1199.98px) { .lm-col-hide-tablet { display: none; } }
@media (min-width: 1200px) { .lm-col-hide-desktop { display: none; } }

/* Ô hiển thị cột (docs / overlay lưới khi thiết kế) */
.lm-grid-overlay { position: relative; }
.lm-grid-overlay::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(90deg, var(--accent-soft) 0 calc((100% - (var(--grid-columns) - 1) * var(--card-gap)) / var(--grid-columns)), transparent 0 calc((100% - (var(--grid-columns) - 1) * var(--card-gap)) / var(--grid-columns) + var(--card-gap)));
}

/* ===== Layout.css ===== */
/* ==========================================================================
   Layout — khung app iOS/iPadOS + khung website
   Mobile: Navigation bar + nội dung + Tab bar · Tablet/Desktop: Sidebar + nội dung
   <div class="lm-layout">
     <aside class="lm-layout__sider lm-sidebar">…</aside>
     <div class="lm-layout__main"> <header class="lm-navbar">…</header> <main class="lm-layout__content">…</main> <nav class="lm-tabbar">…</nav> </div>
   </div>
   ========================================================================== */
.lm-layout {
  --lm-sider-width: 280px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--bg-grouped);
  color: var(--label);
}
.lm-layout--plain { background: var(--bg); }
.lm-layout > .lm-layout__sider { display: none; }
.lm-layout__main { display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; }
.lm-layout__content { flex: 1 1 auto; min-width: 0; }
.lm-layout__sider-toggle { display: none; }

/* Split view: tự động từ tablet */
@media (min-width: 768px) {
  .lm-layout:not(.lm-layout--mobile):has(> .lm-layout__sider) { grid-template-columns: var(--lm-sider-width) minmax(0, 1fr); }
  .lm-layout:not(.lm-layout--mobile) > .lm-layout__sider { display: flex; position: sticky; top: 0; height: 100dvh; }
  .lm-layout:not(.lm-layout--mobile) > .lm-layout__main > .lm-tabbar { display: none; }
  .lm-layout:not(.lm-layout--mobile) .lm-layout__sider-toggle { display: inline-flex; }
  .lm-layout:not(.lm-layout--mobile).is-sider-hidden:has(> .lm-layout__sider) { grid-template-columns: minmax(0, 1fr); }
  .lm-layout:not(.lm-layout--mobile).is-sider-hidden > .lm-layout__sider { display: none; }
}
@media (min-width: 1200px) { .lm-layout { --lm-sider-width: var(--sidebar-width); } }
/* Ép split view ở mọi bề rộng */
.lm-layout--split:has(> .lm-layout__sider) { grid-template-columns: var(--lm-sider-width) minmax(0, 1fr); }
.lm-layout--split > .lm-layout__sider { display: flex; position: sticky; top: 0; height: 100dvh; }
.lm-layout--split > .lm-layout__main > .lm-tabbar { display: none; }
.lm-layout--split .lm-layout__sider-toggle { display: inline-flex; }
.lm-layout--split.is-sider-hidden:has(> .lm-layout__sider) { grid-template-columns: minmax(0, 1fr); }
.lm-layout--split.is-sider-hidden > .lm-layout__sider { display: none; }
/* Ép bố cục mobile ở mọi bề rộng: .lm-layout--mobile (sider ẩn, Tab bar hiện) */

/* Contained: khung nằm trong khối có chiều cao cố định (preview, iframe, widget) — __main là vùng cuộn */
.lm-layout.lm-layout--contained { min-height: 0; height: 100%; }
.lm-layout.lm-layout--contained > .lm-layout__main { min-height: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.lm-layout.lm-layout--contained > .lm-layout__sider { position: static; height: 100%; }

/* --------------------------------------------------------------------------
   Navigation bar
   -------------------------------------------------------------------------- */
.lm-navbar {
  position: sticky; top: 0; z-index: var(--z-header);
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  box-shadow: inset 0 calc(-1 * var(--hairline)) 0 var(--separator);
}
.lm-navbar__bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--space-8);
  min-height: var(--navbar-height);
  padding-left: max(calc(var(--screen-margin) - var(--space-8)), env(safe-area-inset-left, 0px));
  padding-right: max(calc(var(--screen-margin) - var(--space-8)), env(safe-area-inset-right, 0px));
}
.lm-navbar__leading, .lm-navbar__trailing { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.lm-navbar__leading { justify-self: start; grid-column: 1; }
.lm-navbar__trailing { justify-self: end; grid-column: 3; }
.lm-navbar__title {
  grid-column: 2; max-width: min(56vw, 480px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
  font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold);
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.lm-navbar__subtitle { display: block; font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); font-weight: var(--fw-regular); color: var(--label-secondary); }
/* Nút trên thanh */
.lm-navbar .lm-btn--plain { height: var(--navbar-height); padding: 0 var(--space-8); font-weight: var(--fw-regular); }
.lm-navbar .lm-btn--plain.lm-navbar__done { font-weight: var(--fw-semibold); }
.lm-navbar .lm-btn--icon { width: var(--hit-target); padding: 0; }
.lm-navbar .lm-btn .lm-icon { --lm-icon-size: var(--icon-md); }
.lm-navbar__back {
  display: inline-flex; align-items: center; gap: var(--space-2);
  max-width: calc(100% + var(--space-6)); height: var(--navbar-height); /* bù margin-left âm, nếu không nhãn luôn mất 6px */
  margin-left: calc(-1 * var(--space-6)); padding: 0 var(--space-8) 0 0;
  border: 0; background: none; color: var(--accent); text-decoration: none; cursor: pointer;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
}
.lm-navbar__back .lm-icon { --lm-icon-size: 26px; flex: none; }
.lm-navbar__back-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-navbar__back:active { opacity: var(--opacity-pressed); }
.lm-navbar__large-title {
  margin: 0;
  padding: var(--space-2) max(var(--screen-margin), env(safe-area-inset-right, 0px)) var(--space-8) max(var(--screen-margin), env(safe-area-inset-left, 0px));
  font-size: var(--page-title-size); line-height: var(--page-title-line); letter-spacing: var(--ls-large-title); font-weight: var(--fw-bold);
  text-wrap: balance;
}
.lm-navbar__search { padding: 0 var(--screen-margin) var(--space-10); }
.lm-navbar__search .lm-control { min-height: var(--search-height); border-radius: var(--radius-10); }
.lm-navbar__search .lm-control__input { height: var(--search-height); }
.lm-navbar:not(.lm-navbar--large) .lm-navbar__large-title { display: none; }
/* Large title: thanh trong suốt, tiêu đề lớn cuộn đi; JS thêm .is-scrolled */
.lm-navbar--large { display: contents; }
.lm-navbar--large > .lm-navbar__bar {
  position: sticky; top: 0; z-index: var(--z-header);
  padding-top: env(safe-area-inset-top, 0px);
  background: transparent;
  transition: background-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.lm-navbar--large > .lm-navbar__bar .lm-navbar__title { opacity: 0; }
.lm-navbar--large.is-scrolled > .lm-navbar__bar {
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  box-shadow: inset 0 calc(-1 * var(--hairline)) 0 var(--separator);
}
.lm-navbar--large.is-scrolled > .lm-navbar__bar .lm-navbar__title { opacity: 1; }
/* Trong suốt (trên ảnh bìa) */
.lm-navbar--transparent { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* --------------------------------------------------------------------------
   Tab bar
   -------------------------------------------------------------------------- */
.lm-tabbar {
  position: sticky; bottom: 0; z-index: var(--z-header);
  display: flex; align-items: stretch;
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  box-shadow: inset 0 var(--hairline) 0 var(--separator);
}
.lm-tabbar--fixed { position: fixed; left: 0; right: 0; bottom: 0; }
.lm-tabbar__item {
  position: relative;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--tabbar-height); padding: var(--space-2) var(--space-2) 0;
  border: 0; background: none; color: var(--gray);
  text-decoration: none; cursor: pointer; font-family: inherit;
  -webkit-user-select: none; user-select: none;
}
.lm-tabbar__item .lm-icon { --lm-icon-size: 26px; }
.lm-tabbar__label {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-caption-2); line-height: var(--lh-caption-2); font-weight: var(--fw-medium);
}
.lm-tabbar__item[aria-current="page"], .lm-tabbar__item[aria-selected="true"], .lm-tabbar__item.is-active { color: var(--accent); }
.lm-tabbar__item:active { opacity: var(--opacity-pressed); }
.lm-tabbar__badge {
  position: absolute; top: 3px; left: calc(50% + 4px);
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--red); color: var(--on-accent);
  font-size: var(--fs-caption-2); line-height: 18px; font-weight: var(--fw-semibold); text-align: center;
  font-variant-numeric: tabular-nums;
}
.lm-tabbar__badge:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 6px; left: calc(50% + 8px); }
@media (min-width: 768px) {
  .lm-tabbar { justify-content: center; }
  .lm-tabbar__item { flex: 0 1 180px; flex-direction: row; gap: var(--space-6); }
  .lm-tabbar__item .lm-icon { --lm-icon-size: var(--icon-md); }
  .lm-tabbar__label { font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
  .lm-tabbar__badge { top: 6px; left: auto; right: calc(50% - 44px); }
}

/* --------------------------------------------------------------------------
   Sidebar (iPadOS)
   -------------------------------------------------------------------------- */
.lm-sidebar {
  display: flex; flex-direction: column; gap: var(--space-4);
  min-width: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: env(safe-area-inset-top, 0px) 0 calc(var(--space-16) + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px);
  background: var(--bg-secondary);
  box-shadow: inset calc(-1 * var(--hairline)) 0 0 var(--separator);
}
.lm-sidebar__header { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-4); min-height: var(--navbar-height); padding: 0 var(--space-8); }
.lm-sidebar__header .lm-btn--plain { padding: 0 var(--space-8); }
.lm-sidebar__title {
  margin: 0; padding: 0 var(--space-20) var(--space-8);
  font-size: var(--fs-title-1); line-height: var(--lh-title-1); letter-spacing: var(--ls-title-1); font-weight: var(--fw-bold);
}
.lm-sidebar__search { padding: 0 var(--space-16) var(--space-8); }
.lm-sidebar__search .lm-control { min-height: var(--search-height); }
.lm-sidebar__search .lm-control__input { height: var(--search-height); }
.lm-sidebar__section { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-12); }
.lm-sidebar__section + .lm-sidebar__section { margin-top: var(--space-12); }
.lm-sidebar__section-title {
  margin: 0; padding: var(--space-8) var(--space-8) var(--space-4);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-semibold); color: var(--label-secondary);
}
.lm-sidebar__item {
  display: flex; align-items: center; gap: var(--space-12);
  width: 100%; min-height: var(--control-md); padding: 0 var(--space-12);
  border: 0; border-radius: var(--radius-10);
  background: transparent; color: var(--label);
  text-align: left; text-decoration: none; cursor: pointer; font-family: inherit;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
}
.lm-sidebar__item > .lm-icon { --lm-icon-size: var(--icon-md); color: var(--accent); }
.lm-sidebar__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-sidebar__count { flex: none; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.lm-sidebar__item:active { background: var(--row-pressed); }
.lm-sidebar__item[aria-current="page"], .lm-sidebar__item.is-active { background: var(--accent); color: var(--on-accent); }
.lm-sidebar__item[aria-current="page"] > .lm-icon, .lm-sidebar__item.is-active > .lm-icon,
.lm-sidebar__item[aria-current="page"] .lm-sidebar__count, .lm-sidebar__item.is-active .lm-sidebar__count { color: var(--on-accent); }
.lm-sidebar__footer { margin-top: auto; padding: var(--space-12) var(--space-20) 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); }
@media (hover: hover) { .lm-sidebar__item:not([aria-current="page"]):not(.is-active):hover { background: var(--fill-quaternary); } }
@media (min-width: 1200px) and (pointer: fine) {
  .lm-sidebar__item { min-height: 36px; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); border-radius: var(--radius-8); }
  .lm-sidebar__item > .lm-icon { --lm-icon-size: 20px; }
}

/* --------------------------------------------------------------------------
   Toolbar (thanh công cụ dưới / trên)
   -------------------------------------------------------------------------- */
.lm-toolbar {
  position: sticky; bottom: 0; z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-8);
  min-height: var(--toolbar-height);
  padding: 0 max(calc(var(--screen-margin) - var(--space-8)), env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(calc(var(--screen-margin) - var(--space-8)), env(safe-area-inset-left, 0px));
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  box-shadow: inset 0 var(--hairline) 0 var(--separator);
}
.lm-toolbar--top { top: 0; bottom: auto; padding-bottom: 0; box-shadow: inset 0 calc(-1 * var(--hairline)) 0 var(--separator); }
.lm-toolbar .lm-btn--plain { padding: 0 var(--space-8); font-weight: var(--fw-regular); }
.lm-toolbar .lm-btn--icon { width: var(--hit-target); padding: 0; }
.lm-toolbar__status {
  flex: 1 1 auto; min-width: 0; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); color: var(--label-secondary);
}

/* --------------------------------------------------------------------------
   Website header / footer
   -------------------------------------------------------------------------- */
.lm-layout__header {
  position: sticky; top: 0; z-index: var(--z-header);
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  box-shadow: inset 0 calc(-1 * var(--hairline)) 0 var(--separator);
}
.lm-layout__header-inner { display: flex; align-items: center; gap: var(--space-16); min-height: 52px; }
.lm-layout__brand { display: inline-flex; align-items: center; gap: var(--space-8); flex: none; color: var(--label); text-decoration: none; font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: var(--fw-semibold); }
.lm-layout__nav { display: none; align-items: center; gap: var(--space-4); min-width: 0; }
.lm-layout__nav a {
  padding: var(--space-6) var(--space-10); border-radius: var(--radius-8);
  color: var(--label-secondary); text-decoration: none;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); white-space: nowrap;
}
.lm-layout__nav a[aria-current="page"] { color: var(--label); font-weight: var(--fw-semibold); }
.lm-layout__actions { display: flex; align-items: center; gap: var(--space-8); margin-left: auto; }
.lm-layout__menu-btn { display: inline-flex; }
@media (hover: hover) { .lm-layout__nav a:hover { background: var(--fill-quaternary); color: var(--label); } }
@media (min-width: 768px) {
  .lm-layout__nav { display: flex; }
  .lm-layout__menu-btn { display: none; }
}
@media (min-width: 1200px) { .lm-layout__header-inner { min-height: 60px; } }
.lm-layout__footer {
  padding-top: var(--section-gap);
  padding-bottom: calc(var(--section-gap) + env(safe-area-inset-bottom, 0px));
  box-shadow: inset 0 var(--hairline) 0 var(--separator);
  color: var(--label-secondary);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
}
.lm-layout__footer a { color: var(--label-secondary); }

/* ===== Masonry.css ===== */
/* ==========================================================================
   Masonry — lưới so le 2 / 3 / 4 cột, gap = --card-gap
   CSS columns (thứ tự đọc theo cột) · data-lm-masonry="row" (thứ tự đọc theo hàng, JS)
   ========================================================================== */
.lm-masonry {
  --lm-cols: 2;
  column-count: var(--lm-cols);
  column-gap: var(--card-gap);
  min-width: 0;
}
@media (min-width: 768px) { .lm-masonry { --lm-cols: 3; } }
@media (min-width: 1200px) { .lm-masonry { --lm-cols: 4; } }
.lm-masonry > * {
  display: block; width: 100%;
  margin: 0 0 var(--card-gap);
  break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
}
/* Số cột cố định */
.lm-masonry--1 { --lm-cols: 1 !important; }
.lm-masonry--2 { --lm-cols: 2 !important; }
.lm-masonry--3 { --lm-cols: 3 !important; }
.lm-masonry--4 { --lm-cols: 4 !important; }
/* 1 cột trên mobile */
@media (max-width: 767.98px) { .lm-masonry--stack-mobile { --lm-cols: 1; } }

/* Chế độ JS: thứ tự theo hàng (giống Ant Masonry) */
.lm-masonry.is-js { display: flex; align-items: flex-start; gap: var(--card-gap); column-count: auto; }
.lm-masonry__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--card-gap); }
.lm-masonry.is-js > .lm-masonry__col { width: auto; margin: 0; }
.lm-masonry.is-js .lm-masonry__col > * { margin: 0; }

/* Ô ảnh mẫu (tỉ lệ) */
.lm-masonry__tile { position: relative; overflow: hidden; border-radius: var(--radius-12); background: var(--bg-grouped-secondary); }
.lm-masonry__media { display: block; width: 100%; max-width: 100%; aspect-ratio: var(--lm-ratio, 1); object-fit: cover; background: var(--fill-tertiary); }
.lm-masonry__caption { padding: var(--space-8) var(--space-12) var(--space-10); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); }
.lm-masonry__meta { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); }

/* ===== Space.css ===== */
/* ==========================================================================
   Space — khoảng cách giữa các phần tử inline + Space.Compact (ghép control)
   ========================================================================== */
.lm-space {
  --lm-space: var(--space-12);
  display: inline-flex; align-items: center; flex-wrap: nowrap;
  gap: var(--lm-space);
  min-width: 0; vertical-align: top;
}
.lm-space--vertical { display: flex; flex-direction: column; align-items: stretch; }
.lm-space--block { display: flex; width: 100%; }
.lm-space--wrap { flex-wrap: wrap; }
/* Kích thước (Ant small / middle / large) */
.lm-space--xs { --lm-space: var(--space-4); }
.lm-space--sm { --lm-space: var(--space-8); }
.lm-space--lg { --lm-space: var(--space-16); }
.lm-space--xl { --lm-space: var(--space-24); }
.lm-space--field { --lm-space: var(--field-gap); }
.lm-space--group { --lm-space: var(--group-gap); }
/* Căn chỉnh */
.lm-space--align-start { align-items: flex-start; }
.lm-space--align-center { align-items: center; }
.lm-space--align-end { align-items: flex-end; }
.lm-space--align-baseline { align-items: baseline; }
.lm-space__item { display: inline-flex; min-width: 0; }
/* Split: phần tử phân cách giữa các item */
.lm-space__split { display: inline-block; flex: none; width: 1px; height: 0.9em; background: var(--separator-opaque); }
.lm-space--vertical > .lm-space__split { width: 100%; height: var(--hairline); background: var(--separator); }

/* --------------------------------------------------------------------------
   Compact — ghép Input + Button, Select + Input… thành một khối liền
   -------------------------------------------------------------------------- */
.lm-space--compact {
  display: inline-flex; align-items: stretch; flex-wrap: nowrap;
  gap: var(--hairline);
  isolation: isolate;
  vertical-align: top;
}
.lm-space--compact.lm-space--block { display: flex; }
.lm-space--compact > * { flex: none; position: relative; }
.lm-space--compact > .lm-control,
.lm-space--compact > .lm-anchor--block,
.lm-space--compact > .lm-space__grow { flex: 1 1 auto; min-width: 0; width: auto; }
.lm-space--compact > :focus-within { z-index: 1; }
/* Bo góc: chỉ hai đầu */
.lm-space--compact > :not(:first-child),
.lm-space--compact > :not(:first-child) > .lm-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.lm-space--compact > :not(:last-child),
.lm-space--compact > :not(:last-child) > .lm-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
/* Bordered / outlined: chồng viền 1px thay vì khe hở */
.lm-space--compact-bordered { gap: 0; }
.lm-space--compact-bordered > * + * { margin-left: -1px; }
/* Dọc */
.lm-space--compact-vertical { flex-direction: column; align-items: stretch; }
.lm-space--compact-vertical > :not(:first-child),
.lm-space--compact-vertical > :not(:first-child) > .lm-control { border-radius: 0; }
.lm-space--compact-vertical > :first-child,
.lm-space--compact-vertical > :first-child > .lm-control { border-radius: var(--radius-10) var(--radius-10) 0 0; }
.lm-space--compact-vertical > :last-child,
.lm-space--compact-vertical > :last-child > .lm-control { border-radius: 0 0 var(--radius-10) var(--radius-10); }
.lm-space--compact-vertical > :only-child,
.lm-space--compact-vertical > :only-child > .lm-control { border-radius: var(--radius-10); }
/* Phần tử addon tĩnh (đơn vị, tiền tố URL) */
.lm-space__addon {
  display: inline-flex; align-items: center;
  padding: 0 var(--space-12);
  border-radius: var(--radius-10);
  background: var(--fill-secondary); color: var(--label-secondary);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); white-space: nowrap;
}
@media (max-width: 767.98px) {
  .lm-space--stack-mobile:not(.lm-space--compact) { display: flex; flex-direction: column; align-items: stretch; }
}

/* ===== Splitter.css ===== */
/* ==========================================================================
   Splitter — chia vùng kéo được (Split view divider)
   <div class="lm-splitter"> pane · handle · pane </div>
   Pane có kích thước: style="--lm-size: 30%; --lm-grow: 0" · còn lại tự giãn.
   ========================================================================== */
.lm-splitter {
  display: flex; width: 100%; min-width: 0;
  min-height: 240px;
  border-radius: var(--radius-12);
  background: var(--bg-grouped-secondary);
  overflow: hidden;
}
.lm-splitter--vertical { flex-direction: column; }
.lm-splitter--flush { border-radius: 0; background: transparent; }
.lm-splitter__pane {
  flex-grow: var(--lm-grow, 1); flex-shrink: 1; flex-basis: var(--lm-size, 0%);
  min-width: 0; min-height: 0;
  overflow: auto; overscroll-behavior: contain;
  padding: var(--card-padding);
}
.lm-splitter__pane--flush { padding: 0; }
.lm-splitter__pane.is-collapsed { flex: 0 0 0px !important; padding: 0; overflow: hidden; visibility: hidden; }

/* Thanh kéo */
.lm-splitter__handle {
  position: relative; z-index: 1;
  flex: none; width: 12px;
  cursor: col-resize; touch-action: none; outline: none;
  background: transparent;
}
.lm-splitter__handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: var(--hairline); background: var(--separator); }
.lm-splitter__handle::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 4px; height: 36px; translate: -50% -50%;
  border-radius: var(--radius-full); background: var(--gray-3);
  transition: background-color var(--duration-fast) var(--ease-standard), scale var(--duration-fast) var(--ease-spring);
}
.lm-splitter__handle:focus-visible::after,
.lm-splitter__handle.is-dragging::after { background: var(--accent); scale: 1.15; }
.lm-splitter__handle:focus-visible::before { width: var(--ring-width); background: var(--focus-ring); translate: -50% 0; }
.lm-splitter__handle[aria-disabled="true"] { cursor: default; }
.lm-splitter__handle[aria-disabled="true"]::after { display: none; }
@media (hover: hover) { .lm-splitter__handle:not([aria-disabled="true"]):hover::after { background: var(--accent); } }
.lm-splitter.is-dragging { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.lm-splitter--vertical.is-dragging { cursor: row-resize; }

.lm-splitter--vertical > .lm-splitter__handle { width: auto; height: 12px; cursor: row-resize; }
.lm-splitter--vertical > .lm-splitter__handle::before { top: 50%; bottom: auto; left: 0; right: 0; width: auto; height: var(--hairline); }
.lm-splitter--vertical > .lm-splitter__handle::after { width: 36px; height: 4px; }
.lm-splitter--vertical > .lm-splitter__handle:focus-visible::before { width: auto; height: var(--ring-width); translate: 0 -50%; }

/* Nút thu gọn trên thanh kéo */
.lm-splitter__toggle {
  position: absolute; top: var(--space-8); left: 50%; translate: -50% 0; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: var(--radius-full);
  background: var(--bg-elevated); color: var(--label-secondary);
  box-shadow: var(--shadow-raised);
  cursor: pointer;
}
.lm-splitter__toggle .lm-icon { --lm-icon-size: 14px; transition: transform var(--duration-base) var(--ease-spring); }
.lm-splitter__pane.is-collapsed + .lm-splitter__handle .lm-splitter__toggle .lm-icon,
.lm-splitter__handle:has(+ .lm-splitter__pane.is-collapsed) .lm-splitter__toggle .lm-icon { transform: rotate(180deg); }
.lm-splitter--vertical > .lm-splitter__handle .lm-splitter__toggle { top: 50%; left: var(--space-8); translate: 0 -50%; }

/* Mobile: xếp dọc, thanh kéo thành hairline (trừ khi --keep) */
@media (max-width: 767.98px) {
  .lm-splitter:not(.lm-splitter--keep) { flex-direction: column; min-height: 0; height: auto !important; }
  .lm-splitter:not(.lm-splitter--keep) > .lm-splitter__pane,
  .lm-splitter:not(.lm-splitter--keep) > .lm-splitter__pane.is-collapsed { flex: none !important; padding: var(--card-padding); overflow: visible; visibility: visible; }
  .lm-splitter:not(.lm-splitter--keep) > .lm-splitter__handle { width: auto; height: var(--hairline); cursor: default; pointer-events: none; background: var(--separator); }
  .lm-splitter:not(.lm-splitter--keep) > .lm-splitter__handle::before,
  .lm-splitter:not(.lm-splitter--keep) > .lm-splitter__handle::after,
  .lm-splitter:not(.lm-splitter--keep) .lm-splitter__toggle { display: none; }
}

/* ===== Anchor.css ===== */
/* ==========================================================================
   Anchor — scroll-spy table of contents (Ant Anchor) · block lm-anchor-nav
   Mobile: sticky chip row (material bar) · Tablet/Desktop: sticky rail + indicator
   Forced: lm-anchor-nav--chips · lm-anchor-nav--rail
   ========================================================================== */

/* Content + TOC layout helper */
.lm-anchor-layout { display: grid; gap: var(--group-gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
.lm-anchor-layout > .lm-anchor-nav { order: -1; }
@media (min-width: 768px) {
  .lm-anchor-layout { grid-template-columns: minmax(0, 1fr) 200px; gap: var(--section-gap); }
  .lm-anchor-layout > .lm-anchor-nav { order: 0; }
}
@media (min-width: 1200px) { .lm-anchor-layout { grid-template-columns: minmax(0, 1fr) 240px; } }

/* Base = chip row (mobile-first) */
.lm-anchor-nav {
  --lm-anchor-offset: 0px;
  position: sticky; top: calc(var(--lm-anchor-offset) + env(safe-area-inset-top, 0px));
  z-index: var(--z-sticky);
  display: flex; flex-direction: column; gap: var(--space-8);
  min-width: 0;
  margin-inline: calc(-1 * var(--screen-margin));
  padding: var(--space-8) var(--screen-margin);
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  box-shadow: 0 var(--hairline) 0 var(--separator);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
}
.lm-anchor-nav__title {
  display: none; margin: 0; padding-left: var(--space-12);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-semibold); color: var(--label-secondary); text-transform: uppercase;
}
.lm-anchor-nav__list {
  display: flex; flex-direction: row; gap: var(--space-8);
  list-style: none; margin: 0; padding: 0;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
}
.lm-anchor-nav__list::-webkit-scrollbar { display: none; }
.lm-anchor-nav__item { flex: none; scroll-snap-align: start; }
.lm-anchor-nav__item--sub { display: none; }
.lm-anchor-nav__link {
  display: inline-flex; align-items: center;
  min-height: var(--control-sm); padding: 0 var(--space-14);
  border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--label);
  text-decoration: none; white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.lm-anchor-nav__link:active { opacity: var(--opacity-pressed); }
.lm-anchor-nav__link[aria-current], .lm-anchor-nav__link.is-active { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }

/* Rail — forced */
.lm-anchor-nav--rail { margin-inline: 0; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.lm-anchor-nav--rail .lm-anchor-nav__title { display: block; }
.lm-anchor-nav--rail .lm-anchor-nav__list { flex-direction: column; gap: 0; overflow: visible; box-shadow: inset 2px 0 0 var(--fill); }
.lm-anchor-nav--rail .lm-anchor-nav__item--sub { display: block; }
.lm-anchor-nav--rail .lm-anchor-nav__link { display: flex; min-height: 32px; padding: var(--space-4) var(--space-12); border-radius: 0; background: transparent; color: var(--label-secondary); white-space: normal; box-shadow: inset 2px 0 0 transparent; font-weight: var(--fw-regular); }
.lm-anchor-nav--rail .lm-anchor-nav__item--sub > .lm-anchor-nav__link { padding-left: var(--space-24); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.lm-anchor-nav--rail .lm-anchor-nav__link[aria-current], .lm-anchor-nav--rail .lm-anchor-nav__link.is-active { background: transparent; color: var(--accent); font-weight: var(--fw-semibold); box-shadow: inset 2px 0 0 var(--accent); }

/* Rail — automatic from tablet */
@media (min-width: 768px) {
  .lm-anchor-nav:not(.lm-anchor-nav--chips) { margin-inline: 0; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .lm-anchor-nav:not(.lm-anchor-nav--chips) .lm-anchor-nav__title { display: block; }
  .lm-anchor-nav:not(.lm-anchor-nav--chips) .lm-anchor-nav__list { flex-direction: column; gap: 0; overflow: visible; box-shadow: inset 2px 0 0 var(--fill); }
  .lm-anchor-nav:not(.lm-anchor-nav--chips) .lm-anchor-nav__item--sub { display: block; }
  .lm-anchor-nav:not(.lm-anchor-nav--chips) .lm-anchor-nav__link { display: flex; min-height: 32px; padding: var(--space-4) var(--space-12); border-radius: 0; background: transparent; color: var(--label-secondary); white-space: normal; box-shadow: inset 2px 0 0 transparent; font-weight: var(--fw-regular); }
  .lm-anchor-nav:not(.lm-anchor-nav--chips) .lm-anchor-nav__item--sub > .lm-anchor-nav__link { padding-left: var(--space-24); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
  .lm-anchor-nav:not(.lm-anchor-nav--chips) .lm-anchor-nav__link[aria-current],
  .lm-anchor-nav:not(.lm-anchor-nav--chips) .lm-anchor-nav__link.is-active { background: transparent; color: var(--accent); font-weight: var(--fw-semibold); box-shadow: inset 2px 0 0 var(--accent); }
}
@media (hover: hover) and (pointer: fine) {
  .lm-anchor-nav--rail .lm-anchor-nav__link:not([aria-current]):hover { color: var(--label); }
  .lm-anchor-nav__link:not([aria-current]):hover { color: var(--label); }
}

/* ===== Breadcrumb.css ===== */
/* ==========================================================================
   Breadcrumb — trail (≥ 768) · iOS back button "‹ Parent" (mobile)
   Forced: lm-breadcrumb--back · lm-breadcrumb--trail
   ========================================================================== */
.lm-breadcrumb {
  display: flex; align-items: center; min-width: 0;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label-secondary);
}
.lm-breadcrumb__list { display: flex; flex-wrap: wrap; align-items: center; row-gap: var(--space-4); list-style: none; margin: 0; padding: 0; min-width: 0; }
.lm-breadcrumb__item { display: inline-flex; align-items: center; min-width: 0; }
.lm-breadcrumb__item + .lm-breadcrumb__item::before {
  content: ""; flex: none;
  width: 6px; height: 6px; margin: 0 var(--space-10) 0 var(--space-6);
  border-top: 1.5px solid var(--label-tertiary); border-right: 1.5px solid var(--label-tertiary);
  transform: rotate(45deg);
}
.lm-breadcrumb--slash .lm-breadcrumb__item + .lm-breadcrumb__item::before {
  content: "/"; width: auto; height: auto; border: 0; transform: none; margin: 0 var(--space-8); color: var(--label-tertiary);
}
.lm-breadcrumb__link {
  display: inline-flex; align-items: center; gap: var(--space-4);
  margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-4)); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-6);
  color: var(--label-secondary); text-decoration: none; white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.lm-breadcrumb__link .lm-icon, .lm-breadcrumb__current .lm-icon { --lm-icon-size: 16px; }
.lm-breadcrumb__link:active { opacity: var(--opacity-pressed); }
.lm-breadcrumb__current {
  display: inline-flex; align-items: center; gap: var(--space-4); min-width: 0;
  color: var(--label); font-weight: var(--fw-semibold);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lm-breadcrumb__more {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px; padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-6); background: transparent; color: var(--label-secondary);
}
.lm-breadcrumb__more[aria-expanded="true"] { background: var(--fill-tertiary); color: var(--label); }
@media (hover: hover) and (pointer: fine) {
  .lm-breadcrumb__link:hover, .lm-breadcrumb__more:hover { color: var(--label); background: var(--fill-quaternary); }
}

/* iOS back button */
.lm-breadcrumb__back {
  display: none; align-items: center; gap: var(--space-2);
  min-height: var(--hit-target); max-width: 100%;
  margin-left: calc(-1 * var(--space-6)); padding: 0 var(--space-8) 0 0;
  color: var(--accent); text-decoration: none;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
}
.lm-breadcrumb__back .lm-icon { --lm-icon-size: 26px; }
.lm-breadcrumb__back-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-breadcrumb__back:active { opacity: var(--opacity-pressed); }

.lm-breadcrumb--back > .lm-breadcrumb__back { display: inline-flex; }
.lm-breadcrumb--back > .lm-breadcrumb__list { display: none; }
@media (max-width: 767.98px) {
  .lm-breadcrumb:not(.lm-breadcrumb--trail):has(> .lm-breadcrumb__back) > .lm-breadcrumb__back { display: inline-flex; }
  .lm-breadcrumb:not(.lm-breadcrumb--trail):has(> .lm-breadcrumb__back) > .lm-breadcrumb__list { display: none; }
  /* a trail kept on mobile scrolls instead of wrapping */
  .lm-breadcrumb__list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lm-breadcrumb__list::-webkit-scrollbar { display: none; }
}

/* ===== Dropdown.css ===== */
/* ==========================================================================
   Dropdown — UIMenu / context menu (lm-anchor + lm-floating + lm-panel + lm-option)
   + Action sheet (UIAlertController .actionSheet) + Dropdown.Button (split)
   ========================================================================== */
.lm-dropdown { position: relative; }
.lm-dropdown__menu { min-width: 250px; overflow: visible; max-height: none; }
.lm-dropdown__menu .lm-option { gap: var(--space-10); }
/* iOS menus: icon on the right, checkmark on the left */
.lm-dropdown__menu .lm-option__icon { order: 3; color: inherit; }
.lm-dropdown__menu .lm-option__extra { order: 2; font-size: var(--fs-footnote); color: var(--label-tertiary); }
.lm-dropdown__menu .lm-option__check { order: -1; --lm-icon-size: 18px; margin-right: calc(-1 * var(--space-2)); }
.lm-dropdown__menu .lm-option[aria-checked="true"] .lm-option__check { visibility: visible; }
.lm-dropdown__menu .lm-option--danger .lm-option__icon { color: var(--danger); }
/* hairlines between rows (touch) — sections use lm-panel__divider */
.lm-dropdown__menu .lm-option + .lm-option,
.lm-dropdown__menu .lm-option + .lm-dropdown__sub,
.lm-dropdown__menu .lm-dropdown__sub + .lm-option,
.lm-dropdown__menu .lm-dropdown__sub + .lm-dropdown__sub,
.lm-dropdown__menu .lm-dropdown__header + .lm-option { box-shadow: inset 0 var(--hairline) 0 var(--separator); }
.lm-dropdown__menu > .lm-panel__divider { height: var(--space-8); margin: 0; background: var(--fill-quaternary); }
.lm-dropdown__header {
  padding: var(--space-8) var(--space-16);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  color: var(--label-secondary); text-align: center;
}
.lm-dropdown__menu > .lm-option:first-child { border-top-left-radius: var(--radius-12); border-top-right-radius: var(--radius-12); }
.lm-dropdown__menu > .lm-option:last-child { border-bottom-left-radius: var(--radius-12); border-bottom-right-radius: var(--radius-12); }
.lm-dropdown__menu.lm-panel { padding: 0; }
@media (min-width: 1200px) and (pointer: fine) {
  .lm-dropdown__menu.lm-panel { padding: var(--space-4); }
  .lm-dropdown__menu { min-width: 220px; }
  .lm-dropdown__menu .lm-option + .lm-option,
  .lm-dropdown__menu .lm-option + .lm-dropdown__sub,
  .lm-dropdown__menu .lm-dropdown__sub + .lm-option,
  .lm-dropdown__menu .lm-dropdown__sub + .lm-dropdown__sub,
  .lm-dropdown__menu .lm-dropdown__header + .lm-option { box-shadow: none; }
  .lm-dropdown__menu > .lm-panel__divider { height: var(--hairline); margin: var(--space-4) var(--space-8); background: var(--separator); }
  .lm-dropdown__menu > .lm-option:first-child, .lm-dropdown__menu > .lm-option:last-child { border-radius: var(--radius-6); }
  .lm-dropdown__menu .lm-option__icon { --lm-icon-size: 18px; }
}

/* Submenu */
.lm-dropdown__sub { display: block; position: relative; width: 100%; }
.lm-dropdown__sub > .lm-option .lm-option__icon { transition: transform var(--duration-fast) var(--ease-standard); }
.lm-dropdown__sub > .lm-floating { top: calc(-1 * var(--space-6)); left: calc(100% + var(--space-4)); translate: none; min-width: max-content; transform-origin: top left; }
@media (max-width: 767.98px) {
  /* iOS inline expansion */
  .lm-dropdown__sub > .lm-floating { position: static; display: none; opacity: 1; visibility: visible; pointer-events: auto; transform: none; min-width: 0; }
  .lm-dropdown__sub.is-open > .lm-floating { display: block; }
  .lm-dropdown__sub > .lm-floating > .lm-panel { min-width: 0; max-width: none; padding: 0; border-radius: 0; box-shadow: inset 0 var(--hairline) 0 var(--separator); background: var(--fill-quaternary); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lm-dropdown__sub > .lm-floating .lm-option { padding-left: var(--space-32); border-radius: 0; }
  .lm-dropdown__sub.is-open > .lm-option .lm-option__icon { transform: rotate(90deg); }
}

/* Context menu (right click / long press) */
.lm-dropdown__context { position: fixed; top: 0; left: 0; min-width: 0; z-index: var(--z-dropdown); }
.lm-dropdown-target { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.lm-dropdown-target.is-pressed { transform: scale(0.97); transition: transform var(--duration-base) var(--ease-spring); }

/* Dropdown.Button — split button */
.lm-dropdown-button { display: inline-flex; align-items: stretch; gap: 1px; }
.lm-dropdown-button > .lm-btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.lm-dropdown-button > .lm-anchor > .lm-btn { border-top-left-radius: 0; border-bottom-left-radius: 0; min-width: 0; width: var(--control-md); padding: 0; }
.lm-dropdown-button > .lm-anchor > .lm-btn.lm-btn--sm { width: var(--control-sm); }

/* ── Action sheet ─────────────────────────────────────────────────────── */
.lm-action-sheet { align-items: flex-end; justify-content: center; z-index: var(--z-dropdown); }
.lm-action-sheet__sheet {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: var(--space-8);
  width: 100%; max-width: 420px;
  padding: var(--space-8) max(var(--space-8), env(safe-area-inset-right, 0px)) calc(var(--space-8) + env(safe-area-inset-bottom, 0px)) max(var(--space-8), env(safe-area-inset-left, 0px));
  transform: translateY(100%);
  transition: transform var(--duration-slow) var(--ease-spring), opacity var(--duration-fast) var(--ease-out);
}
.lm-layer.is-open > .lm-action-sheet__sheet, .lm-layer--inline > .lm-action-sheet__sheet { transform: none; }
.lm-action-sheet__group {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-14);
  background: var(--material-thick);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
}
.lm-action-sheet__header { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-14) var(--space-16); text-align: center; }
.lm-action-sheet__title { margin: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); font-weight: var(--fw-semibold); color: var(--label-secondary); }
.lm-action-sheet__message { margin: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
.lm-action-sheet__action, .lm-action-sheet__cancel {
  display: flex; align-items: center; justify-content: center; gap: var(--space-8);
  width: 100%; min-height: 57px; padding: 0 var(--space-16);
  border: 0; background: transparent; color: var(--accent);
  font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3);
  cursor: pointer;
}
.lm-action-sheet__action { box-shadow: inset 0 var(--hairline) 0 var(--separator); }
.lm-action-sheet__group > .lm-action-sheet__action:first-child { box-shadow: none; }
.lm-action-sheet__action .lm-icon { --lm-icon-size: 22px; }
.lm-action-sheet__action:active { background: var(--fill-secondary); }
.lm-action-sheet__action--danger { color: var(--danger); }
.lm-action-sheet__action:disabled { color: var(--label-tertiary); cursor: not-allowed; background: transparent; }
.lm-action-sheet__cancel { border-radius: var(--radius-14); background: var(--bg-elevated); font-weight: var(--fw-semibold); }
.lm-action-sheet__cancel:active { background: var(--row-pressed); }
@media (min-width: 768px) {
  /* iPad / desktop: compact centered sheet instead of a full-width bottom sheet */
  .lm-action-sheet { align-items: center; }
  .lm-action-sheet__sheet { max-width: 320px; padding: 0; transform: scale(0.96); opacity: 0; }
  .lm-layer.is-open > .lm-action-sheet__sheet, .lm-layer--inline > .lm-action-sheet__sheet { transform: none; opacity: 1; }
  .lm-action-sheet__action, .lm-action-sheet__cancel { min-height: var(--control-md); font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); }
}
@media (hover: hover) and (pointer: fine) {
  .lm-action-sheet__action:not(:disabled):hover, .lm-action-sheet__cancel:hover { background: var(--fill-quaternary); }
}

/* ===== Menu.css ===== */
/* ==========================================================================
   Menu — iPadOS / macOS sidebar list (Ant Menu inline/vertical/horizontal)
   Modifiers: --soft · --collapsed · --auto-collapse (icon rail on tablet) · --horizontal · --pill
   ========================================================================== */
.lm-menu {
  display: flex; flex-direction: column; gap: var(--space-2);
  min-width: 0; padding: var(--space-8);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  color: var(--label);
}
.lm-menu__heading {
  margin: var(--space-14) 0 var(--space-4); padding: 0 var(--space-12);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-semibold); color: var(--label-secondary);
}
.lm-menu__heading:first-child { margin-top: var(--space-4); }
.lm-menu__item {
  display: flex; align-items: center; gap: var(--space-12);
  width: 100%; min-height: var(--row-height);
  padding: var(--space-6) var(--space-12);
  border: 0; border-radius: var(--radius-10);
  background: transparent; color: var(--label);
  font: inherit; text-align: left; text-decoration: none; list-style: none;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.lm-menu__icon { flex: none; --lm-icon-size: var(--icon-md); color: var(--accent); }
.lm-menu__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-menu__badge { flex: none; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.lm-menu__badge--count {
  min-width: 20px; height: 20px; padding: 0 var(--space-6);
  border-radius: var(--radius-full); background: var(--red); color: var(--on-accent);
  font-size: var(--fs-caption-1); line-height: 20px; font-weight: var(--fw-semibold); text-align: center;
}
.lm-menu__arrow { flex: none; --lm-icon-size: 16px; color: var(--label-tertiary); transition: transform var(--duration-fast) var(--ease-standard); }
.lm-menu__item:active { background: var(--row-pressed); }
.lm-menu__item[aria-current="page"], .lm-menu__item.is-selected { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }
.lm-menu__item[aria-current="page"] :is(.lm-menu__icon, .lm-menu__badge, .lm-menu__arrow),
.lm-menu__item.is-selected :is(.lm-menu__icon, .lm-menu__badge, .lm-menu__arrow) { color: var(--on-accent); }
.lm-menu__item[aria-disabled="true"], .lm-menu__item.is-disabled { color: var(--label-tertiary); cursor: not-allowed; background: transparent; }
.lm-menu__item[aria-disabled="true"] .lm-menu__icon { color: var(--label-tertiary); }
.lm-menu--soft .lm-menu__item[aria-current="page"], .lm-menu--soft .lm-menu__item.is-selected { background: var(--accent-soft); color: var(--accent); }
.lm-menu--soft .lm-menu__item[aria-current="page"] :is(.lm-menu__icon, .lm-menu__badge),
.lm-menu--soft .lm-menu__item.is-selected :is(.lm-menu__icon, .lm-menu__badge) { color: var(--accent); }
.lm-menu__divider { height: var(--hairline); margin: var(--space-8) var(--space-12); border: 0; background: var(--separator); }

/* Submenu — native <details> */
.lm-menu__group { display: flex; flex-direction: column; }
.lm-menu__group > summary { list-style: none; }
.lm-menu__group > summary::-webkit-details-marker { display: none; }
.lm-menu__group[open] > summary .lm-menu__arrow { transform: rotate(180deg); }
.lm-menu__sub { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-2); }
.lm-menu__sub > .lm-menu__item { padding-left: calc(var(--space-12) * 2 + var(--icon-md)); }

@media (hover: hover) and (pointer: fine) {
  .lm-menu__item:not([aria-current="page"]):not(.is-selected):not([aria-disabled="true"]):hover { background: var(--fill-quaternary); }
}
/* Desktop density (macOS sidebar) */
@media (min-width: 1200px) and (pointer: fine) {
  .lm-menu { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
  .lm-menu__item { min-height: 36px; padding: var(--space-6) var(--space-10); gap: var(--space-10); border-radius: var(--radius-8); }
  .lm-menu__icon { --lm-icon-size: 18px; }
  .lm-menu__sub > .lm-menu__item { padding-left: calc(var(--space-10) * 2 + 18px); }
}

/* Collapsed — icon rail */
.lm-menu--collapsed { align-items: center; width: calc(var(--control-md) + 2 * var(--space-8)); }
.lm-menu--collapsed :is(.lm-menu__label, .lm-menu__arrow, .lm-menu__sub, .lm-menu__badge:not(.lm-menu__badge--count)) { display: none; }
.lm-menu--collapsed .lm-menu__heading { height: var(--hairline); width: 100%; margin: var(--space-8) 0; padding: 0; overflow: hidden; font-size: 0; background: var(--separator); }
.lm-menu--collapsed .lm-menu__item { position: relative; justify-content: center; width: var(--control-md); min-height: var(--control-md); padding: 0; }
.lm-menu--collapsed .lm-menu__badge--count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 var(--space-4); font-size: var(--fs-caption-2); line-height: 16px; }
@media (min-width: 768px) and (max-width: 1199.98px) {
  .lm-menu--auto-collapse { align-items: center; width: calc(var(--control-md) + 2 * var(--space-8)); }
  .lm-menu--auto-collapse :is(.lm-menu__label, .lm-menu__arrow, .lm-menu__sub, .lm-menu__badge:not(.lm-menu__badge--count)) { display: none; }
  .lm-menu--auto-collapse .lm-menu__heading { height: var(--hairline); width: 100%; margin: var(--space-8) 0; padding: 0; overflow: hidden; font-size: 0; background: var(--separator); }
  .lm-menu--auto-collapse .lm-menu__item { position: relative; justify-content: center; width: var(--control-md); min-height: var(--control-md); padding: 0; }
  .lm-menu--auto-collapse .lm-menu__badge--count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 var(--space-4); font-size: var(--fs-caption-2); line-height: 16px; }
}

/* Horizontal — top navigation (web) */
.lm-menu--horizontal {
  flex-direction: row; align-items: stretch; gap: var(--space-4);
  padding: 0;
  box-shadow: inset 0 calc(-1 * var(--hairline)) 0 var(--separator);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
}
/* Mobile: the bar scrolls sideways (avoid hover submenus there — they would be clipped) */
@media (max-width: 767.98px) { .lm-menu--horizontal { overflow-x: auto; scrollbar-width: none; } }
.lm-menu--horizontal::-webkit-scrollbar { display: none; }
.lm-menu--horizontal .lm-menu__item { width: auto; flex: none; min-height: var(--control-md); padding: 0 var(--space-12); gap: var(--space-6); border-radius: 0; color: var(--label-secondary); font-weight: var(--fw-semibold); }
.lm-menu--horizontal .lm-menu__icon { --lm-icon-size: 18px; color: inherit; }
.lm-menu--horizontal .lm-menu__item[aria-current="page"], .lm-menu--horizontal .lm-menu__item.is-selected { background: transparent; color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.lm-menu--horizontal .lm-menu__item[aria-current="page"] :is(.lm-menu__icon, .lm-menu__arrow) { color: var(--accent); }
.lm-menu--horizontal .lm-menu__item:active { background: transparent; opacity: var(--opacity-pressed); }
.lm-menu--horizontal > .lm-anchor > .lm-menu__item { height: 100%; }
.lm-menu--pill { gap: var(--space-4); padding: var(--space-4); box-shadow: none; }
.lm-menu--pill .lm-menu__item { min-height: var(--control-sm); border-radius: var(--radius-full); padding: 0 var(--space-14); }
.lm-menu--pill .lm-menu__item[aria-current="page"], .lm-menu--pill .lm-menu__item.is-selected { background: var(--fill-secondary); color: var(--label); box-shadow: none; }
.lm-menu--pill .lm-menu__item[aria-current="page"] .lm-menu__icon { color: var(--label); }
@media (hover: hover) and (pointer: fine) {
  .lm-menu--horizontal .lm-menu__item:not([aria-current="page"]):not(.is-selected):hover { background: transparent; color: var(--label); }
  .lm-menu--pill .lm-menu__item:not([aria-current="page"]):not(.is-selected):hover { background: var(--fill-quaternary); }
}

/* ===== Pagination.css ===== */
/* ==========================================================================
   Pagination — numbered pills (≥ 768) · compact "‹ 3 / 12 ›" (mobile)
   Forced: lm-pagination--simple · lm-pagination--full · size --sm
   ========================================================================== */
.lm-pagination {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  font-variant-numeric: tabular-nums; color: var(--label);
}
.lm-pagination__total { margin-right: var(--space-8); color: var(--label-secondary); }
.lm-pagination__item {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 var(--space-8);
  border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--label);
  font: inherit; text-decoration: none; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.lm-pagination__item .lm-icon { --lm-icon-size: 18px; }
.lm-pagination__item:active:not(:disabled) { opacity: var(--opacity-pressed); }
.lm-pagination__item[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }
.lm-pagination__prev, .lm-pagination__next { color: var(--accent); }
.lm-pagination__item:disabled, .lm-pagination__item[aria-disabled="true"] { color: var(--label-tertiary); cursor: not-allowed; }
.lm-pagination__ellipsis { min-width: 28px; text-align: center; color: var(--label-tertiary); letter-spacing: 0.1em; user-select: none; }
.lm-pagination__simple { display: none; min-width: 72px; text-align: center; color: var(--label-secondary); }
.lm-pagination__simple b { color: var(--label); font-weight: var(--fw-semibold); }
.lm-pagination__size { margin-left: var(--space-8); }
.lm-pagination__size .lm-control { width: auto; min-width: 116px; }
.lm-pagination__jumper { display: inline-flex; align-items: center; gap: var(--space-8); margin-left: var(--space-8); color: var(--label-secondary); }
.lm-pagination__jumper .lm-control { width: 64px; }
.lm-pagination__jumper .lm-control__input { text-align: center; }
@media (hover: hover) and (pointer: fine) {
  .lm-pagination__item:not([aria-current="page"]):not(:disabled):hover { background: var(--fill-quaternary); }
}
@media (pointer: coarse) {
  .lm-pagination__item { min-width: var(--hit-target); height: var(--hit-target); }
}
.lm-pagination--sm { gap: var(--space-2); font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); }
.lm-pagination--sm .lm-pagination__item { min-width: 28px; height: 28px; padding: 0 var(--space-6); }
.lm-pagination--sm .lm-pagination__item .lm-icon { --lm-icon-size: 16px; }
.lm-pagination--center { justify-content: center; }
.lm-pagination--end { justify-content: flex-end; }

/* Simple (forced) */
.lm-pagination--simple { justify-content: center; gap: var(--space-16); }
.lm-pagination--simple :is(.lm-pagination__item:not(.lm-pagination__prev):not(.lm-pagination__next), .lm-pagination__ellipsis, .lm-pagination__size, .lm-pagination__jumper, .lm-pagination__total) { display: none; }
.lm-pagination--simple .lm-pagination__simple { display: inline-block; }
.lm-pagination--simple :is(.lm-pagination__prev, .lm-pagination__next) { min-width: var(--control-md); height: var(--control-md); background: var(--fill-secondary); }
.lm-pagination--simple :is(.lm-pagination__prev, .lm-pagination__next):disabled { background: var(--fill-quaternary); }
/* Simple (automatic on mobile) */
@media (max-width: 767.98px) {
  .lm-pagination:not(.lm-pagination--full) { justify-content: center; gap: var(--space-16); }
  .lm-pagination:not(.lm-pagination--full) :is(.lm-pagination__item:not(.lm-pagination__prev):not(.lm-pagination__next), .lm-pagination__ellipsis, .lm-pagination__size, .lm-pagination__jumper, .lm-pagination__total) { display: none; }
  .lm-pagination:not(.lm-pagination--full) .lm-pagination__simple { display: inline-block; }
  .lm-pagination:not(.lm-pagination--full) :is(.lm-pagination__prev, .lm-pagination__next) { min-width: var(--control-md); height: var(--control-md); background: var(--fill-secondary); }
  .lm-pagination:not(.lm-pagination--full) :is(.lm-pagination__prev, .lm-pagination__next):disabled { background: var(--fill-quaternary); }
}

/* ===== Steps.css ===== */
/* ==========================================================================
   Steps — vertical (mobile) · horizontal with labels below (≥ 768)
   Forced: lm-steps--vertical · lm-steps--horizontal · --dot · --sm · --clickable
   Status: is-wait (default) · is-process · is-finish · is-error
   ========================================================================== */
.lm-steps {
  --lm-step-icon: 28px;
  --lm-step-icon-offset: 0px;
  display: flex; flex-direction: column;
  list-style: none; margin: 0; padding: 0; min-width: 0;
}
.lm-steps__item { position: relative; display: flex; gap: var(--space-12); min-width: 0; padding-bottom: var(--space-16); }
.lm-steps__item:last-child { padding-bottom: 0; }
.lm-steps__item:not(:last-child)::after {
  content: ""; position: absolute;
  left: calc(var(--lm-step-icon) / 2 - 1px);
  top: calc(var(--lm-step-icon-offset) + var(--lm-step-icon) + var(--space-4)); bottom: var(--space-4);
  width: 2px; border-radius: 1px; background: var(--separator-opaque);
}
.lm-steps__item.is-finish:not(:last-child)::after { background: var(--accent); }
.lm-steps__icon {
  position: relative; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--lm-step-icon); height: var(--lm-step-icon); margin-top: var(--lm-step-icon-offset);
  border-radius: 50%;
  background: var(--fill-secondary); color: var(--label-secondary);
  font-size: var(--fs-subheadline); line-height: 1; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.lm-steps__icon .lm-icon { --lm-icon-size: 16px; }
.lm-steps__content { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; margin-top: max(0px, calc((var(--lm-step-icon) - var(--lh-body)) / 2)); }
.lm-steps__title { font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); color: var(--label-secondary); }
.lm-steps__subtitle { margin-left: var(--space-6); font-size: var(--fs-footnote); color: var(--label-tertiary); }
.lm-steps__desc { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }

.lm-steps__item.is-process .lm-steps__icon { background: var(--accent); color: var(--on-accent); }
.lm-steps__item.is-process .lm-steps__title { color: var(--label); font-weight: var(--fw-semibold); }
.lm-steps__item.is-finish .lm-steps__icon { background: var(--accent-soft); color: var(--accent); }
.lm-steps__item.is-finish .lm-steps__title { color: var(--label); }
.lm-steps__item.is-error .lm-steps__icon { background: var(--danger); color: var(--on-accent); }
.lm-steps__item.is-error .lm-steps__title { color: var(--danger-text); font-weight: var(--fw-semibold); }
.lm-steps__item.is-disabled { opacity: var(--opacity-disabled); }

/* Progress ring around the current step (style="--lm-step-progress: 60") */
.lm-steps__item--progress .lm-steps__icon::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--lm-step-progress, 0) * 1%), var(--fill) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
}

/* Sizes & styles */
.lm-steps--sm { --lm-step-icon: 22px; }
.lm-steps--sm .lm-steps__icon { font-size: var(--fs-footnote); }
.lm-steps--sm .lm-steps__icon .lm-icon { --lm-icon-size: 13px; }
.lm-steps--sm .lm-steps__title { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
.lm-steps--sm .lm-steps__content { margin-top: max(0px, calc((var(--lm-step-icon) - var(--lh-subheadline)) / 2)); }
.lm-steps--dot { --lm-step-icon: 10px; --lm-step-icon-offset: calc((var(--lh-body) - 10px) / 2); }
.lm-steps--dot .lm-steps__icon { font-size: 0; }
.lm-steps--dot .lm-steps__icon .lm-icon { display: none; }
.lm-steps--dot .lm-steps__item.is-wait .lm-steps__icon, .lm-steps--dot .lm-steps__item:not([class*="is-"]) .lm-steps__icon { background: var(--gray-3); }
.lm-steps--dot .lm-steps__item.is-finish .lm-steps__icon { background: var(--accent); }
.lm-steps--dot .lm-steps__item.is-process .lm-steps__icon { box-shadow: 0 0 0 4px var(--accent-soft); }

/* Clickable navigation */
.lm-steps--clickable .lm-steps__item { cursor: pointer; border-radius: var(--radius-8); }
.lm-steps--clickable .lm-steps__item:active .lm-steps__content { opacity: var(--opacity-pressed); }
@media (hover: hover) and (pointer: fine) {
  .lm-steps--clickable .lm-steps__item:not(.is-process):hover .lm-steps__title { color: var(--accent); }
}

/* Horizontal — forced */
.lm-steps--horizontal { flex-direction: row; align-items: flex-start; --lm-step-icon-offset: 0px; }
.lm-steps--horizontal .lm-steps__item { flex: 1 1 0; flex-direction: column; align-items: center; gap: var(--space-8); padding-bottom: 0; text-align: center; }
.lm-steps--horizontal .lm-steps__item:not(:last-child)::after { left: calc(50% + var(--lm-step-icon) / 2 + var(--space-8)); right: calc(-50% + var(--lm-step-icon) / 2 + var(--space-8)); top: calc(var(--lm-step-icon) / 2 - 1px); bottom: auto; width: auto; height: 2px; }
.lm-steps--horizontal .lm-steps__content { align-items: center; margin-top: 0; padding-inline: var(--space-4); }
.lm-steps--horizontal .lm-steps__subtitle { margin-left: 0; display: block; }
/* Horizontal — automatic from tablet */
@media (min-width: 768px) {
  .lm-steps:not(.lm-steps--vertical) { flex-direction: row; align-items: flex-start; --lm-step-icon-offset: 0px; }
  .lm-steps:not(.lm-steps--vertical) .lm-steps__item { flex: 1 1 0; flex-direction: column; align-items: center; gap: var(--space-8); padding-bottom: 0; text-align: center; }
  .lm-steps:not(.lm-steps--vertical) .lm-steps__item:not(:last-child)::after { left: calc(50% + var(--lm-step-icon) / 2 + var(--space-8)); right: calc(-50% + var(--lm-step-icon) / 2 + var(--space-8)); top: calc(var(--lm-step-icon) / 2 - 1px); bottom: auto; width: auto; height: 2px; }
  .lm-steps:not(.lm-steps--vertical) .lm-steps__content { align-items: center; margin-top: 0; padding-inline: var(--space-4); }
  .lm-steps:not(.lm-steps--vertical) .lm-steps__subtitle { margin-left: 0; display: block; }
}

/* ===== Tabs.css ===== */
/* ==========================================================================
   Tabs — iOS top tabs (scrollable, 2px accent underline)
   Modifiers: --sm · --lg · --justified · --centered · --card (editable) · --left (vertical ≥ 768)
   Segmented look: use lm-segmented with data-lm-tabs instead.
   ========================================================================== */
.lm-tabs { display: flex; flex-direction: column; gap: var(--group-gap); min-width: 0; }
.lm-tabs__bar { display: flex; align-items: center; gap: var(--space-12); min-width: 0; box-shadow: inset 0 calc(-1 * var(--hairline)) 0 var(--separator); }
.lm-tabs__list {
  display: flex; align-items: stretch; gap: var(--space-20);
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
}
.lm-tabs__list::-webkit-scrollbar { display: none; }
.lm-tabs__tab {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: var(--space-6);
  min-height: var(--control-md); padding: 0 var(--space-2);
  border: 0; background: transparent; color: var(--label-secondary);
  font-family: inherit; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); font-weight: var(--fw-semibold);
  white-space: nowrap; cursor: pointer; scroll-snap-align: start;
  transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.lm-tabs__tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 1px;
  background: var(--accent); transform: scaleX(0);
  transition: transform var(--duration-base) var(--ease-spring);
}
.lm-tabs__tab .lm-icon { --lm-icon-size: 18px; }
.lm-tabs__tab[aria-selected="true"] { color: var(--accent); }
.lm-tabs__tab[aria-selected="true"]::after { transform: scaleX(1); }
.lm-tabs__tab:active:not(:disabled) { opacity: var(--opacity-pressed); }
.lm-tabs__tab:disabled, .lm-tabs__tab[aria-disabled="true"] { color: var(--label-tertiary); cursor: not-allowed; }
.lm-tabs__count {
  min-width: 20px; height: 20px; padding: 0 var(--space-6);
  border-radius: var(--radius-full); background: var(--fill-tertiary); color: var(--label-secondary);
  font-size: var(--fs-caption-1); line-height: 20px; font-weight: var(--fw-medium); text-align: center; font-variant-numeric: tabular-nums;
}
.lm-tabs__tab[aria-selected="true"] .lm-tabs__count { background: var(--accent-soft); color: var(--accent); }
.lm-tabs__extra { flex: none; display: flex; align-items: center; gap: var(--space-8); }
.lm-tabs__panel { min-width: 0; }
.lm-tabs__panel[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .lm-tabs__tab:not([aria-selected="true"]):not(:disabled):not([aria-disabled="true"]):hover { color: var(--label); }
}

/* Sizes & alignment */
.lm-tabs--sm .lm-tabs__list { gap: var(--space-16); }
.lm-tabs--sm .lm-tabs__tab { min-height: 36px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); }
.lm-tabs--lg .lm-tabs__tab { min-height: var(--control-lg); font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); }
.lm-tabs--justified .lm-tabs__list { gap: 0; }
.lm-tabs--justified .lm-tabs__tab { flex: 1 1 0; justify-content: center; padding: 0 var(--space-8); }
.lm-tabs--centered .lm-tabs__list > :first-child { margin-left: auto; }
.lm-tabs--centered .lm-tabs__list > :last-child { margin-right: auto; }

/* Card (editable) — Safari-style tabs attached to the panel */
.lm-tabs--card { gap: 0; }
.lm-tabs--card > .lm-tabs__bar { box-shadow: none; }
.lm-tabs--card .lm-tabs__list { gap: var(--space-4); align-items: flex-end; }
.lm-tabs--card .lm-tabs__tab { min-height: 40px; padding: 0 var(--space-14); border-radius: var(--radius-10) var(--radius-10) 0 0; background: var(--fill-tertiary); color: var(--label-secondary); }
.lm-tabs--card .lm-tabs__tab::after { display: none; }
.lm-tabs--card .lm-tabs__tab[aria-selected="true"] { background: var(--bg-grouped-secondary); color: var(--label); }
.lm-tabs--card > .lm-tabs__panel { padding: var(--card-padding); background: var(--bg-grouped-secondary); border-radius: 0 var(--radius-12) var(--radius-12) var(--radius-12); }
.lm-tabs__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; margin-right: calc(-1 * var(--space-6));
  border-radius: var(--radius-full); color: var(--label-secondary); cursor: pointer;
}
.lm-tabs__close .lm-icon { --lm-icon-size: 13px; }
.lm-tabs__close:hover { background: var(--fill-secondary); color: var(--label); }
.lm-tabs__add {
  flex: none; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-sm); height: var(--control-sm);
  border: 0; border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--accent); cursor: pointer;
}
.lm-tabs__add .lm-icon { --lm-icon-size: 18px; }
.lm-tabs__add:active { opacity: var(--opacity-pressed); }

/* Vertical (tablet & desktop only — mobile falls back to top tabs) */
@media (min-width: 768px) {
  .lm-tabs--left { flex-direction: row; align-items: flex-start; gap: var(--section-gap); }
  .lm-tabs--left > .lm-tabs__bar { flex: none; width: 200px; flex-direction: column; align-items: stretch; box-shadow: inset calc(-1 * var(--hairline)) 0 0 var(--separator); }
  .lm-tabs--left .lm-tabs__list { flex-direction: column; gap: 0; overflow: visible; }
  .lm-tabs--left .lm-tabs__tab { min-height: 40px; padding: 0 var(--space-16) 0 0; white-space: normal; text-align: left; }
  .lm-tabs--left .lm-tabs__tab::after { left: auto; right: 0; top: var(--space-6); bottom: var(--space-6); width: 2px; height: auto; transform: scaleY(0); }
  .lm-tabs--left .lm-tabs__tab[aria-selected="true"]::after { transform: scaleY(1); }
  .lm-tabs--left > .lm-tabs__panel { flex: 1 1 auto; }
}

/* ===== AutoComplete.css ===== */
/* ==========================================================================
   AutoComplete — search suggestions (UISearchController suggestions) + Ant AutoComplete
   lm-control + .lm-floating > .lm-panel of .lm-option (foundation)
   ========================================================================== */
.lm-autocomplete__panel { max-height: 320px; }
.lm-autocomplete .lm-option { cursor: pointer; }
.lm-autocomplete .lm-option__icon { color: var(--label-secondary); }
.lm-autocomplete__mark,
.lm-autocomplete mark {
  background: transparent; color: inherit;
  font-weight: var(--fw-semibold);
}
.lm-autocomplete__empty {
  padding: var(--space-12) var(--space-16);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline);
  color: var(--label-secondary);
}
.lm-autocomplete__footer {
  padding: var(--space-8) var(--space-16) var(--space-4);
  border-top: var(--hairline) solid var(--separator);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote);
  color: var(--label-secondary);
}
/* Full-width panel under a search field on mobile */
@media (max-width: 767.98px) {
  .lm-autocomplete > .lm-floating > .lm-panel { max-width: none; }
}

/* ===== Cascader.css ===== */
/* ==========================================================================
   Picker sheet — shared by Cascader, DatePicker (and any .lm-anchor picker)
   bundle.js adds .is-sheet on mobile (< 768) or when the root has a --sheet modifier.
   Force: .lm-picker--sheet (always sheet) · .lm-picker--dropdown (never sheet)
   ========================================================================== */
.lm-anchor.is-sheet > .lm-floating:not(.lm-floating--static) {
  position: fixed; top: auto; left: 0; right: 0; bottom: 0;
  z-index: var(--z-overlay);
  min-width: 0; translate: none; opacity: 1;
  transform: translateY(100%); transform-origin: bottom center;
  transition: transform var(--duration-slow) var(--ease-spring), visibility 0s linear var(--duration-slow);
}
.lm-anchor.is-sheet.is-open > .lm-floating:not(.lm-floating--static) {
  transform: none;
  transition: transform var(--duration-slow) var(--ease-spring), visibility 0s;
}
.lm-anchor.is-sheet::after {
  content: ""; position: fixed; inset: 0;
  z-index: calc(var(--z-overlay) - 1);
  background: var(--overlay);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-spring), visibility 0s linear var(--duration-slow);
}
.lm-anchor.is-sheet.is-open::after { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity var(--duration-slow) var(--ease-spring), visibility 0s; }
.lm-anchor.is-sheet:has(> .lm-floating--static)::after { display: none; }
.lm-anchor.is-sheet > .lm-floating > .lm-panel {
  width: 100%; max-width: none;
  max-height: min(80dvh, 640px);
  border-radius: var(--radius-16) var(--radius-16) 0 0;
  padding-top: 0;
  padding-bottom: calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-elevated);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: var(--shadow-modal);
}

/* A statically rendered (always open) panel stacks under its trigger */
:is(.lm-cascader, .lm-datepicker, .lm-color-picker, .lm-autocomplete, .lm-mentions):has(> .lm-floating--static) { flex-direction: column; align-items: stretch; gap: var(--space-6); }
.lm-color-picker:has(> .lm-floating--static) { align-items: flex-start; }

.lm-picker-sheet__header { display: none; }
.lm-anchor.is-sheet .lm-picker-sheet__header {
  position: sticky; top: 0; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--space-8);
  min-height: 56px; padding: var(--space-12) var(--space-8) var(--space-4);
  background: var(--bg-elevated);
}
.lm-picker-sheet__grabber {
  position: absolute; top: var(--space-6); left: 50%; translate: -50% 0;
  width: 36px; height: 5px; border-radius: var(--radius-full); background: var(--gray-3);
}
.lm-picker-sheet__title {
  grid-column: 2; max-width: 60vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center;
  font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold);
}
.lm-picker-sheet__start { grid-column: 1; justify-self: start; display: flex; }
.lm-picker-sheet__end { grid-column: 3; justify-self: end; display: flex; }
.lm-picker-sheet__start [hidden] { display: none; }

/* ==========================================================================
   Cascader — multi-column panel (tablet/desktop) · drill-down sheet (mobile)
   ========================================================================== */
.lm-cascader > .lm-floating { min-width: 0; }
.lm-cascader__panel {
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
  min-width: 0; max-width: calc(100vw - 2 * var(--screen-margin)); max-height: none;
}
.lm-cascader__search { padding: var(--space-8); border-bottom: var(--hairline) solid var(--separator); }
.lm-cascader__columns { display: flex; max-height: 300px; overflow-x: auto; overscroll-behavior: contain; }
.lm-cascader__column {
  list-style: none; margin: 0; padding: var(--space-6) 0;
  flex: none; width: 200px; overflow-y: auto; overscroll-behavior: contain;
}
.lm-cascader__column > li { position: relative; }
.lm-cascader__column + .lm-cascader__column { border-left: var(--hairline) solid var(--separator); }
.lm-cascader__results { width: min(420px, calc(100vw - 2 * var(--screen-margin))); }
.lm-cascader .lm-option.is-expanded { background: var(--accent-soft); }
.lm-cascader .lm-option.is-selected { font-weight: var(--fw-semibold); }
.lm-cascader__arrow { flex: none; color: var(--label-tertiary); --lm-icon-size: 16px; }
.lm-cascader__check { min-height: 0; flex: none; }
.lm-cascader__check > input { pointer-events: none; }
.lm-cascader__empty { padding: var(--space-16); font-size: var(--fs-subheadline); color: var(--label-secondary); }
.lm-cascader__tags { display: flex; gap: var(--space-4); overflow: hidden; }
@media (min-width: 1200px) and (pointer: fine) {
  .lm-cascader__column { padding: var(--space-4); }
  .lm-cascader .lm-option { border-radius: var(--radius-6); }
}

/* Sheet presentation: one level at a time */
.lm-cascader.is-sheet .lm-cascader__panel { max-width: none; }
.lm-cascader.is-sheet .lm-cascader__columns { max-height: none; flex: 1 1 auto; overflow: auto; }
.lm-cascader.is-sheet .lm-cascader__column { display: none; width: 100%; padding: 0; }
.lm-cascader.is-sheet .lm-cascader__column:last-child { display: block; }
.lm-cascader.is-sheet .lm-cascader__column + .lm-cascader__column { border-left: 0; }
.lm-cascader.is-sheet .lm-cascader__column > li + li::before {
  content: ""; position: absolute; top: 0; right: 0; left: var(--space-16);
  border-top: var(--hairline) solid var(--separator);
}
.lm-cascader.is-sheet .lm-option {
  min-height: var(--control-md); padding: var(--space-10) var(--space-16); border-radius: 0;
  font-size: var(--fs-body); line-height: var(--lh-body);
}
.lm-cascader.is-sheet .lm-option.is-expanded { background: transparent; }
.lm-cascader.is-sheet .lm-cascader__results { width: 100%; }

/* ===== Checkbox.css ===== */
/* ==========================================================================
   Checkbox — iOS circular selection (Reminders, edit-mode list) + Ant Checkbox, Checkbox.Group
   <label class="lm-checkbox"><input type="checkbox"><span>Nhãn</span></label>
   ========================================================================== */
.lm-checkbox {
  --lm-check-size: 22px;
  --lm-check-color: var(--accent);
  position: relative;
  display: inline-flex; align-items: center; gap: var(--space-12);
  min-height: var(--hit-target);
  color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  vertical-align: middle;
}
.lm-checkbox > input {
  --lm-check-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  -webkit-appearance: none; appearance: none;
  flex: none; display: inline-grid; place-content: center;
  width: var(--lm-check-size); height: var(--lm-check-size); margin: 0;
  border-radius: var(--radius-full);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--gray-2);
  color: var(--on-accent);
  cursor: inherit;
  transition: background-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.lm-checkbox > input::before {
  content: "";
  width: calc(var(--lm-check-size) * 0.62); height: calc(var(--lm-check-size) * 0.62);
  background: currentColor;
  -webkit-mask: var(--lm-check-glyph) center / contain no-repeat;
  mask: var(--lm-check-glyph) center / contain no-repeat;
  transform: scale(0);
  transition: transform var(--duration-fast) var(--ease-spring);
}
.lm-checkbox > input:indeterminate {
  --lm-check-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M6.5 12h11'/%3E%3C/svg%3E");
}
.lm-checkbox > input:checked,
.lm-checkbox > input:indeterminate { background: var(--lm-check-color); box-shadow: none; }
.lm-checkbox > input:checked::before,
.lm-checkbox > input:indeterminate::before { transform: scale(1); }
.lm-checkbox > input:active:not(:disabled) { opacity: var(--opacity-pressed); }
.lm-checkbox > span { min-width: 0; }
.lm-checkbox__desc {
  display: block;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label-secondary);
}
@media (hover: hover) and (pointer: fine) {
  .lm-checkbox:hover > input:not(:checked):not(:indeterminate):not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--lm-check-color); }
}

/* States */
.lm-checkbox:has(> input:disabled) { cursor: not-allowed; color: var(--label-tertiary); }
.lm-checkbox > input:disabled { opacity: var(--opacity-disabled); }
.lm-checkbox > input[aria-invalid="true"]:not(:checked) { box-shadow: inset 0 0 0 1.5px var(--danger); }

/* Sizes */
.lm-checkbox--sm {
  --lm-check-size: 18px; gap: var(--space-8); min-height: var(--control-sm);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
}
.lm-checkbox--lg { --lm-check-size: 26px; }

/* Shapes & tones */
.lm-checkbox--square > input { --lm-check-size: 18px; border-radius: var(--radius-4); }
.lm-checkbox--square.lm-checkbox--sm > input { --lm-check-size: 16px; }
.lm-checkbox--green { --lm-check-color: var(--green); }
.lm-checkbox--orange { --lm-check-color: var(--orange); }
.lm-checkbox--red { --lm-check-color: var(--red); }
.lm-checkbox--purple { --lm-check-color: var(--purple); }
.lm-checkbox--gray { --lm-check-color: var(--gray); }

/* Task style (Reminders): checked label fades and strikes through */
.lm-checkbox--task > input:checked + span { color: var(--label-secondary); text-decoration: line-through; text-decoration-color: var(--label-tertiary); }

/* Full-width row (inside lists / groups) */
.lm-checkbox--row,
.lm-checkbox-group--list > .lm-checkbox {
  display: flex; width: 100%;
  min-height: var(--control-md);
  padding: var(--space-10) var(--space-16);
}
.lm-checkbox--row:active,
.lm-checkbox-group--list > .lm-checkbox:active { background: var(--row-pressed); }
.lm-checkbox--row.lm-checkbox--trailing,
.lm-checkbox-group--list.lm-checkbox-group--trailing > .lm-checkbox { flex-direction: row-reverse; justify-content: space-between; }

/* Group */
.lm-checkbox-group { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; margin: 0; padding: 0; border: 0; }
.lm-checkbox-group--inline { flex-direction: row; flex-wrap: wrap; column-gap: var(--space-20); }
.lm-checkbox-group--list {
  align-items: stretch;
  background: var(--bg-grouped-secondary);
  border-radius: var(--radius-10);
  overflow: hidden;
}
.lm-checkbox-group--list > .lm-checkbox + .lm-checkbox::before {
  content: ""; position: absolute; top: 0; right: 0;
  left: calc(var(--space-16) + var(--lm-check-size) + var(--space-12));
  border-top: var(--hairline) solid var(--separator);
}
.lm-checkbox-group--list.lm-checkbox-group--trailing > .lm-checkbox + .lm-checkbox::before { left: var(--space-16); }

/* ===== ColorPicker.css ===== */
/* ==========================================================================
   ColorPicker — UIColorWell / UIColorPickerViewController + Ant ColorPicker
   bundle.js sets on the root: --lm-color, --lm-color-opaque, --lm-hue, --lm-s, --lm-v, --lm-h, --lm-a
   Note: the saturation/value square must blend pure white and black — those two
   gradient stops are colour math, not theme colours.
   ========================================================================== */
.lm-color-picker { --lm-color: var(--accent); --lm-color-opaque: var(--accent); --lm-hue: 211; --lm-s: 1; --lm-v: 1; --lm-h: 0.586; --lm-a: 1; }
.lm-color-picker__trigger { gap: var(--space-10); }
.lm-color-picker__trigger .lm-control__value {
  font-family: var(--font-mono); font-size: var(--fs-subheadline); letter-spacing: 0;
  text-transform: uppercase; font-variant-numeric: tabular-nums;
}
.lm-color-picker__swatch, .lm-color-picker__preset, .lm-color-well__color {
  --lm-checker: conic-gradient(var(--fill) 25%, transparent 0 50%, var(--fill) 0 75%, transparent 0) 0 0 / 8px 8px;
}
.lm-color-picker__swatch {
  flex: none; width: 24px; height: 24px; border-radius: var(--radius-full);
  background: linear-gradient(var(--lm-color), var(--lm-color)), var(--lm-checker), var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--separator);
}
.lm-control--sm .lm-color-picker__swatch { width: 18px; height: 18px; }

/* UIColorWell — circular well with a spectrum ring */
.lm-color-well {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: conic-gradient(from 90deg, hsl(0 100% 55%), hsl(60 100% 50%), hsl(120 90% 45%), hsl(180 90% 45%), hsl(240 100% 60%), hsl(300 90% 55%), hsl(360 100% 55%));
  cursor: pointer;
}
.lm-color-well::after { content: ""; position: absolute; inset: -7px; }
.lm-color-well__color {
  width: 22px; height: 22px; border-radius: var(--radius-full);
  background: linear-gradient(var(--lm-color), var(--lm-color)), var(--lm-checker), var(--bg-elevated);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}
.lm-color-well:active { opacity: var(--opacity-pressed); }

/* Panel */
.lm-color-picker__panel {
  display: flex; flex-direction: column; gap: var(--space-12);
  width: 288px; max-width: calc(100vw - 2 * var(--screen-margin)); max-height: none;
}
.lm-color-picker__sv {
  position: relative; height: 168px; border-radius: var(--radius-10);
  background:
    linear-gradient(to top, hsl(0 0% 0%), hsl(0 0% 0% / 0)),
    linear-gradient(to right, hsl(0 0% 100%), hsl(var(--lm-hue) 100% 50%));
  touch-action: none; cursor: crosshair;
}
.lm-color-picker__handle {
  position: absolute; width: 22px; height: 22px;
  border-radius: var(--radius-full);
  border: 3px solid var(--thumb);
  background: var(--lm-color-opaque);
  box-shadow: var(--shadow-thumb);
  translate: -50% -50%; pointer-events: none;
}
.lm-color-picker__sv > .lm-color-picker__handle { left: calc(var(--lm-s) * 100%); top: calc((1 - var(--lm-v)) * 100%); }
.lm-color-picker__track {
  position: relative; height: 14px; margin-inline: 7px;
  border-radius: var(--radius-full); touch-action: none; cursor: pointer;
}
.lm-color-picker__track::before { content: ""; position: absolute; inset: 0 -7px; border-radius: inherit; background: inherit; }
.lm-color-picker__track > .lm-color-picker__handle { top: 50%; z-index: 1; }
.lm-color-picker__hue {
  background: linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%));
}
.lm-color-picker__hue > .lm-color-picker__handle { left: calc(var(--lm-h) * 100%); background: hsl(var(--lm-hue) 100% 50%); }
.lm-color-picker__alpha {
  background: linear-gradient(to right, transparent, var(--lm-color-opaque)), conic-gradient(var(--fill) 25%, transparent 0 50%, var(--fill) 0 75%, transparent 0) 0 0 / 8px 8px, var(--bg-elevated);
}
.lm-color-picker__alpha > .lm-color-picker__handle { left: calc(var(--lm-a) * 100%); background: var(--lm-color); }
.lm-color-picker__sv:focus-visible, .lm-color-picker__track:focus-visible { outline: var(--ring-width) solid var(--focus-ring); outline-offset: 3px; }

.lm-color-picker__fields { display: flex; gap: var(--space-8); }
.lm-color-picker__fields > .lm-control { flex: 1 1 auto; }
.lm-color-picker__fields > .lm-color-picker__alpha-field { flex: 0 0 84px; }
.lm-color-picker__fields .lm-control__input { font-family: var(--font-mono); text-transform: uppercase; }
.lm-color-picker__fields .lm-control__prefix { font-size: var(--fs-caption-1); font-weight: var(--fw-semibold); }

.lm-color-picker__presets-label { margin: 0; padding: 0; }
.lm-color-picker__presets { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-8); }
.lm-color-picker__preset {
  position: relative; width: 100%; aspect-ratio: 1; max-width: 32px; justify-self: center;
  padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--lm-color);
  cursor: pointer;
}
.lm-color-picker__preset::after { content: ""; position: absolute; inset: -4px; }
.lm-color-picker__preset[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--lm-color); }
.lm-color-picker__preset:active { opacity: var(--opacity-pressed); }

/* Swatches-only variant (palette without the spectrum) */
.lm-color-picker--swatches .lm-color-picker__sv,
.lm-color-picker--swatches .lm-color-picker__track,
.lm-color-picker--swatches .lm-color-picker__fields { display: none; }

/* States */
.lm-color-picker.is-disabled { opacity: var(--opacity-disabled); pointer-events: none; }

/* ===== DatePicker.css ===== */
/* ==========================================================================
   DatePicker — UIDatePicker (.compact pill, .inline calendar) + Ant DatePicker, RangePicker
   Panel = .lm-panel.lm-date-panel (rendered by bundle.js). Week starts Monday (vi-VN).
   Mobile (< 768) opens as a bottom sheet (see Picker sheet in Cascader.css).
   ========================================================================== */
.lm-datepicker .lm-control { cursor: pointer; }
.lm-datepicker .lm-control__input { cursor: pointer; caret-color: transparent; }
.lm-datepicker .lm-control__prefix .lm-icon { --lm-icon-size: 20px; }
.lm-datepicker > .lm-floating { min-width: 0; }

/* Range: two inputs in one control */
.lm-range-control { gap: var(--space-8); }
.lm-range-control > .lm-control__input { flex: 1 1 0; min-width: 0; }
.lm-range-control > .lm-control__input.is-active { box-shadow: inset 0 -2px 0 var(--accent); }
.lm-range-control__sep { flex: none; color: var(--label-tertiary); --lm-icon-size: 16px; }

/* Panel shell */
.lm-date-panel {
  --lm-day-size: 40px;
  display: flex; flex-direction: column;
  width: max-content; min-width: 0; max-width: calc(100vw - 2 * var(--screen-margin)); max-height: none;
  padding: var(--space-12);
  overflow: auto;
}
.lm-date-panel__body { display: flex; gap: var(--space-12); min-width: 0; }
.lm-date-panel__main { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.lm-date-panel__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding-left: var(--space-6); }
.lm-date-panel__title {
  display: inline-flex; align-items: center; gap: var(--space-4);
  border: 0; background: none; padding: var(--space-6) 0; color: var(--label); cursor: pointer;
  font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold);
}
.lm-date-panel__title .lm-icon { color: var(--accent); --lm-icon-size: 16px; transition: rotate var(--duration-fast) var(--ease-standard); }
.lm-date-panel[data-view="months"] .lm-date-panel__title .lm-icon,
.lm-date-panel[data-view="years"] .lm-date-panel__title .lm-icon { rotate: 90deg; }
.lm-date-panel__nav { display: flex; gap: var(--space-4); }
.lm-date-panel__navbtn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; padding: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--accent); cursor: pointer; --lm-icon-size: 20px;
}
.lm-date-panel__navbtn::after { content: ""; position: absolute; inset: -4px; }
.lm-date-panel__navbtn:active { opacity: var(--opacity-pressed); }
.lm-date-panel__navbtn:disabled { color: var(--label-tertiary); cursor: not-allowed; }

/* Month grid(s) */
.lm-date-panel__views { display: flex; gap: var(--space-24); }
.lm-date-panel__view { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.lm-date-panel__caption {
  text-align: center; padding-bottom: var(--space-4);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-semibold);
}
.lm-date-panel__weekdays, .lm-date-panel__days { display: grid; grid-template-columns: repeat(7, var(--lm-day-size)); }
.lm-date-panel__weekday {
  text-align: center; padding-bottom: var(--space-4);
  font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); font-weight: var(--fw-semibold);
  color: var(--label-secondary); text-transform: uppercase;
}
.lm-date-panel__cell { position: relative; display: flex; align-items: center; justify-content: center; height: var(--lm-day-size); }
.lm-date-panel__day {
  position: relative; z-index: 1;
  width: var(--lm-day-size); height: var(--lm-day-size); max-width: 44px; max-height: 44px;
  border: 0; padding: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--label); cursor: pointer;
  font-size: var(--fs-body); line-height: 1; letter-spacing: var(--ls-body); font-variant-numeric: tabular-nums;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.lm-date-panel__day.is-outside { color: var(--label-tertiary); }
.lm-date-panel__day.is-today { color: var(--accent); font-weight: var(--fw-semibold); }
.lm-date-panel__day.is-selected { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }
.lm-date-panel__day:disabled { color: var(--label-quaternary); cursor: not-allowed; }
.lm-date-panel__day:active:not(:disabled) { opacity: var(--opacity-pressed); }
@media (hover: hover) and (pointer: fine) {
  .lm-date-panel__day:not(.is-selected):not(:disabled):hover { background: var(--fill-quaternary); }
}
/* Range band */
.lm-date-panel__cell.is-in-range { background: var(--accent-soft); }
.lm-date-panel__cell.is-range-start { background: linear-gradient(to right, transparent 50%, var(--accent-soft) 50%); }
.lm-date-panel__cell.is-range-end { background: linear-gradient(to left, transparent 50%, var(--accent-soft) 50%); }
.lm-date-panel__cell.is-range-start.is-range-end { background: transparent; }
.lm-date-panel__days > .is-in-range:nth-child(7n + 1):not(.is-range-start) { border-radius: var(--radius-full) 0 0 var(--radius-full); }
.lm-date-panel__days > .is-in-range:nth-child(7n):not(.is-range-end) { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.lm-date-panel__cell.is-blank { pointer-events: none; }

/* Month & year grids */
.lm-date-panel__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); width: calc(var(--lm-day-size) * 7); padding-block: var(--space-4); }
.lm-date-panel__pick {
  height: var(--control-md); border: 0; border-radius: var(--radius-10);
  background: transparent; color: var(--label); cursor: pointer;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline);
}
.lm-date-panel__pick.is-current { color: var(--accent); font-weight: var(--fw-semibold); }
.lm-date-panel__pick.is-outside { color: var(--label-tertiary); }
.lm-date-panel__pick.is-selected { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }
.lm-date-panel__pick:active { opacity: var(--opacity-pressed); }
@media (hover: hover) and (pointer: fine) { .lm-date-panel__pick:not(.is-selected):hover { background: var(--fill-quaternary); } }

/* Presets & footer */
.lm-date-panel__presets {
  display: flex; flex-direction: column; gap: var(--space-2);
  min-width: 128px; padding-right: var(--space-12);
  border-right: var(--hairline) solid var(--separator);
}
.lm-date-panel__preset {
  height: 36px; padding: 0 var(--space-10); border: 0; border-radius: var(--radius-8);
  background: transparent; color: var(--accent); text-align: left; white-space: nowrap; cursor: pointer;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline);
}
.lm-date-panel__preset:active { opacity: var(--opacity-pressed); }
@media (hover: hover) and (pointer: fine) { .lm-date-panel__preset:hover { background: var(--fill-quaternary); } }
.lm-date-panel__footer {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-8);
  margin-top: var(--space-4); padding-top: var(--space-8);
  border-top: var(--hairline) solid var(--separator);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary);
}

/* Sheet presentation (mobile) */
.lm-datepicker.is-sheet .lm-date-panel {
  --lm-day-size: minmax(0, 1fr);
  width: 100%; max-width: none; padding: 0 var(--screen-margin) calc(var(--space-16) + env(safe-area-inset-bottom, 0px));
}
.lm-datepicker.is-sheet .lm-date-panel__body { flex-direction: column; }
.lm-datepicker.is-sheet .lm-date-panel__presets { flex-direction: row; overflow-x: auto; min-width: 0; padding: 0 0 var(--space-8); border-right: 0; border-bottom: var(--hairline) solid var(--separator); }
.lm-datepicker.is-sheet .lm-date-panel__preset { flex: none; background: var(--fill-tertiary); border-radius: var(--radius-full); padding: 0 var(--space-12); }
.lm-datepicker.is-sheet .lm-date-panel__view { flex: 1 1 auto; }
.lm-datepicker.is-sheet .lm-date-panel__cell { height: auto; aspect-ratio: 1; max-height: 48px; }
.lm-datepicker.is-sheet .lm-date-panel__day { width: 100%; height: 100%; max-width: 44px; max-height: 44px; aspect-ratio: 1; }
.lm-datepicker.is-sheet .lm-date-panel__grid { width: 100%; }

/* Inline calendar (UIDatePicker .inline) — sits in a card, fluid width */
.lm-date-panel--inline {
  --lm-day-size: minmax(0, 1fr);
  width: 100%; max-width: 420px;
  background: var(--bg-grouped-secondary); border-radius: var(--radius-12);
  box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  padding: var(--card-padding);
}
.lm-date-panel--inline .lm-date-panel__view { flex: 1 1 auto; }
.lm-date-panel--inline .lm-date-panel__views { width: 100%; }
.lm-date-panel--inline .lm-date-panel__cell { height: auto; aspect-ratio: 1; max-height: 48px; }
.lm-date-panel--inline .lm-date-panel__day { width: 100%; height: 100%; max-width: 44px; max-height: 44px; aspect-ratio: 1; }
.lm-date-panel--inline .lm-date-panel__grid { width: 100%; }

/* Compact pill (UIDatePicker .compact) */
.lm-date-pill {
  display: inline-flex; align-items: center; gap: var(--space-4);
  height: 34px; padding: 0 var(--space-12);
  border: 0; border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.lm-date-pill[aria-expanded="true"], .lm-date-pill.is-active { color: var(--accent); }
.lm-date-pill:active { opacity: var(--opacity-pressed); }
.lm-date-pill:disabled { color: var(--label-tertiary); cursor: not-allowed; }
.lm-date-pill-group { display: inline-flex; align-items: center; gap: var(--space-6); }

/* ===== Form.css ===== */
/* ==========================================================================
   Form — SwiftUI Form / UITableView .insetGrouped + Ant Form, Form.Item
   Spacing: field → --field-gap (12/14/16) · group → --group-gap (14/18/24)
   ========================================================================== */
.lm-form { display: flex; flex-direction: column; gap: var(--field-gap); min-width: 0; margin: 0; }
.lm-form:has(> .lm-form-group) { gap: var(--group-gap); }

/* Group (a titled set of fields) */
.lm-form-group { display: flex; flex-direction: column; gap: var(--field-gap); min-width: 0; margin: 0; padding: 0; border: 0; }
.lm-form-group__header { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: calc(var(--space-6) - var(--field-gap)); }
.lm-form-group__title {
  margin: 0;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-regular); text-transform: uppercase;
  color: var(--label-secondary);
}
.lm-form-group__desc, .lm-form-group__footer {
  margin: 0;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  color: var(--label-secondary);
}
.lm-form-group__footer { margin-top: calc(var(--space-6) - var(--field-gap)); }
.lm-form-group--card { background: var(--bg-grouped-secondary); border-radius: var(--radius-12); padding: var(--card-padding); }
.lm-form-group--card > .lm-form-group__header { margin-bottom: 0; }

/* Item = label + control + help / error */
.lm-form-item { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.lm-form-item__label {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-4);
  margin: 0;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  font-weight: var(--fw-semibold); color: var(--label);
}
.lm-form-item__required { color: var(--danger-text); font-weight: var(--fw-regular); }
.lm-form-item__optional { color: var(--label-secondary); font-weight: var(--fw-regular); }
.lm-form-item__control { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.lm-form-item__choices { display: flex; flex-wrap: wrap; column-gap: var(--space-20); row-gap: 0; }
.lm-form-item__help, .lm-form-item__error {
  margin: 0;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
}
.lm-form-item__help { color: var(--label-secondary); }
.lm-form-item__error { display: none; align-items: flex-start; gap: var(--space-4); color: var(--danger-text); }
.lm-form-item__error .lm-icon { --lm-icon-size: 16px; margin-top: 1px; }
.lm-form-item__warning { display: none; align-items: flex-start; gap: var(--space-4); margin: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--warning-text); }
.lm-form-item__warning .lm-icon { --lm-icon-size: 16px; margin-top: 1px; }

/* Validation states */
.lm-form-item.is-error .lm-form-item__error { display: flex; }
.lm-form-item.is-error .lm-form-item__help { display: none; }
.lm-form-item.is-error .lm-control { box-shadow: inset 0 0 0 1px var(--danger); background: var(--danger-soft); }
.lm-form-item.is-error .lm-otp__cell { box-shadow: inset 0 0 0 1px var(--danger); }
.lm-form-item.is-error :is(.lm-checkbox, .lm-radio) > input:not(:checked) { box-shadow: inset 0 0 0 1.5px var(--danger); }
.lm-form-item.is-warning .lm-form-item__warning { display: flex; }
.lm-form-item.is-warning .lm-control { box-shadow: inset 0 0 0 1px var(--warning); background: var(--warning-soft); }
.lm-form-item.is-disabled { opacity: var(--opacity-disabled); pointer-events: none; }

/* Horizontal labels — desktop only (auto) or always (fixed) */
@media (min-width: 1200px) {
  .lm-form--horizontal .lm-form-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--space-24); row-gap: var(--space-6); align-items: start; }
  .lm-form--horizontal .lm-form-item > .lm-form-item__label { grid-column: 1; justify-content: flex-end; text-align: right; padding-top: calc((var(--control-md) - var(--lh-subheadline)) / 2); }
  .lm-form--horizontal .lm-form-item > :not(.lm-form-item__label) { grid-column: 2; }
}
.lm-form--horizontal-fixed .lm-form-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: var(--space-24); row-gap: var(--space-6); align-items: start; }
.lm-form--horizontal-fixed .lm-form-item > .lm-form-item__label { grid-column: 1; justify-content: flex-end; text-align: right; padding-top: calc((var(--control-md) - var(--lh-subheadline)) / 2); }
.lm-form--horizontal-fixed .lm-form-item > :not(.lm-form-item__label) { grid-column: 2; }

/* Inline (filter bar) */
.lm-form--inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: var(--field-gap); }
.lm-form--inline > .lm-form-item { flex: 1 1 180px; }
.lm-form--inline > .lm-form__actions { flex: 0 0 auto; flex-direction: row; }
.lm-form--inline > .lm-form__actions > .lm-btn { width: auto; min-width: 0; }

/* --------------------------------------------------------------------------
   Inset grouped rows (iOS Settings style)
   -------------------------------------------------------------------------- */
.lm-form--inset .lm-form-group { gap: 0; }
.lm-form--inset .lm-form-group__header { margin: 0; padding: 0 var(--space-16) var(--space-6); }
.lm-form--inset .lm-form-group__footer { margin: 0; padding: var(--space-6) var(--space-16) 0; }
.lm-form-rows { background: var(--bg-grouped-secondary); border-radius: var(--radius-10); overflow: hidden; }
.lm-form-row {
  position: relative;
  display: flex; align-items: center; gap: var(--space-12);
  min-height: var(--control-md);
  padding: 0 var(--space-16);
  color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
}
.lm-form-row + .lm-form-row::before {
  content: ""; position: absolute; top: 0; right: 0; left: var(--space-16);
  border-top: var(--hairline) solid var(--separator);
}
.lm-form-row__label { flex: 0 0 auto; min-width: 0; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-form-row__value { flex: 1 1 auto; min-width: 0; text-align: right; color: var(--label-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-form-row__chevron { flex: none; color: var(--label-tertiary); --lm-icon-size: 16px; }
.lm-form-row > .lm-control { flex: 1 1 auto; min-height: var(--control-md); }
.lm-form-row__label ~ .lm-control .lm-control__input { text-align: right; }
.lm-form-row > .lm-switch, .lm-form-row > .lm-stepper, .lm-form-row > .lm-stepper-field { margin-left: auto; }
.lm-form-row--link { cursor: pointer; text-decoration: none; }
.lm-form-row--link:active { background: var(--row-pressed); }
.lm-form-row--stacked { flex-direction: column; align-items: stretch; gap: var(--space-2); padding-block: var(--space-8); }
.lm-form-row--stacked > .lm-form-row__label { max-width: none; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); }
.lm-form-row--stacked > .lm-control { min-height: 0; }
.lm-form-row--stacked .lm-control__input { height: var(--lh-body); text-align: left; }
.lm-form-row.is-error > .lm-form-row__label { color: var(--danger-text); }
.lm-form-row--action { justify-content: center; color: var(--accent); cursor: pointer; border: 0; width: 100%; background: transparent; font: inherit; }
.lm-form-row--danger { color: var(--danger); }
@media (hover: hover) { .lm-form-row--link:hover, .lm-form-row--action:hover { background: var(--fill-quaternary); } }

/* --------------------------------------------------------------------------
   Actions — mobile: full width stacked (primary on top) · ≥768: right aligned
   Put buttons in reading order: secondary first, primary last.
   -------------------------------------------------------------------------- */
.lm-form__actions { display: flex; flex-direction: column-reverse; gap: var(--space-8); }
.lm-form__actions > .lm-btn { width: 100%; }
.lm-form__actions--sticky {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  margin-inline: calc(-1 * var(--screen-margin));
  padding: var(--space-12) var(--screen-margin) calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  border-top: var(--hairline) solid var(--separator);
}
@media (min-width: 768px) {
  .lm-form__actions { flex-direction: row; justify-content: flex-end; }
  .lm-form__actions > .lm-btn { width: auto; min-width: 120px; }
  .lm-form__actions--start { justify-content: flex-start; }
  .lm-form__actions--sticky { position: static; margin: 0; padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ===== Input.css ===== */
/* ==========================================================================
   Input — UITextField · UISearchBar · UITextView + Ant Input, Search, Password, TextArea, OTP
   Shell = .lm-control (foundation). This file adds the extras.
   ========================================================================== */
.lm-input .lm-control__prefix .lm-icon,
.lm-input .lm-control__suffix .lm-icon { --lm-icon-size: 20px; }
.lm-input .lm-control__prefix:not(:has(.lm-icon)),
.lm-input .lm-control__suffix:not(:has(.lm-icon)) { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); }

/* Clear button (UITextField .whileEditing) — hidden while the field is empty */
.lm-control:has(> .lm-control__input:placeholder-shown) > .lm-control__clear { display: none; }
.lm-input__clear {
  position: relative;
  width: 18px; height: 18px; flex: none;
  align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--gray);
  color: var(--bg);
  --lm-icon-size: 12px;
}
.lm-input__clear .lm-icon svg { stroke-width: 3; }
.lm-input__clear::after { content: ""; position: absolute; inset: -13px; }
.lm-input__clear:active { opacity: var(--opacity-pressed); }

/* Password reveal */
.lm-input__reveal {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 28px; height: 28px; margin-right: calc(-1 * var(--space-4));
  border: 0; padding: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--label-secondary); cursor: pointer;
  --lm-icon-size: 20px;
}
.lm-input__reveal::after { content: ""; position: absolute; inset: -8px; }
.lm-input__reveal[aria-pressed="true"] { color: var(--accent); }

/* Character count as suffix */
.lm-input__count { flex: none; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-tertiary); font-variant-numeric: tabular-nums; }

/* Underlined variant (Ant variant="underlined") */
.lm-input--underlined { background: transparent; border-radius: 0; padding-inline: 0; box-shadow: inset 0 -1px 0 var(--separator-opaque); }
.lm-input--underlined:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }
.lm-control.lm-input--underlined:not(.is-disabled):hover { background: transparent; }
.lm-input--underlined.is-error { background: transparent; box-shadow: inset 0 -2px 0 var(--danger); }

/* --------------------------------------------------------------------------
   Search field (UISearchBar)
   -------------------------------------------------------------------------- */
.lm-search { display: flex; align-items: center; gap: var(--space-8); width: 100%; min-width: 0; }
.lm-search__field {
  min-height: var(--search-height);
  padding: 0 var(--space-8);
  gap: var(--space-6);
  border-radius: var(--radius-10);
}
.lm-search__field .lm-control__input { height: var(--search-height); }
.lm-search__field > .lm-control__prefix { color: var(--label-secondary); --lm-icon-size: 18px; }
.lm-search__field > .lm-control__suffix { --lm-icon-size: 20px; }
.lm-search input[type="search"]::-webkit-search-decoration,
.lm-search input[type="search"]::-webkit-search-cancel-button,
.lm-search input[type="search"]::-webkit-search-results-button { -webkit-appearance: none; appearance: none; }
.lm-search__cancel {
  display: none; flex: none;
  height: var(--search-height); min-width: 0; padding: 0 var(--space-4);
  font-weight: var(--fw-regular);
}
@media (max-width: 767.98px) {
  .lm-search:focus-within .lm-search__cancel,
  .lm-search.is-active .lm-search__cancel { display: inline-flex; }
}
.lm-search--always-cancel .lm-search__cancel { display: inline-flex; }
.lm-search--capsule .lm-search__field { border-radius: var(--radius-full); padding-inline: var(--space-12); }
.lm-search--lg .lm-search__field { min-height: var(--control-md); }
.lm-search--lg .lm-search__field .lm-control__input { height: var(--control-md); }

/* --------------------------------------------------------------------------
   Addon group (Ant addonBefore / addonAfter, Space.Compact, Search enterButton)
   -------------------------------------------------------------------------- */
.lm-input-group { display: flex; align-items: stretch; gap: 1px; width: 100%; min-width: 0; }
.lm-input-group > * { border-radius: 0; flex: none; }
.lm-input-group > .lm-control,
.lm-input-group > .lm-anchor--block { flex: 1 1 auto; min-width: 0; }
.lm-input-group > :first-child { border-top-left-radius: var(--radius-10); border-bottom-left-radius: var(--radius-10); }
.lm-input-group > :last-child { border-top-right-radius: var(--radius-10); border-bottom-right-radius: var(--radius-10); }
.lm-input-group > .lm-anchor > .lm-control { border-radius: inherit; }
.lm-input-group > .lm-btn { height: auto; min-height: var(--control-md); }
.lm-input-group__addon {
  display: inline-flex; align-items: center; gap: var(--space-6);
  min-height: var(--control-md); padding: 0 var(--space-12);
  background: var(--fill-secondary); color: var(--label-secondary);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  white-space: nowrap;
}
.lm-input-group--sm > :first-child { border-top-left-radius: var(--radius-8); border-bottom-left-radius: var(--radius-8); }
.lm-input-group--sm > :last-child { border-top-right-radius: var(--radius-8); border-bottom-right-radius: var(--radius-8); }
.lm-input-group--sm .lm-input-group__addon,
.lm-input-group--sm > .lm-btn { min-height: var(--control-sm); }

/* --------------------------------------------------------------------------
   TextArea (UITextView)
   -------------------------------------------------------------------------- */
.lm-textarea { flex-direction: column; align-items: stretch; gap: 0; cursor: text; }
.lm-textarea > .lm-control__input { min-height: 88px; padding-block: var(--space-10); line-height: var(--lh-body); }
.lm-textarea--autosize > .lm-control__input { resize: none; overflow: hidden; }
.lm-textarea__count {
  align-self: flex-end; padding-bottom: var(--space-8);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-tertiary);
  font-variant-numeric: tabular-nums;
}
.lm-textarea.is-over .lm-textarea__count { color: var(--danger-text); }

/* --------------------------------------------------------------------------
   OTP (one-time code)
   -------------------------------------------------------------------------- */
.lm-otp { display: flex; align-items: center; gap: var(--space-8); max-width: 100%; }
.lm-otp__cell {
  flex: 0 1 44px; width: 44px; min-width: 0; height: 52px;
  border: 0; border-radius: var(--radius-10); padding: 0;
  background: var(--fill-tertiary); color: var(--label);
  text-align: center; caret-color: var(--accent);
  font-size: var(--fs-title-2); line-height: var(--lh-title-2); font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}
.lm-otp__cell:focus, .lm-otp__cell:focus-visible { outline: none; box-shadow: 0 0 0 var(--ring-width) var(--accent); }
.lm-otp__sep { flex: none; color: var(--label-tertiary); font-size: var(--fs-title-3); }
.lm-otp.is-error .lm-otp__cell { box-shadow: inset 0 0 0 1px var(--danger); background: var(--danger-soft); }
.lm-otp.is-disabled .lm-otp__cell, .lm-otp__cell:disabled { opacity: var(--opacity-disabled); }
@media (min-width: 768px) { .lm-otp__cell { flex-basis: 48px; width: 48px; height: 56px; } }

/* ===== InputNumber.css ===== */
/* ==========================================================================
   InputNumber — numeric field with −/+ controls + UIStepper (Ant InputNumber)
   Shell = .lm-control. Formatting vi-VN: 1.250.000 · 12,5
   ========================================================================== */
.lm-input-number { padding-right: var(--space-6); }
.lm-input-number .lm-control__input { font-variant-numeric: tabular-nums; }
.lm-input-number input::-webkit-outer-spin-button,
.lm-input-number input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.lm-input-number input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.lm-input-number__actions { display: inline-flex; align-items: center; gap: var(--space-4); flex: none; }
.lm-input-number__btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; padding: 0; border: 0;
  border-radius: var(--radius-8);
  background: var(--fill-secondary); color: var(--accent);
  cursor: pointer;
  --lm-icon-size: 18px;
  transition: opacity var(--duration-instant) var(--ease-standard);
}
.lm-input-number__btn .lm-icon svg { stroke-width: 2.2; }
.lm-input-number__btn::after { content: ""; position: absolute; inset: -6px -2px; }
.lm-input-number__btn:active:not(:disabled) { opacity: var(--opacity-pressed); }
.lm-input-number__btn:disabled { background: var(--fill-quaternary); color: var(--label-tertiary); cursor: not-allowed; }
.lm-control--sm.lm-input-number { padding-right: var(--space-4); }
.lm-control--sm .lm-input-number__btn { width: 24px; height: 24px; border-radius: var(--radius-6); --lm-icon-size: 14px; }
.lm-control--lg .lm-input-number__btn { width: 36px; height: 36px; border-radius: var(--radius-10); }

/* Spinner mode (Ant mode="spinner"): − value + */
.lm-input-number--spinner { padding-inline: var(--space-6); }
.lm-input-number--spinner .lm-control__input { text-align: center; }
.lm-input-number--spinner.lm-control--sm { padding-inline: var(--space-4); }

/* Read-only formatted output inside a row */
.lm-input-number--inline { width: auto; display: inline-flex; }
.lm-input-number--inline .lm-control__input { width: 7ch; flex: none; }

/* --------------------------------------------------------------------------
   UIStepper — 94 × 32, segmented − | +
   -------------------------------------------------------------------------- */
.lm-stepper {
  display: inline-flex; align-items: center; flex: none; vertical-align: middle;
  width: 94px; height: var(--control-sm);
  border-radius: var(--radius-8);
  background: var(--fill-tertiary);
}
.lm-stepper__btn {
  position: relative; flex: 1 1 0; height: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; padding: 0; background: transparent; color: var(--label);
  border-radius: var(--radius-8);
  cursor: pointer;
  --lm-icon-size: 18px;
  transition: background-color var(--duration-instant) var(--ease-standard);
}
.lm-stepper__btn .lm-icon svg { stroke-width: 2.2; }
.lm-stepper__btn::after { content: ""; position: absolute; inset: -6px 0; }
.lm-stepper__btn:active:not(:disabled) { background: var(--fill-secondary); }
.lm-stepper__btn:disabled { color: var(--label-tertiary); cursor: not-allowed; }
.lm-stepper__divider { flex: none; width: 1px; height: 18px; background: var(--separator); }
.lm-stepper--tinted .lm-stepper__btn { color: var(--accent); }

/* Value + stepper pair (list row usage) */
.lm-stepper-field { display: inline-flex; align-items: center; gap: var(--space-12); }
.lm-stepper-field__value {
  min-width: 2ch; text-align: right;
  font-size: var(--fs-body); line-height: var(--lh-body); font-variant-numeric: tabular-nums;
  color: var(--label);
}

/* ===== Mentions.css ===== */
/* ==========================================================================
   Mentions — @ / # suggestions in a text view (Messages, Notes) + Ant Mentions
   <div class="lm-mentions lm-anchor lm-anchor--block">
     <label class="lm-control lm-textarea lm-mentions__control"><textarea class="lm-control__input"></textarea></label>
     <div class="lm-floating"><div class="lm-panel" role="listbox"></div></div>
   </div>
   ========================================================================== */
.lm-mentions__control { position: relative; }
.lm-mentions__control > .lm-control__input { position: relative; z-index: 1; background: transparent; }
.lm-mentions__highlight {
  position: absolute; z-index: 0; top: 0; left: var(--space-12);
  padding-block: var(--space-10);
  overflow: hidden; pointer-events: none;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
  color: transparent;
  font: inherit; line-height: var(--lh-body); letter-spacing: inherit;
}
.lm-mentions__highlight mark {
  color: transparent; background: var(--accent-soft);
  border-radius: var(--radius-4);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.lm-mentions__panel { min-width: 260px; }
.lm-mentions .lm-option { cursor: pointer; }
.lm-mentions .lm-option mark { background: transparent; color: inherit; font-weight: var(--fw-semibold); }
.lm-mentions__avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--fill-secondary); color: var(--label);
  font-size: var(--fs-caption-1); line-height: 1; font-weight: var(--fw-semibold);
}
.lm-mentions__empty { padding: var(--space-12) var(--space-16); font-size: var(--fs-subheadline); color: var(--label-secondary); }

/* Rendered mention inside read-only text (comments, chat bubbles) */
.lm-mention { color: var(--link); font-weight: var(--fw-semibold); text-decoration: none; }
.lm-mention--topic { color: var(--accent); font-weight: var(--fw-regular); }
@media (hover: hover) { a.lm-mention:hover { text-decoration: underline; } }

/* ===== Radio.css ===== */
/* ==========================================================================
   Radio — circle radio (default) · iOS checkmark list · segmented radio buttons
   <label class="lm-radio"><input type="radio" name="g"><span>Nhãn</span></label>
   ========================================================================== */
.lm-radio {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--space-8);
  min-height: var(--hit-target);
  color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.lm-radio > input {
  -webkit-appearance: none; appearance: none;
  position: relative; flex: none;
  width: 22px; height: 22px; margin: 0;
  border: 0; border-radius: var(--radius-full);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--gray-2);
  cursor: inherit;
  transition: box-shadow var(--duration-fast) var(--ease-spring), background-color var(--duration-fast) var(--ease-standard);
}
.lm-radio > input:checked { background: var(--thumb); box-shadow: inset 0 0 0 6px var(--accent); }
.lm-radio > input:focus-visible { outline: var(--ring-width) solid var(--focus-ring); outline-offset: 2px; }
.lm-radio > span { min-width: 0; }
.lm-radio__desc { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
.lm-radio:active > input:not(:disabled):not(:checked) { background: var(--fill-tertiary); }
.lm-radio:has(> input:disabled), .lm-radio.is-disabled { color: var(--label-tertiary); cursor: not-allowed; }
.lm-radio > input:disabled { opacity: var(--opacity-disabled); }
.lm-radio-group.is-error .lm-radio > input:not(:checked) { box-shadow: inset 0 0 0 1.5px var(--danger); }
@media (min-width: 1200px) and (pointer: fine) { .lm-radio { min-height: 32px; } }
@media (hover: hover) { .lm-radio:hover > input:not(:disabled):not(:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); } }

/* --- iOS checkmark list (UITableViewCell .checkmark) ----------------------
   Use .lm-radio--check on a label, or put labels in .lm-radio-group--list */
:is(.lm-radio--check, .lm-radio-group--list > .lm-radio) {
  display: flex; width: 100%;
  min-height: var(--row-height);
  padding: var(--space-10) var(--space-16);
  gap: var(--space-12);
}
:is(.lm-radio--check, .lm-radio-group--list > .lm-radio) > span { flex: 1 1 auto; }
:is(.lm-radio--check, .lm-radio-group--list > .lm-radio) > input {
  order: 1;
  border-radius: var(--radius-6);
  background: transparent; box-shadow: none;
}
:is(.lm-radio--check, .lm-radio-group--list > .lm-radio) > input::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
  opacity: 0; transform: scale(0.6);
  transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-spring);
}
:is(.lm-radio--check, .lm-radio-group--list > .lm-radio) > input:checked { background: transparent; box-shadow: none; }
:is(.lm-radio--check, .lm-radio-group--list > .lm-radio) > input:checked::before { opacity: 1; transform: none; }
:is(.lm-radio--check, .lm-radio-group--list > .lm-radio):active:not(:has(> input:disabled)) { background: var(--row-pressed); }
:is(.lm-radio--check, .lm-radio-group--list > .lm-radio) > input:not(:disabled):not(:checked) { background: transparent; }
@media (hover: hover) {
  :is(.lm-radio--check, .lm-radio-group--list > .lm-radio):hover:not(:has(> input:disabled)) { background: var(--fill-quaternary); }
  :is(.lm-radio--check, .lm-radio-group--list > .lm-radio):hover > input:not(:checked) { box-shadow: none; }
}
/* .lm-radio--circle is accepted as an explicit alias of the default circle look (no extra rules). */

/* --- Group ------------------------------------------------------------- */
.lm-radio-group {
  display: flex; flex-direction: column; align-items: flex-start;
  min-width: 0; margin: 0; padding: 0; border: 0;
}
.lm-radio-group--horizontal { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: var(--space-20); }
.lm-radio-group--list {
  align-items: stretch;
  background: var(--bg-grouped-secondary);
  border-radius: var(--radius-10);
  overflow: hidden;
}
.lm-radio-group--list > .lm-radio + .lm-radio::before {
  content: ""; position: absolute; top: 0; left: var(--space-16); right: 0;
  height: var(--hairline); background: var(--separator);
}

/* --- Radio buttons (Ant Radio.Button) — segmented look by default ------- */
.lm-radio-button-group {
  display: inline-flex; align-items: stretch; gap: 2px;
  min-height: var(--segmented-height);
  padding: 2px;
  border-radius: var(--radius-8);
  background: var(--fill-tertiary);
  vertical-align: middle;
}
.lm-radio-button { position: relative; display: inline-flex; flex: 1 1 0; min-width: 0; cursor: pointer; }
.lm-radio-button > input {
  -webkit-appearance: none; appearance: none;
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit;
}
.lm-radio-button > span {
  flex: 1 1 auto;
  display: flex; align-items: center; justify-content: center; gap: var(--space-4);
  padding: 0 var(--space-12);
  border-radius: calc(var(--radius-8) - 2px);
  color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.lm-radio-button > input:checked + span { background: var(--segment-selected); box-shadow: var(--shadow-raised); font-weight: var(--fw-semibold); }
.lm-radio-button > input:focus-visible + span { outline: var(--ring-width) solid var(--focus-ring); outline-offset: 1px; }
.lm-radio-button > input:disabled { cursor: not-allowed; }
.lm-radio-button > input:disabled + span { color: var(--label-tertiary); }
.lm-radio-button:active > input:not(:checked):not(:disabled) + span { opacity: var(--opacity-pressed); }
/* hairline between two unselected segments */
.lm-radio-button + .lm-radio-button::before {
  content: ""; position: absolute; left: -2px; top: 25%; bottom: 25%;
  width: 1px; background: var(--separator);
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.lm-radio-button:has(> input:checked)::before,
.lm-radio-button:has(> input:checked) + .lm-radio-button::before { opacity: 0; }

/* Outline (Ant buttonStyle="outline", web forms) */
.lm-radio-button-group--outline { background: transparent; padding: 0; gap: 0; border-radius: var(--radius-10); box-shadow: inset 0 0 0 1px var(--separator-opaque); }
.lm-radio-button-group--outline > .lm-radio-button > span { border-radius: 0; min-height: var(--control-sm); }
.lm-radio-button-group--outline > .lm-radio-button:first-child > span { border-radius: var(--radius-10) 0 0 var(--radius-10); }
.lm-radio-button-group--outline > .lm-radio-button:last-child > span { border-radius: 0 var(--radius-10) var(--radius-10) 0; }
.lm-radio-button-group--outline > .lm-radio-button + .lm-radio-button::before { top: 0; bottom: 0; left: 0; background: var(--separator-opaque); }
.lm-radio-button-group--outline > .lm-radio-button > input:checked + span { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: var(--fw-semibold); }
/* Solid (Ant buttonStyle="solid") */
.lm-radio-button-group--solid > .lm-radio-button > input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* Sizes & width */
.lm-radio-button-group--sm { min-height: 28px; }
.lm-radio-button-group--sm > .lm-radio-button > span { padding: 0 var(--space-10); font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); }
.lm-radio-button-group--lg { min-height: 40px; border-radius: var(--radius-10); }
.lm-radio-button-group--lg > .lm-radio-button > span { font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); border-radius: var(--radius-8); }
.lm-radio-button-group--block { display: flex; width: 100%; }

/* ===== Rate.css ===== */
/* ==========================================================================
   Rate — App Store–style star rating · Ant Rate
   <div class="lm-rate" data-value="4" aria-label="Đánh giá"></div>  (items built by bundle.js)
   ========================================================================== */
.lm-rate {
  --lm-rate-size: 28px;
  --lm-rate-gap: var(--space-6);
  --lm-rate-on: var(--yellow);
  --lm-rate-off: var(--gray-4);
  display: inline-flex; align-items: center; gap: var(--lm-rate-gap);
  vertical-align: middle;
  outline: none;
}
.lm-rate__item {
  position: relative;
  display: inline-flex; flex: none;
  width: var(--lm-rate-size); height: var(--lm-rate-size);
  border-radius: var(--radius-4);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--duration-fast) var(--ease-spring);
}
/* enlarge the touch target to 44px tall without changing layout */
.lm-rate__item::after { content: ""; position: absolute; inset: calc((var(--lm-rate-size) - var(--hit-target)) / 2) calc(var(--lm-rate-gap) / -2); }
.lm-rate__first, .lm-rate__second {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--lm-rate-size); height: var(--lm-rate-size);
  color: var(--lm-rate-off);
  font-size: calc(var(--lm-rate-size) * 0.86); line-height: 1; font-weight: var(--fw-semibold);
  transition: color var(--duration-fast) var(--ease-standard);
}
.lm-rate__first { position: absolute; top: 0; left: 0; width: 50%; overflow: hidden; justify-content: flex-start; color: transparent; }
.lm-rate__first > *, .lm-rate__second > * { flex: none; }
.lm-rate .lm-icon { --lm-icon-size: var(--lm-rate-size); }
.lm-rate__char { display: inline-block; width: var(--lm-rate-size); text-align: center; }
.lm-rate__item.is-half .lm-rate__first,
.lm-rate__item.is-full .lm-rate__first,
.lm-rate__item.is-full .lm-rate__second { color: var(--lm-rate-on); }
.lm-rate__item:focus-visible { outline: var(--ring-width) solid var(--focus-ring); outline-offset: 2px; }
.lm-rate:not(.is-readonly):not(.is-disabled) .lm-rate__item:active { transform: scale(0.88); }
@media (hover: hover) { .lm-rate:not(.is-readonly):not(.is-disabled) .lm-rate__item:hover { transform: scale(1.12); } }
.lm-rate.is-readonly .lm-rate__item, .lm-rate.is-disabled .lm-rate__item { cursor: default; }
.lm-rate.is-readonly .lm-rate__item::after { display: none; }
.lm-rate.is-disabled { opacity: var(--opacity-disabled); }

/* Value / caption text */
.lm-rate__text {
  margin-left: var(--space-4);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label-secondary);
  font-variant-numeric: tabular-nums;
}

/* Sizes */
.lm-rate--sm { --lm-rate-size: 14px; --lm-rate-gap: 2px; }
.lm-rate--sm .lm-rate__text { font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.lm-rate--lg { --lm-rate-size: 36px; --lm-rate-gap: var(--space-8); }
@media (min-width: 1200px) and (pointer: fine) { .lm-rate:not(.lm-rate--sm):not(.lm-rate--lg) { --lm-rate-size: 22px; --lm-rate-gap: var(--space-4); } }

/* Character tones */
.lm-rate--heart { --lm-rate-on: var(--pink); }
.lm-rate--accent { --lm-rate-on: var(--accent); }

/* Summary block (App Store "4,6 trên 5") */
.lm-rate-summary { display: inline-grid; grid-template-columns: auto auto; align-items: center; column-gap: var(--space-12); row-gap: var(--space-2); }
.lm-rate-summary__score { grid-row: span 2; font-size: var(--fs-large-title); line-height: var(--lh-large-title); font-weight: var(--fw-bold); letter-spacing: var(--ls-large-title); font-variant-numeric: tabular-nums; }
.lm-rate-summary__count { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); }

/* ===== Select.css ===== */
/* ==========================================================================
   Select — iOS pull-down menu / picker list · Ant Select
   Structure (contract):
   <div class="lm-select lm-anchor lm-anchor--block">
     <button type="button" class="lm-control lm-control--select" data-lm-toggle aria-haspopup="listbox" aria-expanded="false">
       <span class="lm-control__value" data-placeholder="Chọn…">Hà Nội</span>
       <i class="lm-icon lm-control__suffix" data-icon="chevron-up-down"></i>
     </button>
     <div class="lm-floating"><div class="lm-panel" role="listbox"> .lm-option[role=option] … </div></div>
   </div>
   ========================================================================== */
:is(.lm-select, .lm-timepicker, .lm-tree-select) [hidden] { display: none !important; }
:is(.lm-select, .lm-timepicker, .lm-tree-select) > .lm-control {
  border: 0; margin: 0;
  text-align: left;
  font-family: inherit;
}
:is(.lm-select, .lm-timepicker, .lm-tree-select) > .lm-control:disabled { opacity: var(--opacity-disabled); cursor: not-allowed; }
:is(.lm-select, .lm-timepicker, .lm-tree-select) .lm-control__suffix { color: var(--label-secondary); --lm-icon-size: 18px; }
:is(.lm-select, .lm-timepicker, .lm-tree-select).is-open > .lm-control:not(.lm-control--outlined):not(.lm-control--plain) { background: var(--fill-secondary); }
:is(.lm-select, .lm-timepicker, .lm-tree-select).is-open > .lm-control--outlined { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 var(--ring-width) var(--accent-soft); }
.lm-select > .lm-floating > .lm-panel { min-width: max(100%, 200px); }
.lm-select .lm-option { scroll-margin: var(--space-6); }
.lm-select .lm-option[aria-selected="true"] .lm-option__label { font-weight: var(--fw-regular); }

/* Groups & empty */
.lm-select__group + .lm-select__group { margin-top: var(--space-6); padding-top: var(--space-6); border-top: var(--hairline) solid var(--separator); }
.lm-select__empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-6);
  padding: var(--space-24) var(--space-16);
  color: var(--label-secondary);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  text-align: center;
}
.lm-select__empty .lm-icon { --lm-icon-size: var(--icon-lg); color: var(--label-tertiary); }

/* Multiple: tags inside the control */
.lm-select--multiple > .lm-control { height: auto; min-height: var(--control-md); padding-block: 6px; cursor: pointer; }
.lm-select__tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); flex: 1 1 auto; min-width: 0; }
.lm-select__tag {
  display: inline-flex; align-items: center; gap: 2px;
  max-width: 100%; height: 28px;
  padding: 0 2px 0 var(--space-10);
  border-radius: var(--radius-6);
  background: var(--fill-secondary);
  color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  white-space: nowrap;
}
.lm-select__tag-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lm-select__tag--more { padding-right: var(--space-10); color: var(--label-secondary); }
.lm-select__tag-remove {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--label-secondary); cursor: pointer;
}
.lm-select__tag-remove .lm-icon { --lm-icon-size: 14px; }
.lm-select__tag-remove:active { opacity: var(--opacity-pressed); }
@media (hover: hover) { .lm-select__tag-remove:hover { color: var(--label); background: var(--fill-tertiary); } }
.lm-select__placeholder { color: var(--placeholder); padding-inline: 2px; }
.lm-select__search {
  flex: 1 1 64px; min-width: 64px; height: 28px;
  border: 0; outline: 0; padding: 0 2px; background: transparent;
  color: inherit; font: inherit;
}
.lm-select__search::placeholder { color: var(--placeholder); opacity: 1; }
.lm-control > .lm-select__search { height: var(--control-md); }
.lm-control--sm .lm-select__tag { height: 22px; font-size: var(--fs-footnote); line-height: var(--lh-footnote); padding-left: var(--space-8); }
.lm-control--sm .lm-select__tag-remove { width: 20px; height: 20px; }
.lm-select--multiple > .lm-control--sm { min-height: var(--control-sm); padding-block: 4px; }

/* Sheet-only header/footer */
:is(.lm-select, .lm-timepicker, .lm-tree-select) .lm-select-sheet__header,
:is(.lm-select, .lm-timepicker, .lm-tree-select) .lm-select-sheet__footer { display: none; }
.lm-select-sheet__header {
  align-items: center; justify-content: center;
  padding: var(--space-2) var(--space-16) var(--space-10);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-semibold); color: var(--label-secondary);
}
.lm-select-sheet__footer { justify-content: flex-end; padding: var(--space-8) var(--space-16) var(--space-4); border-top: var(--hairline) solid var(--separator); margin-top: var(--space-6); }

/* --------------------------------------------------------------------------
   Bottom sheet presentation (shared by Select, TimePicker, TreeSelect)
   Auto on mobile (< 768). Force: --sheet. Opt-out: --popover.
   -------------------------------------------------------------------------- */
@keyframes lm-picker-scrim { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 767.98px) {
  .lm-select:not(.lm-select--popover) > .lm-floating,
  .lm-timepicker:not(.lm-timepicker--popover) > .lm-floating,
  .lm-tree-select:not(.lm-tree-select--popover) > .lm-floating {
    position: fixed; z-index: var(--z-overlay);
    top: auto; bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
    left: max(var(--space-8), env(safe-area-inset-left, 0px)); right: max(var(--space-8), env(safe-area-inset-right, 0px));
    min-width: 0; translate: none;
    transform: translateY(calc(100% + var(--space-24))); transform-origin: bottom center;
    transition: transform var(--duration-slow) var(--ease-spring), opacity var(--duration-fast) var(--ease-out), visibility 0s linear var(--duration-slow);
  }
  .lm-select.is-open:not(.lm-select--popover) > .lm-floating,
  .lm-timepicker.is-open:not(.lm-timepicker--popover) > .lm-floating,
  .lm-tree-select.is-open:not(.lm-tree-select--popover) > .lm-floating {
    transform: none;
    transition: transform var(--duration-slow) var(--ease-spring), opacity var(--duration-fast) var(--ease-out), visibility 0s;
  }
  .lm-select:not(.lm-select--popover) > .lm-floating > .lm-panel,
  .lm-timepicker:not(.lm-timepicker--popover) > .lm-floating > .lm-panel,
  .lm-tree-select:not(.lm-tree-select--popover) > .lm-floating > .lm-panel {
    position: relative; width: 100%; min-width: 0; max-width: none; max-height: 60vh;
    padding-top: var(--space-20);
    border-radius: var(--radius-14);
    background: var(--bg-elevated); -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: var(--shadow-modal);
  }
  .lm-select:not(.lm-select--popover) > .lm-floating > .lm-panel::before,
  .lm-timepicker:not(.lm-timepicker--popover) > .lm-floating > .lm-panel::before,
  .lm-tree-select:not(.lm-tree-select--popover) > .lm-floating > .lm-panel::before {
    content: ""; position: absolute; top: var(--space-6); left: 50%; translate: -50% 0;
    width: 36px; height: 5px; border-radius: var(--radius-full); background: var(--gray-3);
  }
  .lm-select.is-open:not(.lm-select--popover)::after,
  .lm-timepicker.is-open:not(.lm-timepicker--popover)::after,
  .lm-tree-select.is-open:not(.lm-tree-select--popover)::after {
    content: ""; position: fixed; inset: 0; z-index: calc(var(--z-overlay) - 1);
    background: var(--overlay); animation: lm-picker-scrim var(--duration-base) var(--ease-standard);
  }
  .lm-select:not(.lm-select--popover) :is(.lm-select-sheet__header, .lm-select-sheet__footer),
  .lm-timepicker:not(.lm-timepicker--popover) :is(.lm-select-sheet__header, .lm-select-sheet__footer),
  .lm-tree-select:not(.lm-tree-select--popover) :is(.lm-select-sheet__header, .lm-select-sheet__footer) { display: flex; }
}
/* Forced sheet at every width */
.lm-select--sheet > .lm-floating, .lm-timepicker--sheet > .lm-floating, .lm-tree-select--sheet > .lm-floating {
  position: fixed; z-index: var(--z-overlay);
  top: auto; bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
  left: max(var(--space-8), env(safe-area-inset-left, 0px)); right: max(var(--space-8), env(safe-area-inset-right, 0px));
  min-width: 0; translate: none;
  transform: translateY(calc(100% + var(--space-24))); transform-origin: bottom center;
  transition: transform var(--duration-slow) var(--ease-spring), opacity var(--duration-fast) var(--ease-out), visibility 0s linear var(--duration-slow);
}
@media (min-width: 768px) {
  .lm-select--sheet > .lm-floating, .lm-timepicker--sheet > .lm-floating, .lm-tree-select--sheet > .lm-floating {
    left: 50%; right: auto; width: min(420px, calc(100% - 2 * var(--space-8))); margin-left: calc(min(420px, calc(100% - 2 * var(--space-8))) / -2);
  }
}
.lm-select--sheet.is-open > .lm-floating, .lm-timepicker--sheet.is-open > .lm-floating, .lm-tree-select--sheet.is-open > .lm-floating {
  transform: none;
  transition: transform var(--duration-slow) var(--ease-spring), opacity var(--duration-fast) var(--ease-out), visibility 0s;
}
:is(.lm-select--sheet, .lm-timepicker--sheet, .lm-tree-select--sheet) > .lm-floating > .lm-panel {
  position: relative; width: 100%; min-width: 0; max-width: none; max-height: 60vh;
  padding-top: var(--space-20);
  border-radius: var(--radius-14);
  background: var(--bg-elevated); -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: var(--shadow-modal);
}
:is(.lm-select--sheet, .lm-timepicker--sheet, .lm-tree-select--sheet) > .lm-floating > .lm-panel::before {
  content: ""; position: absolute; top: var(--space-6); left: 50%; translate: -50% 0;
  width: 36px; height: 5px; border-radius: var(--radius-full); background: var(--gray-3);
}
:is(.lm-select--sheet, .lm-timepicker--sheet, .lm-tree-select--sheet).is-open::after {
  content: ""; position: fixed; inset: 0; z-index: calc(var(--z-overlay) - 1);
  background: var(--overlay); animation: lm-picker-scrim var(--duration-base) var(--ease-standard);
}
:is(.lm-select--sheet, .lm-timepicker--sheet, .lm-tree-select--sheet) :is(.lm-select-sheet__header, .lm-select-sheet__footer) { display: flex; }

/* ===== Slider.css ===== */
/* ==========================================================================
   Slider — UISlider · Ant Slider
   <div class="lm-slider">
     <i class="lm-icon lm-slider__icon" data-icon="sun"></i>
     <div class="lm-slider__rail"><input type="range" class="lm-slider__input" min="0" max="100" value="40" aria-label="…"></div>
     <i class="lm-icon lm-slider__icon" data-icon="sun"></i>
   </div>
   --lm-value (0–100) is kept in sync by bundle.js; set it inline for SSR.
   ========================================================================== */
.lm-slider {
  --lm-tone: var(--accent);
  display: flex; align-items: center; gap: var(--space-12);
  width: 100%; min-width: 0;
  color: var(--label-secondary);
}
.lm-slider__rail { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lm-slider__icon { flex: none; --lm-icon-size: 18px; }
.lm-slider__icon--lg { --lm-icon-size: 24px; }
.lm-slider__value {
  flex: none; min-width: 3ch; text-align: right;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label); font-variant-numeric: tabular-nums;
}

/* Native range input */
.lm-slider__input {
  --lm-fill: calc(var(--slider-thumb) / 2 + (100% - var(--slider-thumb)) * var(--lm-value, 50) / 100);
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: var(--slider-thumb);
  margin: 0; padding: 0; background: transparent;
  cursor: pointer; touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.lm-slider__input:focus { outline: none; }
.lm-slider__input::-webkit-slider-runnable-track {
  height: var(--slider-track); border-radius: var(--radius-full);
  background: linear-gradient(to right, var(--lm-tone, var(--accent)) 0 var(--lm-fill), var(--fill) var(--lm-fill) 100%);
}
.lm-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: var(--slider-thumb); height: var(--slider-thumb);
  margin-top: calc((var(--slider-track) - var(--slider-thumb)) / 2);
  border: 0; border-radius: var(--radius-full);
  background: var(--thumb); box-shadow: var(--shadow-thumb);
  transition: transform var(--duration-fast) var(--ease-spring);
}
.lm-slider__input::-moz-range-track { height: var(--slider-track); border-radius: var(--radius-full); background: var(--fill); }
.lm-slider__input::-moz-range-progress { height: var(--slider-track); border-radius: var(--radius-full); background: var(--lm-tone, var(--accent)); }
.lm-slider__input::-moz-range-thumb {
  width: var(--slider-thumb); height: var(--slider-thumb);
  border: 0; border-radius: var(--radius-full);
  background: var(--thumb); box-shadow: var(--shadow-thumb);
}
.lm-slider__input:focus-visible::-webkit-slider-thumb { box-shadow: var(--shadow-thumb), 0 0 0 var(--ring-width) var(--focus-ring); }
.lm-slider__input:focus-visible::-moz-range-thumb { box-shadow: var(--shadow-thumb), 0 0 0 var(--ring-width) var(--focus-ring); }
.lm-slider__input:active::-webkit-slider-thumb { transform: scale(1.08); }
.lm-slider__input:disabled { cursor: not-allowed; opacity: var(--opacity-disabled); }
.lm-slider__input:disabled::-webkit-slider-runnable-track { background: var(--fill); }
.lm-slider__input:disabled::-moz-range-progress { background: var(--fill); }

/* Tones */
.lm-slider--success { --lm-tone: var(--success); }
.lm-slider--warning { --lm-tone: var(--warning); }
.lm-slider--danger { --lm-tone: var(--danger); }
.lm-slider--neutral { --lm-tone: var(--label); }

/* Tooltip value while dragging / keyboard focus */
.lm-slider__tooltip {
  position: absolute; bottom: calc(100% + var(--space-6));
  left: calc(var(--slider-thumb) / 2 + (100% - var(--slider-thumb)) * var(--lm-value, 50) / 100);
  translate: -50% 0;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-6);
  background: var(--bg-elevated); box-shadow: var(--shadow-popover);
  color: var(--label);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  opacity: 0; transform: translateY(4px) scale(0.9);
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-spring);
}
.lm-slider__rail.is-dragging .lm-slider__tooltip,
.lm-slider__rail:has(.lm-slider__input:focus-visible) .lm-slider__tooltip,
.lm-slider--tooltip-always .lm-slider__tooltip { opacity: 1; transform: none; }

/* Marks: ticks + labels under the track (macOS-style tick marks) */
.lm-slider__marks { position: relative; height: 22px; margin: 0 0 var(--space-2); }
.lm-slider__mark {
  position: absolute; top: 0;
  left: calc(var(--slider-thumb) / 2 + (100% - var(--slider-thumb)) * var(--lm-at, 0) / 100);
  translate: -50% 0;
  padding-top: var(--space-8);
  font-size: var(--fs-caption-1); line-height: var(--lh-caption-1);
  color: var(--label-secondary); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.lm-slider__mark::before {
  content: ""; position: absolute; top: 0; left: 50%; translate: -50% 0;
  width: 2px; height: 5px; border-radius: 1px; background: var(--gray-3);
}
.lm-slider__mark.is-active { color: var(--label); }
.lm-slider__mark.is-active::before { background: var(--lm-tone, var(--accent)); }

/* Range: two thumbs over one track drawn by the rail */
.lm-slider--range { flex-wrap: wrap; row-gap: var(--space-4); }
.lm-slider--range > .lm-slider__value { order: -1; flex: 1 0 100%; text-align: left; }
.lm-slider--range .lm-slider__rail { height: var(--slider-thumb); flex-direction: row; }
.lm-slider--range .lm-slider__rail::before {
  content: ""; position: absolute;
  left: calc(var(--slider-thumb) / 2); right: calc(var(--slider-thumb) / 2);
  top: calc(var(--slider-thumb) / 2 - var(--slider-track) / 2); height: var(--slider-track);
  border-radius: var(--radius-full);
  background: linear-gradient(to right,
    var(--fill) 0 calc(var(--lm-low, 20) * 1%),
    var(--lm-tone) calc(var(--lm-low, 20) * 1%) calc(var(--lm-high, 80) * 1%),
    var(--fill) calc(var(--lm-high, 80) * 1%) 100%);
}
.lm-slider--range .lm-slider__input { position: absolute; top: 0; left: 0; right: 0; width: 100%; height: var(--slider-thumb); pointer-events: none; }
.lm-slider--range .lm-slider__input::-webkit-slider-runnable-track { background: transparent; }
.lm-slider--range .lm-slider__input::-moz-range-track { background: transparent; }
.lm-slider--range .lm-slider__input::-moz-range-progress { background: transparent; }
.lm-slider--range .lm-slider__input::-webkit-slider-thumb { pointer-events: auto; position: relative; z-index: 1; }
.lm-slider--range .lm-slider__input::-moz-range-thumb { pointer-events: auto; }
.lm-slider--range:has(.lm-slider__marks) .lm-slider__rail { height: auto; padding-top: var(--slider-thumb); }
.lm-slider--range .lm-slider__marks { width: 100%; }

/* Vertical: a horizontal slider rotated inside a fixed box */
.lm-slider--vertical { flex-direction: column-reverse; width: auto; }
.lm-slider--vertical .lm-slider__rail {
  flex: none;
  width: var(--slider-thumb); height: var(--lm-slider-length, 160px);
}
.lm-slider--vertical .lm-slider__input {
  position: absolute; left: 50%; top: 50%;
  width: var(--lm-slider-length, 160px);
  transform: translate(-50%, -50%) rotate(-90deg);
}
.lm-slider--vertical .lm-slider__tooltip { display: none; }

/* Compact (desktop toolbars) */
.lm-slider--sm { --slider-thumb: 20px; }
@media (min-width: 1200px) and (pointer: fine) {
  .lm-slider:not(.lm-slider--lg) { --slider-thumb: 22px; }
}

/* ===== Switch.css ===== */
/* ==========================================================================
   Switch — UISwitch 51×31 · Ant Switch
   One element: <input type="checkbox" class="lm-switch" role="switch">
   ========================================================================== */
.lm-switch {
  --lm-sw-w: var(--switch-width);
  --lm-sw-h: var(--switch-height);
  --lm-sw-pad: 2px;
  --lm-sw-thumb: calc(var(--lm-sw-h) - 2 * var(--lm-sw-pad));
  --lm-sw-travel: calc(var(--lm-sw-w) - var(--lm-sw-h));
  --lm-sw-stretch: 7px;
  --lm-sw-on: var(--switch-on);
  -webkit-appearance: none; appearance: none;
  position: relative; display: inline-block; flex: none;
  width: var(--lm-sw-w); height: var(--lm-sw-h);
  margin: 0; padding: 0; border: 0;
  border-radius: var(--radius-full);
  background: var(--fill);
  vertical-align: middle;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
/* Thumb */
.lm-switch::before {
  content: "";
  position: absolute; top: var(--lm-sw-pad); left: var(--lm-sw-pad);
  width: var(--lm-sw-thumb); height: var(--lm-sw-thumb);
  border-radius: var(--radius-full);
  background: var(--thumb);
  box-shadow: var(--shadow-thumb);
  transition: transform var(--duration-base) var(--ease-spring), width var(--duration-fast) var(--ease-spring);
}
.lm-switch:checked { background: var(--lm-sw-on); }
.lm-switch:checked::before { transform: translateX(var(--lm-sw-travel)); }
/* Pressed: the thumb stretches toward its travel direction (iOS) */
.lm-switch:active:not(:disabled)::before { width: calc(var(--lm-sw-thumb) + var(--lm-sw-stretch)); }
.lm-switch:checked:active:not(:disabled)::before { transform: translateX(calc(var(--lm-sw-travel) - var(--lm-sw-stretch))); }
.lm-switch:focus-visible { outline: var(--ring-width) solid var(--focus-ring); outline-offset: 2px; }
.lm-switch:disabled { opacity: var(--opacity-disabled); cursor: not-allowed; }

/* Sizes — sm is for dense desktop forms and table cells */
.lm-switch--sm { --lm-sw-w: 40px; --lm-sw-h: 24px; --lm-sw-stretch: 5px; }

/* Tones (iOS onTintColor) */
.lm-switch--accent { --lm-sw-on: var(--accent); }
.lm-switch--danger { --lm-sw-on: var(--danger); }

/* On/Off labels (iOS Accessibility › On/Off Labels · Ant checkedChildren) */
.lm-switch--labels::after {
  content: "";
  position: absolute; top: 50%; translate: 0 -50%;
  right: calc(var(--lm-sw-h) * 0.3);
  width: calc(var(--lm-sw-h) * 0.3); height: calc(var(--lm-sw-h) * 0.3);
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1.5px var(--label-secondary);
}
.lm-switch--labels:checked::after {
  right: auto; left: calc(var(--lm-sw-h) * 0.42);
  width: 1.5px; height: calc(var(--lm-sw-h) * 0.34);
  border-radius: 1px; box-shadow: none;
  background: var(--thumb);
}

/* Loading: a small ring spins inside the thumb */
.lm-switch.is-loading { cursor: progress; }
.lm-switch.is-loading::after {
  content: "";
  position: absolute; box-sizing: border-box;
  top: calc(var(--lm-sw-pad) + var(--lm-sw-thumb) * 0.2);
  left: calc(var(--lm-sw-pad) + var(--lm-sw-thumb) * 0.2);
  right: auto; translate: none;
  width: calc(var(--lm-sw-thumb) * 0.6); height: calc(var(--lm-sw-thumb) * 0.6);
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-4); border-top-color: var(--gray);
  background: none; box-shadow: none;
  animation: lm-spin 0.8s linear infinite;
  transition: translate var(--duration-base) var(--ease-spring);
}
.lm-switch.is-loading:checked::after { left: calc(var(--lm-sw-pad) + var(--lm-sw-thumb) * 0.2); translate: var(--lm-sw-travel) 0; }

/* Labelled switch row: text left, switch right (Settings style) */
.lm-switch-label {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-12);
  min-height: var(--hit-target);
  color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  cursor: pointer;
}
.lm-switch-label__text { flex: 1 1 auto; min-width: 0; }
.lm-switch-label__desc { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
.lm-switch-label--inline { justify-content: flex-start; }
.lm-switch-label--inline .lm-switch-label__text { flex: 0 1 auto; }
.lm-switch-label:has(.lm-switch:disabled) { color: var(--label-tertiary); cursor: not-allowed; }
@media (min-width: 1200px) and (pointer: fine) { .lm-switch-label { min-height: 32px; } }

/* ===== TimePicker.css ===== */
/* ==========================================================================
   TimePicker — UIDatePicker .time (wheels + compact pill) · Ant TimePicker
   ========================================================================== */

/* Wheel picker -------------------------------------------------------------
   <div class="lm-wheel" data-value="09:30" data-step="5"></div>  (columns built by bundle.js) */
.lm-wheel {
  --lm-wheel-row: 34px;
  --lm-wheel-rows: 5;
  position: relative;
  display: flex; justify-content: center;
  height: calc(var(--lm-wheel-row) * var(--lm-wheel-rows));
  padding: 0 var(--space-8);
  color: var(--label);
  font-size: var(--fs-title-3); line-height: var(--lm-wheel-row); letter-spacing: var(--ls-title-3);
  font-variant-numeric: tabular-nums;
  user-select: none; -webkit-user-select: none;
}
/* selection band */
.lm-wheel::before {
  content: "";
  position: absolute; left: var(--space-8); right: var(--space-8); top: 50%;
  height: var(--lm-wheel-row); translate: 0 -50%;
  border-radius: var(--radius-8);
  background: var(--fill-quaternary);
  pointer-events: none;
}
.lm-wheel:has(.lm-wheel__col:focus-visible)::before { box-shadow: 0 0 0 var(--ring-width) var(--focus-ring); }
.lm-wheel__col {
  position: relative; z-index: 1;
  flex: 0 0 auto; min-width: 64px;
  height: 100%; margin: 0;
  padding: calc(var(--lm-wheel-row) * (var(--lm-wheel-rows) - 1) / 2) 0;
  list-style: none;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), #000 42%, #000 58%, rgba(0, 0, 0, 0.15));
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), #000 42%, #000 58%, rgba(0, 0, 0, 0.15));
}
.lm-wheel__col::-webkit-scrollbar { display: none; }
.lm-wheel__col--narrow { min-width: 52px; }
.lm-wheel__item {
  height: var(--lm-wheel-row);
  padding: 0 var(--space-12);
  text-align: center; white-space: nowrap;
  scroll-snap-align: center;
  cursor: pointer;
  color: var(--label-secondary);
  transition: color var(--duration-fast) var(--ease-standard);
}
.lm-wheel__item.is-selected, .lm-wheel__item[aria-selected="true"] { color: var(--label); }
.lm-wheel__unit { align-self: center; position: relative; z-index: 1; font-size: var(--fs-body); color: var(--label-secondary); }

/* Compact pill (iOS compact date/time style) ---------------------------- */
.lm-time-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-6);
  height: 34px; min-width: 64px;
  padding: 0 var(--space-12);
  border: 0; border-radius: var(--radius-8);
  background: var(--fill-tertiary);
  color: var(--label);
  font-family: inherit;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.lm-time-pill[aria-expanded="true"], .lm-time-pill.is-active { color: var(--accent); }
.lm-time-pill:active { opacity: var(--opacity-pressed); }
.lm-time-pill:disabled { color: var(--label-tertiary); cursor: not-allowed; }
.lm-time-pill.is-error { color: var(--danger-text); background: var(--danger-soft); }
@media (hover: hover) { .lm-time-pill:not(:disabled):hover { background: var(--fill-secondary); } }

/* Field trigger + panel ------------------------------------------------- */
.lm-timepicker .lm-control__value { font-variant-numeric: tabular-nums; }
.lm-timepicker__panel { min-width: 260px; max-height: none; padding: var(--space-8) 0 0; overflow: hidden; }
.lm-timepicker__panel.lm-panel { max-height: none; }
.lm-timepicker__footer {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-8);
  margin-top: var(--space-8);
  padding: var(--space-6) var(--space-12);
  border-top: var(--hairline) solid var(--separator);
}
.lm-timepicker > .lm-floating { min-width: max-content; }

/* Column list (Ant desktop style) --------------------------------------- */
.lm-time-columns { display: flex; height: 224px; padding: 0 var(--space-4); }
.lm-time-columns__col {
  position: relative;
  width: 56px; margin: 0; padding: var(--space-4) var(--space-2) 196px;
  list-style: none;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.lm-time-columns__col + .lm-time-columns__col { border-left: var(--hairline) solid var(--separator); }
.lm-time-columns__cell {
  display: block; width: 100%; height: 28px; margin: 0 0 2px; padding: 0;
  border: 0; border-radius: var(--radius-6);
  background: transparent; color: var(--label);
  font-family: inherit; font-size: var(--fs-subheadline); line-height: 28px;
  font-variant-numeric: tabular-nums; text-align: center;
  cursor: pointer;
}
.lm-time-columns__cell[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-semibold); }
.lm-time-columns__cell:disabled { color: var(--label-tertiary); cursor: not-allowed; }
@media (hover: hover) { .lm-time-columns__cell:not([aria-selected="true"]):not(:disabled):hover { background: var(--fill-quaternary); } }

/* Range: two pills with an arrow ---------------------------------------- */
.lm-time-range { display: inline-flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
.lm-time-range__sep { color: var(--label-tertiary); --lm-icon-size: 16px; }

/* Inline (form row: label left, pill right) */
.lm-time-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); min-height: var(--hit-target); }

/* ===== Transfer.css ===== */
/* ==========================================================================
   Transfer — two grouped lists with move buttons · Ant Transfer
   Rows use the Checkbox contract: <label class="lm-checkbox"><input type="checkbox"><span>…</span></label>
   ========================================================================== */
.lm-transfer {
  display: grid; gap: var(--space-12);
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-width: 0;
}
@media (min-width: 768px) {
  .lm-transfer { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-16); }
}
.lm-transfer [hidden] { display: none !important; }

.lm-transfer__panel {
  display: flex; flex-direction: column;
  min-width: 0;
  background: var(--bg-grouped-secondary);
  border-radius: var(--radius-12);
  overflow: hidden;
}
.lm-transfer__header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-8);
  min-height: var(--control-md);
  padding: 0 var(--space-16);
  border-bottom: var(--hairline) solid var(--separator);
}
.lm-transfer__header .lm-checkbox { font-weight: var(--fw-semibold); }
.lm-transfer__title { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: var(--fw-semibold); }
.lm-transfer__count {
  flex: none;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  color: var(--label-secondary); font-variant-numeric: tabular-nums;
}
.lm-transfer__search { padding: var(--space-8) var(--space-12); }
.lm-transfer__list {
  flex: 1 1 auto;
  height: 264px; margin: 0; padding: 0;
  list-style: none;
  overflow-y: auto; overscroll-behavior: contain;
}
.lm-transfer__item { position: relative; display: flex; align-items: center; }
.lm-transfer__item + .lm-transfer__item::before {
  content: ""; position: absolute; top: 0; left: calc(var(--space-16) + 22px + var(--space-12)); right: 0;
  height: var(--hairline); background: var(--separator);
}
.lm-transfer__item > .lm-checkbox { flex: 1 1 auto; min-width: 0; min-height: var(--row-height); padding: var(--space-6) var(--space-16); gap: var(--space-12); }
.lm-transfer__item > .lm-checkbox > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-transfer__item-desc { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-transfer__item:active { background: var(--row-pressed); }
.lm-transfer__item.is-disabled { color: var(--label-tertiary); }
@media (hover: hover) { .lm-transfer__item:not(.is-disabled):hover { background: var(--fill-quaternary); } }
.lm-transfer__item.is-moved { animation: lm-transfer-in var(--duration-base) var(--ease-spring); }
@keyframes lm-transfer-in { from { background: var(--accent-soft); } to { background: transparent; } }

.lm-transfer__empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-6);
  height: 100%; min-height: 160px; padding: var(--space-24) var(--space-16);
  color: var(--label-secondary);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline);
  text-align: center;
}
.lm-transfer__empty .lm-icon { --lm-icon-size: var(--icon-lg); color: var(--label-tertiary); }
.lm-transfer__footer {
  display: flex; justify-content: flex-end; gap: var(--space-8);
  padding: var(--space-8) var(--space-12);
  border-top: var(--hairline) solid var(--separator);
}

/* Move buttons: row on mobile (chevrons point down/up), column on tablet+ */
.lm-transfer__actions { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: var(--space-12); }
.lm-transfer__actions .lm-icon { transform: rotate(90deg); transition: transform var(--duration-fast) var(--ease-standard); }
@media (min-width: 768px) {
  .lm-transfer__actions { flex-direction: column; gap: var(--space-8); }
  .lm-transfer__actions .lm-icon { transform: none; }
}
/* Forced layouts */
.lm-transfer--stacked { grid-template-columns: minmax(0, 1fr) !important; gap: var(--space-12) !important; }
.lm-transfer--stacked .lm-transfer__actions { flex-direction: row; }
.lm-transfer--stacked .lm-transfer__actions .lm-icon { transform: rotate(90deg); }
.lm-transfer.is-disabled { opacity: var(--opacity-disabled); pointer-events: none; }

/* ===== TreeSelect.css ===== */
/* ==========================================================================
   TreeSelect — hierarchical picker (drill-in list in a popover/sheet) · Ant TreeSelect
   Trigger = Select trigger. Panel holds .lm-tree-select__tree (built by bundle.js or hand-written).
   ========================================================================== */
.lm-tree-select > .lm-floating > .lm-panel { min-width: max(100%, 280px); max-height: 380px; padding-top: 0; }
.lm-tree-select--multiple > .lm-control { height: auto; min-height: var(--control-md); padding-block: 6px; cursor: pointer; }
.lm-tree-select__search {
  position: sticky; top: 0; z-index: 1;
  padding: var(--space-8) var(--space-8) var(--space-6);
  background: inherit;
}
.lm-panel .lm-tree-select__search { background: var(--bg-elevated); }
.lm-tree-select__tree, .lm-tree-select__tree ul { list-style: none; margin: 0; padding: 0; }
.lm-tree-select__tree { padding-block: var(--space-4); }
.lm-tree-select__tree ul { padding-left: 20px; }
.lm-tree-select__node[aria-expanded="false"] > ul { display: none; }

.lm-tree-select__row {
  display: flex; align-items: center; gap: var(--space-4);
  min-height: var(--control-md);
  padding: 0 var(--space-12) 0 var(--space-4);
  color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  cursor: pointer; outline: none;
  -webkit-tap-highlight-color: transparent;
}
.lm-tree-select__row:active { background: var(--row-pressed); }
.lm-tree-select__row.is-active, .lm-tree-select__row:focus-visible { background: var(--fill-quaternary); }
.lm-tree-select__row:focus-visible { box-shadow: inset 0 0 0 var(--ring-width) var(--focus-ring); }
@media (hover: hover) { .lm-tree-select__row:hover { background: var(--fill-quaternary); } }

.lm-tree-select__switcher {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-6);
  background: transparent; color: var(--label-tertiary);
  cursor: pointer;
}
.lm-tree-select__switcher .lm-icon { --lm-icon-size: 16px; transition: transform var(--duration-fast) var(--ease-spring); }
.lm-tree-select__node[aria-expanded="true"] > .lm-tree-select__row .lm-tree-select__switcher .lm-icon { transform: rotate(90deg); }
.lm-tree-select__switcher.is-leaf { visibility: hidden; }

.lm-tree-select__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-tree-select__row > .lm-checkbox { flex: 1 1 auto; min-width: 0; min-height: 0; }
.lm-tree-select__row > .lm-checkbox > .lm-tree-select__text { flex: 1 1 auto; }
.lm-tree-select__count {
  flex: none; font-size: var(--fs-footnote); line-height: var(--lh-footnote);
  color: var(--label-secondary); font-variant-numeric: tabular-nums;
}
.lm-tree-select__check { flex: none; color: var(--accent); visibility: hidden; --lm-icon-size: var(--icon-md); }
.lm-tree-select__node[aria-selected="true"] > .lm-tree-select__row .lm-tree-select__check { visibility: visible; }
.lm-tree-select__node[aria-disabled="true"] > .lm-tree-select__row { color: var(--label-tertiary); cursor: not-allowed; background: transparent; }
.lm-tree-select__node[data-selectable="false"] > .lm-tree-select__row > .lm-tree-select__text { color: var(--label-secondary); }
.lm-tree-select__node.is-match > .lm-tree-select__row .lm-tree-select__text { color: var(--accent); }
.lm-tree-select__empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-6);
  padding: var(--space-24) var(--space-16);
  color: var(--label-secondary); text-align: center;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline);
}
.lm-tree-select__empty .lm-icon { --lm-icon-size: var(--icon-lg); color: var(--label-tertiary); }

/* Desktop density */
@media (min-width: 1200px) and (pointer: fine) {
  .lm-tree-select__row { min-height: 32px; border-radius: var(--radius-6); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
  .lm-tree-select__tree { padding: var(--space-4); }
  .lm-tree-select__switcher { width: 24px; height: 24px; }
}

/* ===== Upload.css ===== */
/* ==========================================================================
   Upload — drop zone, file list, picture grid, avatar · Ant Upload
   <div class="lm-upload" data-lm-upload> trigger(s) + <ul class="lm-upload__list"> </div>
   ========================================================================== */
.lm-upload { display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; }
.lm-upload [hidden] { display: none !important; }
/* The real <input type=file> stays in the DOM (keyboard + screen readers) but is visually hidden */
.lm-upload__input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
label:has(> .lm-upload__input:focus-visible) { outline: var(--ring-width) solid var(--focus-ring); outline-offset: 2px; }

/* Drag & drop zone ------------------------------------------------------ */
.lm-upload__dragger {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-6);
  min-height: 160px;
  padding: var(--space-24) var(--space-16);
  border: 1.5px dashed var(--separator-opaque);
  border-radius: var(--radius-12);
  background: var(--bg-grouped-secondary);
  color: var(--label);
  text-align: center;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-spring);
}
.lm-upload__dragger > .lm-icon { --lm-icon-size: 36px; color: var(--accent); margin-bottom: var(--space-2); }
.lm-upload__title { font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold); }
.lm-upload__link { color: var(--link); font-weight: var(--fw-semibold); }
.lm-upload__hint { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
.lm-upload__dragger.is-dragover { background: var(--accent-soft); border-color: var(--accent); border-style: solid; transform: scale(1.01); }
.lm-upload__dragger:active { background: var(--fill-quaternary); }
.lm-upload__dragger.is-disabled, .lm-upload__dragger:has(.lm-upload__input:disabled) { opacity: var(--opacity-disabled); cursor: not-allowed; }
.lm-upload__dragger.is-error { border-color: var(--danger); background: var(--danger-soft); }
@media (hover: hover) { .lm-upload__dragger:not(.is-disabled):hover { border-color: var(--accent); } }
/* Compact dragger for desktop side panels */
.lm-upload__dragger--compact { flex-direction: row; min-height: 0; padding: var(--space-16); gap: var(--space-12); text-align: left; }
.lm-upload__dragger--compact > .lm-icon { --lm-icon-size: 28px; margin: 0; }

/* File list (inset grouped list) --------------------------------------- */
.lm-upload__list {
  margin: 0; padding: 0; list-style: none;
  background: var(--bg-grouped-secondary);
  border-radius: var(--radius-12);
  overflow: hidden;
}
.lm-upload__list:empty { display: none; }
.lm-upload__item {
  position: relative;
  display: flex; align-items: center; gap: var(--space-12);
  min-height: 60px;
  padding: var(--space-10) var(--space-12) var(--space-10) var(--space-16);
}
.lm-upload__item + .lm-upload__item::before {
  content: ""; position: absolute; top: 0; left: calc(var(--space-16) + 36px + var(--space-12)); right: 0;
  height: var(--hairline); background: var(--separator);
}
.lm-upload__thumb {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: var(--radius-8);
  background: var(--fill-tertiary); color: var(--accent);
  overflow: hidden;
}
.lm-upload__thumb .lm-icon { --lm-icon-size: 20px; }
.lm-upload__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lm-upload__meta { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.lm-upload__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); }
.lm-upload__info { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); font-variant-numeric: tabular-nums; }
.lm-upload__progress { position: relative; height: 3px; margin-top: var(--space-4); border-radius: var(--radius-full); background: var(--fill); overflow: hidden; }
.lm-upload__progress > span { position: absolute; inset: 0 auto 0 0; width: var(--lm-progress, 0%); border-radius: inherit; background: var(--accent); transition: width var(--duration-base) var(--ease-standard); }
.lm-upload__status { flex: none; display: inline-flex; --lm-icon-size: var(--icon-md); }
.lm-upload__actions { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; }
.lm-upload__action {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-sm); height: var(--control-sm);
  padding: 0; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--label-secondary); cursor: pointer;
}
.lm-upload__action .lm-icon { --lm-icon-size: 20px; }
.lm-upload__action:active { opacity: var(--opacity-pressed); }
@media (hover: hover) { .lm-upload__action:hover { background: var(--fill-tertiary); color: var(--label); } }
.lm-upload__item.is-done .lm-upload__status { color: var(--success); }
.lm-upload__item.is-done .lm-upload__progress { display: none; }
.lm-upload__item.is-error .lm-upload__thumb { background: var(--danger-soft); color: var(--danger); }
.lm-upload__item.is-error .lm-upload__info { color: var(--danger-text); }
.lm-upload__item.is-error .lm-upload__progress,
.lm-upload__item.is-error .lm-upload__status { display: none; }
.lm-upload__item.is-uploading .lm-upload__status { display: none; }
.lm-upload__item.is-entering { animation: lm-upload-in var(--duration-base) var(--ease-spring); }
@keyframes lm-upload-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* Picture card grid ------------------------------------------------------ */
.lm-upload--picture-card .lm-upload__list,
.lm-upload__grid {
  display: grid; gap: var(--space-8);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: transparent; border-radius: 0; overflow: visible;
}
@media (min-width: 768px) { .lm-upload--picture-card .lm-upload__list, .lm-upload__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-12); } }
@media (min-width: 1200px) { .lm-upload--picture-card .lm-upload__list, .lm-upload__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.lm-upload__tile {
  position: relative;
  aspect-ratio: 1 / 1; max-width: 100%;
  border-radius: var(--radius-12);
  background: var(--fill-tertiary);
  overflow: hidden;
  list-style: none;
}
.lm-upload__tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lm-upload__tile-remove {
  position: absolute; top: var(--space-6); right: var(--space-6);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--material-thin); color: var(--label);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate));
  cursor: pointer;
}
.lm-upload__tile-remove .lm-icon { --lm-icon-size: 14px; }
.lm-upload__tile-remove::after { content: ""; position: absolute; inset: -9px; }
.lm-upload__tile-badge {
  position: absolute; left: var(--space-6); bottom: var(--space-6);
  padding: 2px var(--space-6); border-radius: var(--radius-6);
  background: var(--material-thin); color: var(--label);
  -webkit-backdrop-filter: blur(var(--blur-sm)); backdrop-filter: blur(var(--blur-sm));
  font-size: var(--fs-caption-2); line-height: var(--lh-caption-2); font-weight: var(--fw-semibold);
}
.lm-upload__tile.is-uploading img { filter: saturate(0.4); opacity: 0.6; }
.lm-upload__tile-progress {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-6);
  color: var(--label);
  font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.lm-upload__tile.is-error { box-shadow: inset 0 0 0 1.5px var(--danger); }
.lm-upload__tile.is-error .lm-upload__tile-progress { color: var(--danger-text); }
.lm-upload__tile--add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4);
  border: 1.5px dashed var(--separator-opaque); background: transparent;
  color: var(--accent);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: var(--fw-semibold);
  cursor: pointer;
}
.lm-upload__tile--add .lm-icon { --lm-icon-size: 24px; }
.lm-upload__tile-trigger {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4);
  color: inherit; cursor: pointer; border-radius: inherit;
}
.lm-upload__tile--add.is-dragover { background: var(--accent-soft); border-color: var(--accent); }
.lm-upload__tile--add:active { background: var(--fill-quaternary); }
@media (hover: hover) { .lm-upload__tile--add:hover { border-color: var(--accent); } }

/* Avatar uploader ------------------------------------------------------ */
.lm-upload__avatar {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; gap: var(--space-8);
  cursor: pointer;
}
.lm-upload__avatar-img {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 96px; height: 96px;
  border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--label-secondary);
  overflow: hidden;
}
.lm-upload__avatar-img .lm-icon { --lm-icon-size: 36px; }
.lm-upload__avatar-img img { width: 100%; height: 100%; object-fit: cover; }
.lm-upload__avatar-label { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--link); font-weight: var(--fw-semibold); }
.lm-upload__avatar:active .lm-upload__avatar-img { opacity: var(--opacity-pressed); }
.lm-upload__avatar.is-uploading .lm-upload__avatar-img::after {
  content: ""; position: absolute; inset: 0; background: var(--overlay);
}
.lm-upload__avatar .lm-spinner { position: absolute; top: 48px; left: 50%; translate: -50% -50%; z-index: 1; --lm-spinner-color: var(--thumb); }

/* ===== Avatar.css ===== */
/* ==========================================================================
   Avatar — Contacts-style monogram / photo / symbol
   ========================================================================== */
.lm-avatar {
  --avatar-size: var(--avatar-md);
  --avatar-ring: var(--bg-grouped-secondary);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--avatar-size); height: var(--avatar-size);
  border-radius: var(--radius-full);
  /* iOS Contacts monogram: gray gradient, white initials */
  background: linear-gradient(180deg, var(--gray-2), var(--gray));
  color: var(--thumb);
  font-family: var(--font-rounded);
  font-size: calc(var(--avatar-size) * 0.4); line-height: 1; letter-spacing: 0;
  font-weight: var(--fw-semibold);
  text-transform: uppercase; white-space: nowrap;
  vertical-align: middle; user-select: none;
}
.lm-avatar > img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.lm-avatar > .lm-icon { --lm-icon-size: calc(var(--avatar-size) * 0.56); }
.lm-avatar--symbol { background: var(--fill-secondary); color: var(--label-secondary); }

/* Sizes */
.lm-avatar--xs { --avatar-size: var(--avatar-xs); }
.lm-avatar--sm { --avatar-size: var(--avatar-sm); }
.lm-avatar--md { --avatar-size: var(--avatar-md); }
.lm-avatar--lg { --avatar-size: var(--avatar-lg); }
.lm-avatar--xl { --avatar-size: var(--avatar-xl); }

/* Shape */
.lm-avatar--square { border-radius: var(--radius-8); }
.lm-avatar--square.lm-avatar--xs { border-radius: var(--radius-6); }
.lm-avatar--square.lm-avatar--lg, .lm-avatar--square.lm-avatar--xl { border-radius: var(--radius-12); }

/* Colored monograms — system color gradient */
.lm-avatar--blue, .lm-avatar--green, .lm-avatar--indigo, .lm-avatar--orange, .lm-avatar--pink,
.lm-avatar--purple, .lm-avatar--red, .lm-avatar--teal, .lm-avatar--mint, .lm-avatar--cyan, .lm-avatar--brown {
  background: linear-gradient(180deg, color-mix(in srgb, var(--avatar-color) 72%, var(--thumb)), var(--avatar-color));
}
.lm-avatar--blue { --avatar-color: var(--blue); }
.lm-avatar--green { --avatar-color: var(--green); }
.lm-avatar--indigo { --avatar-color: var(--indigo); }
.lm-avatar--orange { --avatar-color: var(--orange); }
.lm-avatar--pink { --avatar-color: var(--pink); }
.lm-avatar--purple { --avatar-color: var(--purple); }
.lm-avatar--red { --avatar-color: var(--red); }
.lm-avatar--teal { --avatar-color: var(--teal); }
.lm-avatar--mint { --avatar-color: var(--mint); }
.lm-avatar--cyan { --avatar-color: var(--cyan); }
.lm-avatar--brown { --avatar-color: var(--brown); }

/* Presence dot */
.lm-avatar__status {
  position: absolute; right: 0; bottom: 0;
  width: max(8px, calc(var(--avatar-size) * 0.26)); height: max(8px, calc(var(--avatar-size) * 0.26));
  border-radius: var(--radius-full);
  background: var(--green);
  box-shadow: 0 0 0 max(1.5px, calc(var(--avatar-size) * 0.05)) var(--avatar-ring);
}
.lm-avatar__status--offline { background: var(--gray-2); }
.lm-avatar__status--busy { background: var(--red); }
.lm-avatar__status--away { background: var(--orange); }
.lm-avatar--square .lm-avatar__status { right: -2px; bottom: -2px; }

/* Interactive */
button.lm-avatar, a.lm-avatar { border: 0; padding: 0; cursor: pointer; text-decoration: none; }
button.lm-avatar:active, a.lm-avatar:active { opacity: var(--opacity-pressed); }

/* Group (stacked) */
.lm-avatar-group { display: inline-flex; align-items: center; flex-direction: row; isolation: isolate; }
.lm-avatar-group > .lm-avatar { box-shadow: 0 0 0 2px var(--avatar-ring); }
.lm-avatar-group > .lm-avatar + .lm-avatar { margin-left: calc(var(--avatar-size) * -0.28); }
.lm-avatar-group--sm > .lm-avatar { --avatar-size: var(--avatar-sm); }
.lm-avatar-group--xs > .lm-avatar { --avatar-size: var(--avatar-xs); }
.lm-avatar-group--lg > .lm-avatar { --avatar-size: var(--avatar-lg); }
.lm-avatar--more {
  background: var(--fill-secondary); color: var(--label-secondary);
  font-family: var(--font-sans); font-size: calc(var(--avatar-size) * 0.34); text-transform: none;
}
.lm-avatar-group--on-bg > .lm-avatar { --avatar-ring: var(--bg); }
.lm-avatar-group--on-grouped > .lm-avatar { --avatar-ring: var(--bg-grouped); }

/* ===== Badge.css ===== */
/* ==========================================================================
   Badge — iOS notification badge · dot · status · ribbon
   ========================================================================== */
.lm-badge { position: relative; display: inline-flex; vertical-align: middle; flex: none; }

.lm-badge__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--red); color: var(--thumb);
  font-family: var(--font-sans);
  font-size: var(--fs-footnote); line-height: 1; letter-spacing: 0; font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  vertical-align: middle; top: auto;
}
.lm-badge__count:empty { display: none; }
.lm-badge__count--sm { min-width: 14px; height: 14px; padding: 0 4px; font-size: var(--fs-caption-2); font-weight: var(--fw-semibold); }
.lm-badge__count--lg { min-width: 24px; height: 24px; padding: 0 7px; font-size: var(--fs-subheadline); }
.lm-badge__count--gray { background: var(--gray); }
.lm-badge__count--blue { background: var(--blue); }
.lm-badge__count--green { background: var(--green); }
.lm-badge__count--orange { background: var(--orange); }
.lm-badge__count--soft { background: var(--fill-secondary); color: var(--label-secondary); }
.lm-badge__count--ring { box-shadow: 0 0 0 2px var(--lm-badge-ring, var(--bg-grouped-secondary)); }

.lm-badge__dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: var(--radius-full); background: var(--red);
  box-shadow: 0 0 0 2px var(--lm-badge-ring, var(--bg-grouped-secondary));
}
.lm-badge__dot--blue { background: var(--blue); }

/* Anchored on an icon / avatar / button */
.lm-badge:not(.lm-badge--standalone) > .lm-badge__count,
.lm-badge:not(.lm-badge--standalone) > .lm-badge__dot {
  position: absolute; z-index: 1; top: 0; right: 0;
  transform: translate(calc(50% + var(--lm-badge-x, 0px)), calc(-50% + var(--lm-badge-y, 0px)));
}
.lm-badge:not(.lm-badge--standalone) > .lm-badge__dot { transform: translate(calc(25% + var(--lm-badge-x, 0px)), calc(-25% + var(--lm-badge-y, 0px))); }
.lm-badge--on-avatar > .lm-badge__count, .lm-badge--on-avatar > .lm-badge__dot { --lm-badge-x: -18%; --lm-badge-y: 18%; }

/* Pop-in when the count changes (bundle.js adds .is-bump) */
.lm-badge__count.is-bump { animation: lm-badge-bump var(--duration-base) var(--ease-spring); }
@keyframes lm-badge-bump { 0% { scale: 0.6; } 60% { scale: 1.15; } 100% { scale: 1; } }

/* Status (Ant Badge status) */
.lm-badge-status { display: inline-flex; align-items: center; gap: var(--space-6); color: var(--label); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
.lm-badge-status__dot { position: relative; width: 8px; height: 8px; flex: none; border-radius: var(--radius-full); background: var(--gray-2); }
.lm-badge-status--success .lm-badge-status__dot { background: var(--success); }
.lm-badge-status--processing .lm-badge-status__dot { background: var(--info); }
.lm-badge-status--error .lm-badge-status__dot { background: var(--danger); }
.lm-badge-status--warning .lm-badge-status__dot { background: var(--warning); }
.lm-badge-status--processing .lm-badge-status__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit;
  animation: lm-badge-pulse 1.4s var(--ease-out) infinite;
}
@keyframes lm-badge-pulse { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.6); opacity: 0; } }

/* Ribbon on a card corner */
.lm-ribbon-wrap { position: relative; }
.lm-ribbon {
  --lm-ribbon-color: var(--accent);
  position: absolute; z-index: 2; top: var(--space-12); right: calc(-1 * var(--space-4));
  padding: var(--space-2) var(--space-8);
  border-radius: var(--radius-6) var(--radius-6) 0 var(--radius-6);
  background: var(--lm-ribbon-color); color: var(--on-accent);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.lm-ribbon::after {
  content: ""; position: absolute; right: 0; top: 100%;
  width: var(--space-4); height: var(--space-4);
  background: var(--lm-ribbon-color); filter: brightness(0.55);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.lm-ribbon--start { right: auto; left: calc(-1 * var(--space-4)); border-radius: var(--radius-6) var(--radius-6) var(--radius-6) 0; }
.lm-ribbon--start::after { right: auto; left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.lm-ribbon--red { --lm-ribbon-color: var(--red); }
.lm-ribbon--green { --lm-ribbon-color: var(--green); }
.lm-ribbon--orange { --lm-ribbon-color: var(--orange); }
.lm-ribbon--purple { --lm-ribbon-color: var(--purple); }

/* ===== Calendar.css ===== */
/* ==========================================================================
   Calendar — Calendar.app month view
   Auto: Mobile = compact month + dots + agenda · Tablet+ = full month with event chips
   Forced: --compact | --full · --mini (compact, no agenda) · --agenda (side agenda ≥ 1200)
   ========================================================================== */
.lm-calendar {
  --cal-cell: 44px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8);
  min-width: 0; color: var(--label);
}
.lm-calendar__month { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.lm-calendar__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); }
.lm-calendar__title {
  margin: 0; min-width: 0;
  font-size: var(--fs-title-2); line-height: var(--lh-title-2); letter-spacing: var(--ls-title-2); font-weight: var(--fw-bold);
}
.lm-calendar__title-year { color: var(--accent); }
.lm-calendar__nav { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; }
.lm-calendar__nav .lm-btn--icon { color: var(--accent); }
.lm-calendar__weekdays {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); font-weight: var(--fw-semibold);
  color: var(--label-secondary); text-align: center; text-transform: uppercase;
}
.lm-calendar__weekdays > :nth-child(n+6) { color: var(--label-tertiary); }
.lm-calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: var(--space-4); }

/* Day cell — compact (default) */
.lm-calendar__day {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 0; min-height: var(--cal-cell); padding: var(--space-2) 0;
  border: 0; background: transparent; color: var(--label);
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.lm-calendar__date {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-full);
  font-size: var(--fs-title-3); line-height: 1; letter-spacing: 0; font-weight: var(--fw-regular);
  font-variant-numeric: tabular-nums;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.lm-calendar__day.is-weekend .lm-calendar__date { color: var(--label-secondary); }
.lm-calendar__day.is-outside .lm-calendar__date { color: var(--label-tertiary); }
.lm-calendar__day.is-today .lm-calendar__date { color: var(--accent); font-weight: var(--fw-semibold); }
.lm-calendar__day[aria-pressed="true"] .lm-calendar__date { background: var(--label); color: var(--bg); font-weight: var(--fw-semibold); }
.lm-calendar__day.is-today[aria-pressed="true"] .lm-calendar__date { background: var(--accent); color: var(--on-accent); }
.lm-calendar__day:disabled { cursor: not-allowed; }
.lm-calendar__day:disabled .lm-calendar__date { color: var(--label-quaternary); text-decoration: line-through; }
.lm-calendar__day:focus-visible { outline: none; }
.lm-calendar__day:focus-visible .lm-calendar__date { outline: var(--ring-width) solid var(--focus-ring); outline-offset: 1px; }
.lm-calendar__day:active .lm-calendar__date { background: var(--fill-secondary); }
@media (hover: hover) and (pointer: fine) { .lm-calendar__day:not([aria-pressed="true"]):not(:disabled):hover .lm-calendar__date { background: var(--fill-quaternary); } }

.lm-calendar__dots { display: flex; gap: 3px; height: 5px; }
.lm-calendar__dot { width: 5px; height: 5px; border-radius: var(--radius-full); background: var(--ev, var(--gray)); }
.lm-calendar__events { display: none; }

/* Event colors */
.lm-calendar__dot--blue, .lm-calendar__event--blue, .lm-calendar__agenda-dot--blue { --ev: var(--blue); }
.lm-calendar__dot--green, .lm-calendar__event--green, .lm-calendar__agenda-dot--green { --ev: var(--green); }
.lm-calendar__dot--orange, .lm-calendar__event--orange, .lm-calendar__agenda-dot--orange { --ev: var(--orange); }
.lm-calendar__dot--red, .lm-calendar__event--red, .lm-calendar__agenda-dot--red { --ev: var(--red); }
.lm-calendar__dot--purple, .lm-calendar__event--purple, .lm-calendar__agenda-dot--purple { --ev: var(--purple); }
.lm-calendar__dot--teal, .lm-calendar__event--teal, .lm-calendar__agenda-dot--teal { --ev: var(--teal); }
.lm-calendar__dot--indigo, .lm-calendar__event--indigo, .lm-calendar__agenda-dot--indigo { --ev: var(--indigo); }
.lm-calendar__dot--pink, .lm-calendar__event--pink, .lm-calendar__agenda-dot--pink { --ev: var(--pink); }

/* Agenda (selected day) */
.lm-calendar__agenda { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; padding-top: var(--space-8); border-top: var(--hairline) solid var(--separator); }
.lm-calendar__agenda-title { margin: 0; padding: 0 var(--space-4); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-semibold); color: var(--label-secondary); }
.lm-calendar__agenda-dot { width: 4px; align-self: stretch; min-height: 32px; border-radius: var(--radius-full); background: var(--ev, var(--gray)); }
.lm-calendar__agenda-empty { padding: var(--space-16); text-align: center; color: var(--label-secondary); font-size: var(--fs-subheadline); background: var(--bg-grouped-secondary); border-radius: var(--radius-10); }
.lm-calendar--mini .lm-calendar__agenda { display: none; }
.lm-calendar--mini { --cal-cell: 40px; }
.lm-calendar--mini .lm-calendar__title { font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); }
.lm-calendar--mini .lm-calendar__date { width: 30px; height: 30px; font-size: var(--fs-body); }

/* ---------- Full month (forced) ---------- */
.lm-calendar--full .lm-calendar__weekdays { text-align: left; padding-left: var(--space-8); }
.lm-calendar--full .lm-calendar__grid { row-gap: 0; border-top: var(--hairline) solid var(--separator); }
.lm-calendar--full .lm-calendar__day { align-items: stretch; justify-content: flex-start; gap: var(--space-4); min-height: 96px; padding: var(--space-4) var(--space-4) var(--space-6); border-bottom: var(--hairline) solid var(--separator); }
.lm-calendar--full .lm-calendar__date { width: 28px; height: 28px; font-size: var(--fs-subheadline); font-weight: var(--fw-semibold); }
.lm-calendar--full .lm-calendar__dots { display: none; }
.lm-calendar--full .lm-calendar__events { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lm-calendar--full .lm-calendar__agenda { display: none; }
.lm-calendar--full .lm-calendar__day:active .lm-calendar__date { background: transparent; }
.lm-calendar--full .lm-calendar__day:active { background: var(--fill-quaternary); }

/* ---------- Full month (auto, tablet+) ---------- */
@media (min-width: 768px) {
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__weekdays { text-align: left; padding-left: var(--space-8); }
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__grid { row-gap: 0; border-top: var(--hairline) solid var(--separator); }
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__day { align-items: stretch; justify-content: flex-start; gap: var(--space-4); min-height: 96px; padding: var(--space-4) var(--space-4) var(--space-6); border-bottom: var(--hairline) solid var(--separator); }
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__date { width: 28px; height: 28px; font-size: var(--fs-subheadline); font-weight: var(--fw-semibold); }
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__dots { display: none; }
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__events { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini):not(.lm-calendar--agenda) .lm-calendar__agenda { display: none; }
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__day:active .lm-calendar__date { background: transparent; }
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__day:active { background: var(--fill-quaternary); }
}
@media (min-width: 1200px) {
  .lm-calendar:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__day,
  .lm-calendar--full .lm-calendar__day { min-height: 112px; }
  .lm-calendar--agenda:not(.lm-calendar--compact):not(.lm-calendar--mini) { grid-template-columns: minmax(0, 1fr) 300px; column-gap: var(--group-gap); align-items: start; }
  .lm-calendar--agenda:not(.lm-calendar--compact):not(.lm-calendar--mini) .lm-calendar__agenda { border-top: 0; padding-top: 0; display: flex; }
}
.lm-calendar__event {
  display: flex; align-items: center; gap: var(--space-4); min-width: 0;
  padding: 1px var(--space-4);
  border-radius: var(--radius-4);
  background: color-mix(in srgb, var(--ev, var(--gray)) 16%, transparent);
  color: var(--label);
  font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); text-align: left;
}
.lm-calendar__event::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--ev, var(--gray)); }
.lm-calendar__event-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-calendar__event-time { color: var(--label-secondary); font-variant-numeric: tabular-nums; flex: none; }
.lm-calendar__more { font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); color: var(--label-secondary); padding-left: var(--space-4); text-align: left; }
.lm-calendar__day.is-outside .lm-calendar__event { opacity: 0.55; }

/* ===== Card.css ===== */
/* ==========================================================================
   Card — grouped content surface (widgets, App Store cards)
   ========================================================================== */
.lm-card {
  position: relative;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--bg-grouped-secondary);
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-card);
  color: var(--label);
  overflow: hidden;
  text-decoration: none;
}
.lm-card__header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-12);
  min-height: calc(var(--lh-headline) + var(--card-padding));
  padding: var(--card-padding) var(--card-padding) 0;
}
.lm-card__heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lm-card__title {
  margin: 0; min-width: 0;
  font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lm-card__title--lg { font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); }
.lm-card__subtitle { margin: 0; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); color: var(--label-secondary); }
.lm-card__eyebrow { font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: var(--fw-semibold); color: var(--label-secondary); text-transform: uppercase; letter-spacing: 0.02em; }
.lm-card__extra { flex: none; display: inline-flex; align-items: center; gap: var(--space-8); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--link); }
.lm-card__extra a { color: inherit; text-decoration: none; }
.lm-card__body {
  display: flex; flex-direction: column; gap: var(--space-8);
  padding: var(--card-padding);
  min-width: 0;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
}
.lm-card__header + .lm-card__body, .lm-card__tabs + .lm-card__body { padding-top: var(--space-8); }
.lm-card__body p { margin: 0; }
.lm-card__footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-8);
  padding: 0 var(--card-padding) var(--card-padding);
}
.lm-card__tabs { padding: var(--space-8) var(--card-padding) 0; }

/* Cover — full-bleed media */
.lm-card__cover { position: relative; aspect-ratio: var(--lm-card-ratio, 16 / 9); max-width: 100%; overflow: hidden; background: var(--fill-tertiary); }
.lm-card__cover > img, .lm-card__cover > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lm-card__cover-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--card-padding);
  background: var(--material-thin);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
}

/* Meta row — avatar + title + description */
.lm-card__meta { display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.lm-card__meta-text { display: flex; flex-direction: column; min-width: 0; }
.lm-card__meta-title { font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-card__meta-desc { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-secondary); }

/* Actions — equal cells split by hairlines */
.lm-card__actions { display: flex; border-top: var(--hairline) solid var(--separator); margin-top: auto; }
.lm-card__actions > * {
  flex: 1 1 0; min-width: 0; min-height: var(--control-md);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-6);
  border: 0; border-radius: 0; background: transparent; color: var(--accent);
  font: inherit; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-medium);
  text-decoration: none; cursor: pointer;
  --lm-icon-size: 20px;
}
.lm-card__actions > * + * { border-left: var(--hairline) solid var(--separator); }
.lm-card__actions > *:active { background: var(--row-pressed); }
.lm-card__actions > .is-danger { color: var(--danger); }
@media (hover: hover) and (pointer: fine) { .lm-card__actions > *:hover { background: var(--fill-quaternary); } }

/* Variants */
.lm-card--flat { box-shadow: none; }
.lm-card--outlined { box-shadow: inset 0 0 0 var(--hairline) var(--separator-opaque); }
.lm-card--inner, .lm-card .lm-card { background: var(--bg-grouped-tertiary); box-shadow: none; border-radius: var(--radius-10); }
.lm-card--elevated { background: var(--bg-elevated); box-shadow: var(--shadow-raised); }
.lm-card--hoverable, .lm-card--pressable { transition: transform var(--duration-base) var(--ease-spring), box-shadow var(--duration-base) var(--ease-standard); }
@media (hover: hover) and (pointer: fine) {
  .lm-card--hoverable:hover { box-shadow: var(--shadow-raised); transform: translateY(-2px); }
}
.lm-card--pressable { cursor: pointer; }
.lm-card--pressable:active { transform: scale(0.98); }
.lm-card--horizontal { flex-direction: row; }
.lm-card--horizontal > .lm-card__cover { flex: 0 0 38%; aspect-ratio: auto; min-height: 120px; }
.lm-card--horizontal > .lm-card__content { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.lm-card--hero { border-radius: var(--radius-20); }
.lm-card--hero .lm-card__cover { aspect-ratio: var(--lm-card-ratio, 4 / 3); }
@media (min-width: 768px) { .lm-card--hero .lm-card__cover { aspect-ratio: var(--lm-card-ratio, 16 / 9); } }

/* Loading */
.lm-card__skeleton { display: flex; flex-direction: column; gap: var(--space-8); }
.lm-card__skeleton-line {
  height: 12px; border-radius: var(--radius-4);
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--fill-quaternary) 50%, var(--skeleton) 100%);
  background-size: 200% 100%;
  animation: lm-card-shimmer 1.4s linear infinite;
}
.lm-card__skeleton-line--title { height: 18px; width: 55%; }
.lm-card__skeleton-line--short { width: 40%; }
.lm-card__skeleton-line--mid { width: 75%; }
@keyframes lm-card-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.lm-card.is-loading { pointer-events: none; }

/* Grid of cards (alias of .lm-card-grid with stretch) */
.lm-card-list { display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0; }

/* ===== Carousel.css ===== */
/* ==========================================================================
   Carousel — paging scroll view + UIPageControl
   Mobile: slides 88% wide with peek · Tablet/Desktop: full-width slides + arrows
   ========================================================================== */
.lm-carousel { position: relative; display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.lm-carousel__viewport {
  position: relative; /* offsetParent for slides */
  display: flex; gap: var(--card-gap);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--lm-carousel-inset, 0px);
  padding-inline: var(--lm-carousel-inset, 0px);
  scrollbar-width: none; -ms-overflow-style: none;
  border-radius: var(--radius-12);
}
.lm-carousel__viewport::-webkit-scrollbar { display: none; }
.lm-carousel__viewport:focus-visible { outline-offset: 2px; }
.lm-carousel__slide {
  position: relative; flex: 0 0 88%; min-width: 0;
  scroll-snap-align: center; scroll-snap-stop: always;
  border-radius: var(--radius-12); overflow: hidden;
  background: var(--bg-grouped-secondary);
  aspect-ratio: var(--lm-carousel-ratio, 16 / 9);
}
.lm-carousel__slide > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lm-carousel__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--card-padding) var(--card-padding) calc(var(--card-padding) + 24px);
  background: linear-gradient(transparent, var(--overlay));
  color: var(--thumb); /* always on a darkened photo */
}
.lm-carousel__caption-title { font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); font-weight: var(--fw-bold); }
.lm-carousel__caption-text { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); opacity: 0.9; }
@media (min-width: 768px) {
  .lm-carousel:not(.lm-carousel--peek) .lm-carousel__viewport { gap: 0; }
  .lm-carousel:not(.lm-carousel--peek) .lm-carousel__slide { flex-basis: 100%; border-radius: 0; }
}
.lm-carousel--peek .lm-carousel__slide { flex-basis: 88%; }
@media (min-width: 768px) { .lm-carousel--peek .lm-carousel__slide { flex-basis: calc((100% - var(--card-gap)) / 2); scroll-snap-align: start; } }
@media (min-width: 1200px) { .lm-carousel--peek .lm-carousel__slide { flex-basis: calc((100% - 2 * var(--card-gap)) / 3); } }
.lm-carousel--full .lm-carousel__viewport { gap: 0; }
.lm-carousel--full .lm-carousel__slide { flex-basis: 100%; border-radius: 0; }

/* Arrows — glass circles, visible on hover with a mouse */
.lm-carousel__arrow {
  position: absolute; z-index: 2; top: var(--lm-carousel-arrow-top, calc(50% - 14px)); translate: 0 -50%;
  display: none; align-items: center; justify-content: center;
  width: var(--control-md); height: var(--control-md);
  border: 0; border-radius: var(--radius-full); padding: 0;
  background: var(--material-thin); color: var(--label);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate));
  box-shadow: var(--shadow-raised);
  cursor: pointer; opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
  --lm-icon-size: 20px;
}
.lm-carousel__arrow--prev { left: var(--space-12); }
.lm-carousel__arrow--next { right: var(--space-12); }
.lm-carousel__arrow:disabled { opacity: 0 !important; pointer-events: none; }
.lm-carousel__arrow:active { scale: 0.94; }
@media (min-width: 768px) { .lm-carousel__arrow { display: inline-flex; } }
@media (hover: hover) and (pointer: fine) {
  .lm-carousel:hover .lm-carousel__arrow, .lm-carousel:focus-within .lm-carousel__arrow { opacity: 1; }
}
@media (hover: none) and (min-width: 768px) { .lm-carousel__arrow { opacity: 1; } }

/* Page control (UIPageControl) */
.lm-page-control {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  align-self: center;
  padding: var(--space-6) var(--space-10);
  border-radius: var(--radius-full);
}
.lm-page-control__dot {
  position: relative; flex: none;
  width: 7px; height: 7px; padding: 0; border: 0;
  border-radius: var(--radius-full);
  background: var(--gray-3); cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), width var(--duration-base) var(--ease-spring);
}
.lm-page-control__dot::before { content: ""; position: absolute; inset: -9px -5px; } /* bigger hit area */
.lm-page-control__dot[aria-current="true"] { background: var(--label); }
.lm-page-control--pill .lm-page-control__dot[aria-current="true"] { width: 20px; }
/* over imagery: material capsule */
.lm-page-control--overlay, .lm-carousel--dots-overlay .lm-page-control {
  position: absolute; z-index: 2; left: 50%; bottom: calc(var(--space-8) + var(--lm-carousel-dots-offset, 0px)); translate: -50% 0;
  background: var(--material-thin);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate));
}
.lm-carousel--dots-overlay .lm-page-control__dot, .lm-page-control--overlay .lm-page-control__dot { background: var(--label-tertiary); }
.lm-carousel--dots-overlay .lm-page-control__dot[aria-current="true"], .lm-page-control--overlay .lm-page-control__dot[aria-current="true"] { background: var(--label); }
.lm-carousel--dots-overlay { --lm-carousel-arrow-top: 50%; }

/* Fade effect */
.lm-carousel--fade .lm-carousel__viewport { display: grid; overflow: hidden; scroll-snap-type: none; gap: 0; padding: 0; }
.lm-carousel--fade .lm-carousel__slide {
  grid-area: 1 / 1; flex: none; width: 100%;
  opacity: 0; visibility: hidden;
  transition: opacity var(--duration-slow) var(--ease-standard), visibility 0s linear var(--duration-slow);
}
.lm-carousel--fade .lm-carousel__slide.is-active { opacity: 1; visibility: visible; transition: opacity var(--duration-slow) var(--ease-standard), visibility 0s; }

/* Vertical (Ant dotPlacement left/right) */
.lm-carousel--vertical .lm-carousel__viewport { flex-direction: column; overflow-x: hidden; overflow-y: auto; scroll-snap-type: y mandatory; height: var(--lm-carousel-height, 240px); gap: 0; }
.lm-carousel--vertical .lm-carousel__slide { flex: 0 0 100%; aspect-ratio: auto; border-radius: 0; }

/* ===== Collapse.css ===== */
/* ==========================================================================
   Collapse — DisclosureGroup on <details>/<summary>
   ========================================================================== */
.lm-collapse {
  interpolate-size: allow-keywords;
  display: flex; flex-direction: column; min-width: 0;
  background: var(--bg-grouped-secondary);
  border-radius: var(--radius-10);
  overflow: hidden;
  color: var(--label);
}
@media (min-width: 768px) { .lm-collapse { border-radius: var(--radius-12); } }
.lm-collapse__item { position: relative; min-width: 0; }
.lm-collapse__item + .lm-collapse__item::before {
  content: ""; position: absolute; top: 0; left: var(--space-16); right: 0;
  height: var(--hairline); background: var(--separator); z-index: 1;
}
.lm-collapse__header {
  display: flex; align-items: center; gap: var(--space-12);
  min-height: var(--row-height);
  padding: calc((var(--row-height) - var(--lh-body)) / 2) var(--space-16);
  list-style: none; cursor: pointer; user-select: none;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  -webkit-tap-highlight-color: transparent;
}
.lm-collapse__header::-webkit-details-marker { display: none; }
.lm-collapse__header::marker { content: ""; }
.lm-collapse__header:active { background: var(--row-pressed); }
.lm-collapse__header:focus-visible { outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .lm-collapse__header:hover { background: var(--fill-quaternary); } }
.lm-collapse__icon { flex: none; display: inline-flex; color: var(--accent); --lm-icon-size: var(--icon-md); }
.lm-collapse__title { flex: 1 1 auto; min-width: 0; }
.lm-collapse__item[open] > .lm-collapse__header .lm-collapse__title { font-weight: var(--fw-semibold); }
.lm-collapse__extra { flex: none; color: var(--label-secondary); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); }
.lm-collapse__arrow {
  flex: none; color: var(--accent); --lm-icon-size: 14px;
  transition: transform var(--duration-base) var(--ease-spring);
}
.lm-collapse__arrow svg { stroke-width: 2.8; }
.lm-collapse__item[open] > .lm-collapse__header .lm-collapse__arrow { transform: rotate(90deg); }
.lm-collapse__content {
  padding: 0 var(--space-16) var(--card-padding);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label-secondary);
}
.lm-collapse__content > :first-child { margin-top: 0; }
.lm-collapse__content > :last-child { margin-bottom: 0; }

/* Smooth open/close where ::details-content is supported */
.lm-collapse__item::details-content {
  block-size: 0; overflow: clip;
  transition: block-size var(--duration-base) var(--ease-standard), content-visibility var(--duration-base) allow-discrete;
}
.lm-collapse__item[open]::details-content { block-size: auto; }

/* Arrow at start (Ant default expandIconPosition="start") */
.lm-collapse--arrow-start .lm-collapse__arrow { order: -1; }
.lm-collapse--arrow-start .lm-collapse__content { padding-left: calc(var(--space-16) + 14px + var(--space-12)); }

/* Disabled panel */
.lm-collapse__item.is-disabled > .lm-collapse__header { color: var(--label-tertiary); cursor: not-allowed; pointer-events: none; }
.lm-collapse__item.is-disabled > .lm-collapse__header .lm-collapse__arrow,
.lm-collapse__item.is-disabled > .lm-collapse__header .lm-collapse__icon { color: var(--label-tertiary); }

/* Variants */
.lm-collapse--bordered { background: var(--bg-grouped-secondary); box-shadow: inset 0 0 0 1px var(--separator-opaque); }
.lm-collapse--bordered .lm-collapse__item + .lm-collapse__item::before { left: 0; }
.lm-collapse--bordered .lm-collapse__item[open] > .lm-collapse__header { background: var(--fill-quaternary); }
.lm-collapse--bordered .lm-collapse__content { padding-top: var(--card-padding); }
.lm-collapse--ghost { background: transparent; border-radius: 0; overflow: visible; }
.lm-collapse--ghost .lm-collapse__header, .lm-collapse--ghost .lm-collapse__content { padding-inline: 0; }
.lm-collapse--ghost .lm-collapse__item + .lm-collapse__item::before { left: 0; }
.lm-collapse--borderless { background: var(--fill-quaternary); }
.lm-collapse--borderless .lm-collapse__item + .lm-collapse__item::before { display: none; }
.lm-collapse--separate { background: transparent; gap: var(--card-gap); overflow: visible; border-radius: 0; }
.lm-collapse--separate > .lm-collapse__item { background: var(--bg-grouped-secondary); border-radius: var(--radius-12); box-shadow: var(--shadow-card); overflow: hidden; }
.lm-collapse--separate .lm-collapse__item + .lm-collapse__item::before { display: none; }
.lm-collapse--sm { --row-height: 36px; }
.lm-collapse--sm .lm-collapse__header { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); padding-block: calc((var(--row-height) - var(--lh-subheadline)) / 2); }
.lm-collapse--lg { --row-height: 52px; }

/* Nested */
.lm-collapse .lm-collapse { margin-top: var(--space-4); }
.lm-collapse .lm-collapse:not(.lm-collapse--ghost) { background: var(--bg-grouped-tertiary); }

/* ===== Descriptions.css ===== */
/* ==========================================================================
   Descriptions — label/value pairs
   Auto: Mobile = Settings rows · Tablet = 2-col grid · Desktop = 3-col grid
   Forced: --rows (rows everywhere) | --grid (grid everywhere) · --cols-1..4
   ========================================================================== */
.lm-descriptions { --desc-cols: 1; display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; color: var(--label); }
.lm-descriptions__header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); padding: 0 var(--space-16); }
.lm-descriptions__title {
  margin: 0; min-width: 0;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); font-weight: var(--fw-regular);
  color: var(--label-secondary); text-transform: uppercase;
}
.lm-descriptions__extra { flex: none; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--link); }
.lm-descriptions__extra a, .lm-descriptions__value a { color: var(--link); text-decoration: none; }

/* ---------- Rows (mobile default) ---------- */
.lm-descriptions__list {
  margin: 0; padding: 0; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg-grouped-secondary);
  border-radius: var(--radius-10);
  overflow: hidden;
}
.lm-descriptions__item {
  position: relative; min-width: 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-16);
  min-height: var(--row-height);
  padding: calc((var(--row-height) - var(--lh-body)) / 2) var(--space-16);
}
.lm-descriptions__item + .lm-descriptions__item::before { content: ""; position: absolute; top: 0; left: var(--space-16); right: 0; height: var(--hairline); background: var(--separator); }
.lm-descriptions__label { margin: 0; flex: none; max-width: 50%; font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); color: var(--label); }
.lm-descriptions__value { margin: 0; flex: 1 1 auto; min-width: 0; text-align: right; font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); color: var(--label-secondary); overflow-wrap: anywhere; }
.lm-descriptions__value--strong { color: var(--label); font-weight: var(--fw-semibold); }

/* Vertical rows: label above value */
.lm-descriptions--vertical .lm-descriptions__item { flex-direction: column; align-items: stretch; gap: 2px; }
.lm-descriptions--vertical .lm-descriptions__label { max-width: none; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); }
.lm-descriptions--vertical .lm-descriptions__value { text-align: left; color: var(--label); }

/* ---------- Grid (forced) ---------- */
.lm-descriptions--grid { --desc-cols: 2; }
.lm-descriptions--grid .lm-descriptions__list {
  display: grid; grid-template-columns: repeat(var(--desc-cols), minmax(0, 1fr));
  column-gap: var(--space-24); row-gap: var(--space-16); padding: var(--card-padding);
}
.lm-descriptions--grid .lm-descriptions__item { flex-direction: column; align-items: stretch; gap: 2px; min-height: 0; padding: 0; }
.lm-descriptions--grid .lm-descriptions__item::before { display: none; }
.lm-descriptions--grid .lm-descriptions__label { max-width: none; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
.lm-descriptions--grid .lm-descriptions__value { text-align: left; color: var(--label); }
.lm-descriptions--grid .lm-descriptions__item--span-2 { grid-column: span 2; }
.lm-descriptions--grid .lm-descriptions__item--span-full { grid-column: 1 / -1; }

/* ---------- Grid (auto, tablet+) ---------- */
@media (min-width: 768px) {
  .lm-descriptions:not(.lm-descriptions--rows) { --desc-cols: 2; }
  .lm-descriptions:not(.lm-descriptions--rows):not(.lm-descriptions--bordered) .lm-descriptions__list {
    display: grid; grid-template-columns: repeat(var(--desc-cols), minmax(0, 1fr));
    column-gap: var(--space-24); row-gap: var(--space-16); padding: var(--card-padding);
    border-radius: var(--radius-12);
  }
  .lm-descriptions:not(.lm-descriptions--rows):not(.lm-descriptions--bordered) .lm-descriptions__item { flex-direction: column; align-items: stretch; gap: 2px; min-height: 0; padding: 0; }
  .lm-descriptions:not(.lm-descriptions--rows):not(.lm-descriptions--bordered) .lm-descriptions__item::before { display: none; }
  .lm-descriptions:not(.lm-descriptions--rows):not(.lm-descriptions--bordered) .lm-descriptions__label { max-width: none; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
  .lm-descriptions:not(.lm-descriptions--rows):not(.lm-descriptions--bordered) .lm-descriptions__value { text-align: left; color: var(--label); }
  .lm-descriptions:not(.lm-descriptions--rows) .lm-descriptions__item--span-2 { grid-column: span 2; }
  .lm-descriptions:not(.lm-descriptions--rows) .lm-descriptions__item--span-full { grid-column: 1 / -1; }
}
@media (min-width: 1200px) { .lm-descriptions:not(.lm-descriptions--rows) { --desc-cols: 3; } }
/* explicit column counts win at every breakpoint */
.lm-descriptions.lm-descriptions--cols-1 { --desc-cols: 1; }
.lm-descriptions.lm-descriptions--cols-2 { --desc-cols: 2; }
.lm-descriptions.lm-descriptions--cols-3 { --desc-cols: 3; }
.lm-descriptions.lm-descriptions--cols-4 { --desc-cols: 4; }
.lm-descriptions.lm-descriptions--cols-1 .lm-descriptions__item--span-2 { grid-column: auto; }

/* ---------- Bordered (table look; 1px grid lines via gap) ---------- */
.lm-descriptions--bordered { --bordered-cols: 1; }
.lm-descriptions--bordered .lm-descriptions__list {
  display: grid; grid-template-columns: repeat(var(--bordered-cols), minmax(0, 1fr));
  gap: 1px; padding: 1px;
  background: var(--separator-opaque);
}
.lm-descriptions--bordered .lm-descriptions__item {
  display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
  gap: 0; padding: 0; min-height: 0;
  background: var(--bg-grouped-secondary);
}
.lm-descriptions--bordered .lm-descriptions__item::before { display: none; }
.lm-descriptions--bordered .lm-descriptions__label {
  max-width: none; padding: var(--space-10) var(--space-12);
  background: var(--fill-quaternary); color: var(--label-secondary);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
}
.lm-descriptions--bordered .lm-descriptions__value {
  padding: var(--space-10) var(--space-12); text-align: left; color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
}
.lm-descriptions--bordered.lm-descriptions--grid { --bordered-cols: var(--desc-cols); }
@media (min-width: 768px) { .lm-descriptions--bordered:not(.lm-descriptions--rows) { --bordered-cols: var(--desc-cols); } }

/* ---------- Size / surface ---------- */
.lm-descriptions--sm { --row-height: 36px; }
.lm-descriptions--sm .lm-descriptions__label, .lm-descriptions--sm .lm-descriptions__value { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
.lm-descriptions--sm .lm-descriptions__item { padding-block: calc((var(--row-height) - var(--lh-subheadline)) / 2); }
.lm-descriptions--plain .lm-descriptions__list { background: transparent; border-radius: 0; }

/* ===== Empty.css ===== */
/* ==========================================================================
   Empty — ContentUnavailableView
   ========================================================================== */
.lm-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-8);
  padding: var(--space-40) var(--card-padding);
  text-align: center; color: var(--label);
  min-width: 0;
}
.lm-empty__image {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 64px; height: 64px; margin-bottom: var(--space-8);
  border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--label-secondary);
  --lm-icon-size: 32px;
}
.lm-empty__image--accent { background: var(--accent-soft); color: var(--accent); }
.lm-empty__image--plain { width: auto; height: auto; background: none; --lm-icon-size: 48px; }
.lm-empty__image > img, .lm-empty__image > svg { max-width: 100%; }
.lm-empty__title {
  margin: 0;
  font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold);
  text-wrap: balance;
}
.lm-empty__description {
  margin: 0; max-width: 36ch;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label-secondary); text-wrap: pretty;
}
.lm-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-8); margin-top: var(--space-8); }

/* Page-level (full screen) */
.lm-empty--lg { padding-block: var(--space-64); gap: var(--space-10); }
.lm-empty--lg .lm-empty__image { width: 88px; height: 88px; --lm-icon-size: 44px; }
.lm-empty--lg .lm-empty__title { font-size: var(--fs-title-2); line-height: var(--lh-title-2); letter-spacing: var(--ls-title-2); font-weight: var(--fw-bold); }
.lm-empty--lg .lm-empty__description { font-size: var(--fs-callout); line-height: var(--lh-callout); letter-spacing: var(--ls-callout); }

/* Simple — inside Select, Table, List */
.lm-empty--simple { flex-direction: column; gap: var(--space-4); padding: var(--space-20) var(--space-12); color: var(--label-secondary); }
.lm-empty--simple .lm-empty__image { width: auto; height: auto; margin: 0; background: none; color: var(--label-tertiary); --lm-icon-size: 28px; }
.lm-empty--simple .lm-empty__title { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); font-weight: var(--fw-regular); color: var(--label-secondary); }
.lm-empty--simple .lm-empty__description { font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); }

/* ===== Image.css ===== */
/* ==========================================================================
   Image — rounded media frame + full-screen preview (Photos viewer)
   ========================================================================== */
.lm-image { margin: 0; display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.lm-image__frame {
  position: relative; display: block;
  width: 100%; max-width: 100%;
  aspect-ratio: var(--lm-image-ratio, 4 / 3);
  overflow: hidden; border: 0; padding: 0; margin: 0;
  border-radius: var(--radius-12);
  background: var(--fill-tertiary);
  color: inherit; font: inherit; text-align: left;
}
.lm-image--sm .lm-image__frame { border-radius: var(--radius-8); }
.lm-image--square .lm-image__frame { --lm-image-ratio: 1; }
.lm-image--wide .lm-image__frame { --lm-image-ratio: 16 / 9; }
.lm-image--portrait .lm-image__frame { --lm-image-ratio: 3 / 4; }
.lm-image--circle .lm-image__frame { border-radius: var(--radius-full); --lm-image-ratio: 1; }
.lm-image__img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; display: block;
  object-fit: var(--lm-image-fit, cover);
  transition: opacity var(--duration-base) var(--ease-standard);
}
.lm-image--contain { --lm-image-fit: contain; }
.lm-image__caption { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }

/* Preview trigger */
button.lm-image__frame, a.lm-image__frame { cursor: zoom-in; }
button.lm-image__frame:focus-visible, a.lm-image__frame:focus-visible { outline-offset: 2px; }
button.lm-image__frame:active .lm-image__img { opacity: var(--opacity-pressed); }
.lm-image__hint {
  position: absolute; z-index: 2; right: var(--space-8); bottom: var(--space-8);
  display: inline-flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-10);
  border-radius: var(--radius-full);
  background: var(--material-thin); color: var(--label);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate));
  font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); font-weight: var(--fw-medium);
  opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard);
  --lm-icon-size: 14px; pointer-events: none;
}
@media (hover: hover) and (pointer: fine) { .lm-image__frame:hover .lm-image__hint { opacity: 1; } }
.lm-image__frame:focus-visible .lm-image__hint { opacity: 1; }

/* Placeholder (loading) */
.lm-image__placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px); transform: scale(1.12); }
.lm-image__frame.is-loading::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(100deg, transparent 20%, var(--fill-quaternary) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: lm-image-shimmer 1.4s linear infinite;
}
.lm-image__frame.is-loading .lm-image__img { opacity: 0; }
@keyframes lm-image-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Fallback (error) */
.lm-image__fallback {
  position: absolute; inset: 0; z-index: 1;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4);
  color: var(--label-tertiary); font-size: var(--fs-footnote); line-height: var(--lh-footnote);
  --lm-icon-size: 32px;
}
.lm-image__frame.is-error .lm-image__img { display: none; }
.lm-image__frame.is-error .lm-image__fallback { display: flex; }

/* Gallery grids */
.lm-image-group { display: grid; gap: var(--card-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
@media (min-width: 768px) { .lm-image-group { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .lm-image-group { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Photos-app grid: tight squares */
.lm-image-group--photos { gap: 2px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lm-image-group--photos .lm-image__frame { --lm-image-ratio: 1; border-radius: 0; }
@media (min-width: 768px) { .lm-image-group--photos { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .lm-image-group--photos { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

/* ---------- Preview overlay ---------- */
.lm-image-preview { z-index: var(--z-overlay); }
.lm-image-preview > .lm-overlay { background: var(--overlay-strong); }
.lm-image-preview__stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: calc(64px + env(safe-area-inset-top, 0px)) var(--screen-margin) calc(88px + env(safe-area-inset-bottom, 0px));
  overflow: hidden; touch-action: none;
}
.lm-image-preview__img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: var(--radius-8);
  transform: translate(var(--lm-pan-x, 0px), var(--lm-pan-y, 0px)) scale(var(--lm-zoom, 1)) rotate(var(--lm-rotate, 0deg));
  transition: transform var(--duration-base) var(--ease-spring), opacity var(--duration-base) var(--ease-standard);
  user-select: none; -webkit-user-drag: none; cursor: zoom-in;
  opacity: 0;
}
.lm-image-preview.is-open .lm-image-preview__img, .lm-image-preview.lm-layer--inline .lm-image-preview__img { opacity: 1; }
.lm-image-preview.is-zoomed .lm-image-preview__img { cursor: grab; }
.lm-image-preview.is-panning .lm-image-preview__img { transition: none; cursor: grabbing; }
.lm-image-preview__top {
  position: absolute; z-index: 1; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-12);
  padding: calc(var(--space-12) + env(safe-area-inset-top, 0px)) var(--screen-margin) var(--space-12);
}
.lm-image-preview__counter, .lm-image-preview__toolbar {
  display: inline-flex; align-items: center; gap: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--material-thin); color: var(--label);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
}
.lm-image-preview__counter { padding: var(--space-6) var(--space-12); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.lm-image-preview__toolbar {
  position: absolute; z-index: 1; left: 50%; bottom: calc(var(--space-20) + env(safe-area-inset-bottom, 0px)); translate: -50% 0;
  padding: var(--space-4);
}
.lm-image-preview__btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--control-md); height: var(--control-md);
  border: 0; border-radius: var(--radius-full); padding: 0;
  background: transparent; color: var(--label); cursor: pointer;
  --lm-icon-size: 22px;
}
.lm-image-preview__btn:active { opacity: var(--opacity-pressed); }
.lm-image-preview__btn:disabled { color: var(--label-tertiary); cursor: default; }
.lm-image-preview__btn--glass {
  background: var(--material-thin);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
}
@media (hover: hover) and (pointer: fine) { .lm-image-preview__btn:not(:disabled):hover { background: var(--fill-secondary); } }
.lm-image-preview__nav { position: absolute; z-index: 1; top: 50%; translate: 0 -50%; }
.lm-image-preview__nav--prev { left: var(--screen-margin); }
.lm-image-preview__nav--next { right: var(--screen-margin); }
@media (max-width: 767.98px) { .lm-image-preview__nav { display: none; } }
.lm-image-preview__caption {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  padding: 0 var(--screen-margin); text-align: center;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--thumb); opacity: 0.85; /* always on overlay-strong (dark) */
}
.lm-image-preview.lm-layer--inline { min-height: 360px; }

/* ===== List.css ===== */
/* ==========================================================================
   List — UITableView / SwiftUI List (inset grouped · grouped · plain)
   ========================================================================== */
.lm-list {
  --list-inset: var(--space-16);
  --list-gap: var(--space-12);
  --lead-size: 0px;
  position: relative;
  display: flex; flex-direction: column;
  margin: 0; padding: 0; list-style: none;
  min-width: 0;
  background: var(--bg-grouped-secondary);
  color: var(--label);
}
.lm-list > li:not(.lm-list__item) { display: block; list-style: none; margin: 0; padding: 0; min-width: 0; }
.lm-list--inset { border-radius: var(--radius-10); overflow: hidden; }
.lm-list--grouped { border-radius: 0; border-block: var(--hairline) solid var(--separator); }
.lm-list--plain { background: var(--bg); border-radius: 0; }
.lm-list--on-elevated { background: var(--bg-elevated-secondary); }
@media (min-width: 768px) { .lm-list--inset { border-radius: var(--radius-12); } }

/* Row */
.lm-list__item {
  position: relative;
  display: flex; align-items: center; gap: var(--list-gap);
  width: 100%; min-height: var(--row-height);
  padding: calc((var(--row-height) - var(--lh-body)) / 2) var(--list-inset);
  border: 0; margin: 0;
  background: transparent; color: inherit;
  font: inherit; font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  text-align: left; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.lm-list__item:has(.lm-list__subtitle) { min-height: 60px; padding-block: var(--space-10); }
/* hairline separator, inset to the content edge (iOS) */
.lm-list__item::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  left: var(--list-inset);
  height: var(--hairline); background: var(--separator); pointer-events: none;
}
.lm-list__item:has(> .lm-list__leading) { --lead-size: 29px; }
.lm-list__item:has(> .lm-list__leading)::after { left: calc(var(--list-inset) + var(--lead-size) + var(--list-gap)); }
.lm-list__item:has(> .lm-list__leading > .lm-avatar) { --lead-size: var(--avatar-md); }
.lm-list__item:has(> .lm-list__leading > .lm-avatar--sm) { --lead-size: var(--avatar-sm); }
.lm-list__item:has(> .lm-list__leading > .lm-avatar--lg) { --lead-size: var(--avatar-lg); }
.lm-list__item:has(> .lm-list__leading > .lm-avatar--xs) { --lead-size: var(--avatar-xs); }
.lm-list > .lm-list__item:last-child::after,
.lm-list > li:last-child > .lm-list__item::after,
.lm-list > li:last-child > .lm-list__swipe .lm-list__item::after,
.lm-list > .lm-list__swipe:last-child .lm-list__item::after { display: none; }
.lm-list--full-separators .lm-list__item::after,
.lm-list__item--full-separator::after { left: 0 !important; }
.lm-list--no-separators .lm-list__item::after { display: none; }

/* Slots */
.lm-list__leading { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: var(--lead-size); color: var(--accent); --lm-icon-size: var(--icon-md); }
.lm-list__content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lm-list__title { min-width: 0; overflow-wrap: anywhere; }
.lm-list__title--strong { font-weight: var(--fw-semibold); }
.lm-list__subtitle {
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label-secondary);
}
.lm-list__meta { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); }
.lm-list__trailing {
  display: inline-flex; align-items: center; gap: var(--space-6);
  flex: 0 1 auto; min-width: 0; max-width: 55%;
  color: var(--label-secondary);
}
.lm-list__value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--label-secondary); }
.lm-list__chevron { flex: none; color: var(--label-tertiary); --lm-icon-size: 14px; margin-right: -2px; }
.lm-list__chevron svg { stroke-width: 2.8; }
.lm-list__check { flex: none; color: var(--accent); --lm-icon-size: 20px; visibility: hidden; }
.lm-list__check svg { stroke-width: 2.4; }
.lm-list__item[aria-selected="true"] .lm-list__check,
.lm-list__item[aria-checked="true"] .lm-list__check,
.lm-list__item.is-selected .lm-list__check { visibility: visible; }
.lm-list__info { flex: none; color: var(--accent); --lm-icon-size: 22px; }

/* Settings icon tile — 29px rounded square, white glyph */
.lm-list__icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--icon-tile); height: var(--icon-tile);
  border-radius: var(--radius-6);
  background: var(--gray); color: var(--thumb);
  --lm-icon-size: 18px;
}
.lm-list__icon svg { stroke-width: 2; }
.lm-list__icon--blue { background: var(--blue); }
.lm-list__icon--green { background: var(--green); }
.lm-list__icon--indigo { background: var(--indigo); }
.lm-list__icon--orange { background: var(--orange); }
.lm-list__icon--pink { background: var(--pink); }
.lm-list__icon--purple { background: var(--purple); }
.lm-list__icon--red { background: var(--red); }
.lm-list__icon--teal { background: var(--teal); }
.lm-list__icon--yellow { background: var(--yellow); }
.lm-list__icon--mint { background: var(--mint); }
.lm-list__icon--cyan { background: var(--cyan); }
.lm-list__icon--brown { background: var(--brown); }
.lm-list__icon--gray { background: var(--gray); }

/* Interactive rows */
.lm-list__item--link { cursor: pointer; transition: background-color var(--duration-instant) var(--ease-standard); }
.lm-list__item--link:active { background: var(--row-pressed); transition-duration: 0s; }
.lm-list__item--link:focus-visible { outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .lm-list__item--link:hover { background: var(--fill-quaternary); }
  .lm-list__item--link:active { background: var(--row-pressed); }
}
.lm-list__item--action { justify-content: center; color: var(--accent); }
.lm-list__item--action .lm-list__content { flex: 0 1 auto; align-items: center; }
.lm-list__item--danger { color: var(--danger); }
.lm-list__item--danger.lm-list__item--action { color: var(--danger); }
.lm-list__item[aria-disabled="true"], .lm-list__item.is-disabled { color: var(--label-tertiary); pointer-events: none; }
.lm-list__item[aria-disabled="true"] .lm-list__leading, .lm-list__item.is-disabled .lm-list__leading { opacity: var(--opacity-disabled); }

/* Sections */
.lm-list-section { display: flex; flex-direction: column; min-width: 0; }
.lm-list-section__header {
  margin: 0; padding: 0 var(--space-16) var(--space-6);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); font-weight: var(--fw-regular);
  color: var(--label-secondary); text-transform: uppercase;
}
.lm-list-section__header--prominent { text-transform: none; font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); font-weight: var(--fw-bold); color: var(--label); padding-bottom: var(--space-8); }
.lm-list-section__footer {
  margin: 0; padding: var(--space-6) var(--space-16) 0;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  color: var(--label-secondary);
}
.lm-list-section__footer a { color: var(--link); text-decoration: none; }
.lm-list-section--plain > .lm-list-section__header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  padding: var(--space-4) var(--space-16);
  background: var(--bg-secondary); text-transform: none;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-semibold); color: var(--label);
}
.lm-list-stack { display: flex; flex-direction: column; gap: var(--group-gap); min-width: 0; }

/* Swipe actions (UIContextualAction) */
.lm-list__swipe { position: relative; overflow: hidden; touch-action: pan-y; }
.lm-list__swipe > .lm-list__item {
  background: var(--lm-list-row-bg, var(--bg-grouped-secondary));
  transform: translateX(var(--swipe-x, 0px));
  transition: transform var(--duration-base) var(--ease-spring);
  z-index: 1;
}
.lm-list--plain .lm-list__swipe > .lm-list__item { --lm-list-row-bg: var(--bg); }
.lm-list__swipe.is-dragging > .lm-list__item { transition: none; }
.lm-list__swipe.is-swiped { --swipe-x: calc(-1 * var(--swipe-width, 148px)); }
.lm-list__swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.lm-list__swipe-action {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 74px; border: 0; padding: 0 var(--space-8);
  background: var(--gray); color: var(--thumb);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); font-weight: var(--fw-medium);
  cursor: pointer; --lm-icon-size: 20px;
}
.lm-list__swipe-action--danger { background: var(--red); }
.lm-list__swipe-action--warning { background: var(--orange); }
.lm-list__swipe-action--accent { background: var(--blue); }
.lm-list__swipe-action--purple { background: var(--purple); }
.lm-list__swipe-action:active { opacity: var(--opacity-pressed); }

/* Footer rows */
.lm-list__more {
  display: flex; align-items: center; justify-content: center; gap: var(--space-8);
  min-height: var(--row-height); width: 100%; border: 0; background: transparent;
  color: var(--accent); font: inherit; cursor: pointer;
}
.lm-list__more:active { background: var(--row-pressed); }
.lm-list__empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  padding: var(--space-24) var(--space-16); text-align: center;
  color: var(--label-secondary); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline);
}

/* Dense (desktop tables of rows) */
.lm-list--dense { --row-height: 36px; --list-inset: var(--space-12); }
.lm-list--dense .lm-list__item { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); padding-block: calc((var(--row-height) - var(--lh-subheadline)) / 2); }
.lm-list--dense .lm-list__item:has(.lm-list__subtitle) { min-height: 48px; padding-block: var(--space-6); }
.lm-list--dense .lm-list__subtitle { font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.lm-list--dense .lm-list__item:has(> .lm-list__leading) { --lead-size: 22px; }
.lm-list--dense .lm-list__icon { width: 22px; height: 22px; border-radius: var(--radius-6); --lm-icon-size: 14px; }
@media (min-width: 1200px) and (pointer: fine) { .lm-list--dense-desktop { --row-height: 36px; --list-inset: var(--space-12); } }

.lm-list__trailing { white-space: nowrap; }

/* ===== Listy.css ===== */
/* ==========================================================================
   Listy — virtualized long list · sticky section headers · A–Z index (Contacts)
   ========================================================================== */
.lm-listy {
  --listy-row: 44px;
  --listy-header: 28px;
  --listy-index-w: 22px;
  position: relative;
  display: flex; flex-direction: column;
  height: var(--lm-listy-height, 480px); min-width: 0;
  background: var(--bg);
  border-radius: var(--radius-12);
  overflow: hidden;
  color: var(--label);
}
.lm-listy--flush { border-radius: 0; }
.lm-listy__viewport {
  position: relative; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.lm-listy__viewport:focus-visible { outline-offset: -2px; }
.lm-listy__spacer { position: relative; width: 100%; }
.lm-listy__row {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; gap: var(--space-12);
  height: var(--listy-row);
  padding: 0 calc(var(--space-16) + var(--listy-index-w)) 0 var(--space-16);
  background: var(--bg);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
  color: inherit; text-decoration: none; cursor: pointer;
}
.lm-listy__row::after { content: ""; position: absolute; left: var(--listy-sep, var(--space-16)); right: 0; bottom: 0; height: var(--hairline); background: var(--separator); }
.lm-listy__row.is-last::after { display: none; }
.lm-listy__row:has(.lm-avatar) { --listy-sep: calc(var(--space-16) + var(--avatar-sm) + var(--space-12)); }
.lm-listy__row:active { background: var(--row-pressed); }
@media (hover: hover) and (pointer: fine) { .lm-listy__row:hover { background: var(--fill-quaternary); } .lm-listy__row:active { background: var(--row-pressed); } }
.lm-listy__row[aria-selected="true"] { background: var(--accent-soft); }
.lm-listy__text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-listy__text strong { font-weight: var(--fw-semibold); }
.lm-listy__meta { flex: none; color: var(--label-secondary); font-size: var(--fs-subheadline); }

/* Section header rows (in the flow) + the sticky overlay copy */
.lm-listy__header, .lm-listy__sticky {
  display: flex; align-items: center;
  height: var(--listy-header);
  padding: 0 var(--space-16);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); font-weight: var(--fw-semibold);
  color: var(--label);
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
}
.lm-listy__header { position: absolute; left: 0; right: 0; top: 0; }
/* sticky copy lives at the top of the viewport and is pushed up by the next header */
.lm-listy__sticky {
  position: sticky; z-index: 2; top: 0;
  margin-bottom: calc(-1 * var(--listy-header));
  pointer-events: none;
  transform: translateY(var(--listy-push, 0px));
}
.lm-listy__sticky[hidden] { display: none; }

/* A–Z index bar */
.lm-listy__index {
  position: absolute; z-index: 3; top: 50%; right: 2px; translate: 0 -50%;
  display: flex; flex-direction: column; align-items: center;
  width: var(--listy-index-w); max-height: calc(100% - var(--space-16));
  padding: var(--space-4) 0;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.lm-listy__index-key {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  font-size: var(--fs-caption-2); line-height: 13px; letter-spacing: 0; font-weight: var(--fw-semibold);
  color: var(--accent); text-align: center; cursor: pointer;
}
.lm-listy__index.is-active { background: var(--fill-quaternary); border-radius: var(--radius-full); }
.lm-listy__bubble {
  position: absolute; z-index: 4; top: 50%; left: 50%; translate: -50% -50%;
  display: flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: var(--radius-16);
  background: var(--material-regular); color: var(--label);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  box-shadow: var(--shadow-popover);
  font-size: var(--fs-title-1); font-weight: var(--fw-bold);
  opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard); pointer-events: none;
}
.lm-listy__bubble.is-visible { opacity: 1; }

/* Toolbar slot above the list (search, count) */
.lm-listy__toolbar { flex: none; display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-12) var(--space-16) var(--space-8); background: var(--bg); border-bottom: var(--hairline) solid var(--separator); }
.lm-listy__count { flex: none; padding: var(--space-12) var(--space-16); text-align: center; color: var(--label-secondary); font-size: var(--fs-subheadline); }
.lm-listy__empty { padding: var(--space-40) var(--space-16); text-align: center; color: var(--label-secondary); }

@media (min-width: 1200px) and (pointer: fine) {
  .lm-listy--dense-desktop { --listy-row: 36px; }
  .lm-listy--dense-desktop .lm-listy__row { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); }
}

/* ===== Popover.css ===== */
/* ==========================================================================
   Popover — material card with arrow (UIPopoverPresentationController)
   <div class="lm-anchor lm-popover"> trigger [data-lm-toggle]
     <div class="lm-floating lm-floating--bottom" role="dialog"><div class="lm-popover__card">…</div></div>
   ========================================================================== */
.lm-popover > .lm-floating { min-width: 0; width: max-content; max-width: min(320px, calc(100vw - 2 * var(--screen-margin))); }
.lm-popover > .lm-floating--bottom, .lm-popover > .lm-floating--bottom-start, .lm-popover > .lm-floating--bottom-end,
.lm-popover > .lm-floating:not([class*="lm-floating--"]) { top: calc(100% + var(--space-10)); }
.lm-popover > .lm-floating--top, .lm-popover > .lm-floating--top-start, .lm-popover > .lm-floating--top-end { bottom: calc(100% + var(--space-10)); }
.lm-popover > .lm-floating--left { right: calc(100% + var(--space-10)); }
.lm-popover > .lm-floating--right { left: calc(100% + var(--space-10)); }

.lm-popover__card {
  --pop-bg: var(--material-thick);
  position: relative;
  display: flex; flex-direction: column; gap: var(--space-6);
  min-width: 200px;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-12);
  background: var(--pop-bg);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  box-shadow: var(--shadow-popover);
  color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  text-align: left; white-space: normal;
}
.lm-popover__title { margin: 0; font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold); }
.lm-popover__content { margin: 0; color: var(--label-secondary); }
.lm-popover__actions { display: flex; justify-content: flex-end; gap: var(--space-8); margin-top: var(--space-6); }
.lm-popover__close {
  position: absolute; top: var(--space-8); right: var(--space-8);
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--label-secondary); cursor: pointer;
  --lm-icon-size: 14px;
}
.lm-popover__card:has(.lm-popover__close) .lm-popover__title { padding-right: var(--space-24); }
/* Flush content (lists, menus inside a popover) */
.lm-popover__card--flush { padding: var(--space-6) 0; }

/* Arrow: a clipped rotated square in the card material (only the outer half is painted) */
.lm-popover__card::before {
  content: "";
  position: absolute; width: 14px; height: 14px;
  background: var(--pop-bg);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  border-radius: 2px 0 0 0;
}
/* arrow pointing up (card below trigger) */
.lm-floating--bottom > .lm-popover__card::before { top: -7px; left: 50%; margin-left: -7px; transform: rotate(45deg); }
.lm-floating--bottom-start > .lm-popover__card::before,
.lm-floating:not([class*="lm-floating--"]) > .lm-popover__card::before { top: -7px; left: var(--space-16); transform: rotate(45deg); }
.lm-floating--bottom-end > .lm-popover__card::before { top: -7px; right: var(--space-16); transform: rotate(45deg); }
/* arrow pointing down (card above trigger) */
.lm-floating--top > .lm-popover__card::before { bottom: -7px; left: 50%; margin-left: -7px; transform: rotate(225deg); }
.lm-floating--top-start > .lm-popover__card::before { bottom: -7px; left: var(--space-16); transform: rotate(225deg); }
.lm-floating--top-end > .lm-popover__card::before { bottom: -7px; right: var(--space-16); transform: rotate(225deg); }
/* arrow pointing right / left */
.lm-floating--left > .lm-popover__card::before { right: -7px; top: 50%; margin-top: -7px; transform: rotate(135deg); }
.lm-floating--right > .lm-popover__card::before { left: -7px; top: 50%; margin-top: -7px; transform: rotate(-45deg); }
.lm-popover--no-arrow .lm-popover__card::before { display: none; }
/* Solid surface (over busy backgrounds) */
.lm-popover--solid .lm-popover__card { --pop-bg: var(--bg-elevated); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Mobile: dock as a bottom sheet card (opt-in) */
@media (max-width: 767.98px) {
  .lm-popover--sheet-mobile > .lm-floating {
    position: fixed; z-index: var(--z-popover);
    top: auto; left: var(--space-8); right: var(--space-8);
    bottom: calc(var(--space-8) + env(safe-area-inset-bottom, 0px));
    width: auto; max-width: none; translate: none;
    transform: translateY(16px); transform-origin: bottom center;
  }
  .lm-popover--sheet-mobile.is-open > .lm-floating { transform: none; }
  .lm-popover--sheet-mobile .lm-popover__card { border-radius: var(--radius-16); padding: var(--space-16) var(--space-16) var(--space-20); box-shadow: var(--shadow-modal); }
  .lm-popover--sheet-mobile .lm-popover__card::before { display: none; }
}

/* ===== QRCode.css ===== */
/* ==========================================================================
   QRCode — frame, logo slot, status overlays. Any QR library draws into __canvas.
   The frame is ALWAYS light (dark modules on white) so cameras can scan it in dark mode.
   ========================================================================== */
.lm-qrcode {
  --lm-qr-size: 160px;
  --lm-qr-bg: var(--thumb); /* always white — scanner contrast */
  position: relative;
  display: inline-flex; flex: none;
  padding: var(--space-12);
  background: var(--lm-qr-bg);
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-card), 0 0 0 var(--hairline) var(--separator);
  color-scheme: light;
  vertical-align: top;
}
.lm-qrcode__canvas {
  position: relative;
  width: var(--lm-qr-size); height: var(--lm-qr-size); max-width: 100%;
  overflow: hidden;
}
.lm-qrcode__canvas canvas, .lm-qrcode__canvas img { width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.lm-qrcode__canvas.is-error::after {
  content: "Không tạo được mã QR";
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: var(--fs-footnote); color: var(--gray);
  background: repeating-linear-gradient(45deg, var(--gray-6) 0 6px, transparent 6px 12px);
}
/* Logo in the centre (use error-correction level H) */
.lm-qrcode__logo {
  position: absolute; z-index: 1; left: 50%; top: 50%;
  width: 24%; aspect-ratio: 1; translate: -50% -50%;
  display: flex; align-items: center; justify-content: center;
  padding: 4%;
  background: var(--lm-qr-bg);
  border-radius: var(--radius-8);
  color: var(--blue);
  --lm-icon-size: 70%;
}
.lm-qrcode__logo > img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-6); }
.lm-qrcode__logo > .lm-icon { width: 100%; height: 100%; }

/* Status overlay: set data-status="expired|loading|scanned" on .lm-qrcode */
.lm-qrcode__status {
  position: absolute; inset: 0; z-index: 2;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-8);
  padding: var(--space-12);
  border-radius: inherit;
  background: var(--material-regular);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate));
  color: var(--label); color-scheme: normal;
  text-align: center;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-semibold);
}
.lm-qrcode[data-status] .lm-qrcode__status { display: flex; }
.lm-qrcode__status .lm-icon { --lm-icon-size: 32px; }
.lm-qrcode[data-status="scanned"] .lm-qrcode__status .lm-icon { color: var(--success); }
.lm-qrcode[data-status="expired"] .lm-qrcode__status .lm-icon { color: var(--label-secondary); }

/* Sizes & variants */
.lm-qrcode--sm { --lm-qr-size: 96px; padding: var(--space-8); border-radius: var(--radius-10); }
.lm-qrcode--lg { --lm-qr-size: 220px; padding: var(--space-16); border-radius: var(--radius-16); }
.lm-qrcode--borderless { padding: 0; box-shadow: none; background: var(--lm-qr-bg); border-radius: var(--radius-4); }

/* Block: QR + caption on the page surface */
.lm-qrcode-block { display: inline-flex; flex-direction: column; align-items: center; gap: var(--space-8); max-width: 100%; text-align: center; }
.lm-qrcode-block__title { margin: 0; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); font-weight: var(--fw-semibold); color: var(--label); }
.lm-qrcode-block__caption { margin: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); max-width: 240px; }

/* ===== Segmented.css ===== */
/* ==========================================================================
   Segmented — UISegmentedControl (sliding thumb)
   Thumb position comes from --lm-index / --lm-count (set by core data-lm-tabs).
   ========================================================================== */
.lm-segmented {
  --lm-index: 0;
  --lm-count: 1;
  --seg-pad: var(--space-2);
  --seg-height: var(--segmented-height);
  position: relative;
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  align-items: stretch;
  height: var(--seg-height);
  padding: var(--seg-pad);
  border-radius: var(--radius-10);
  background: var(--fill-tertiary);
  max-width: 100%;
  isolation: isolate;
  user-select: none; -webkit-user-select: none;
}
/* Sliding thumb */
.lm-segmented::before {
  content: "";
  position: absolute; z-index: 0;
  top: var(--seg-pad); bottom: var(--seg-pad);
  left: calc(var(--seg-pad) + (100% - 2 * var(--seg-pad)) / var(--lm-count) * var(--lm-index));
  width: calc((100% - 2 * var(--seg-pad)) / var(--lm-count));
  border-radius: var(--radius-8);
  background: var(--segment-selected);
  box-shadow: var(--shadow-raised);
  transition: left var(--duration-base) var(--ease-spring), top var(--duration-base) var(--ease-spring);
}
/* Without data-lm-tabs (static markup) the selected item paints its own thumb */
.lm-segmented:not([data-lm-tabs])::before { display: none; }
.lm-segmented:not([data-lm-tabs]) .lm-segmented__item[aria-selected="true"] { background: var(--segment-selected); box-shadow: var(--shadow-raised); }

.lm-segmented__item {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-6);
  min-width: 0; height: 100%;
  padding: 0 var(--space-12);
  border: 0; border-radius: var(--radius-8);
  background: transparent; color: var(--label);
  font-family: inherit;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  font-weight: var(--fw-medium);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity var(--duration-instant) var(--ease-standard);
}
.lm-segmented__item .lm-icon { --lm-icon-size: 18px; }
.lm-segmented__item[aria-selected="true"] { font-weight: var(--fw-semibold); }
.lm-segmented__item:active:not([aria-selected="true"]):not(:disabled) { opacity: var(--opacity-pressed); }
.lm-segmented__item:focus-visible { outline-offset: -2px; }
/* Hairline dividers between unselected neighbours */
.lm-segmented__item + .lm-segmented__item::before {
  content: "";
  position: absolute; left: 0; top: 25%; height: 50%;
  width: calc(var(--hairline) * 2);
  margin-left: calc(var(--hairline) * -1);
  background: var(--separator);
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.lm-segmented__item[aria-selected="true"]::before,
.lm-segmented__item[aria-selected="true"] + .lm-segmented__item::before { opacity: 0; }
.lm-segmented__item:disabled, .lm-segmented__item[aria-disabled="true"] { color: var(--label-tertiary); cursor: not-allowed; }
.lm-segmented__count { font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); color: var(--label-secondary); font-weight: var(--fw-regular); }

/* Block (full width) */
.lm-segmented--block { display: grid; width: 100%; }
/* Sizes */
.lm-segmented--sm { --seg-height: calc(var(--control-sm) - var(--space-4)); }
.lm-segmented--sm .lm-segmented__item { padding: 0 var(--space-10); font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); }
.lm-segmented--sm::before { border-radius: var(--radius-6); }
.lm-segmented--lg { --seg-height: var(--control-md); --seg-pad: var(--space-4); border-radius: var(--radius-12); }
.lm-segmented--lg::before, .lm-segmented--lg .lm-segmented__item { border-radius: var(--radius-8); }
.lm-segmented--lg .lm-segmented__item { font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); }
/* Icon-only */
.lm-segmented--icon .lm-segmented__item { padding: 0 var(--space-10); }
/* Vertical */
.lm-segmented--vertical { grid-auto-flow: row; grid-auto-rows: var(--seg-height); grid-auto-columns: auto; height: auto; }
.lm-segmented--vertical::before {
  left: var(--seg-pad); right: var(--seg-pad); width: auto; bottom: auto;
  top: calc(var(--seg-pad) + (100% - 2 * var(--seg-pad)) / var(--lm-count) * var(--lm-index));
  height: calc((100% - 2 * var(--seg-pad)) / var(--lm-count));
}
.lm-segmented--vertical .lm-segmented__item { justify-content: flex-start; }
.lm-segmented--vertical .lm-segmented__item + .lm-segmented__item::before { left: 12%; width: 76%; top: 0; height: calc(var(--hairline) * 2); margin: calc(var(--hairline) * -1) 0 0; }
/* Whole control disabled */
.lm-segmented.is-disabled { opacity: var(--opacity-disabled); pointer-events: none; }
/* On a material / navigation bar */
.lm-segmented--on-bar { background: var(--fill-secondary); }

/* ===== Statistic.css ===== */
/* ==========================================================================
   Statistic — KPI number with title, prefix/suffix, trend, countdown
   ========================================================================== */
.lm-statistic { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.lm-statistic__title {
  display: flex; align-items: center; gap: var(--space-6);
  margin: 0;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  color: var(--label-secondary);
}
.lm-statistic__title .lm-icon { --lm-icon-size: var(--icon-sm); }
.lm-statistic__value {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-2) var(--space-4);
  margin: 0;
  font-size: var(--fs-title-1); line-height: var(--lh-title-1); letter-spacing: var(--ls-title-1);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  color: var(--label);
}
.lm-statistic__number { white-space: nowrap; }
.lm-statistic__decimal { font-size: 0.7em; font-weight: var(--fw-semibold); }
.lm-statistic__prefix, .lm-statistic__suffix {
  font-size: 0.6em; line-height: 1; font-weight: var(--fw-semibold);
  color: var(--label-secondary); letter-spacing: 0;
}
.lm-statistic__prefix .lm-icon, .lm-statistic__suffix .lm-icon { --lm-icon-size: 1em; }
.lm-statistic__trend {
  display: inline-flex; align-items: center; gap: var(--space-4);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-semibold);
  color: var(--label-secondary);
  font-variant-numeric: tabular-nums;
}
.lm-statistic__trend .lm-icon { --lm-icon-size: 14px; }
.lm-statistic__trend--up { color: var(--success-text); }
.lm-statistic__trend--down { color: var(--danger-text); }
.lm-statistic__trend-note { font-weight: var(--fw-regular); color: var(--label-secondary); }
.lm-statistic__footer { font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); color: var(--label-secondary); }

/* Value tones */
.lm-statistic--success .lm-statistic__value { color: var(--success-text); }
.lm-statistic--danger .lm-statistic__value { color: var(--danger-text); }
.lm-statistic--accent .lm-statistic__value { color: var(--accent); }

/* Sizes */
.lm-statistic--sm .lm-statistic__value { font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); font-weight: var(--fw-semibold); }
.lm-statistic--lg .lm-statistic__value { font-size: var(--fs-large-title); line-height: var(--lh-large-title); letter-spacing: var(--ls-large-title); }

/* Card surface (KPI tile) */
.lm-statistic--card {
  padding: var(--card-padding);
  background: var(--bg-grouped-secondary);
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-card);
}
/* Countdown — digits keep their width while ticking */
.lm-statistic--countdown .lm-statistic__number { font-variant-numeric: tabular-nums; }
.lm-statistic.is-finished .lm-statistic__value { color: var(--label-tertiary); }

/* KPI grid: 2 cols mobile → 3 tablet → 4 desktop */
.lm-statistic-grid { display: grid; gap: var(--card-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .lm-statistic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .lm-statistic-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Inline group separated by hairlines (inside one card) */
.lm-statistic-row { display: flex; flex-wrap: wrap; gap: var(--space-16) 0; }
.lm-statistic-row > .lm-statistic { flex: 1 1 140px; padding: 0 var(--space-16); }
.lm-statistic-row > .lm-statistic + .lm-statistic { border-left: var(--hairline) solid var(--separator); }
.lm-statistic-row > .lm-statistic:first-child { padding-left: 0; }

/* Mobile: one step smaller so a 2-column KPI grid keeps "18.450.000 ₫" on one line */
@media (max-width: 767.98px) {
  .lm-statistic__value { font-size: var(--fs-title-2); line-height: var(--lh-title-2); letter-spacing: var(--ls-title-2); }
}

/* ===== Table.css ===== */
/* ==========================================================================
   Table — grid table (≥ 768) · stacked card list (< 768)
   Native <table> markup. Forced modes: lm-table--grid / lm-table--stacked.
   ========================================================================== */
.lm-table {
  --tbl-surface: var(--bg-grouped-secondary);
  --tbl-pad-y: var(--space-12);
  --tbl-pad-x: var(--space-16);
  --tbl-row-tint: transparent;
  position: relative;
  min-width: 0;
  background: var(--tbl-surface);
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
}
.lm-table__toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-8) var(--space-12);
  padding: var(--card-padding);
  border-bottom: var(--hairline) solid var(--separator);
}
.lm-table__title { margin: 0; font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold); }
.lm-table__meta { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); }
.lm-table__tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); }

.lm-table__scroll { position: relative; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.lm-table__table { width: 100%; min-width: var(--lm-table-min-width, 0px); border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }

/* Header */
.lm-table__table th {
  position: relative;
  padding: var(--space-10) var(--tbl-pad-x);
  background: var(--tbl-surface);
  color: var(--label-secondary);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); font-weight: var(--fw-semibold);
  text-align: left; white-space: nowrap; vertical-align: middle;
  border-bottom: var(--hairline) solid var(--separator);
}
.lm-table__sort {
  display: inline-flex; align-items: center; gap: var(--space-4);
  margin: calc(var(--space-4) * -1) calc(var(--space-6) * -1); padding: var(--space-4) var(--space-6);
  border: 0; border-radius: var(--radius-6); background: transparent;
  color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer;
}
.lm-table__sort .lm-icon { --lm-icon-size: 14px; color: var(--label-tertiary); }
.lm-table__sort:hover { background: var(--fill-quaternary); }
th[aria-sort="ascending"] .lm-table__sort, th[aria-sort="descending"] .lm-table__sort { color: var(--accent); }
th[aria-sort="ascending"] .lm-table__sort .lm-icon, th[aria-sort="descending"] .lm-table__sort .lm-icon { color: var(--accent); }
.lm-table__filter {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 24px; height: 24px; margin-left: var(--space-4); padding: 0;
  border: 0; border-radius: var(--radius-6); background: transparent; color: var(--label-tertiary); cursor: pointer;
  --lm-icon-size: 14px;
}
.lm-table__filter:hover { background: var(--fill-quaternary); color: var(--label-secondary); }
.lm-table__filter.is-active { color: var(--accent); background: var(--accent-soft); }

/* Body */
.lm-table__table td {
  padding: var(--tbl-pad-y) var(--tbl-pad-x);
  background-color: var(--tbl-surface);
  background-image: linear-gradient(var(--tbl-row-tint), var(--tbl-row-tint));
  vertical-align: middle;
  border-bottom: var(--hairline) solid var(--separator);
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.lm-table__table tbody tr:last-child > td { border-bottom: 0; }
.lm-table__table tbody tr[aria-selected="true"] { --tbl-row-tint: var(--accent-soft); }
@media (hover: hover) { .lm-table__table tbody tr:not(.lm-table__expand-row):not(.lm-table__empty):hover { --tbl-row-tint: var(--fill-quaternary); } .lm-table__table tbody tr[aria-selected="true"]:hover { --tbl-row-tint: var(--accent-soft); } }
.lm-table__num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lm-table__center { text-align: center !important; }
.lm-table__primary { font-weight: var(--fw-semibold); }
.lm-table__cell-sub { display: block; font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary); font-weight: var(--fw-regular); }
.lm-table__user { display: flex; align-items: center; gap: var(--space-10); min-width: 0; }
.lm-table__select { width: 44px; padding-right: 0 !important; }
.lm-table__actions { text-align: right; white-space: nowrap; }
.lm-table__actions .lm-btn + .lm-btn { margin-left: var(--space-4); }

/* Expandable rows */
.lm-table__expander {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--radius-6);
  background: transparent; color: var(--label-secondary); cursor: pointer; --lm-icon-size: 16px;
}
.lm-table__expander .lm-icon { transition: transform var(--duration-base) var(--ease-spring); }
.lm-table__expander[aria-expanded="true"] .lm-icon { transform: rotate(90deg); }
.lm-table__expander:hover { background: var(--fill-quaternary); }
.lm-table__expand-row > td { --tbl-row-tint: var(--fill-quaternary); color: var(--label-secondary); font-size: var(--fs-footnote); line-height: var(--lh-footnote); }
.lm-table__table tr[hidden] { display: none !important; }

/* Summary (tfoot) */
.lm-table__table tfoot td {
  --tbl-row-tint: var(--fill-quaternary);
  font-weight: var(--fw-semibold);
  border-top: var(--hairline) solid var(--separator); border-bottom: 0;
}

/* Empty */
.lm-table__empty td { padding: var(--space-40) var(--space-16) !important; text-align: center; color: var(--label-secondary); }
.lm-table__empty .lm-icon { --lm-icon-size: 40px; display: flex; margin: 0 auto var(--space-8); color: var(--label-tertiary); }

/* Loading overlay */
.lm-table__loading {
  position: absolute; inset: 0; z-index: 3;
  display: none; align-items: center; justify-content: center; gap: var(--space-8);
  background: var(--material-thin);
  -webkit-backdrop-filter: blur(var(--blur-sm)); backdrop-filter: blur(var(--blur-sm));
  color: var(--label-secondary); font-size: var(--fs-footnote);
}
.lm-table.is-loading .lm-table__loading { display: flex; }

/* Footer (pagination / selection summary) */
.lm-table__footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-8) var(--space-12);
  padding: var(--space-10) var(--tbl-pad-x);
  border-top: var(--hairline) solid var(--separator);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--label-secondary);
}
.lm-table__bulk { display: none; align-items: center; gap: var(--space-8); color: var(--accent); font-weight: var(--fw-semibold); }
.lm-table.has-selection .lm-table__bulk { display: inline-flex; }

/* Sticky header & fixed columns */
.lm-table--sticky .lm-table__scroll { max-height: var(--lm-table-height, 360px); overflow: auto; }
.lm-table--sticky .lm-table__table thead th { position: sticky; top: 0; z-index: 2; }
/* th có position: relative ở trên → nêu rõ th để ô tiêu đề của cột ghim cũng dính khi cuộn ngang */
.lm-table__fixed, .lm-table__table th.lm-table__fixed { position: sticky; left: 0; z-index: 1; }
.lm-table__fixed-end, .lm-table__table th.lm-table__fixed-end { position: sticky; right: 0; z-index: 1; }
.lm-table__table thead th.lm-table__fixed, .lm-table__table thead th.lm-table__fixed-end { z-index: 3; }
/* Divider on the frozen edge appears once content scrolls beneath it (classes set by Table.js) */
.lm-table__scroll.is-scrolled .lm-table__fixed { box-shadow: inset calc(var(--hairline) * -2) 0 0 var(--separator-opaque); }
/* Ô chọn (44px) cũng ghim: cột ghim ngay sau nó lùi sang phải, chỉ kẻ vạch ở cột ghim cuối */
.lm-table__select.lm-table__fixed + .lm-table__fixed { left: 44px; }
.lm-table__scroll.is-scrolled .lm-table__select.lm-table__fixed:has(+ .lm-table__fixed) { box-shadow: none; }
.lm-table__scroll.has-more .lm-table__fixed-end { box-shadow: inset calc(var(--hairline) * 2) 0 0 var(--separator-opaque); }

/* Variants */
.lm-table--striped .lm-table__table tbody tr:nth-child(even):not([aria-selected="true"]) { --tbl-row-tint: var(--fill-quaternary); }
.lm-table--bordered .lm-table__table th + th, .lm-table--bordered .lm-table__table td + td { border-left: var(--hairline) solid var(--separator); }
.lm-table--flat { box-shadow: none; border-radius: 0; }
.lm-table--sm { --tbl-pad-y: var(--space-8); --tbl-pad-x: var(--space-12); }
.lm-table--sm .lm-table__table th { padding-block: var(--space-6); }
.lm-table--lg { --tbl-pad-y: var(--space-16); }

/* --------------------------------------------------------------------------
   Stacked (card list). Auto on mobile; forced by lm-table--stacked.
   Each <td data-label="…"> becomes "label · value"; .lm-table__primary is the card title.
   -------------------------------------------------------------------------- */
.lm-table--stacked { background: transparent; box-shadow: none; border-radius: 0; overflow: visible; font-size: var(--fs-subheadline); }
.lm-table--stacked .lm-table__toolbar { padding: 0 0 var(--space-12); border: 0; }
.lm-table--stacked .lm-table__scroll { overflow: visible; max-height: none; }
.lm-table--stacked .lm-table__table, .lm-table--stacked .lm-table__table tbody, .lm-table--stacked .lm-table__table tfoot { display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0; }
.lm-table--stacked .lm-table__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lm-table--stacked .lm-table__table tr { position: relative; display: flex; flex-direction: column; gap: var(--space-6); padding: var(--card-padding); background: var(--bg-grouped-secondary); background-image: linear-gradient(var(--tbl-row-tint), var(--tbl-row-tint)); border-radius: var(--radius-12); box-shadow: var(--shadow-card); }
.lm-table--stacked .lm-table__table td { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); padding: 0; border: 0; background: none; text-align: right; position: static; box-shadow: none; }
.lm-table--stacked .lm-table__table td[data-label]::before { content: attr(data-label); flex: none; color: var(--label-secondary); text-align: left; font-weight: var(--fw-regular); }
.lm-table--stacked .lm-table__table td.lm-table__primary { order: -1; display: block; text-align: left; padding-right: var(--space-40); font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); }
.lm-table--stacked .lm-table__table td.lm-table__primary::before { content: none; }
.lm-table--stacked .lm-table__table td.lm-table__select { position: absolute; top: var(--card-padding); right: var(--card-padding); width: auto; left: auto; }
.lm-table--stacked .lm-table__table td.lm-table__fixed:not(.lm-table__select), .lm-table--stacked .lm-table__table td.lm-table__fixed-end { left: auto; right: auto; } /* dạng thẻ: bỏ vị trí ghim cột */
.lm-table--stacked .lm-table__table td.lm-table__expand-cell { position: absolute; bottom: var(--card-padding); left: var(--card-padding); }
.lm-table--stacked .lm-table__table td.lm-table__actions { order: 99; justify-content: flex-end; padding-top: var(--space-8); margin-top: var(--space-2); border-top: var(--hairline) solid var(--separator); }
.lm-table--stacked .lm-table__table td.lm-table__actions::before { content: none; }
.lm-table--stacked .lm-table__expand-row { margin-top: calc(var(--card-gap) * -1 + var(--space-2)); border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.lm-table--stacked .lm-table__expand-row > td { display: block; text-align: left; }
.lm-table--stacked .lm-table__table tfoot tr { --tbl-row-tint: var(--fill-quaternary); }
.lm-table--stacked .lm-table__table tfoot td { border: 0; }
.lm-table--stacked .lm-table__empty td { display: block; }
.lm-table--stacked .lm-table__footer { padding: var(--space-12) 0 0; border: 0; }
.lm-table--stacked .lm-table__loading { border-radius: var(--radius-12); }

@media (max-width: 767.98px) {
  .lm-table:not(.lm-table--grid) { background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
  .lm-table:not(.lm-table--grid) .lm-table__toolbar { padding: 0 0 var(--space-12); border: 0; }
  .lm-table:not(.lm-table--grid) .lm-table__scroll { overflow: visible; max-height: none; }
  .lm-table:not(.lm-table--grid) .lm-table__table, .lm-table:not(.lm-table--grid) .lm-table__table tbody, .lm-table:not(.lm-table--grid) .lm-table__table tfoot { display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0; }
  .lm-table:not(.lm-table--grid) .lm-table__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lm-table:not(.lm-table--grid) .lm-table__table tr { position: relative; display: flex; flex-direction: column; gap: var(--space-6); padding: var(--card-padding); background: var(--bg-grouped-secondary); background-image: linear-gradient(var(--tbl-row-tint), var(--tbl-row-tint)); border-radius: var(--radius-12); box-shadow: var(--shadow-card); }
  .lm-table:not(.lm-table--grid) .lm-table__table td { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-12); padding: 0; border: 0; background: none; text-align: right; position: static; box-shadow: none; }
  .lm-table:not(.lm-table--grid) .lm-table__table td[data-label]::before { content: attr(data-label); flex: none; color: var(--label-secondary); text-align: left; font-weight: var(--fw-regular); }
  .lm-table:not(.lm-table--grid) .lm-table__table td.lm-table__primary { order: -1; display: block; text-align: left; padding-right: var(--space-40); font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); }
  .lm-table:not(.lm-table--grid) .lm-table__table td.lm-table__primary::before { content: none; }
  .lm-table:not(.lm-table--grid) .lm-table__table td.lm-table__select { position: absolute; top: var(--card-padding); right: var(--card-padding); width: auto; left: auto; }
  .lm-table:not(.lm-table--grid) .lm-table__table td.lm-table__fixed:not(.lm-table__select), .lm-table:not(.lm-table--grid) .lm-table__table td.lm-table__fixed-end { left: auto; right: auto; }
  .lm-table:not(.lm-table--grid) .lm-table__table td.lm-table__expand-cell { position: absolute; bottom: var(--card-padding); left: var(--card-padding); }
  .lm-table:not(.lm-table--grid) .lm-table__table td.lm-table__actions { order: 99; justify-content: flex-end; padding-top: var(--space-8); margin-top: var(--space-2); border-top: var(--hairline) solid var(--separator); }
  .lm-table:not(.lm-table--grid) .lm-table__table td.lm-table__actions::before { content: none; }
  .lm-table:not(.lm-table--grid) .lm-table__expand-row { margin-top: calc(var(--card-gap) * -1 + var(--space-2)); border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
  .lm-table:not(.lm-table--grid) .lm-table__expand-row > td { display: block; text-align: left; }
  .lm-table:not(.lm-table--grid) .lm-table__table tfoot tr { --tbl-row-tint: var(--fill-quaternary); }
  .lm-table:not(.lm-table--grid) .lm-table__table tfoot td { border: 0; }
  .lm-table:not(.lm-table--grid) .lm-table__empty td { display: block; }
  .lm-table:not(.lm-table--grid) .lm-table__footer { padding: var(--space-12) 0 0; border: 0; }
  .lm-table:not(.lm-table--grid) .lm-table__loading { border-radius: var(--radius-12); }
}

/* ===== Tag.css ===== */
/* ==========================================================================
   Tag — status labels, colour tags, filter chips
   Soft tint = tag colour at 14% · ink = tag colour mixed toward --label (legible in light & dark)
   ========================================================================== */
.lm-tag {
  --tag-color: var(--gray);
  --tag-mix: 60%;
  --tag-bg: color-mix(in srgb, var(--tag-color) 14%, transparent);
  --tag-ink: color-mix(in srgb, var(--tag-color) var(--tag-mix), var(--label));
  display: inline-flex; align-items: center; gap: var(--space-4);
  max-width: 100%;
  padding: var(--space-4) var(--space-8);
  border: 0; border-radius: var(--radius-6);
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-family: inherit;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-medium);
  white-space: nowrap; vertical-align: middle;
  text-decoration: none;
}
.lm-tag > .lm-icon { --lm-icon-size: var(--icon-sm); }
.lm-tag__text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* Colours (every iOS system colour) */
.lm-tag--blue { --tag-color: var(--blue); }
.lm-tag--green { --tag-color: var(--green); }
.lm-tag--indigo { --tag-color: var(--indigo); }
.lm-tag--orange { --tag-color: var(--orange); }
.lm-tag--pink { --tag-color: var(--pink); }
.lm-tag--purple { --tag-color: var(--purple); }
.lm-tag--red { --tag-color: var(--red); }
.lm-tag--teal { --tag-color: var(--teal); }
.lm-tag--yellow { --tag-color: var(--yellow); --tag-mix: 45%; }
.lm-tag--mint { --tag-color: var(--mint); }
.lm-tag--cyan { --tag-color: var(--cyan); }
.lm-tag--brown { --tag-color: var(--brown); }
.lm-tag--gray { --tag-color: var(--gray); }
.lm-tag--accent { --tag-color: var(--accent); }

/* Status (semantic tokens) */
.lm-tag--success { --tag-bg: var(--success-soft); --tag-ink: var(--success-text); --tag-color: var(--success); }
.lm-tag--warning { --tag-bg: var(--warning-soft); --tag-ink: var(--warning-text); --tag-color: var(--warning); }
.lm-tag--danger, .lm-tag--error { --tag-bg: var(--danger-soft); --tag-ink: var(--danger-text); --tag-color: var(--danger); }
.lm-tag--info { --tag-color: var(--info); }
.lm-tag--processing .lm-spinner { --lm-spinner-size: 12px; --lm-spinner-color: currentColor; }
.lm-tag__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--tag-color); flex: none; }

/* Variants */
.lm-tag--filled { --tag-bg: var(--tag-color); --tag-ink: var(--on-accent); }
.lm-tag--filled.lm-tag--yellow { --tag-ink: var(--label); }
.lm-tag--outlined { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tag-color) 45%, transparent); }
.lm-tag--plain { background: var(--fill-tertiary); color: var(--label); }
.lm-tag--pill { border-radius: var(--radius-full); padding-inline: var(--space-10); }

/* Sizes */
.lm-tag--sm { padding: var(--space-2) var(--space-6); font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); letter-spacing: var(--ls-caption-1); border-radius: var(--radius-4); }
.lm-tag--lg { padding: var(--space-6) var(--space-12); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); border-radius: var(--radius-8); }

/* Closable */
.lm-tag__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-right: calc(var(--space-2) * -1);
  padding: 0; border: 0; border-radius: var(--radius-full);
  background: transparent; color: inherit; opacity: 0.7; cursor: pointer;
  --lm-icon-size: 12px;
}
.lm-tag__close:hover { opacity: 1; background: var(--fill-tertiary); }
.lm-tag__close:active { opacity: var(--opacity-pressed); }
.lm-tag.is-closing { opacity: 0; transform: scale(0.9); transition: opacity var(--duration-fast) var(--ease-in), transform var(--duration-fast) var(--ease-in); }

/* Checkable filter chips (button[aria-pressed]) */
.lm-tag--checkable {
  --tag-bg: var(--fill-tertiary); --tag-ink: var(--label);
  padding: var(--space-6) var(--space-12);
  border-radius: var(--radius-full);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), opacity var(--duration-instant) var(--ease-standard);
}
.lm-tag--checkable[aria-pressed="true"], .lm-tag--checkable.is-checked { --tag-bg: var(--accent); --tag-ink: var(--on-accent); }
.lm-tag--checkable:active { opacity: var(--opacity-pressed); }
.lm-tag--checkable:disabled { opacity: var(--opacity-disabled); cursor: not-allowed; }
@media (hover: hover) { .lm-tag--checkable:not([aria-pressed="true"]):not(:disabled):hover { --tag-bg: var(--fill-secondary); } }

/* Add tag (dashed) + inline input */
.lm-tag--add { background: transparent; color: var(--label-secondary); box-shadow: none; border: 1px dashed var(--separator-opaque); padding: calc(var(--space-4) - 1px) calc(var(--space-8) - 1px); cursor: pointer; }
.lm-tag--add:hover { color: var(--accent); border-color: var(--accent); }
.lm-tag--input { background: var(--bg-elevated); box-shadow: inset 0 0 0 1px var(--accent); padding-block: 0; }
.lm-tag__input { width: 96px; min-width: 0; height: calc(var(--lh-footnote) + 2 * var(--space-4)); border: 0; outline: 0; padding: 0; background: transparent; color: var(--label); font: inherit; }

/* Group */
.lm-tag-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); min-width: 0; }
.lm-tag-group--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: var(--space-2); }
.lm-tag-group--scroll::-webkit-scrollbar { display: none; }

/* ===== Timeline.css ===== */
/* ==========================================================================
   Timeline — vertical steps with dots and hairline connectors
   Modes (≥ 768px): --label (time column) · --alternate · --right. Mobile is always left.
   ========================================================================== */
.lm-timeline {
  --tl-dot: 20px;
  --tl-gap: var(--space-12);
  --tl-label-w: 120px;
  --tl-axis: calc(var(--tl-dot) / 2);
  --tl-surface: var(--bg-grouped-secondary);
  --tl-step: var(--space-16);
  display: flex; flex-direction: column;
  margin: 0; padding: 0; list-style: none;
  min-width: 0;
}
.lm-timeline__item {
  --tl-color: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: var(--tl-dot) minmax(0, 1fr);
  grid-template-areas: "dot content" "dot time";
  column-gap: var(--tl-gap);
  align-content: start;
  padding-bottom: var(--tl-step);
}
/* Connector: from below the dot to the next item */
.lm-timeline__item::before {
  content: "";
  position: absolute;
  left: var(--tl-axis); translate: -50% 0;
  top: calc(var(--lh-subheadline) / 2 + 5px + var(--space-4));
  bottom: 0;
  width: calc(var(--hairline) * 2);
  background: var(--separator);
}
.lm-timeline__item:last-child::before { display: none; }
.lm-timeline__item:last-child { padding-bottom: 0; }

.lm-timeline__dot {
  grid-area: dot;
  justify-self: center; align-self: start;
  position: relative; z-index: 1;
  width: 10px; height: 10px;
  margin-top: calc((var(--lh-subheadline) - 10px) / 2);
  border-radius: var(--radius-full);
  border: 2px solid var(--tl-color);
  background: var(--tl-surface);
}
.lm-timeline__item.is-active .lm-timeline__dot,
.lm-timeline__dot--filled { background: var(--tl-color); }
.lm-timeline__item.is-active .lm-timeline__dot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--tl-color) 22%, transparent); }
/* Icon dot */
.lm-timeline__dot--icon {
  width: var(--tl-dot); height: var(--tl-dot); margin-top: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--tl-color); color: var(--on-accent);
  --lm-icon-size: 12px;
}
.lm-timeline__dot--icon .lm-icon > svg { stroke-width: 2.6; }
.lm-timeline__item:has(.lm-timeline__dot--icon)::before { top: calc(var(--tl-dot) + var(--space-4)); }

.lm-timeline__content { grid-area: content; min-width: 0; }
.lm-timeline__title {
  margin: 0;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  font-weight: var(--fw-semibold); color: var(--label);
}
.lm-timeline__desc {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  color: var(--label-secondary);
}
.lm-timeline__time {
  grid-area: time;
  margin-top: var(--space-2);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  color: var(--label-secondary);
  font-variant-numeric: tabular-nums;
}

/* Colours */
.lm-timeline__item--success { --tl-color: var(--success); }
.lm-timeline__item--warning { --tl-color: var(--warning); }
.lm-timeline__item--danger { --tl-color: var(--danger); }
.lm-timeline__item--gray { --tl-color: var(--gray-2); }
.lm-timeline__item--purple { --tl-color: var(--purple); }

/* Pending: spinner dot, muted text, dashed connector leading to it */
.lm-timeline__item--pending .lm-timeline__dot { width: auto; height: auto; border: 0; background: transparent; margin-top: calc((var(--lh-subheadline) - 16px) / 2); }
.lm-timeline__item--pending .lm-spinner { --lm-spinner-size: 16px; }
.lm-timeline__item--pending .lm-timeline__title { color: var(--label-secondary); font-weight: var(--fw-regular); }
.lm-timeline__item:has(+ .lm-timeline__item--pending)::before {
  background: repeating-linear-gradient(to bottom, var(--separator) 0 3px, transparent 3px 6px);
}

/* Reverse order */
.lm-timeline--reverse { flex-direction: column-reverse; }
.lm-timeline--reverse .lm-timeline__item:last-child { padding-bottom: var(--tl-step); }
.lm-timeline--reverse .lm-timeline__item:last-child::before { display: block; }
.lm-timeline--reverse .lm-timeline__item:first-child { padding-bottom: 0; }
.lm-timeline--reverse .lm-timeline__item:first-child::before { display: none; }

/* Compact (dense lists, activity log) */
.lm-timeline--compact { --tl-step: var(--space-10); }

/* ---- Tablet & desktop modes ---- */
@media (min-width: 768px) {
  .lm-timeline--label { --tl-axis: calc(var(--tl-label-w) + var(--tl-gap) + var(--tl-dot) / 2); }
  .lm-timeline--label .lm-timeline__item { grid-template-columns: var(--tl-label-w) var(--tl-dot) minmax(0, 1fr); grid-template-areas: "time dot content"; }
  .lm-timeline--label .lm-timeline__time { margin-top: 0; text-align: right; line-height: var(--lh-subheadline); }

  .lm-timeline--alternate { --tl-axis: 50%; }
  .lm-timeline--alternate .lm-timeline__item { grid-template-columns: minmax(0, 1fr) var(--tl-dot) minmax(0, 1fr); grid-template-areas: "time dot content"; }
  .lm-timeline--alternate .lm-timeline__time { margin-top: 0; text-align: right; line-height: var(--lh-subheadline); }
  .lm-timeline--alternate .lm-timeline__item:nth-child(even) { grid-template-areas: "content dot time"; }
  .lm-timeline--alternate .lm-timeline__item:nth-child(even) .lm-timeline__content { text-align: right; }
  .lm-timeline--alternate .lm-timeline__item:nth-child(even) .lm-timeline__time { text-align: left; }

  .lm-timeline--right { --tl-axis: calc(100% - var(--tl-dot) / 2); }
  .lm-timeline--right .lm-timeline__item { grid-template-columns: minmax(0, 1fr) var(--tl-dot); grid-template-areas: "content dot" "time dot"; }
  .lm-timeline--right .lm-timeline__content, .lm-timeline--right .lm-timeline__time { text-align: right; }
}

/* ===== Tooltip.css ===== */
/* ==========================================================================
   Tooltip — small inverted bubble on hover / keyboard focus / tap
   <span class="lm-anchor lm-anchor--hover lm-tooltip"> trigger
     <span class="lm-floating lm-floating--top" role="tooltip"><span class="lm-tooltip__bubble">…</span></span>
   ========================================================================== */
.lm-tooltip { --lm-tooltip-delay: 300ms; }
.lm-tooltip > .lm-floating {
  z-index: var(--z-tooltip);
  min-width: 0; width: max-content; max-width: 240px;
  pointer-events: none;
}
/* Open after a short delay on hover; instantly on keyboard focus */
.lm-tooltip.lm-anchor--hover:hover > .lm-floating { transition-delay: var(--lm-tooltip-delay); }
.lm-tooltip.lm-anchor--hover:focus-within > .lm-floating { transition-delay: 0s; }

.lm-tooltip__bubble {
  --tt-bg: var(--label);
  --tt-ink: var(--bg);
  position: relative;
  display: block;
  padding: var(--space-6) var(--space-10);
  border-radius: var(--radius-6);
  background: var(--tt-bg);
  color: var(--tt-ink);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-regular);
  text-align: left; white-space: normal; overflow-wrap: anywhere;
  box-shadow: var(--shadow-popover);
}
.lm-tooltip__bubble kbd { font-family: var(--font-mono); font-size: var(--fs-caption-1); opacity: 0.7; margin-left: var(--space-6); }
/* Arrow — a rotated square in the bubble colour */
.lm-tooltip__bubble::after {
  content: "";
  position: absolute; width: 8px; height: 8px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 1px;
}
.lm-floating--top > .lm-tooltip__bubble::after { left: 50%; bottom: -4px; margin-left: -4px; }
.lm-floating--top-start > .lm-tooltip__bubble::after { left: var(--space-12); bottom: -4px; }
.lm-floating--top-end > .lm-tooltip__bubble::after { right: var(--space-12); bottom: -4px; }
.lm-floating--bottom > .lm-tooltip__bubble::after { left: 50%; top: -4px; margin-left: -4px; }
.lm-floating--bottom-start > .lm-tooltip__bubble::after,
.lm-floating:not([class*="lm-floating--"]) > .lm-tooltip__bubble::after { left: var(--space-12); top: -4px; }
.lm-floating--bottom-end > .lm-tooltip__bubble::after { right: var(--space-12); top: -4px; }
.lm-floating--left > .lm-tooltip__bubble::after { right: -4px; top: 50%; margin-top: -4px; }
.lm-floating--right > .lm-tooltip__bubble::after { left: -4px; top: 50%; margin-top: -4px; }
.lm-tooltip--no-arrow .lm-tooltip__bubble::after { display: none; }

/* Colour variants */
.lm-tooltip--accent .lm-tooltip__bubble { --tt-bg: var(--accent); --tt-ink: var(--on-accent); }
.lm-tooltip--danger .lm-tooltip__bubble { --tt-bg: var(--danger); --tt-ink: var(--on-accent); }
.lm-tooltip--success .lm-tooltip__bubble { --tt-bg: var(--success-text); --tt-ink: var(--bg); }
/* Light (material) — matches iOS context hints on iPad/Mac */
.lm-tooltip--light .lm-tooltip__bubble {
  --tt-bg: var(--material-regular); --tt-ink: var(--label);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-sm)) saturate(var(--saturate));
}
.lm-tooltip--light .lm-tooltip__bubble::after { background: var(--bg-elevated); }

/* Inline helper: a small (i) trigger next to a label */
.lm-tooltip__trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--label-secondary); cursor: help;
  --lm-icon-size: 16px;
}
.lm-tooltip__trigger:hover { color: var(--accent); }

/* ===== Tour.css ===== */
/* ==========================================================================
   Tour — spotlight + step card (coach marks / onboarding)
   Positions come from CSS vars set by Lumen.tour(): --tour-x/-y/-w/-h (spotlight), --tour-card-x/-y.
   ========================================================================== */
.lm-tour {
  --tour-x: 50%; --tour-y: 50%; --tour-w: 0px; --tour-h: 0px;
  --tour-card-x: 12px; --tour-card-y: 12px;
  position: fixed; inset: 0; z-index: var(--z-tooltip);
  visibility: hidden; pointer-events: none;
  transition: visibility 0s linear var(--duration-base);
}
.lm-tour.is-open { visibility: visible; pointer-events: auto; transition: visibility 0s; }
.lm-tour--contained { position: absolute; }
/* Click-catcher (transparent; darkening comes from the spotlight shadow) */
.lm-tour__mask { position: absolute; inset: 0; }
.lm-tour__spotlight {
  position: absolute;
  left: var(--tour-x); top: var(--tour-y); width: var(--tour-w); height: var(--tour-h);
  border-radius: var(--radius-12);
  box-shadow: 0 0 0 9999px var(--overlay);
  pointer-events: none;
  opacity: 0;
  transition: left var(--duration-slow) var(--ease-spring), top var(--duration-slow) var(--ease-spring),
    width var(--duration-slow) var(--ease-spring), height var(--duration-slow) var(--ease-spring), opacity var(--duration-base) var(--ease-standard);
}
.lm-tour.is-open .lm-tour__spotlight { opacity: 1; }
.lm-tour__spotlight::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--thumb) 70%, transparent);
}
.lm-tour--no-mask .lm-tour__spotlight { box-shadow: none; }

.lm-tour__card {
  --tour-card-bg: var(--bg-elevated);
  --tour-card-ink: var(--label);
  --tour-card-muted: var(--label-secondary);
  position: absolute;
  left: var(--tour-card-x); top: var(--tour-card-y);
  width: min(320px, calc(100% - 2 * var(--space-12)));
  display: flex; flex-direction: column; gap: var(--space-6);
  padding: var(--space-16);
  border-radius: var(--radius-16);
  background: var(--tour-card-bg);
  color: var(--tour-card-ink);
  box-shadow: var(--shadow-modal);
  opacity: 0; transform: translateY(6px) scale(0.98);
  transition: left var(--duration-slow) var(--ease-spring), top var(--duration-slow) var(--ease-spring),
    opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-spring);
}
.lm-tour.is-open .lm-tour__card, .lm-tour__card--static { opacity: 1; transform: none; }
.lm-tour__card--static { position: relative; left: auto; top: auto; width: 100%; max-width: 320px; }
.lm-tour__cover {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; max-width: 100%;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-10);
  background: var(--accent-soft); color: var(--accent);
  --lm-icon-size: 40px;
  overflow: hidden;
}
.lm-tour__cover[hidden] { display: none; }
.lm-tour__title { margin: 0; padding-right: var(--space-24); font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold); }
.lm-tour__desc { margin: 0; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); color: var(--tour-card-muted); }
.lm-tour__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-12); margin-top: var(--space-10); }
.lm-tour__actions { display: flex; gap: var(--space-8); margin-left: auto; }
.lm-tour__actions [hidden] { display: none; }
.lm-tour__dots { display: flex; align-items: center; gap: var(--space-6); }
.lm-tour__dots > span { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--gray-3); transition: background-color var(--duration-fast) var(--ease-standard), width var(--duration-base) var(--ease-spring); }
.lm-tour__dots > span.is-active { width: 18px; background: var(--accent); }
.lm-tour__count { font-size: var(--fs-footnote); line-height: var(--lh-footnote); color: var(--tour-card-muted); font-variant-numeric: tabular-nums; }
.lm-tour__close {
  position: absolute; top: var(--space-12); right: var(--space-12);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--tour-card-muted); cursor: pointer;
  --lm-icon-size: 14px;
}
/* Primary card (Ant type="primary") */
.lm-tour--primary .lm-tour__card, .lm-tour__card--primary { --tour-card-bg: var(--accent); --tour-card-ink: var(--on-accent); --tour-card-muted: color-mix(in srgb, var(--on-accent) 80%, transparent); }
.lm-tour--primary .lm-tour__dots > span, .lm-tour__card--primary .lm-tour__dots > span { background: color-mix(in srgb, var(--on-accent) 40%, transparent); }
.lm-tour--primary .lm-tour__dots > span.is-active, .lm-tour__card--primary .lm-tour__dots > span.is-active { background: var(--on-accent); }
.lm-tour--primary .lm-tour__close, .lm-tour__card--primary .lm-tour__close { background: color-mix(in srgb, var(--on-accent) 20%, transparent); color: var(--on-accent); }
.lm-tour--primary .lm-tour__cover, .lm-tour__card--primary .lm-tour__cover { background: color-mix(in srgb, var(--on-accent) 18%, transparent); color: var(--on-accent); }

/* Mobile: the card docks to the bottom (or top when the target sits low) */
@media (max-width: 767.98px) {
  .lm-tour__card:not(.lm-tour__card--static) {
    left: var(--space-12); right: var(--space-12); width: auto;
    top: auto; bottom: calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
  }
  .lm-tour__card.is-top:not(.lm-tour__card--static) { top: calc(var(--space-12) + env(safe-area-inset-top, 0px)); bottom: auto; }
  .lm-tour__card .lm-tour__actions .lm-btn { flex: 1 1 auto; }
}

/* ===== Tree.css ===== */
/* ==========================================================================
   Tree — iOS/iPadOS outline list (disclosure chevrons, indentation)
   ul.lm-tree[role=tree] > li.lm-tree__node[role=treeitem] > .lm-tree__row + ul.lm-tree__group[role=group]
   ========================================================================== */
.lm-tree {
  --tree-indent: 20px;
  --tree-row: var(--control-md);
  --tree-toggle: 26px;
  margin: 0; padding: 0; list-style: none;
  min-width: 0;
  color: var(--label);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body);
}
@media (min-width: 1200px) and (pointer: fine) {
  .lm-tree { --tree-row: 32px; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
}
.lm-tree__group { margin: 0; padding: 0 0 0 var(--tree-indent); list-style: none; }
.lm-tree__node { margin: 0; outline: none; }
.lm-tree__node[aria-expanded="false"] > .lm-tree__group { display: none; }

.lm-tree__row {
  position: relative;
  display: flex; align-items: center; gap: var(--space-6);
  min-height: var(--tree-row);
  padding: 0 var(--space-8) 0 var(--space-2);
  border-radius: var(--radius-8);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.lm-tree__row:active { background: var(--row-pressed); }
@media (hover: hover) { .lm-tree__row:hover { background: var(--fill-quaternary); } }
.lm-tree__node:focus-visible > .lm-tree__row { outline: var(--ring-width) solid var(--focus-ring); outline-offset: -2px; }

.lm-tree__toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--tree-toggle); height: var(--tree-toggle);
  padding: 0; border: 0; border-radius: var(--radius-6);
  background: transparent; color: var(--label-tertiary); cursor: pointer;
  --lm-icon-size: 14px;
}
.lm-tree__toggle .lm-icon { transition: transform var(--duration-base) var(--ease-spring); }
.lm-tree__toggle .lm-icon > svg { stroke-width: 2.4; }
.lm-tree__node[aria-expanded="true"] > .lm-tree__row .lm-tree__toggle .lm-icon { transform: rotate(90deg); }
.lm-tree__node:not([aria-expanded]) > .lm-tree__row .lm-tree__toggle { visibility: hidden; }
.lm-tree__toggle .lm-spinner { --lm-spinner-size: 14px; }
.lm-tree__node.is-loading > .lm-tree__row .lm-tree__toggle { visibility: visible; }

.lm-tree__check { flex: none; display: inline-flex; }
.lm-tree__icon { flex: none; color: var(--accent); --lm-icon-size: var(--icon-md); }
.lm-tree__icon--doc { color: var(--label-secondary); }
.lm-tree__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-tree__label mark { background: var(--accent-soft); color: var(--accent); border-radius: var(--radius-4); padding: 0 var(--space-2); }
.lm-tree__extra { flex: none; color: var(--label-secondary); font-size: var(--fs-subheadline); font-variant-numeric: tabular-nums; }
.lm-tree__handle { flex: none; display: none; color: var(--label-tertiary); cursor: grab; --lm-icon-size: 18px; }

/* Selected */
.lm-tree__node[aria-selected="true"] > .lm-tree__row { background: var(--accent-soft); }
.lm-tree__node[aria-selected="true"] > .lm-tree__row .lm-tree__label { color: var(--accent); font-weight: var(--fw-semibold); }
/* Disabled */
.lm-tree__node[aria-disabled="true"] > .lm-tree__row { cursor: not-allowed; color: var(--label-tertiary); background: transparent; }
.lm-tree__node[aria-disabled="true"] > .lm-tree__row .lm-tree__icon { color: var(--label-tertiary); }

/* Show guide lines */
.lm-tree--lines .lm-tree__group {
  margin-left: calc(var(--space-2) + var(--tree-toggle) / 2);
  padding-left: calc(var(--tree-indent) - var(--space-2) - var(--tree-toggle) / 2);
  border-left: calc(var(--hairline) * 2) solid var(--separator);
}

/* Draggable (visual states; wire with your DnD library) */
.lm-tree--draggable .lm-tree__handle { display: inline-flex; opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard); }
.lm-tree--draggable .lm-tree__row:hover .lm-tree__handle, .lm-tree--draggable .lm-tree__node:focus-visible > .lm-tree__row .lm-tree__handle { opacity: 1; }
@media (hover: none) { .lm-tree--draggable .lm-tree__handle { opacity: 1; } }
.lm-tree__node.is-dragging > .lm-tree__row { opacity: 0.5; }
.lm-tree__node.is-drop-inside > .lm-tree__row { box-shadow: inset 0 0 0 var(--ring-width) var(--accent); background: var(--accent-soft); }
.lm-tree__node.is-drop-before > .lm-tree__row::before,
.lm-tree__node.is-drop-after > .lm-tree__row::after {
  content: ""; position: absolute; left: var(--tree-toggle); right: 0; height: 2px; border-radius: var(--radius-full); background: var(--accent);
}
.lm-tree__node.is-drop-before > .lm-tree__row::before { top: -1px; }
.lm-tree__node.is-drop-after > .lm-tree__row::after { bottom: -1px; }

/* Block style: tree inside an inset-grouped card */
.lm-tree--card { padding: var(--space-6); background: var(--bg-grouped-secondary); border-radius: var(--radius-12); }
/* Directory tree: rows span full width, whole row toggles */
.lm-tree--directory .lm-tree__row { padding-right: var(--space-12); }

/* ===== Alert.css ===== */
/* ==========================================================================
   Alert — inline status banner (soft tinted callout, iOS-style)
   <div class="lm-alert lm-alert--success" role="status">icon · content · action · close</div>
   ========================================================================== */
.lm-alert {
  --alert-icon: var(--accent);
  --alert-bg: var(--info-soft);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "icon content close" ". action action";
  align-items: start;
  padding: var(--space-12) var(--space-12) var(--space-12) var(--space-14);
  border-radius: var(--radius-12);
  background: var(--alert-bg);
  color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.lm-alert__icon { grid-area: icon; margin: -1px var(--space-10) 0 0; color: var(--alert-icon); --lm-icon-size: 22px; }
.lm-alert__content { grid-area: content; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.lm-alert__title { margin: 0; font-weight: var(--fw-semibold); }
.lm-alert__desc { margin: 0; color: var(--label); }
.lm-alert__desc a { color: var(--link); }
.lm-alert__action { grid-area: action; display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-10); }
.lm-alert__close {
  grid-area: close;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin: -6px -6px -6px var(--space-8);
  border: 0; border-radius: var(--radius-full); padding: 0;
  background: transparent; color: var(--label-secondary); cursor: pointer;
  --lm-icon-size: 16px;
}
.lm-alert__close:active { opacity: var(--opacity-pressed); }
@media (hover: hover) { .lm-alert__close:hover { background: var(--fill-quaternary); } }

/* Types (Ant type="success|info|warning|error") */
.lm-alert--info { --alert-icon: var(--accent); --alert-bg: var(--info-soft); }
.lm-alert--success { --alert-icon: var(--success-text); --alert-bg: var(--success-soft); }
.lm-alert--warning { --alert-icon: var(--warning-text); --alert-bg: var(--warning-soft); }
.lm-alert--error, .lm-alert--danger { --alert-icon: var(--danger-text); --alert-bg: var(--danger-soft); }
.lm-alert--neutral { --alert-icon: var(--label-secondary); --alert-bg: var(--fill-quaternary); }

/* Compact: one line, no description */
.lm-alert--compact {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "icon content action close";
  align-items: center;
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-10);
}
.lm-alert--compact .lm-alert__icon { margin-top: 0; --lm-icon-size: 20px; }
.lm-alert--compact .lm-alert__title { font-weight: var(--fw-regular); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-alert--compact .lm-alert__desc { display: none; }
.lm-alert--compact .lm-alert__action { margin: 0 0 0 var(--space-8); flex-wrap: nowrap; }

/* Banner: full-bleed at the top of a page/section (Ant banner) */
.lm-alert--banner {
  border-radius: 0;
  padding-left: max(var(--screen-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--screen-margin), env(safe-area-inset-right, 0px));
}

.lm-alert.is-closing { opacity: 0; transform: scale(0.98); }

/* Tablet & desktop: action moves to the right */
@media (min-width: 768px) {
  .lm-alert:not(.lm-alert--compact) {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "icon content action close";
  }
  .lm-alert:not(.lm-alert--compact) .lm-alert__action { align-self: center; margin: 0 0 0 var(--space-16); flex-wrap: nowrap; }
}

/* ===== Drawer.css ===== */
/* ==========================================================================
   Drawer — bottom sheet (mobile, UISheetPresentationController) / side panel (tablet+)
   <div class="lm-layer lm-drawer" id="d" data-lm-overlay aria-hidden="true">
     <div class="lm-overlay" data-lm-close></div>
     <section class="lm-drawer__panel" role="dialog" aria-modal="true">grabber · header · body · footer</section>
   </div>
   Mode is driven by custom properties so each mode is written once.
   ========================================================================== */
.lm-drawer {
  /* sheet (default on mobile) */
  --drawer-justify: center;
  --drawer-align: flex-end;
  --drawer-w: 100%;
  --drawer-maxw: 100%;
  --drawer-h: auto;
  --drawer-maxh: calc(100dvh - var(--space-40) - env(safe-area-inset-top, 0px));
  --drawer-radius: var(--radius-16) var(--radius-16) 0 0;
  --drawer-from: translate3d(0, 100%, 0);
  --drawer-stacked: translate3d(0, -10px, 0) scale(0.94);
  --drawer-grabber: flex;
  --drawer-pad: var(--space-16);
  --drawer-btn-flex: 1 1 0;
  --drawer-safe-bottom: env(safe-area-inset-bottom, 0px);
  justify-content: var(--drawer-justify);
  align-items: var(--drawer-align);
}
.lm-drawer__panel {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: var(--drawer-w); max-width: var(--drawer-maxw);
  height: var(--drawer-h); max-height: var(--drawer-maxh);
  padding-bottom: var(--drawer-safe-bottom);
  background: var(--bg-elevated); color: var(--label);
  border-radius: var(--drawer-radius);
  box-shadow: var(--shadow-modal);
  overflow: hidden; outline: none;
  transform: var(--drawer-from);
  transition: transform var(--duration-slow) var(--ease-spring), height var(--duration-slow) var(--ease-spring), filter var(--duration-slow) var(--ease-spring);
}
.lm-drawer.is-open > .lm-drawer__panel,
.lm-drawer.lm-layer--inline > .lm-drawer__panel { transform: none; }
.lm-drawer.is-open.is-stacked > .lm-drawer__panel { transform: var(--drawer-stacked); filter: brightness(0.97); }
.lm-drawer.is-dragging > .lm-drawer__panel { transition: none; }

.lm-drawer__grabber {
  display: var(--drawer-grabber); justify-content: center; align-items: flex-start;
  flex: none; width: 100%; height: 20px; margin: 0 0 calc(-1 * var(--space-6)); padding: 5px 0 0;
  border: 0; background: transparent; cursor: grab; touch-action: none;
}
.lm-drawer__grabber::before { content: ""; width: 36px; height: 5px; border-radius: var(--radius-full); background: var(--gray-3); }
.lm-drawer.is-dragging .lm-drawer__grabber { cursor: grabbing; }

.lm-drawer__header {
  display: flex; align-items: center; gap: var(--space-12);
  min-height: 56px; flex: none;
  padding: var(--space-12) var(--drawer-pad) var(--space-8);
}
.lm-drawer__title {
  flex: 1 1 auto; min-width: 0; margin: 0;
  font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); font-weight: var(--fw-bold);
}
.lm-drawer__extra { display: flex; align-items: center; gap: var(--space-8); flex: none; }
.lm-drawer__close {
  position: relative; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--label-secondary); cursor: pointer;
  --lm-icon-size: 16px;
}
.lm-drawer__close::after { content: ""; position: absolute; inset: -7px; }
.lm-drawer__close:active { opacity: var(--opacity-pressed); }
.lm-drawer__body {
  /* x: hidden — popup đang đóng (lịch 2 tháng, select) không tạo thanh cuộn ngang; popup mở bị cắt sẽ tự ghim position: fixed (Lumen.place) */
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 var(--drawer-pad) var(--drawer-pad);
}
.lm-drawer__footer {
  display: flex; gap: var(--space-8); flex: none; justify-content: flex-end;
  padding: var(--space-12) var(--drawer-pad) var(--drawer-pad);
  border-top: var(--hairline) solid var(--separator);
}
.lm-drawer__footer > .lm-btn { flex: var(--drawer-btn-flex); }

/* Detents (sheet mode) — data-lm-detents="medium large" enables drag/tap switching */
.lm-drawer--medium { --drawer-h: 50dvh; }
.lm-drawer--large { --drawer-h: calc(100dvh - var(--space-40) - env(safe-area-inset-top, 0px)); }

/* Forced modes */
.lm-drawer--side {
  --drawer-justify: flex-end; --drawer-align: stretch;
  --drawer-w: var(--drawer-width); --drawer-maxw: calc(100% - var(--space-40));
  --drawer-h: 100%; --drawer-maxh: 100%;
  --drawer-radius: var(--radius-16) 0 0 var(--radius-16);
  --drawer-from: translate3d(100%, 0, 0); --drawer-stacked: translate3d(-32px, 0, 0);
  --drawer-grabber: none; --drawer-pad: var(--space-24); --drawer-btn-flex: 0 0 auto;
}
.lm-drawer--side.lm-drawer--left {
  --drawer-justify: flex-start;
  --drawer-radius: 0 var(--radius-16) var(--radius-16) 0;
  --drawer-from: translate3d(-100%, 0, 0); --drawer-stacked: translate3d(32px, 0, 0);
}
.lm-drawer--top {
  --drawer-justify: center; --drawer-align: flex-start;
  --drawer-w: 100%; --drawer-maxw: 100%; --drawer-h: auto;
  --drawer-radius: 0 0 var(--radius-16) var(--radius-16);
  --drawer-from: translate3d(0, -100%, 0); --drawer-stacked: translate3d(0, 10px, 0) scale(0.96);
  --drawer-grabber: none; --drawer-safe-bottom: 0px;
}
.lm-drawer--top > .lm-drawer__panel { padding-top: env(safe-area-inset-top, 0px); }

/* Auto: side panel from tablet up (unless sheet/bottom/top forced) */
@media (min-width: 768px) {
  .lm-drawer:not(.lm-drawer--sheet):not(.lm-drawer--bottom):not(.lm-drawer--top) {
    --drawer-justify: flex-end; --drawer-align: stretch;
    --drawer-w: var(--drawer-width); --drawer-maxw: calc(100% - var(--space-40));
    --drawer-h: 100%; --drawer-maxh: 100%;
    --drawer-radius: var(--radius-16) 0 0 var(--radius-16);
    --drawer-from: translate3d(100%, 0, 0); --drawer-stacked: translate3d(-32px, 0, 0);
    --drawer-grabber: none; --drawer-pad: var(--space-24); --drawer-btn-flex: 0 0 auto;
  }
  .lm-drawer.lm-drawer--left:not(.lm-drawer--sheet):not(.lm-drawer--bottom):not(.lm-drawer--top) {
    --drawer-justify: flex-start;
    --drawer-radius: 0 var(--radius-16) var(--radius-16) 0;
    --drawer-from: translate3d(-100%, 0, 0); --drawer-stacked: translate3d(32px, 0, 0);
  }
  .lm-drawer--sheet { --drawer-maxw: 640px; --drawer-pad: var(--space-24); --drawer-btn-flex: 0 0 auto; }
  .lm-drawer--large.lm-drawer--sheet, .lm-drawer--large.lm-drawer--bottom { --drawer-h: calc(100dvh - var(--space-64)); }
}
/* Sizes for side mode (Ant size="large" = 736) */
.lm-drawer--wide { --drawer-width-wide: calc(var(--drawer-width) * 1.84); }
@media (min-width: 768px) {
  .lm-drawer.lm-drawer--wide:not(.lm-drawer--sheet):not(.lm-drawer--bottom):not(.lm-drawer--top) { --drawer-w: var(--drawer-width-wide); }
}
.lm-drawer--side.lm-drawer--wide { --drawer-w: var(--drawer-width-wide); }

/* ===== Message.css ===== */
/* ==========================================================================
   Message — iOS toast capsule (top) + HUD (center). Created by Lumen.message.*
   ========================================================================== */
.lm-message-host {
  position: fixed; z-index: var(--z-toast);
  top: 0; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-8);
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--space-12));
  padding-left: max(var(--screen-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--screen-margin), env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.lm-message {
  display: inline-flex; align-items: center; gap: var(--space-8);
  max-width: min(100%, 480px);
  min-height: var(--control-md);
  padding: var(--space-10) var(--space-20) var(--space-10) var(--space-14);
  border-radius: var(--radius-full);
  background: var(--material-regular);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  box-shadow: var(--shadow-popover);
  color: var(--label);
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); font-weight: var(--fw-semibold);
  pointer-events: auto;
  animation: lm-message-in var(--duration-slow) var(--ease-spring) both;
}
.lm-message__icon { flex: none; color: var(--accent); --lm-icon-size: 22px; --lm-spinner-size: 20px; }
.lm-message__text { min-width: 0; overflow-wrap: anywhere; }
.lm-message--info .lm-message__icon { color: var(--accent); }
.lm-message--success .lm-message__icon { color: var(--success-text); }
.lm-message--warning .lm-message__icon { color: var(--warning-text); }
.lm-message--error .lm-message__icon { color: var(--danger-text); }
.lm-message--loading .lm-message__icon { --lm-spinner-color: var(--label-secondary); }
.lm-message.is-leaving { animation: lm-message-out var(--duration-fast) var(--ease-in) both; }
.lm-message--static { animation: none; }
@keyframes lm-message-in { from { opacity: 0; transform: translate3d(0, -120%, 0) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes lm-message-out { to { opacity: 0; transform: translate3d(0, -40%, 0) scale(0.92); } }

/* HUD — centered square ("Đã sao chép", "Đã lưu") */
.lm-hud-host {
  position: fixed; inset: 0; z-index: var(--z-toast);
  display: grid; place-items: center;
  pointer-events: none;
}
.lm-hud {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-10);
  width: 160px; min-height: 160px;
  padding: var(--space-20) var(--space-16);
  border-radius: var(--radius-16);
  background: var(--material-regular);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  box-shadow: var(--shadow-modal);
  color: var(--label);
  text-align: center;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); font-weight: var(--fw-semibold);
  animation: lm-hud-in var(--duration-base) var(--ease-spring) both;
}
.lm-hud__icon { color: var(--label-secondary); --lm-icon-size: 44px; --lm-spinner-size: 37px; }
.lm-hud.is-leaving { animation: lm-hud-out var(--duration-fast) var(--ease-in) both; }
.lm-hud--static { animation: none; }
@keyframes lm-hud-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes lm-hud-out { to { opacity: 0; transform: scale(0.92); } }

/* ===== Modal.css ===== */
/* ==========================================================================
   Modal — two families
   1. lm-alert-dialog : UIAlertController (.alert) — 270px, blur, centered
   2. lm-modal        : page sheet (mobile) / centered dialog (tablet+)
   ========================================================================== */

/* ---------- 1. Alert dialog ---------- */
.lm-alert-dialog { align-items: center; justify-content: center; padding: var(--space-24); }
.lm-alert-dialog__box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: var(--alert-width); max-width: 100%;
  max-height: calc(100dvh - var(--space-48));
  overflow: hidden;
  border-radius: var(--radius-14);
  background: var(--material-regular);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  box-shadow: var(--shadow-modal);
  color: var(--label); text-align: center;
  opacity: 0; transform: scale(1.08);
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-base) var(--ease-spring);
}
.lm-alert-dialog.is-open > .lm-alert-dialog__box,
.lm-alert-dialog.lm-layer--inline > .lm-alert-dialog__box { opacity: 1; transform: none; }
.lm-alert-dialog__content {
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-20) var(--space-16) var(--space-16);
  overflow: auto;
}
.lm-alert-dialog__title {
  margin: 0;
  font-size: var(--fs-headline); line-height: var(--lh-headline); letter-spacing: var(--ls-headline); font-weight: var(--fw-semibold);
}
.lm-alert-dialog__message {
  margin: 0;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
}
.lm-alert-dialog .lm-alert-dialog__field {
  margin-top: var(--space-12);
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 var(--hairline) var(--separator-opaque);
  border-radius: var(--radius-8);
  text-align: left;
}
.lm-alert-dialog__actions { display: flex; flex: none; border-top: var(--hairline) solid var(--separator); }
.lm-alert-dialog__action {
  flex: 1 1 0; min-width: 0;
  min-height: var(--control-md);
  padding: var(--space-10) var(--space-8);
  border: 0; background: transparent; color: var(--accent);
  font-family: inherit;
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); font-weight: var(--fw-regular);
  cursor: pointer;
  transition: background-color var(--duration-instant) var(--ease-standard);
}
.lm-alert-dialog__action + .lm-alert-dialog__action { border-left: var(--hairline) solid var(--separator); }
.lm-alert-dialog__action:active { background: var(--fill-tertiary); }
.lm-alert-dialog__action--cancel, .lm-alert-dialog__action--preferred { font-weight: var(--fw-semibold); }
.lm-alert-dialog__action--danger { color: var(--danger); }
.lm-alert-dialog__action:disabled { color: var(--label-tertiary); cursor: not-allowed; background: transparent; }
@media (hover: hover) and (pointer: fine) { .lm-alert-dialog__action:not(:disabled):hover { background: var(--fill-quaternary); } }
/* 3+ actions (or forced) stack vertically; put Cancel last */
.lm-alert-dialog__actions--stacked,
.lm-alert-dialog__actions:has(> :nth-child(3)) { flex-direction: column; }
.lm-alert-dialog__actions--stacked > .lm-alert-dialog__action + .lm-alert-dialog__action,
.lm-alert-dialog__actions:has(> :nth-child(3)) > .lm-alert-dialog__action + .lm-alert-dialog__action {
  border-left: 0; border-top: var(--hairline) solid var(--separator);
}

/* ---------- 2. Modal: sheet ⇄ dialog (mode via custom properties) ---------- */
.lm-modal {
  /* sheet (default on mobile) */
  --m-align: flex-end;
  --m-layer-pad: 0px;
  --m-dialog-width: var(--modal-width);
  --m-width: 100%;
  --m-height: auto;
  --m-maxh: calc(100dvh - var(--space-40) - env(safe-area-inset-top, 0px));
  --m-radius: var(--radius-16) var(--radius-16) 0 0;
  --m-from: translate3d(0, 100%, 0);
  --m-from-opacity: 1;
  --m-sheet-only: flex;
  --m-dialog-only: none;
  --m-pad: var(--space-16);
  --m-safe-bottom: env(safe-area-inset-bottom, 0px);
  --m-header-cols: minmax(0, 1fr) auto minmax(0, 1fr);
  --m-title-col: 2;
  --m-title-align: center;
  --m-title-size: var(--fs-headline);
  --m-title-line: var(--lh-headline);
  --m-title-track: var(--ls-headline);
  --m-title-wrap: nowrap;
  --m-btn-flex: 1 1 0;
  justify-content: center;
  align-items: var(--m-align);
  padding: var(--m-layer-pad);
}
.lm-modal--wide { --m-dialog-width: calc(var(--modal-width) * 1.5); }
.lm-modal--sm { --m-dialog-width: calc(var(--modal-width) - 80px); }
.lm-modal--dialog {
  --m-align: center; --m-layer-pad: var(--space-24);
  --m-width: var(--m-dialog-width); --m-maxh: calc(100dvh - 2 * var(--space-48));
  --m-radius: var(--radius-14); --m-from: scale(0.96); --m-from-opacity: 0;
  --m-sheet-only: none; --m-dialog-only: flex; --m-pad: var(--space-24); --m-safe-bottom: 0px;
  --m-header-cols: minmax(0, 1fr) auto; --m-title-col: 1; --m-title-align: left;
  --m-title-size: var(--fs-title-3); --m-title-line: var(--lh-title-3); --m-title-track: var(--ls-title-3);
  --m-title-wrap: normal; --m-btn-flex: 0 0 auto;
}
@media (min-width: 768px) {
  .lm-modal:not(.lm-modal--sheet):not(.lm-modal--fullscreen) {
    --m-align: center; --m-layer-pad: var(--space-24);
    --m-width: var(--m-dialog-width); --m-maxh: calc(100dvh - 2 * var(--space-48));
    --m-radius: var(--radius-14); --m-from: scale(0.96); --m-from-opacity: 0;
    --m-sheet-only: none; --m-dialog-only: flex; --m-pad: var(--space-24); --m-safe-bottom: 0px;
    --m-header-cols: minmax(0, 1fr) auto; --m-title-col: 1; --m-title-align: left;
    --m-title-size: var(--fs-title-3); --m-title-line: var(--lh-title-3); --m-title-track: var(--ls-title-3);
    --m-title-wrap: normal; --m-btn-flex: 0 0 auto;
  }
  .lm-modal--sheet { --m-width: min(640px, 100%); --m-pad: var(--space-24); }
}
/* Full screen cover (all widths) */
.lm-modal.lm-modal--fullscreen {
  --m-align: stretch; --m-width: 100%; --m-height: 100%; --m-maxh: 100%; --m-radius: 0;
  --m-from: translate3d(0, 100%, 0); --m-from-opacity: 1;
}
.lm-modal--fullscreen > .lm-modal__dialog { padding-top: env(safe-area-inset-top, 0px); }

.lm-modal__dialog {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: var(--m-width); max-width: 100%;
  height: var(--m-height); max-height: var(--m-maxh);
  padding-bottom: var(--m-safe-bottom);
  overflow: hidden; outline: none;
  border-radius: var(--m-radius);
  background: var(--bg-elevated); color: var(--label);
  box-shadow: var(--shadow-modal);
  opacity: var(--m-from-opacity);
  transform: var(--m-from);
  transition: transform var(--duration-slow) var(--ease-spring), opacity var(--duration-fast) var(--ease-out);
}
.lm-modal.is-open > .lm-modal__dialog,
.lm-modal.lm-layer--inline > .lm-modal__dialog { opacity: 1; transform: none; }

.lm-modal__grabber { display: var(--m-sheet-only); justify-content: center; flex: none; height: 13px; padding-top: 5px; margin-bottom: calc(-1 * var(--space-8)); }
.lm-modal__grabber::before { content: ""; width: 36px; height: 5px; border-radius: var(--radius-full); background: var(--gray-3); }

.lm-modal__header {
  display: grid; grid-template-columns: var(--m-header-cols); align-items: center; column-gap: var(--space-8);
  min-height: 56px; flex: none;
  padding: var(--space-8) var(--m-pad);
}
.lm-modal__title {
  grid-column: var(--m-title-col); grid-row: 1;
  min-width: 0; margin: 0;
  text-align: var(--m-title-align); white-space: var(--m-title-wrap); overflow: hidden; text-overflow: ellipsis;
  font-size: var(--m-title-size); line-height: var(--m-title-line); letter-spacing: var(--m-title-track); font-weight: var(--fw-semibold);
}
.lm-modal__cancel, .lm-modal__done { display: var(--m-sheet-only); grid-row: 1; padding-inline: var(--space-4); min-width: 0; height: var(--control-md); }
.lm-modal__cancel { grid-column: 1; justify-self: start; font-weight: var(--fw-regular); }
.lm-modal__done { grid-column: 3; justify-self: end; font-weight: var(--fw-semibold); }
.lm-modal__close {
  grid-column: 2; grid-row: 1; justify-self: end;
  position: relative; display: var(--m-dialog-only); align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--fill-tertiary); color: var(--label-secondary); cursor: pointer;
  --lm-icon-size: 16px;
}
.lm-modal__close::after { content: ""; position: absolute; inset: -7px; }
.lm-modal__close:active { opacity: var(--opacity-pressed); }
@media (hover: hover) { .lm-modal__close:hover { background: var(--fill-secondary); } }

.lm-modal__body {
  /* x: hidden — popup đang đóng không tạo thanh cuộn ngang; popup mở bị cắt sẽ tự ghim position: fixed (Lumen.place) */
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 var(--m-pad) var(--m-pad);
}
.lm-modal__desc { margin: 0; color: var(--label-secondary); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
.lm-modal__footer {
  display: var(--m-dialog-only); flex: none; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-8);
  padding: 0 var(--m-pad) var(--m-pad);
}
.lm-modal__footer--always { display: flex; padding-top: var(--space-12); }
.lm-modal__footer > .lm-btn { flex: var(--m-btn-flex); }
.lm-modal__footer--split { justify-content: space-between; }

/* ===== Notification.css ===== */
/* ==========================================================================
   Notification — iOS banner (UNNotification style). Created by Lumen.notification()
   Mobile: top, full width · Tablet/Desktop: top-right 360px stack
   ========================================================================== */
.lm-notification-host {
  position: fixed; z-index: var(--z-toast);
  top: 0; left: 0; right: 0;
  display: flex; flex-direction: column; gap: var(--space-8);
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--space-8));
  padding-left: max(var(--screen-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--screen-margin), env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.lm-notification-host--bottom-right {
  top: auto; bottom: 0;
  justify-content: flex-end;
  padding-top: 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--space-8));
}
@media (min-width: 768px) {
  .lm-notification-host:not(.lm-notification-host--top) {
    left: auto;
    width: min(100%, calc(360px + 2 * var(--screen-margin)));
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--screen-margin));
  }
  .lm-notification-host--bottom-right { padding-top: 0; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--screen-margin)); }
  .lm-notification-host--top { align-items: center; }
  .lm-notification-host--top .lm-notification { max-width: 420px; }
}

.lm-notification {
  --notif-tone: var(--accent);
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-12);
  width: 100%;
  padding: var(--space-12) var(--space-14);
  border-radius: var(--radius-20);
  background: var(--material-regular);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  box-shadow: var(--shadow-modal);
  color: var(--label);
  overflow: hidden;
  pointer-events: auto;
  touch-action: none;
  animation: lm-notif-in var(--duration-slow) var(--ease-spring) both;
}
.lm-notification--success { --notif-tone: var(--success); }
.lm-notification--info { --notif-tone: var(--info); }
.lm-notification--warning { --notif-tone: var(--warning); }
.lm-notification--error { --notif-tone: var(--danger); }

.lm-notification__tile {
  display: grid; place-items: center; align-self: start;
  width: 38px; height: 38px;
  border-radius: var(--radius-8);
  background: var(--notif-tone); color: var(--on-accent);
  --lm-icon-size: 22px;
}
.lm-notification__tile img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.lm-notification__main { min-width: 0; }
.lm-notification__head { display: flex; align-items: baseline; gap: var(--space-8); }
.lm-notification__title {
  flex: 1 1 auto; min-width: 0; margin: 0;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); font-weight: var(--fw-semibold);
}
.lm-notification__time {
  flex: none;
  font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); letter-spacing: var(--ls-caption-1);
  color: var(--label-secondary);
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.lm-notification__body {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label);
  overflow-wrap: anywhere;
}
.lm-notification__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-10); }
.lm-notification__close {
  position: absolute; top: var(--space-10); right: var(--space-10);
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--fill-secondary); color: var(--label-secondary); cursor: pointer;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
  --lm-icon-size: 12px;
}
.lm-notification__close:focus-visible,
.lm-notification:focus-within .lm-notification__close { opacity: 1; }
.lm-notification:focus-within .lm-notification__time { opacity: 0; }
@media (hover: hover) {
  .lm-notification:hover .lm-notification__close { opacity: 1; }
  .lm-notification:hover .lm-notification__time { opacity: 0; }
}
.lm-notification__progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--notif-tone);
  transform-origin: left center;
  animation: lm-notif-progress var(--lm-duration, 4500ms) linear forwards;
}
.lm-notification:hover .lm-notification__progress, .lm-notification:focus-within .lm-notification__progress { animation-play-state: paused; }
.lm-notification.is-dragging { animation: none; transition: none; }
.lm-notification.is-leaving { animation: lm-notif-out var(--duration-base) var(--ease-in) both; }
.lm-notification--static { animation: none; }
.lm-notification--static .lm-notification__progress { animation: none; transform: scaleX(0.6); }

.lm-notification-host--bottom-right .lm-notification { animation-name: lm-notif-in-bottom; }
@media (min-width: 768px) {
  .lm-notification-host:not(.lm-notification-host--top) .lm-notification { animation-name: lm-notif-in-side; }
}
@keyframes lm-notif-in { from { opacity: 0; transform: translate3d(0, -110%, 0); } to { opacity: 1; transform: none; } }
@keyframes lm-notif-in-bottom { from { opacity: 0; transform: translate3d(0, 110%, 0); } to { opacity: 1; transform: none; } }
@keyframes lm-notif-in-side { from { opacity: 0; transform: translate3d(110%, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes lm-notif-out { to { opacity: 0; transform: translate3d(0, -30%, 0) scale(0.96); } }
@keyframes lm-notif-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ===== Popconfirm.css ===== */
/* ==========================================================================
   Popconfirm — confirmation bubble (tablet/desktop) · action sheet (mobile)
   <div class="lm-anchor lm-popconfirm"> trigger[data-lm-toggle] · .lm-floating > .lm-popconfirm__bubble </div>
   ========================================================================== */
.lm-popconfirm__bubble {
  position: relative;
  width: max-content; min-width: 240px;
  max-width: min(320px, calc(100vw - 2 * var(--screen-margin)));
  padding: var(--space-12);
  border-radius: var(--radius-12);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-popover);
  color: var(--label);
}
.lm-popconfirm__bubble::before {
  content: ""; position: absolute;
  width: 12px; height: 12px;
  background: inherit; border-radius: 2px;
  top: -5px; left: var(--space-16);
  transform: rotate(45deg);
}
.lm-floating--bottom > .lm-popconfirm__bubble::before { left: 50%; margin-left: -6px; }
.lm-floating--bottom-end > .lm-popconfirm__bubble::before { left: auto; right: var(--space-16); }
.lm-floating--top > .lm-popconfirm__bubble::before,
.lm-floating--top-start > .lm-popconfirm__bubble::before,
.lm-floating--top-end > .lm-popconfirm__bubble::before { top: auto; bottom: -5px; }
.lm-floating--top > .lm-popconfirm__bubble::before { left: 50%; margin-left: -6px; }
.lm-floating--top-end > .lm-popconfirm__bubble::before { left: auto; right: var(--space-16); }
.lm-floating--left > .lm-popconfirm__bubble::before { top: 50%; left: auto; right: -5px; margin-top: -6px; }
.lm-floating--right > .lm-popconfirm__bubble::before { top: 50%; left: -5px; margin-top: -6px; }
.lm-floating--static > .lm-popconfirm__bubble::before { display: none; }

.lm-popconfirm__body { position: relative; display: flex; align-items: flex-start; gap: var(--space-10); }
.lm-popconfirm__icon { flex: none; margin-top: -1px; color: var(--warning-text); --lm-icon-size: 20px; }
.lm-popconfirm--danger .lm-popconfirm__icon { color: var(--danger-text); }
.lm-popconfirm__text { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.lm-popconfirm__title { margin: 0; font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); font-weight: var(--fw-semibold); }
.lm-popconfirm__desc { margin: 0; font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
.lm-popconfirm__actions { position: relative; display: flex; justify-content: flex-end; gap: var(--space-8); margin-top: var(--space-12); }

/* ---------- Sheet mode (action sheet) — forced ---------- */
.lm-popconfirm--sheet::before {
  content: ""; position: fixed; inset: 0; z-index: var(--z-overlay);
  background: var(--overlay); opacity: 0; visibility: hidden;
  transition: opacity var(--duration-base) var(--ease-standard), visibility 0s linear var(--duration-base);
}
.lm-popconfirm--sheet.is-open::before { opacity: 1; visibility: visible; transition: opacity var(--duration-base) var(--ease-standard), visibility 0s; }
.lm-popconfirm--sheet > .lm-floating {
  position: fixed; z-index: calc(var(--z-overlay) + 1);
  top: auto; left: 0; right: 0; bottom: 0; translate: none; min-width: 0;
  padding: 0 max(var(--space-8), env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + var(--space-8)) max(var(--space-8), env(safe-area-inset-left, 0px));
  transform: translate3d(0, 110%, 0); transform-origin: bottom center;
}
.lm-popconfirm--sheet .lm-popconfirm__bubble { width: 100%; max-width: 560px; min-width: 0; margin: 0 auto; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
.lm-popconfirm--sheet .lm-popconfirm__bubble::before { display: none; }
.lm-popconfirm--sheet .lm-popconfirm__body {
  flex-direction: column; align-items: center; gap: var(--space-2); text-align: center;
  padding: var(--space-14) var(--space-16);
  border-radius: var(--radius-14) var(--radius-14) 0 0;
  background: var(--material-thick);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
}
.lm-popconfirm--sheet .lm-popconfirm__icon { display: none; }
.lm-popconfirm--sheet .lm-popconfirm__title { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
.lm-popconfirm--sheet .lm-popconfirm__actions { flex-direction: column-reverse; gap: var(--space-8); margin: 0; }
.lm-popconfirm--sheet .lm-popconfirm__actions > .lm-btn {
  width: 100%; height: 56px; border-radius: var(--radius-14);
  background: var(--bg-elevated); color: var(--btn-tone);
  font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); font-weight: var(--fw-semibold);
}
.lm-popconfirm--sheet .lm-popconfirm__actions > .lm-btn:last-child {
  border-radius: 0 0 var(--radius-14) var(--radius-14);
  border-top: var(--hairline) solid var(--separator);
  background: var(--material-thick); font-weight: var(--fw-regular);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
}
.lm-popconfirm--sheet .lm-floating--static { position: static; transform: none; padding: 0; }
.lm-popconfirm--sheet:has(.lm-floating--static)::before { display: none; }

/* ---------- Sheet mode — automatic below 768px (unless --bubble) ---------- */
@media (max-width: 767.98px) {
  .lm-popconfirm:not(.lm-popconfirm--bubble)::before {
    content: ""; position: fixed; inset: 0; z-index: var(--z-overlay);
    background: var(--overlay); opacity: 0; visibility: hidden;
    transition: opacity var(--duration-base) var(--ease-standard), visibility 0s linear var(--duration-base);
  }
  .lm-popconfirm:not(.lm-popconfirm--bubble).is-open::before { opacity: 1; visibility: visible; transition: opacity var(--duration-base) var(--ease-standard), visibility 0s; }
  .lm-popconfirm:not(.lm-popconfirm--bubble) > .lm-floating {
    position: fixed; z-index: calc(var(--z-overlay) + 1);
    top: auto; left: 0; right: 0; bottom: 0; translate: none; min-width: 0;
    padding: 0 max(var(--space-8), env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + var(--space-8)) max(var(--space-8), env(safe-area-inset-left, 0px));
    transform: translate3d(0, 110%, 0); transform-origin: bottom center;
  }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-popconfirm__bubble { width: 100%; max-width: 560px; min-width: 0; margin: 0 auto; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-popconfirm__bubble::before { display: none; }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-popconfirm__body {
    flex-direction: column; align-items: center; gap: var(--space-2); text-align: center;
    padding: var(--space-14) var(--space-16);
    border-radius: var(--radius-14) var(--radius-14) 0 0;
    background: var(--material-thick);
    -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-popconfirm__icon { display: none; }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-popconfirm__title { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-popconfirm__actions { flex-direction: column-reverse; gap: var(--space-8); margin: 0; }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-popconfirm__actions > .lm-btn {
    width: 100%; height: 56px; border-radius: var(--radius-14);
    background: var(--bg-elevated); color: var(--btn-tone);
    font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); font-weight: var(--fw-semibold);
  }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-popconfirm__actions > .lm-btn:last-child {
    border-radius: 0 0 var(--radius-14) var(--radius-14);
    border-top: var(--hairline) solid var(--separator);
    background: var(--material-thick); font-weight: var(--fw-regular);
    -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate)); backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  }
  .lm-popconfirm:not(.lm-popconfirm--bubble) .lm-floating--static { position: static; transform: none; padding: 0; }
  .lm-popconfirm:not(.lm-popconfirm--bubble):has(.lm-floating--static)::before { display: none; }
}

/* ===== Progress.css ===== */
/* ==========================================================================
   Progress — UIProgressView (line), circle/dashboard, steps, activity rings
   Value via CSS var --value (0–100) + aria-valuenow. Lumen.progress(el, v) keeps both in sync.
   ========================================================================== */
.lm-progress {
  --value: 0;
  --progress-tone: var(--accent);
  --progress-h: 4px;
  display: flex; align-items: center; gap: var(--space-10);
  width: 100%; min-width: 0;
}
.lm-progress__track {
  position: relative; flex: 1 1 auto; min-width: 0;
  height: var(--progress-h);
  border-radius: var(--radius-full);
  background: var(--fill);
  overflow: hidden;
}
.lm-progress__bar {
  position: absolute; inset: 0 auto 0 0;
  width: calc(var(--value) * 1%);
  border-radius: inherit;
  background: var(--progress-tone);
  transition: width var(--duration-base) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.lm-progress__buffer { position: absolute; inset: 0 auto 0 0; width: calc(var(--buffer, 0) * 1%); border-radius: inherit; background: var(--fill-secondary); }
.lm-progress__label {
  flex: none; min-width: 3.5ch; text-align: right;
  display: inline-flex; align-items: center; justify-content: flex-end;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  color: var(--label-secondary);
  font-variant-numeric: tabular-nums;
  --lm-icon-size: 18px;
}
/* stacked label (title above + value) */
.lm-progress--stacked { flex-wrap: wrap; row-gap: var(--space-6); }
.lm-progress__caption { flex: 1 0 100%; display: flex; justify-content: space-between; gap: var(--space-8); font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
.lm-progress__caption > span:last-child { color: var(--label-secondary); font-variant-numeric: tabular-nums; }

/* sizes */
.lm-progress--sm { --progress-h: 2px; }
.lm-progress--lg { --progress-h: 8px; }
/* status */
.lm-progress--success { --progress-tone: var(--success); }
.lm-progress--success .lm-progress__label { color: var(--success-text); }
.lm-progress--exception { --progress-tone: var(--danger); }
.lm-progress--exception .lm-progress__label { color: var(--danger-text); }
.lm-progress--gradient .lm-progress__bar { background: linear-gradient(90deg, var(--teal), var(--accent)); }
/* active shimmer */
.lm-progress--active .lm-progress__bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--material-thin), transparent);
  transform: translateX(-100%);
  animation: lm-progress-shimmer 1.6s var(--ease-standard) infinite;
}
@keyframes lm-progress-shimmer { to { transform: translateX(100%); } }
/* indeterminate */
.lm-progress--indeterminate .lm-progress__bar { width: 35%; animation: lm-progress-indeterminate 1.2s var(--ease-standard) infinite; }
@keyframes lm-progress-indeterminate { from { left: -35%; } to { left: 100%; } }

/* steps */
.lm-progress__steps { display: flex; gap: var(--space-4); flex: 1 1 auto; min-width: 0; }
.lm-progress__step { flex: 1 1 0; height: var(--progress-h); border-radius: var(--radius-full); background: var(--fill); }
.lm-progress__step.is-done { background: var(--progress-tone); }

/* ---------- Circle / dashboard ---------- */
.lm-progress-circle {
  --value: 0;
  --progress-tone: var(--accent);
  --size: 120px;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--size); height: var(--size);
}
.lm-progress-circle > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.lm-progress-circle__track, .lm-progress-circle__bar { fill: none; stroke-width: var(--stroke, 8); stroke-linecap: round; }
.lm-progress-circle__track { stroke: var(--fill); }
.lm-progress-circle__bar {
  stroke: var(--progress-tone);
  stroke-dasharray: var(--value) 100;
  transition: stroke-dasharray var(--duration-slow) var(--ease-standard), stroke var(--duration-fast) var(--ease-standard);
}
.lm-progress-circle__label {
  position: relative; display: flex; flex-direction: column; align-items: center;
  font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  --lm-icon-size: 36px;
}
.lm-progress-circle__sub { font-size: var(--fs-caption-1); line-height: var(--lh-caption-1); font-weight: var(--fw-regular); color: var(--label-secondary); }
.lm-progress-circle--sm { --size: 64px; --stroke: 10; }
.lm-progress-circle--sm .lm-progress-circle__label { font-size: var(--fs-footnote); line-height: var(--lh-footnote); --lm-icon-size: 22px; }
.lm-progress-circle--lg { --size: 160px; }
.lm-progress-circle--lg .lm-progress-circle__label { font-size: var(--fs-title-1); line-height: var(--lh-title-1); }
.lm-progress-circle--success { --progress-tone: var(--success); }
.lm-progress-circle--success .lm-progress-circle__label { color: var(--success-text); }
.lm-progress-circle--exception { --progress-tone: var(--danger); }
.lm-progress-circle--exception .lm-progress-circle__label { color: var(--danger-text); }
/* dashboard: 270° arc open at the bottom */
.lm-progress-circle--dashboard > svg { transform: rotate(135deg); }
.lm-progress-circle--dashboard .lm-progress-circle__track { stroke-dasharray: 75 100; }
.lm-progress-circle--dashboard .lm-progress-circle__bar { stroke-dasharray: calc(var(--value) * 0.75) 100; }

/* ---------- Activity rings (three concentric circles) ---------- */
.lm-progress-rings { --size: 120px; position: relative; display: inline-block; flex: none; width: var(--size); height: var(--size); }
.lm-progress-rings > svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.lm-progress-rings circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.lm-progress-rings__track { opacity: 0.22; }
.lm-progress-rings__ring { stroke-dasharray: var(--value, 0) 100; transition: stroke-dasharray var(--duration-slow) var(--ease-standard); }
.lm-progress-rings .is-move { stroke: var(--pink); }
.lm-progress-rings .is-exercise { stroke: var(--green); }
.lm-progress-rings .is-stand { stroke: var(--cyan); }

/* ===== Result.css ===== */
/* ==========================================================================
   Result — full-state screen (success, error, 404…)
   ========================================================================== */
.lm-result {
  --result-tone: var(--accent);
  --result-soft: var(--accent-soft);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-8);
  width: 100%;
  padding: var(--space-40) var(--screen-margin);
  text-align: center;
  color: var(--label);
}
.lm-result__icon {
  display: grid; place-items: center;
  width: 72px; height: 72px; margin-bottom: var(--space-8);
  border-radius: var(--radius-full);
  background: var(--result-soft); color: var(--result-tone);
  --lm-icon-size: 36px;
}
.lm-result__icon .lm-icon > svg { stroke-width: 2.2; }
.lm-result__code {
  margin: 0 0 var(--space-4);
  font-family: var(--font-rounded);
  font-size: calc(var(--fs-large-title) * 2); line-height: 1; font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  color: var(--label-tertiary);
  font-variant-numeric: tabular-nums;
}
.lm-result__title {
  margin: 0; max-width: 32ch;
  font-size: var(--fs-title-2); line-height: var(--lh-title-2); letter-spacing: var(--ls-title-2); font-weight: var(--fw-bold);
  text-wrap: balance;
}
.lm-result__subtitle {
  margin: 0; max-width: 48ch;
  font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline);
  color: var(--label-secondary);
  text-wrap: pretty;
}
.lm-result__extra {
  display: flex; flex-direction: column; align-items: stretch; gap: var(--space-8);
  width: 100%; max-width: 360px; margin-top: var(--space-16);
}
.lm-result__content {
  width: 100%; max-width: 560px; margin-top: var(--space-16);
  text-align: left;
}
/* status */
.lm-result--success { --result-tone: var(--success-text); --result-soft: var(--success-soft); }
.lm-result--info { --result-tone: var(--accent); --result-soft: var(--info-soft); }
.lm-result--warning { --result-tone: var(--warning-text); --result-soft: var(--warning-soft); }
.lm-result--error { --result-tone: var(--danger-text); --result-soft: var(--danger-soft); }
.lm-result--neutral { --result-tone: var(--label-secondary); --result-soft: var(--fill-tertiary); }
/* compact (inside a card / sheet) */
.lm-result--compact { padding: var(--space-24) var(--card-padding); }
.lm-result--compact .lm-result__icon { width: 56px; height: 56px; --lm-icon-size: 28px; }
.lm-result--compact .lm-result__title { font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); }

@media (min-width: 768px) {
  .lm-result { padding-block: var(--space-64); }
  .lm-result__extra { flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: none; width: auto; }
  .lm-result__extra > .lm-btn { flex: none; }
}

/* ===== Skeleton.css ===== */
/* ==========================================================================
   Skeleton — loading placeholders (redacted look, iOS .redacted(reason: .placeholder))
   ========================================================================== */
.lm-skeleton { display: flex; align-items: flex-start; gap: var(--space-12); width: 100%; min-width: 0; }
.lm-skeleton__content { display: flex; flex-direction: column; gap: var(--space-10); flex: 1 1 auto; min-width: 0; padding-top: var(--space-2); }
.lm-skeleton__avatar, .lm-skeleton__title, .lm-skeleton__line,
.lm-skeleton__button, .lm-skeleton__input, .lm-skeleton__image, .lm-skeleton__block {
  position: relative; overflow: hidden; flex: none;
  background: var(--skeleton);
  border-radius: var(--radius-6);
}
.lm-skeleton__avatar { width: var(--avatar-md); height: var(--avatar-md); border-radius: var(--radius-full); }
.lm-skeleton__avatar--sm { width: var(--avatar-sm); height: var(--avatar-sm); }
.lm-skeleton__avatar--lg { width: var(--avatar-lg); height: var(--avatar-lg); }
.lm-skeleton__avatar--square { border-radius: var(--radius-8); }
.lm-skeleton__title { width: 42%; height: 16px; }
.lm-skeleton__line { width: 100%; height: 12px; }
.lm-skeleton__paragraph { display: flex; flex-direction: column; gap: var(--space-8); }
.lm-skeleton__paragraph > .lm-skeleton__line:last-child:not(:only-child) { width: 60%; }
.lm-skeleton__button { width: 96px; height: var(--control-md); border-radius: var(--radius-10); }
.lm-skeleton__button--sm { width: 64px; height: var(--control-sm); border-radius: var(--radius-8); }
.lm-skeleton__button--block { width: 100%; }
.lm-skeleton__input { width: 100%; height: var(--control-md); border-radius: var(--radius-10); }
.lm-skeleton__image {
  display: grid; place-items: center;
  width: 96px; height: 96px; border-radius: var(--radius-12);
  color: var(--label-tertiary); --lm-icon-size: 32px;
}
.lm-skeleton__image--wide { width: 100%; height: auto; aspect-ratio: 16 / 9; max-width: 100%; }
.lm-skeleton__block { width: 100%; height: 100%; }
/* round lines (Ant round) */
.lm-skeleton--round .lm-skeleton__title, .lm-skeleton--round .lm-skeleton__line, .lm-skeleton--round .lm-skeleton__button { border-radius: var(--radius-full); }

/* active shimmer */
.lm-skeleton--active .lm-skeleton__avatar::after, .lm-skeleton--active .lm-skeleton__title::after,
.lm-skeleton--active .lm-skeleton__line::after, .lm-skeleton--active .lm-skeleton__button::after,
.lm-skeleton--active .lm-skeleton__input::after, .lm-skeleton--active .lm-skeleton__image::after,
.lm-skeleton--active .lm-skeleton__block::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--material-thin) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: lm-skeleton-shimmer 1.4s var(--ease-standard) infinite;
}
@keyframes lm-skeleton-shimmer { to { transform: translateX(100%); } }

/* Composites */
.lm-skeleton-list { list-style: none; margin: 0; padding: 0; border-radius: var(--radius-12); background: var(--bg-grouped-secondary); overflow: hidden; }
.lm-skeleton-list > li { display: flex; align-items: center; gap: var(--space-12); min-height: 60px; padding: var(--space-10) var(--space-16); }
.lm-skeleton-list > li + li { box-shadow: inset 72px 0 0 var(--bg-grouped-secondary), inset 0 var(--hairline) 0 var(--separator); }
.lm-skeleton-card { display: flex; flex-direction: column; gap: var(--space-12); padding: var(--card-padding); border-radius: var(--radius-12); background: var(--bg-grouped-secondary); }

/* ===== Spin.css ===== */
/* ==========================================================================
   Spin — UIActivityIndicatorView (uses .lm-spinner from foundation)
   ========================================================================== */
.lm-spin {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-8);
  color: var(--label-secondary);
}
.lm-spin__tip { font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); color: var(--label-secondary); }
.lm-spin--inline { flex-direction: row; gap: var(--space-8); }

/* Container: wraps content, shows a spinner over it while loading */
.lm-spin-container { position: relative; min-width: 0; }
.lm-spin-container__content { transition: opacity var(--duration-base) var(--ease-standard), filter var(--duration-base) var(--ease-standard); }
.lm-spin-container__mask {
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard), visibility 0s linear var(--duration-base);
}
.lm-spin-container.is-loading > .lm-spin-container__content { opacity: 0.45; filter: blur(1.5px); pointer-events: none; user-select: none; }
.lm-spin-container.is-loading > .lm-spin-container__mask { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity var(--duration-base) var(--ease-standard), visibility 0s; }
/* Ant delay: avoid flashing for fast loads */
.lm-spin-container--delay.is-loading > .lm-spin-container__mask,
.lm-spin-container--delay.is-loading > .lm-spin-container__content { transition-delay: 300ms; }

/* Fullscreen loading HUD (Ant Spin fullscreen) */
.lm-spin-fullscreen { align-items: center; justify-content: center; z-index: calc(var(--z-toast) - 1); }
.lm-spin-fullscreen.is-open > .lm-overlay { opacity: 0.5; }
.lm-spin-hud {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-12);
  width: 120px; min-height: 120px; padding: var(--space-16);
  border-radius: var(--radius-14);
  background: var(--material-regular);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-lg)) saturate(var(--saturate));
  box-shadow: var(--shadow-modal);
  color: var(--label); text-align: center;
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote); font-weight: var(--fw-semibold);
  opacity: 0; transform: scale(0.9);
  transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-base) var(--ease-spring);
}
.lm-spin-fullscreen.is-open > .lm-spin-hud, .lm-spin-fullscreen.lm-layer--inline > .lm-spin-hud { opacity: 1; transform: none; }
.lm-spin-hud .lm-spinner { --lm-spinner-size: 37px; --lm-spinner-color: var(--label-secondary); }

/* ===== Watermark.css ===== */
/* ==========================================================================
   Watermark — repeated rotated text over a region. Image built by Lumen.watermark()
   ========================================================================== */
.lm-watermark { position: relative; isolation: isolate; min-width: 0; }
.lm-watermark::after {
  content: "";
  position: absolute; inset: 0; z-index: 9;
  pointer-events: none;
  background-image: var(--lm-watermark-image, none);
  background-repeat: repeat;
  background-size: var(--lm-watermark-size, auto);
  background-position: var(--lm-watermark-offset, 0 0);
}
/* Cover the viewport (e.g. confidential screens) */
.lm-watermark--fullscreen::after { position: fixed; z-index: var(--z-tooltip); }

/* ===== Affix.css ===== */
/* ==========================================================================
   Affix — sticky top/bottom with safe-area; gains bar material when stuck
   Offsets: --lm-affix-top · --lm-affix-bottom · JS adds .is-stuck
   ========================================================================== */
.lm-affix {
  --lm-affix-top: 0px;
  --lm-affix-bottom: 0px;
  position: sticky;
  top: calc(var(--lm-affix-top) + env(safe-area-inset-top, 0px));
  z-index: var(--z-sticky);
  transition: background-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.lm-affix--bottom { top: auto; bottom: calc(var(--lm-affix-bottom) + env(safe-area-inset-bottom, 0px)); }
.lm-affix.is-stuck {
  background: var(--material-bar);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  backdrop-filter: blur(var(--blur-md)) saturate(var(--saturate));
  box-shadow: 0 var(--hairline) 0 var(--separator);
}
.lm-affix--bottom.is-stuck { box-shadow: 0 calc(-1 * var(--hairline)) 0 var(--separator); }
/* Full-bleed bar: cancels the page gutter so the material reaches the screen edges */
.lm-affix--bleed { margin-inline: calc(-1 * var(--screen-margin)); padding-inline: var(--screen-margin); }
.lm-affix--bar { display: flex; align-items: center; gap: var(--space-8); min-height: var(--toolbar-height); padding-block: var(--space-8); }
.lm-affix__sentinel { display: block; height: 1px; margin-bottom: -1px; visibility: hidden; pointer-events: none; }
.lm-affix--bottom + .lm-affix__sentinel { margin-bottom: 0; margin-top: -1px; }

/* ===== BorderBeam.css ===== */
/* ==========================================================================
   BorderBeam — decorative light beam travelling along a container border
   <article class="lm-card lm-border-beam-host"><span class="lm-border-beam" aria-hidden="true"></span>…</article>
   Vars: --lm-beam-color · --lm-beam-size (border width) · --lm-beam-length (arc) · --lm-beam-duration
   ========================================================================== */
@property --lm-beam-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.lm-border-beam-host { position: relative; isolation: isolate; }
.lm-border-beam {
  --lm-beam-color: var(--accent);
  --lm-beam-size: 1.5px;
  --lm-beam-length: 90deg;
  --lm-beam-duration: 6s;
  position: absolute; inset: 0; z-index: 1;
  border-radius: inherit;
  padding: var(--lm-beam-size);
  pointer-events: none;
  background: conic-gradient(from var(--lm-beam-angle), transparent 0deg, transparent calc(360deg - var(--lm-beam-length)), var(--lm-beam-color) 358deg, transparent 360deg);
  -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-clip: content-box, border-box;
  -webkit-mask-composite: xor;
  mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-clip: content-box, border-box;
  mask-composite: exclude;
  animation: lm-beam-spin var(--lm-beam-duration) linear infinite;
}
.lm-border-beam--dual::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: inherit;
  background: conic-gradient(from calc(var(--lm-beam-angle) + 180deg), transparent 0deg, transparent calc(360deg - var(--lm-beam-length)), var(--lm-beam-color-2, var(--lm-beam-color)) 358deg, transparent 360deg);
  -webkit-mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  -webkit-mask-clip: content-box, border-box;
  -webkit-mask-composite: xor;
  mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-clip: content-box, border-box;
  mask-composite: exclude;
  animation: inherit; /* --lm-beam-angle does not inherit, so the pseudo runs its own spin */
}
@keyframes lm-beam-spin { to { --lm-beam-angle: 360deg; } }

/* Colors */
.lm-border-beam--purple { --lm-beam-color: var(--purple); }
.lm-border-beam--pink { --lm-beam-color: var(--pink); }
.lm-border-beam--green { --lm-beam-color: var(--green); }
.lm-border-beam--orange { --lm-beam-color: var(--orange); }
.lm-border-beam--teal { --lm-beam-color: var(--teal); }
.lm-border-beam--ai { --lm-beam-color: var(--purple); --lm-beam-color-2: var(--accent); }
/* Speed & size */
.lm-border-beam--fast { --lm-beam-duration: 3s; }
.lm-border-beam--slow { --lm-beam-duration: 12s; }
.lm-border-beam--thick { --lm-beam-size: 2.5px; }
.lm-border-beam--long { --lm-beam-length: 160deg; }
/* Static (paused) — also applied for reduced motion */
.lm-border-beam--static { animation: none; --lm-beam-angle: 40deg; }
@media (prefers-reduced-motion: reduce) {
  .lm-border-beam { animation: none; --lm-beam-angle: 40deg; }
}

/* ===== ConfigProvider.css ===== */
/* ==========================================================================
   ConfigProvider — theme scope, accent override, density, direction
   Theme: data-theme="light|dark|light-hc|dark-hc" on any element (tokens.css)
   ========================================================================== */
/* A subtree with its own theme must repaint its surface */
.lm-config { background: var(--bg-grouped); color: var(--label); }

/* Accent override — re-derives every token that follows the accent */
.lm-accent {
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --link: var(--accent);
  --focus-ring: var(--accent);
  --info: var(--accent);
  --info-soft: var(--accent-soft);
}
.lm-accent--blue { --accent: var(--blue); }
.lm-accent--indigo { --accent: var(--indigo); }
.lm-accent--purple { --accent: var(--purple); }
.lm-accent--pink { --accent: var(--pink); }
.lm-accent--red { --accent: var(--red); }
.lm-accent--orange { --accent: var(--orange); }
.lm-accent--green { --accent: var(--green); }
.lm-accent--teal { --accent: var(--teal); }
.lm-accent--mint { --accent: var(--mint); }
.lm-accent--cyan { --accent: var(--cyan); }
.lm-accent--brown { --accent: var(--brown); }
.lm-accent--gray { --accent: var(--gray); }

/* Density — compact (desktop data-heavy screens, Ant componentSize="small") */
.lm-compact {
  --control-sm: 28px;
  --control-md: 36px;
  --control-lg: 44px;
  --row-height: 36px;
  --hit-target: 36px;
  --segmented-height: 28px;
  --search-height: 32px;
  --navbar-height: 40px;
}
.lm-compact .lm-option { min-height: 36px; padding-block: var(--space-6); }
.lm-compact .lm-btn { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }
.lm-compact .lm-control { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); letter-spacing: var(--ls-subheadline); }

/* Direction — mirror directional glyphs in RTL */
[dir="rtl"] .lm-icon:is([data-icon="chevron-right"], [data-icon="chevron-left"], [data-icon="arrow-left"], [data-icon="arrow-right"], [data-icon="arrow-up-right"]) { transform: scaleX(-1); }

/* Swatch button used by theme pickers */
.lm-config-swatch {
  width: var(--control-sm); height: var(--control-sm); padding: 0;
  border: 0; border-radius: var(--radius-full);
  background: var(--lm-swatch, var(--accent));
  box-shadow: inset 0 0 0 1px var(--separator);
  cursor: pointer;
}
.lm-config-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg-grouped), 0 0 0 4px var(--lm-swatch, var(--accent)); }
.lm-config-swatch:active { opacity: var(--opacity-pressed); }

/* ===== Util.css ===== */
/* ==========================================================================
   Util — breakpoint indicator (other utilities live in foundation §8)
   ========================================================================== */
.lm-bp-indicator {
  display: inline-flex; align-items: center; gap: var(--space-6);
  min-height: 28px; padding: 0 var(--space-12);
  border-radius: var(--radius-full);
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-footnote); line-height: var(--lh-footnote); letter-spacing: var(--ls-footnote);
  font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lm-bp-indicator::before { content: "Mobile · < 768px"; }
@media (min-width: 768px) { .lm-bp-indicator::before { content: "Tablet · 768–1199px"; } }
@media (min-width: 1200px) { .lm-bp-indicator::before { content: "Desktop · ≥ 1200px"; } }

/* ===== LiquidGlass.css ===== */
/* ==========================================================================
   Liquid Glass — kiểu thứ hai (iOS 26 / iPadOS 26 / macOS 26)
   Bật cho cả app: <html data-style="glass">  · hoặc cho một vùng: <div data-style="glass">
   Lớp 0 Nội dung (bảng, form, card, list) ......... nền ĐẶC — không bao giờ là kính
   Lớp 1 Khung điều hướng (navbar, tab bar, sidebar, toolbar, nút, segmented) ... kính thường
   Lớp 2 Popup nhỏ (dropdown, select, popover, notification, message) ........... kính ĐẬM
   Lớp 3 Popup lớn (modal, drawer có dữ liệu) ...... thân ĐẶC, chỉ nút đóng là kính
   Quy tắc: không chồng kính lên kính · tối đa 2 lớp nổi · kính chỉ cho bề mặt nhỏ.
   Giảm trong suốt: tự động theo hệ điều hành, hoặc data-transparency="reduced" | "tinted".
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Vật liệu & biến kiểu
   -------------------------------------------------------------------------- */
[data-style="glass"] {
  --g-fill: var(--glass-fill);
  --g-fill-thick: var(--glass-fill-thick);
  --g-fill-clear: var(--glass-fill-clear);
  --g-filter: blur(var(--blur-glass)) saturate(var(--saturate));
  --g-gloss: linear-gradient(180deg, color-mix(in srgb, var(--glass-highlight) 38%, transparent) 0%, transparent 52%);
  --g-edge: inset 0 0 0 1px var(--glass-rim), inset 0 1px 0 var(--glass-highlight), inset 0 -1px 0 var(--glass-shade);
  --g-radius-group: var(--radius-24);
  --g-radius-popup: var(--radius-20);
  --g-radius-sheet: var(--radius-32);
  --g-radius-control: var(--radius-12);
  --g-inset: var(--space-8);
}
@media (min-width: 768px) {
  [data-style="glass"] { --g-radius-group: var(--radius-20); --g-radius-sheet: var(--radius-24); }
}
@media (min-width: 1200px) {
  [data-style="glass"] { --g-radius-group: var(--radius-16); --g-radius-popup: var(--radius-16); --g-radius-sheet: var(--radius-20); --g-radius-control: var(--radius-10); }
}
/* Desktop dùng chuột: mật độ kiểu macOS (vùng chạm 44 chỉ cần cho cảm ứng) */
@media (min-width: 1200px) and (pointer: fine) {
  [data-style="glass"] {
    --control-sm: 28px; --control-md: 36px; --control-lg: 44px;
    --row-height: 36px; --segmented-height: 28px; --search-height: 32px;
  }
}
/* Giảm trong suốt — theo hệ điều hành hoặc do người dùng chọn */
@media (prefers-reduced-transparency: reduce) {
  [data-style="glass"] { --g-fill: var(--bg-elevated); --g-fill-thick: var(--bg-elevated); --g-fill-clear: var(--bg-elevated); --g-filter: none; --g-gloss: none; }
}
[data-style="glass"][data-transparency="reduced"], [data-transparency="reduced"] [data-style="glass"], [data-style="glass"] [data-transparency="reduced"] {
  --g-fill: var(--bg-elevated); --g-fill-thick: var(--bg-elevated); --g-fill-clear: var(--bg-elevated); --g-filter: none; --g-gloss: none;
}
[data-style="glass"][data-transparency="tinted"], [data-transparency="tinted"] [data-style="glass"], [data-style="glass"] [data-transparency="tinted"] {
  --g-fill: var(--glass-fill-thick); --g-fill-clear: var(--glass-fill);
}

/* Lớp vật liệu dùng trực tiếp (hoạt động cả khi không bật data-style) */
.lm-glass, .lm-glass--thick, .lm-glass--clear, .lm-glass--tinted {
  background-color: var(--g-fill, var(--glass-fill));
  background-image: var(--g-gloss, none);
  -webkit-backdrop-filter: var(--g-filter, blur(var(--blur-glass)) saturate(var(--saturate)));
  backdrop-filter: var(--g-filter, blur(var(--blur-glass)) saturate(var(--saturate)));
  box-shadow: var(--g-edge, inset 0 0 0 1px var(--glass-rim)), var(--shadow-glass);
}
.lm-glass--thick { background-color: var(--g-fill-thick, var(--glass-fill-thick)); }
.lm-glass--clear { background-color: var(--g-fill-clear, var(--glass-fill-clear)); }
.lm-glass--tinted { background-color: color-mix(in srgb, var(--accent) 86%, transparent); color: var(--on-accent); }
/* Không chồng kính lên kính: kính nằm trong kính chuyển sang đậm */
.lm-glass .lm-glass, .lm-glass .lm-glass--clear { background-color: var(--g-fill-thick, var(--glass-fill-thick)); }

/* --------------------------------------------------------------------------
   LỚP 1 — Khung điều hướng: kính thường
   -------------------------------------------------------------------------- */
/* Navigation bar: không còn dải liền mép — nội dung cuộn dưới, mờ dần ở mép (scroll edge) */
[data-style="glass"] .lm-navbar:not(.lm-navbar--large),
[data-style="glass"] .lm-navbar--large > .lm-navbar__bar,
[data-style="glass"] .lm-navbar--large.is-scrolled > .lm-navbar__bar {
  background: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  isolation: isolate;
}
[data-style="glass"] .lm-navbar:not(.lm-navbar--large)::after,
[data-style="glass"] .lm-navbar--large > .lm-navbar__bar::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; bottom: calc(-1 * var(--space-16));
  pointer-events: none;
  background: linear-gradient(to bottom, var(--glass-edge) 0%, color-mix(in srgb, var(--glass-edge) 55%, transparent) 60%, transparent 100%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent);
  mask-image: linear-gradient(to bottom, #000 45%, transparent);
  opacity: 1; transition: opacity var(--duration-fast) var(--ease-standard);
}
[data-style="glass"] .lm-navbar--large:not(.is-scrolled) > .lm-navbar__bar::after { opacity: 0; }
[data-style="glass"] .lm-navbar--large > .lm-navbar__bar { position: sticky; }
/* Nút trên thanh → viên kính tròn / viên thuốc */
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing) > :is(.lm-btn, .lm-navbar__back) {
  height: 40px; min-width: 40px; margin: 0; padding: 0 var(--space-14);
  border-radius: var(--radius-full);
  color: var(--label); font-weight: var(--fw-medium);
  background-color: var(--g-fill); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-glass);
}
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing) > .lm-btn--icon,
[data-style="glass"] .lm-navbar__leading > .lm-navbar__back { width: 40px; padding: 0; justify-content: center; }
[data-style="glass"] .lm-navbar__back .lm-navbar__back-label { display: none; }
[data-style="glass"] .lm-navbar__back .lm-icon { --lm-icon-size: 22px; }
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing) > .lm-btn--filled,
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing) > .lm-navbar__done {
  background-color: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold);
}
/* Nhiều nút cạnh nhau → gom vào một viên kính */
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing):has(> .lm-btn + .lm-btn) {
  gap: 0; padding: 2px; border-radius: var(--radius-full);
  background-color: var(--g-fill); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-glass);
}
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing):has(> .lm-btn + .lm-btn) > .lm-btn {
  height: 36px; min-width: 36px; background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing):has(> .lm-btn + .lm-btn) > .lm-btn--icon { width: 36px; }
[data-style="glass"] .lm-navbar__search .lm-control { border-radius: var(--radius-full); }

/* Tab bar: viên kính nổi cách mép (mobile) */
[data-style="glass"] .lm-tabbar {
  bottom: calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
  gap: var(--space-2);
  margin: 0 max(var(--screen-margin), env(safe-area-inset-left, 0px)) calc(var(--space-12) + env(safe-area-inset-bottom, 0px)) max(var(--screen-margin), env(safe-area-inset-right, 0px));
  padding: var(--space-4);
  border-radius: var(--radius-full);
  background-color: var(--g-fill); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-glass);
}
[data-style="glass"] .lm-tabbar--fixed { left: 0; right: 0; }
[data-style="glass"] .lm-tabbar__item {
  height: 54px; padding: var(--space-4) var(--space-2) 0;
  border-radius: var(--radius-full); color: var(--label);
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
[data-style="glass"] .lm-tabbar__item .lm-icon { --lm-icon-size: 24px; }
[data-style="glass"] .lm-tabbar__item[aria-current="page"],
[data-style="glass"] .lm-tabbar__item[aria-selected="true"],
[data-style="glass"] .lm-tabbar__item.is-active { color: var(--accent); background: var(--fill-tertiary); }
[data-style="glass"] .lm-tabbar__badge { top: 2px; }
@media (min-width: 768px) {
  [data-style="glass"] .lm-tabbar { width: max-content; max-width: calc(100% - 2 * var(--screen-margin)); margin-inline: auto; align-self: center; }
  [data-style="glass"] .lm-tabbar__item { height: 44px; padding: 0 var(--space-16); flex: 0 0 auto; }
  [data-style="glass"] .lm-tabbar__badge { right: var(--space-4); }
}

/* Sidebar: panel kính nổi, cách mép cửa sổ (iPadOS/macOS 26) */
[data-style="glass"] .lm-sidebar {
  background-color: var(--g-fill); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-glass);
}
@media (min-width: 768px) {
  [data-style="glass"] .lm-layout:not(.lm-layout--mobile) > .lm-layout__sider {
    top: var(--g-inset); height: calc(100dvh - 2 * var(--g-inset));
    margin: var(--g-inset) 0 var(--g-inset) var(--g-inset);
    border-radius: var(--g-radius-group);
  }
}
[data-style="glass"] .lm-layout--split > .lm-layout__sider {
  top: var(--g-inset); height: calc(100dvh - 2 * var(--g-inset));
  margin: var(--g-inset) 0 var(--g-inset) var(--g-inset);
  border-radius: var(--g-radius-group);
}
[data-style="glass"] .lm-layout.lm-layout--contained > .lm-layout__sider { height: calc(100% - 2 * var(--g-inset)); }
[data-style="glass"] .lm-sidebar .lm-menu__item, [data-style="glass"] .lm-sidebar__item { border-radius: var(--radius-12); }

/* Toolbar: các nhóm nút thành viên kính nổi */
[data-style="glass"] .lm-toolbar {
  background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
[data-style="glass"] .lm-toolbar > .lm-btn,
[data-style="glass"] .lm-toolbar__group {
  border-radius: var(--radius-full);
  background-color: var(--g-fill); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-glass);
}
[data-style="glass"] .lm-toolbar__group { display: inline-flex; align-items: center; padding: 2px; }
[data-style="glass"] .lm-toolbar__group > .lm-btn { background: transparent; box-shadow: none; }

/* Nút */
[data-style="glass"] .lm-btn:not(.lm-btn--link) { border-radius: var(--radius-full); }
[data-style="glass"] .lm-btn--gray,
[data-style="glass"] .lm-btn--glass {
  background-color: var(--g-fill); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), 0 2px 10px var(--glass-shade);
}
[data-style="glass"] .lm-btn--filled { /* glassProminent */
  background-image: var(--g-gloss);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--glass-highlight) 30%, transparent), inset 0 1px 0 color-mix(in srgb, var(--glass-highlight) 55%, transparent), 0 4px 14px color-mix(in srgb, var(--btn-tone) 32%, transparent);
}
[data-style="glass"] .lm-btn--filled:disabled, [data-style="glass"] .lm-btn--filled.is-disabled { background-image: none; box-shadow: none; }
[data-style="glass"] .lm-btn-group > .lm-btn { border-radius: 0; }
[data-style="glass"] .lm-btn-group > .lm-btn:first-child { border-radius: var(--radius-full) 0 0 var(--radius-full); }
[data-style="glass"] .lm-btn-group > .lm-btn:last-child { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
[data-style="glass"] .lm-float-btn {
  background-image: var(--g-gloss);
  box-shadow: var(--g-edge), var(--shadow-glass);
}
[data-style="glass"] :is(.lm-float-btn--glass, .lm-float-btn--default) {
  background-color: var(--g-fill);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
}

/* Segmented: thumb kính dạng viên thuốc */
[data-style="glass"] .lm-segmented { border-radius: var(--radius-full); }
[data-style="glass"] .lm-segmented::before,
[data-style="glass"] .lm-segmented:not([data-lm-tabs]) .lm-segmented__item[aria-selected="true"] {
  border-radius: var(--radius-full);
  background-image: var(--g-gloss);
  box-shadow: inset 0 0 0 1px var(--glass-rim), var(--shadow-raised);
}
[data-style="glass"] .lm-segmented--vertical, [data-style="glass"] .lm-segmented--vertical::before { border-radius: var(--radius-16); }

/* Switch: núm dạng viên thuốc, phồng thành thấu kính khi nhấn */
[data-style="glass"] .lm-switch {
  --lm-sw-w: 62px; --lm-sw-h: 28px; --lm-sw-thumb-w: 38px;
  --lm-sw-travel: calc(var(--lm-sw-w) - var(--lm-sw-thumb-w) - 2 * var(--lm-sw-pad));
}
[data-style="glass"] .lm-switch--sm { --lm-sw-w: 48px; --lm-sw-h: 22px; --lm-sw-thumb-w: 29px; }
[data-style="glass"] .lm-switch::before {
  width: var(--lm-sw-thumb-w);
  transition: transform var(--duration-base) var(--ease-spring), background-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
[data-style="glass"] .lm-switch:active:not(:disabled)::before {
  width: var(--lm-sw-thumb-w);
  transform: scale(1.22);
  background-color: var(--g-fill-clear);
  -webkit-backdrop-filter: blur(2px) saturate(var(--saturate)); backdrop-filter: blur(2px) saturate(var(--saturate));
  box-shadow: inset 0 0 0 1px var(--glass-rim), inset 0 1px 0 var(--glass-highlight), var(--shadow-glass);
}
[data-style="glass"] .lm-switch:checked:active:not(:disabled)::before { transform: translateX(var(--lm-sw-travel)) scale(1.22); }

/* Slider: núm viên thuốc, thành thấu kính khi kéo */
[data-style="glass"] .lm-slider__input::-webkit-slider-thumb {
  width: 38px; height: 24px; margin-top: calc((var(--slider-track) - 24px) / 2);
  transition: transform var(--duration-fast) var(--ease-spring), background-color var(--duration-fast) var(--ease-standard);
}
[data-style="glass"] .lm-slider__input::-moz-range-thumb { width: 38px; height: 24px; }
[data-style="glass"] .lm-slider__input:active::-webkit-slider-thumb {
  transform: scale(1.3); background: var(--g-fill-clear);
  box-shadow: inset 0 0 0 1px var(--glass-rim), inset 0 1px 0 var(--glass-highlight), var(--shadow-glass);
}
[data-style="glass"] .lm-slider__input:active::-moz-range-thumb {
  transform: scale(1.3); background: var(--g-fill-clear);
  box-shadow: inset 0 0 0 1px var(--glass-rim), var(--shadow-glass);
}

/* Ô nhập: bo lớn hơn; ô tìm kiếm thành viên thuốc */
[data-style="glass"] .lm-control { border-radius: var(--g-radius-control); }
[data-style="glass"] :is(.lm-search .lm-control, .lm-control--search) { border-radius: var(--radius-full); }
[data-style="glass"] .lm-control--sm { border-radius: var(--radius-full); }

/* Không chồng kính lên kính: khi một popup mở từ bên trong khung kính, khung đó tạm thành
   kính đậm và bỏ backdrop-filter — nhờ vậy popup (lớp 2) làm mờ được nội dung thật phía sau. */
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing, .lm-toolbar__group, .lm-tabbar, .lm-sidebar, .lm-toolbar, .lm-float-btn-group):has(.lm-anchor.is-open, .lm-floating.is-open),
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing, .lm-toolbar__group, .lm-tabbar, .lm-sidebar, .lm-toolbar, .lm-float-btn-group):has(.lm-anchor.is-open, .lm-floating.is-open) > :is(.lm-btn, .lm-navbar__back) {
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
[data-style="glass"] :is(.lm-toolbar__group, .lm-tabbar, .lm-sidebar):has(.lm-anchor.is-open, .lm-floating.is-open),
[data-style="glass"] :is(.lm-navbar__leading, .lm-navbar__trailing):has(> .lm-btn + .lm-btn):has(.lm-anchor.is-open, .lm-floating.is-open) {
  background-color: var(--g-fill-thick);
}

/* --------------------------------------------------------------------------
   LỚP 0 — Nội dung: giữ nền đặc, chỉ bo góc đồng tâm lớn hơn
   -------------------------------------------------------------------------- */
[data-style="glass"] .lm-card { border-radius: var(--g-radius-group); }
[data-style="glass"] .lm-list--inset,
[data-style="glass"] .lm-form-rows { border-radius: var(--g-radius-group); }
[data-style="glass"] .lm-tag { border-radius: var(--radius-full); }

/* --------------------------------------------------------------------------
   LỚP 2 — Popup nhỏ: kính ĐẬM (đọc được trên nội dung nhiều chữ)
   -------------------------------------------------------------------------- */
[data-style="glass"] .lm-panel:not(.lm-panel--solid),
[data-style="glass"] .lm-popover__card,
[data-style="glass"] .lm-popconfirm__bubble,
[data-style="glass"] .lm-notification,
[data-style="glass"] .lm-hud,
[data-style="glass"] .lm-action-sheet__group,
[data-style="glass"] .lm-action-sheet__cancel {
  background-color: var(--g-fill-thick); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-popover);
}
[data-style="glass"] .lm-panel { border-radius: var(--g-radius-popup); padding: var(--space-6); }
[data-style="glass"] .lm-panel .lm-option { border-radius: calc(var(--g-radius-popup) - var(--space-6)); }
[data-style="glass"] .lm-panel__divider { margin-inline: calc(-1 * var(--space-6)); }
[data-style="glass"] :is(.lm-popover__card, .lm-popconfirm__bubble) { border-radius: var(--g-radius-popup); }
[data-style="glass"] :is(.lm-notification, .lm-hud) { border-radius: var(--g-radius-group); }
[data-style="glass"] :is(.lm-action-sheet__group, .lm-action-sheet__cancel) { border-radius: var(--g-radius-group); }
[data-style="glass"] .lm-message {
  background-color: var(--g-fill-thick); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-popover);
}

/* --------------------------------------------------------------------------
   LỚP 3 — Popup lớn: thân ĐẶC, nổi cách mép, bo lớn; chỉ nút đóng là kính
   -------------------------------------------------------------------------- */
[data-style="glass"] .lm-modal:not(.lm-modal--fullscreen) {
  --m-radius: var(--g-radius-sheet);
  --m-layer-pad: var(--g-inset);
  --m-maxh: calc(100dvh - var(--space-40) - 2 * var(--g-inset) - env(safe-area-inset-top, 0px));
}
@media (min-width: 768px) {
  [data-style="glass"] .lm-modal:not(.lm-modal--sheet):not(.lm-modal--fullscreen) { --m-radius: var(--g-radius-sheet); --m-layer-pad: var(--space-24); }
}
[data-style="glass"] .lm-modal--dialog { --m-radius: var(--g-radius-sheet); --m-layer-pad: var(--space-24); }
[data-style="glass"] :is(.lm-modal__close, .lm-drawer__close, .lm-popover__close, .lm-notification__close) {
  border-radius: var(--radius-full);
  background-color: var(--g-fill-thick); background-image: var(--g-gloss);
  box-shadow: var(--g-edge);
}
[data-style="glass"] :is(.lm-modal__cancel, .lm-modal__done) {
  border-radius: var(--radius-full); padding: 0 var(--space-14); min-height: 36px;
  background-color: var(--fill-tertiary); box-shadow: inset 0 0 0 1px var(--glass-rim);
}
[data-style="glass"] .lm-modal__done { background-color: var(--accent); color: var(--on-accent); }

[data-style="glass"] .lm-drawer {
  --drawer-radius: var(--g-radius-sheet);
  --drawer-maxh: calc(100dvh - var(--space-40) - 2 * var(--g-inset) - env(safe-area-inset-top, 0px));
  padding: var(--g-inset);
}
[data-style="glass"] .lm-drawer.lm-drawer--large { --drawer-h: calc(100dvh - var(--space-40) - 2 * var(--g-inset) - env(safe-area-inset-top, 0px)); }
/* Sheet ở nấc trung bình là kính đậm; kéo lên nấc lớn thì thành nền đặc (iOS 26) */
[data-style="glass"] .lm-drawer--medium > .lm-drawer__panel {
  background-color: var(--g-fill-thick); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-modal);
}

/* Alert dialog kiểu iOS 26: chữ căn trái, nút viên thuốc, không kẻ hairline */
[data-style="glass"] .lm-alert-dialog__box {
  width: min(300px, 100%);
  border-radius: var(--radius-32);
  text-align: left;
  background-color: var(--g-fill-thick); background-image: var(--g-gloss);
  -webkit-backdrop-filter: var(--g-filter); backdrop-filter: var(--g-filter);
  box-shadow: var(--g-edge), var(--shadow-modal);
}
[data-style="glass"] .lm-alert-dialog__content { padding: var(--space-24) var(--space-24) var(--space-8); gap: var(--space-6); }
[data-style="glass"] .lm-alert-dialog__title { font-size: var(--fs-title-3); line-height: var(--lh-title-3); letter-spacing: var(--ls-title-3); }
[data-style="glass"] .lm-alert-dialog__message { font-size: var(--fs-subheadline); line-height: var(--lh-subheadline); color: var(--label-secondary); }
[data-style="glass"] .lm-alert-dialog .lm-alert-dialog__field { border-radius: var(--radius-12); }
[data-style="glass"] .lm-alert-dialog__actions { border-top: 0; gap: var(--space-8); padding: var(--space-16) var(--space-16) var(--space-16); }
[data-style="glass"] .lm-alert-dialog__action {
  border-radius: var(--radius-full); min-height: 48px;
  background: var(--fill-tertiary); color: var(--label); font-weight: var(--fw-semibold);
}
[data-style="glass"] .lm-alert-dialog__action + .lm-alert-dialog__action,
[data-style="glass"] .lm-alert-dialog__actions--stacked > .lm-alert-dialog__action + .lm-alert-dialog__action { border: 0; }
[data-style="glass"] .lm-alert-dialog__action--preferred { background: var(--accent); color: var(--on-accent); }
[data-style="glass"] .lm-alert-dialog__action--danger { color: var(--danger); }
[data-style="glass"] .lm-alert-dialog__action:active { opacity: var(--opacity-pressed); }

/* --------------------------------------------------------------------------
   Docs: nền "hình nền" để thấy rõ kính (chỉ dùng trong trang mẫu)
   -------------------------------------------------------------------------- */
.lm-glass-wallpaper {
  background-color: var(--bg-grouped);
  background-image:
    radial-gradient(40% 50% at 12% 18%, color-mix(in srgb, var(--blue) 55%, transparent), transparent 70%),
    radial-gradient(35% 45% at 88% 12%, color-mix(in srgb, var(--pink) 45%, transparent), transparent 70%),
    radial-gradient(45% 50% at 78% 88%, color-mix(in srgb, var(--orange) 45%, transparent), transparent 70%),
    radial-gradient(40% 45% at 20% 90%, color-mix(in srgb, var(--mint) 45%, transparent), transparent 70%);
}
