/* Botlétrehozás – közös komponensek (BotUI) stílusa.
   docs/plans/bot-letrehozas-2-3-felulet-2026-11-25.md, 2.1 és 6.2/2 (B0). Gazda: B (6.1).
   Minden szín a tokens.css-ből (világos és sötét témában is a tokenek váltanak); itt beégetett szín nincs. A kártya 16 px,
   a mező 10 px sarkú, fókuszban lila gyűrű; telefonon (≤ 760 px) a koppintható elem legalább 44 px. */

:root {
  --bu-radius-card: 16px;
  --bu-radius-field: 10px;
  --bu-gap: 16px;
  --bu-ring: 0 0 0 var(--focus-width) var(--color-focus);
  /* Pontrács (a Folyamatok vászna): háttérkép és méret egy rövidítésben, background: var(--bu-dots). */
  --bu-dots: radial-gradient(circle, var(--color-border-strong) 1px, transparent 1.5px) 0 0 / 16px 16px;
}

/* ── Kártya ─────────────────────────────────────────────── */
.bu-card { display: grid; gap: var(--space-3); min-width: 0; padding: var(--bu-gap); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--bu-radius-card); color: var(--color-text-body); }
.bu-card__head { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; }
.bu-card__icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--bu-radius-field);
  background: var(--color-accent-soft); color: var(--color-accent-text); }
.bu-card__icon svg { width: 18px; height: 18px; }
.bu-card__titles { flex: 1; min-width: 0; }
.bu-card__title { margin: 0; font-size: var(--text-md); line-height: var(--leading-md); font-weight: var(--weight-semibold); color: var(--color-text); }
.bu-card__sub { margin: 2px 0 0; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }
.bu-card__action { flex-shrink: 0; }
.bu-card__body { min-width: 0; }
@media (max-width: 760px) {
  .bu-card__head { flex-wrap: wrap; }
  .bu-card__action { min-height: var(--control-height); }
}

/* ── Kapcsoló (natív jelölőnégyzet role="switch") ───────────── */
.bu-toggle { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-height);
  color: var(--color-text-body); cursor: pointer; }
.bu-toggle__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.bu-toggle__track { position: relative; flex-shrink: 0; width: 40px; height: 24px; border-radius: var(--radius-full);
  background: var(--color-surface-inset); border: 1px solid var(--color-border-control);
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.bu-toggle__thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: var(--radius-full);
  background: var(--color-surface); border: 1px solid var(--color-border-control); transition: transform var(--duration-fast) var(--ease-out); }
.bu-toggle__input:checked + .bu-toggle__track { background: var(--color-accent); border-color: var(--color-accent); }
.bu-toggle__input:checked + .bu-toggle__track .bu-toggle__thumb { transform: translateX(16px); border-color: var(--color-accent); }
.bu-toggle__input:focus-visible + .bu-toggle__track { box-shadow: var(--bu-ring); }
.bu-toggle__input:disabled { cursor: not-allowed; }
.bu-toggle__input:disabled + .bu-toggle__track { opacity: .55; }
.bu-toggle.is-locked { cursor: not-allowed; color: var(--color-text-muted); }
.bu-toggle__label { min-width: 0; }
.bu-lock { position: relative; z-index: 1; display: inline-flex; color: var(--color-text-muted); }
.bu-lock svg { width: 16px; height: 16px; }

/* ── Chip ───────────────────────────────────────────────── */
.bu-chip { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; min-height: 28px; padding: 2px var(--space-3);
  border-radius: var(--radius-full); background: var(--color-accent-soft); color: var(--color-accent-text); border: 1px solid var(--color-accent-line);
  font-size: var(--text-sm); line-height: var(--leading-sm); overflow-wrap: anywhere; }
.bu-chip--faint { background: transparent; color: var(--color-text-muted); border-color: var(--color-border-strong); border-style: dashed; }

/* ── Szegmentált választó (rádiócsoport) ─────────────────── */
.bu-segment { display: inline-flex; flex-wrap: wrap; gap: 2px; max-width: 100%; padding: 2px; border-radius: var(--bu-radius-field);
  background: var(--color-surface-inset); border: 1px solid var(--color-border); }
