/* Сгенерировано из features.css: стили «Обзора функций» внутри общего Mini App (область .fx) */
/* =====================================================================
   FLOW — ОБЗОР ФУНКЦИЙ (v4). Токены и базовые блоки — из styles.css
   ===================================================================== */

.fx .feat-sticky {
  padding-bottom: 8px;
}

/* ---------- Статус подписки в шапке ---------- */
.fx .plus-pill {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--flow);
  background: var(--flow-soft);
}

.fx .plus-pill.is-cta {
  color: #fff;
  background: var(--flow);
}

/* ---------- Чипы разделов ---------- */
.fx .chips {
  display: flex;
  gap: 6px;
  margin: 10px -14px 0;
  padding: 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.fx .chips::-webkit-scrollbar {
  display: none;
}

.fx .chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.fx .chip-count {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.fx .chip.active {
  color: #fff;
  background: var(--ink);
  box-shadow: none;
}

body.theme-dark .fx .chip.active {
  color: var(--paper);
}

.fx .chip.active .chip-count {
  color: inherit;
  opacity: 0.6;
}

.fx .chip.chip-plus.active {
  color: #fff;
  background: var(--flow);
}

.fx .chip-star {
  color: var(--amber);
}

.fx .chip.active .chip-star {
  color: inherit;
}

/* ---------- Иконки функций ---------- */
.fx .feat-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 21px;
  line-height: 1;
  background: var(--surface-2);
}

.fx .feat-icon.is-plus {
  background: var(--flow-soft);
}

.fx .feat-icon-lg {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 26px;
}

/* ---------- Популярное ---------- */
.fx .pop-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 14px;
  padding: 2px 14px 6px;
  scrollbar-width: none;
}

.fx .pop-strip::-webkit-scrollbar {
  display: none;
}

.fx .pop-card {
  flex: 0 0 148px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border-radius: 18px;
  text-align: left;
  background: var(--surface);
}

.fx .pop-card:active {
  transform: scale(0.97);
}

.fx .pop-name {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.fx .pop-cmd {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--flow);
}

/* ---------- Список ---------- */
.fx .feat-list {
  margin: 0 10px;
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.fx .feat-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  transition: background-color 0.15s ease;
}

.fx .feat-row + .feat-row::after {
  content: '';
  position: absolute;
  top: 0;
  left: 66px;
  right: 0;
  height: 1px;
  background: var(--line);
}

.fx .feat-row:active {
  background: var(--surface-2);
}

.fx .feat-body {
  flex: 1;
  min-width: 0;
}

.fx .feat-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.fx .feat-name {
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx .feat-cmd {
  flex-shrink: 0;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--flow);
}

.fx .feat-cmd.is-ui {
  font-family: var(--text);
  color: var(--ink-3);
}

.fx .feat-summary {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fx .feat-summary mark, .fx .feat-name mark {
  background: rgba(var(--flow-rgb), 0.18);
  color: inherit;
  border-radius: 3px;
}

.fx .feat-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.fx .tag-plus {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--flow);
}

.fx .fav-dot {
  width: 14px;
  height: 14px;
  color: var(--amber);
}

/* ---------- Карточка функции (шторка) ---------- */
.fx .sheet {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  animation: sheetUp 0.34s var(--ease);
}

.fx .sheet.closing {
  animation: sheetDown 0.22s ease-in forwards;
}

@keyframes sheetDown {
  to { transform: translateY(100%); }
}

.fx .overlay.closing {
  animation: fadeOut 0.22s ease forwards;
}

@keyframes fadeOut {
  to { opacity: 0; }
}

.fx .sheet-grabber {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  touch-action: none;
}

.fx .sheet-grabber i {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  background: rgba(127, 127, 127, 0.35);
}

.fx .sheet-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 12px 18px;
  touch-action: none;
}

.fx .sheet-title-wrap {
  flex: 1;
  min-width: 0;
}

