/* ── Multiple choice with checkboxes, groups and deferred apply ───────────────
   Chat service picker (Figma «17 · ИИ-чат», «Чат / Меню сервисов» и «Чат / Сервис в меню»).
   Opt-in through LidflyUiMultiSelect options; other multiple choices keep the check mark. */
.lf-select__marks {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.lf-select__marks:empty {
  display: none;
}

.lf-select__marks img,
.lf-select__marks svg {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: contain;
}

.lf-select__marks > * + * {
  margin-left: -4px;
}

.lf-select--checkboxes .lf-select__option,
.lf-select__group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 12px;
}

.lf-select--checkboxes .lf-select__option.is-selected {
  font-weight: inherit;
}

.lf-select--checkboxes .lf-select__option-label {
  flex: 0 1 auto;
}

.lf-select__option-logo {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: contain;
}

.lf-select__option-caption {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 400;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lf-select__action {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--color-brand-text);
  font-size: 13px;
  font-weight: 600;
}

.lf-select--checkboxes .lf-select__option.is-disabled {
  opacity: 1;
}

.lf-select--checkboxes .lf-select__option.is-disabled .lf-select__box,
.lf-select--checkboxes .lf-select__option.is-disabled .lf-select__option-logo,
.lf-select--checkboxes .lf-select__option.is-disabled .lf-select__option-label {
  opacity: 0.5;
}

.lf-select__box {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid color-mix(in srgb, var(--color-text) 35%, transparent);
  border-radius: 5px;
  background: var(--color-bg-card);
  color: var(--color-bg-card);
}

.lf-select__box svg {
  width: 14px;
  height: 14px;
}

.lf-select__box.is-checked,
.lf-select__box.is-mixed {
  border-color: var(--color-text);
  background: var(--color-text);
}

.lf-select__box.is-mixed::after {
  content: "";
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: var(--color-bg-card);
}

.lf-select__group-row {
  min-height: 32px;
  border-radius: var(--radius-small);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.lf-select__group-row--all {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}

.lf-select__group-row.is-active,
.lf-select__group-row:hover {
  background: color-mix(in srgb, var(--color-brand) 12%, transparent);
}

.lf-select__group-row.is-disabled {
  cursor: default;
  opacity: 0.5;
}

.lf-select__footer {
  display: grid;
  gap: 4px;
  padding: 6px 6px 6px 12px;
  border-top: 1px solid var(--color-border);
}

.lf-select__note {
  margin: 0;
  padding: 2px 6px 2px 0;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 18px;
}

.lf-select__footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lf-select__count {
  margin-right: auto;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.lf-select--deferred .lf-select__panel {
  width: min(400px, calc(100vw - 24px));
}

.lf-select--deferred.open .lf-select__panel {
  display: flex;
  flex-direction: column;
}

.lf-select--deferred .lf-select__options {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(560px, 70vh);
}

/* The note repeated as the last line of the list: shown only inside a phone sheet. */
.lf-select__list-note {
  display: none;
  margin: 0;
  padding: 12px 12px 4px;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 18px;
}

/* ── Phone sheet (Figma «Чат / Лист сервисов», «Чат / Сервис в меню» Вид=Телефон) ──
   Rows are 56 px: the name on top, the caption under it, so nothing is cut at 320 px.
   The «always available» note scrolls with the list; the footer keeps only the actions. */
.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "box logo label action"
    "box logo caption action";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  min-height: 56px;
  padding: 8px 12px;
}

.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__option > .lf-select__box { grid-area: box; }
.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__option > .lf-select__option-logo,
.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__option > .lf-select__option-icon { grid-area: logo; width: 24px; height: 24px; }
.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__option-label {
  grid-area: label;
  align-self: end;
  overflow: hidden;
  font-size: 16px;
  font-weight: 500;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__option-caption {
  grid-area: caption;
  align-self: start;
  margin: 0;
  text-align: left;
  white-space: normal;
}

/* A single-line row (no caption) keeps its name centred. */
.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__option:not(:has(.lf-select__option-caption)) .lf-select__option-label {
  grid-row: 1 / 3;
  align-self: center;
}

.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__action {
  grid-area: action;
  grid-row: 1 / 3;
}

.lf-sheet .lf-sheet__host.lf-select--checkboxes .lf-select__group-row {
  min-height: 40px;
  padding: 0 12px;
}

.lf-sheet .lf-sheet__host .lf-select__list-note {
  display: block;
}

.lf-sheet .lf-sheet__host .lf-select__footer .lf-select__note {
  display: none;
}

.lf-sheet .lf-sheet__host .lf-select__footer .btn {
  min-height: 36px;
}