.bu-segment__item { position: relative; display: inline-flex; flex: 1 1 auto; }
.bu-segment__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bu-segment__label { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 36px; padding: var(--space-1) var(--space-3);
  border-radius: calc(var(--bu-radius-field) - 2px); color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); text-align: center; }
.bu-segment__input:checked + .bu-segment__label { background: var(--color-surface); color: var(--color-text); box-shadow: 0 0 0 1px var(--color-border-strong); }
.bu-segment__input:focus-visible + .bu-segment__label { box-shadow: var(--bu-ring); }
.bu-segment__input:disabled + .bu-segment__label { opacity: .55; }
@media (max-width: 760px) { .bu-segment__label { min-height: var(--control-height); } }

/* ── Oldalpanel / alsó lap (natív modális <dialog>) ─────────── */
.bu-sheet { position: fixed; margin: 0; padding: 0; border: 0; max-width: none; max-height: none; background: transparent; color: var(--color-text-body); overflow: visible; }
.bu-sheet::backdrop { background: var(--color-overlay); }
.bu-sheet__panel { display: flex; flex-direction: column; height: 100%; background: var(--color-surface); border: 1px solid var(--color-border);
  box-shadow: var(--shadow-overlay); overflow: hidden; }
.bu-sheet--right { inset: 0 0 0 auto; width: min(440px, 100vw); height: 100dvh; }
.bu-sheet--right .bu-sheet__panel { border-radius: var(--bu-radius-card) 0 0 var(--bu-radius-card); border-right: 0; }
.bu-sheet--bottom { inset: auto 0 0 0; width: 100vw; height: auto; max-height: min(85dvh, 720px); }
.bu-sheet--bottom .bu-sheet__panel { max-height: min(85dvh, 720px); border-radius: var(--bu-radius-card) var(--bu-radius-card) 0 0; border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.bu-sheet[open].bu-sheet--right .bu-sheet__panel { animation: bu-from-right var(--duration-base) var(--ease-out); }
.bu-sheet[open].bu-sheet--bottom .bu-sheet__panel { animation: bu-from-bottom var(--duration-base) var(--ease-out); }
.bu-sheet__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--bu-gap);
  border-bottom: 1px solid var(--color-border); }
.bu-sheet__title { flex: 1; min-width: 0; margin: 0; font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: var(--weight-semibold); color: var(--color-text); }
.bu-sheet__title:focus { outline: none; }
.bu-sheet__close { flex-shrink: 0; min-height: var(--control-height); }
.bu-sheet__body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--bu-gap); }
@keyframes bu-from-right { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bu-from-bottom { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bu-sheet[open] .bu-sheet__panel { animation: none; } }

/* ── Lenyíló menü ───────────────────────────────────────── */
.bu-menu { display: grid; gap: 2px; }
.bu-menu--pop { position: absolute; z-index: 60; min-width: 220px; max-width: min(360px, calc(100vw - 16px)); padding: var(--space-1);
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--bu-radius-field); box-shadow: var(--shadow-overlay); }
.bu-menu__item { display: flex; align-items: flex-start; gap: var(--space-3); width: 100%; min-height: 40px; padding: var(--space-2) var(--space-3);
  border: 0; border-radius: calc(var(--bu-radius-field) - 4px); background: transparent; color: var(--color-text); font: inherit; text-align: left; cursor: pointer; }
.bu-menu__item:hover, .bu-menu__item:focus-visible { background: var(--color-surface-soft); }
.bu-menu__item:focus-visible { outline: none; box-shadow: var(--bu-ring); }
.bu-menu__item[aria-disabled="true"] { color: var(--color-text-muted); cursor: not-allowed; }
.bu-menu__icon { display: inline-flex; padding-top: 2px; color: var(--color-text-muted); }
.bu-menu__icon svg { width: 16px; height: 16px; }
.bu-menu__text { display: grid; gap: 2px; min-width: 0; }
.bu-menu__label { font-weight: var(--weight-medium); }
.bu-menu__sub { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--color-text-muted); overflow-wrap: anywhere; }
.bu-menu--sheet .bu-menu__item { min-height: var(--control-height); }