.fx .sheet-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.fx .sheet-meta {
  margin-top: 3px;
  font-size: 13px;
  color: var(--ink-2);
}

.fx .sheet-meta .tag-plus {
  font-size: 13px;
}

.fx .fav-btn[aria-pressed='true'] {
  color: var(--amber);
}

.fx .fav-btn[aria-pressed='true'] svg {
  fill: currentColor;
}

.fx .sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 18px calc(22px + var(--safe-bottom));
  -webkit-user-select: text;
  user-select: text;
}

.fx .sheet-desc {
  font-size: 16px;
  line-height: 1.45;
}

.fx .sheet-h {
  margin: 20px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

/* Живой пример — главный элемент карточки */
.fx .demo {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  border-radius: 18px;
  background: var(--paper);
}

.fx .demo-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.38;
  word-break: break-word;
}

.fx .demo-msg.out {
  align-self: flex-end;
  background: var(--bubble-out);
  border-bottom-right-radius: 6px;
}

.fx .demo-msg.result {
  align-self: flex-end;
  background: var(--bubble-out);
  border-bottom-right-radius: 6px;
}

.fx .demo-msg.bot {
  align-self: flex-start;
  background: var(--bubble-in);
  border-bottom-left-radius: 6px;
  box-shadow: inset 0 0 0 1.5px rgba(var(--flow-rgb), 0.35);
}

.fx .demo-from {
  display: block;
  margin-bottom: 1px;
  font-size: 13px;
  font-weight: 600;
  color: var(--flow);
}

.fx .pop-cmd.is-ui {
  font-family: var(--text);
  color: var(--ink-3);
}

.fx .demo-note {
  align-self: flex-start;
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  font-size: 15px;
  line-height: 1.38;
  background: var(--bubble-in);
}

.fx .demo-cmd {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--flow);
}

.fx .demo-step {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.fx .demo-step svg {
  color: var(--flow);
}

.fx .demo-msg.reveal, .fx .demo-note.reveal, .fx .demo-step.reveal {
  animation: demoIn 0.42s var(--ease) both;
}

@keyframes demoIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Команда и копирование */
.fx .cmd-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 12px 12px 14px;
  border-radius: 16px;
  background: var(--surface-2);
}

.fx .cmd-box-text {
  flex: 1;
  min-width: 0;
}

.fx .cmd-label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
}

.fx .cmd-code {
  display: block;
  margin-top: 2px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.fx .cmd-code.is-ui {
  font-family: var(--text);
  font-weight: 500;
}

.fx .btn-copy {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--flow);
  transition: background-color 0.2s ease, transform 0.12s ease;
}

.fx .btn-copy:active {
  transform: scale(0.96);
}

.fx .btn-copy.copied {
  background: #1f9d55;
}

.fx .alias-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fx .alias-chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--flow);
  background: var(--flow-soft);
}

.fx .alias-chip:active {
  transform: scale(0.96);
}

.fx .usage {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.fx .usage code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 5px;
  color: var(--flow);
  background: var(--flow-soft);
  white-space: nowrap;
}

.fx .usage b {
  font-weight: 600;
}

.fx #btn-detail-sub {
  margin-top: 22px;
}

/* ---------- Toast ---------- */
.fx .toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 200;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.35;
  color: #fff;
  background: rgba(16, 24, 40, 0.92);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s var(--ease);
}

.fx .toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.theme-dark .fx .toast {
  color: var(--paper);
  background: rgba(232, 236, 244, 0.95);
}


/* Внутри общего Mini App: гасим общие стили twin.css для .sheet/.toast/.sheet-head */
.fx .sheet { padding: 0; }
.fx .sheet-head { justify-content: flex-start; }
.fx .toast { animation: none; bottom: calc(84px + var(--safe-bottom)); }
.features-mark { background: linear-gradient(135deg, #5b7cff, #22c3a6); }
.fx-seg { margin: 2px 14px 12px; }
.fx-pane.hidden { display: none; }
