/* ===================================================================
   Shot AI Mini App — Phase 6 COMPONENTS
   Источник: docs/VISUAL_MASTER_PROMPT.md §1.3 (owner-approved текстовый
   референс). Все селекторы скоуплены на .p6 / #p6-* — существующие
   селекторы styles.css НЕ переопределяются.
   =================================================================== */

/* ===== Экран-носитель ===== */
.p6.app-screen {
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
.p6 .p6-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.p6 .p6-title { font-size: 20px; font-weight: 700; margin: 0; color: #fff; letter-spacing: -0.01em; }
.p6 .p6-footnote { font-size: 11px; color: var(--muted); text-align: center; margin: 0; line-height: 1.5; }
.p6 .p6-info-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.45; }
.p6 .p6-info-row .info-ico { flex: 0 0 auto; color: var(--accent); }

/* ===== .topbar (§1.3) ===== */
.p6 .topbar {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 16px;
  box-sizing: border-box;
  background: rgba(7, 11, 20, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.p6 .topbar-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.p6 .topbar-title { font-size: 17px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.p6 .topbar-btn {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border: 1px solid transparent; border-radius: 10px;
  background: rgba(22, 32, 58, 0.4);
  color: var(--text);
  font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.p6 .topbar-btn:active { background: var(--panel-2); border-color: var(--border); }
.p6 .p6-logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.p6 .p6-logo-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 34px;
  box-shadow: 0 0 14px rgba(124, 77, 255, 0.5);
}

/* ===== .balance-chip (§1.3) ===== */
.p6 .balance-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2-glass);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-chip);
  padding: 6px 14px;
  font-size: 14px; font-weight: 700; color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.p6 .balance-chip:active { transform: scale(0.96); border-color: var(--star); }
.p6 .balance-chip .star { color: var(--star); font-size: 14px; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6)); }

/* ===== Кнопки (§1.3) ===== */
.p6 .btn-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px;
  box-sizing: border-box;
  background: var(--grad-primary);
  color: #fff; font-size: 16px; font-weight: 700;
  border: none; border-radius: var(--radius-btn);
  box-shadow: var(--glow-cta);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: -0.01em;
}
.p6 .btn-cta:hover { background: var(--grad-primary-hover); }
.p6 .btn-cta:active { transform: scale(0.98); box-shadow: 0 2px 10px rgba(124, 77, 255, 0.6); }
.p6 .btn-cta:disabled { opacity: 0.45; pointer-events: none; box-shadow: none; }
.p6 .btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px;
  box-sizing: border-box;
  background: var(--panel-2-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text); font-size: 15px; font-weight: 600;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.p6 .btn-secondary:hover { border-color: rgba(255, 255, 255, 0.25); background: var(--panel-2); }
.p6 .btn-secondary:active { transform: scale(0.98); }
.p6 .btn-cta.sm, .p6 .btn-secondary.sm { width: auto; height: 38px; padding: 0 18px; font-size: 14px; border-radius: 10px; }

/* ===== .card (§1.3) ===== */
.p6 .card {
  background: var(--panel-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card), var(--shadow-card-inner);
  padding: 16px;
  box-sizing: border-box;
  position: relative;
  transition: all 0.2s ease;
}
.p6 .card.is-selected {
  border: 2px solid var(--accent);
  box-shadow: var(--glow-accent), var(--shadow-card), var(--shadow-card-inner);
  background: linear-gradient(180deg, rgba(30, 41, 75, 0.8) 0%, rgba(14, 21, 36, 0.9) 100%);
}
.p6 .card-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; color: #fff; letter-spacing: -0.01em; }
.p6 .card-sub { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.45; }
.p6 .mode-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.p6 .mode-thumb {
  width: 68px; height: 68px; flex: 0 0 68px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 50%, rgba(30, 41, 75, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.p6 .badge-recommend {
  display: inline-block;
  background: var(--accent-pink);
  color: #fff; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-radius: var(--radius-chip);
  padding: 4px 10px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(217, 70, 239, 0.4);
}

/* ===== Превью-ряд 7 слотов (Э3) ===== */
.p6 .pack-slots { display: flex; gap: 6px; margin-top: 14px; }
.p6 .pack-slot {
  flex: 1; aspect-ratio: 3 / 4;
  border-radius: 8px;
  border: 1.5px dashed rgba(148, 163, 184, 0.25);
  background: var(--panel-2-glass);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.p6 .pack-slot.filled {
  border-style: solid;
  border-color: var(--accent);
  background: #0F172A;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}
.p6 .pack-slot .pack-num {
  position: absolute; top: 3px; left: 4px;
  font-size: 9px; font-weight: 700; color: var(--muted);
}
.p6 .pack-slot.filled .pack-num { color: #A855F7; }

/* ===== .chip (§1.3) ===== */
.p6 .chip {
  display: inline-flex; align-items: center;
  border-radius: var(--radius-chip);
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  background: var(--panel-2-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.p6 .chip:hover { border-color: rgba(255, 255, 255, 0.25); color: var(--text); }
.p6 .chip.active { background: var(--grad-primary); border-color: transparent; color: #fff; box-shadow: var(--glow-cta); }

/* ===== .tile (§1.3, Э2) ===== */
.p6 .p6-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.p6 .tile {
  display: flex; align-items: center; gap: 12px;
  width: 100%; box-sizing: border-box;
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card), var(--shadow-card-inner);
  padding: 14px;
  color: var(--text);
  font-family: inherit; font-size: 14px; text-align: left;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.p6 .tile:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), var(--shadow-card-inner);
}
.p6 .tile:active { transform: scale(0.98); }
.p6 .tile-icon {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.p6 .ti-blue   { background: linear-gradient(135deg, rgba(46, 124, 246, 0.25), rgba(6, 182, 212, 0.2)); border: 1px solid rgba(46, 124, 246, 0.4); color: #38BDF8; }
.p6 .ti-purple { background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(168, 85, 247, 0.2)); border: 1px solid rgba(139, 92, 246, 0.4); color: #C084FC; }
.p6 .ti-pink   { background: linear-gradient(135deg, rgba(217, 70, 239, 0.25), rgba(236, 72, 153, 0.2)); border: 1px solid rgba(217, 70, 239, 0.4); color: #F472B6; }
.p6 .ti-green  { background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(16, 185, 129, 0.2)); border: 1px solid rgba(34, 197, 94, 0.4); color: #4ADE80; }
.p6 .ti-amber  { background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.2)); border: 1px solid rgba(251, 191, 36, 0.4); color: #FBBF24; }
.p6 .ti-slate  { background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(100, 116, 139, 0.2)); border: 1px solid rgba(148, 163, 184, 0.3); color: #E2E8F0; }
.p6 .tile-label { flex: 1; font-weight: 600; min-width: 0; color: #fff; }
.p6 .tile-count { font-size: 13px; font-weight: 700; color: var(--muted); }
.p6 .tile-main {
  grid-row: span 2;
  flex-direction: column; align-items: flex-start; justify-content: flex-end;
  gap: 12px;
  background: linear-gradient(145deg, #2563EB 0%, #7C3AED 60%, #9333EA 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(124, 77, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  min-height: 160px;
}
.p6 .tile-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(124, 77, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.p6 .tile-main .tile-icon { background: #fff; color: #2563EB; font-size: 20px; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }
.p6 .tile-main .tile-label { color: #fff; font-size: 18px; font-weight: 800; flex: none; letter-spacing: -0.01em; }

/* Block B: trial tile + result sheet. */
.p6 .tile-trial {
  border: 1px dashed rgba(52, 211, 153, 0.55);
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.55), rgba(15, 23, 42, 0.9));
  /* Три текстовых блока (иконка/заголовок/подпись) не помещаются в строку
     на узкой колонке сетки: заголовок сжимался, а подпись налезала на него
     (тексты «накладывались»). Карточка — вертикальная раскладка. */
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
}
.p6 .tile-trial .tile-icon { font-size: 22px; }
.p6 .tile-trial .tile-label {
  flex: none;              /* не сжимаем заголовок */
  min-width: 0;
  font-weight: 700;
  line-height: 1.25;
}
/* .tile-sub в плитке триала УБРАН (одна надпись) — детали перенесены
   в шторку триала (p6.trial.sub). Правило оставлено на случай, если
   подпись вернётся в другую плитку. */
.p6 .tile-sub {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}
.trial-result { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.trial-result .trial-note {
  margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted);
}
.trial-result .trial-note--warn { color: #F59E0B; }
.trial-result img { width: 100%; border-radius: 12px; display: block; }
.trial-badge {
  align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: #06281d; background: #34d399;
  border-radius: 999px; padding: 3px 10px;
}

/* ===== .is-soon (§1.3, FIX-1) ===== */
.p6 .is-soon { opacity: 0.55; pointer-events: none; }
.p6 .soon-badge {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(22, 32, 58, 0.8);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px; font-weight: 700;
  border-radius: var(--radius-chip);
  padding: 2px 8px;
}

/* ===== .bottom-nav (§1.3) ===== */
.p6 .bottom-nav {
  position: sticky; bottom: 0; z-index: 20;
  display: flex;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.p6 .bottom-nav button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none;
  color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.p6 .bottom-nav button.active {
  color: #fff;
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
}
.p6 .bottom-nav button.active .nav-ico { color: var(--accent); }
.p6 .bottom-nav .nav-ico { font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* ===== .banner (§1.3) ===== */
.p6 .banner {
  position: relative;
  background: var(--panel-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card), var(--shadow-card-inner);
  padding: 16px;
  padding-right: 90px;
  box-sizing: border-box;
  overflow: hidden;
}
.p6 .banner::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--radius-card);
  padding: 1px;
  background: linear-gradient(120deg, #2E7CF6, #8B5CF6, #D946EF);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.p6 .banner-title { font-size: 15px; font-weight: 700; color: #fff; margin: 0; letter-spacing: -0.01em; }
.p6 .banner-sub { font-size: 13px; color: var(--muted); margin: 4px 0 12px; line-height: 1.45; }
.p6 .p6-mascot {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 62px; height: 62px;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, #FDE68A, #F59E0B);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
}
.p6 .p6-mascot img { width: 100%; height: 100%; object-fit: contain; }

/* ===== .upload-slot / слоты загрузки (§1.3, Э4/Э5) ===== */
.p6 .upload-slot {
  width: 84px; height: 84px; flex: 0 0 84px;
  box-sizing: border-box;
  background: var(--panel-2-glass);
  backdrop-filter: blur(8px);
  border: 1.5px dashed rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.p6 .upload-slot:hover { border-color: rgba(255, 255, 255, 0.4); color: var(--text); }
.p6 .upload-slot .slot-ico-label { font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; color: var(--muted); }
.p6 .upload-slot.is-filled { border-style: solid; border-color: var(--accent); background: #0F172A; }
.p6 .slot-row { display: flex; align-items: center; gap: 14px; }
.p6 .slot-meta { flex: 1; min-width: 0; }
.p6 .slot-title { font-size: 15px; font-weight: 700; color: #fff; }
.p6 .slot-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.p6 .slot-preview {
  width: 84px; height: 84px; flex: 0 0 84px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border-accent);
  background: var(--panel-2);
  display: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.p6 .slot-preview.visible { display: block; }

/* ===== .checklist-row (§1.3, Э10) ===== */
.p6 .checklist-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}
.p6 .checklist-row:last-child { border-bottom: none; }
.p6 .check-circle {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%;
  background: var(--success);
  color: #fff; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-success);
}
.p6 .check-label { font-size: 15px; font-weight: 700; color: #fff; }
.p6 .check-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ===== .step-chips / .tool-row (§1.3, Э7+) ===== */
.p6 .step-chips { display: flex; gap: 6px; }
.p6 .step-chip {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--panel-2-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease;
}
.p6 .step-chip.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--glow-accent);
}
.p6 .tool-row { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; }
.p6 .tool-row button {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 58px;
  background: none; border: none;
  color: var(--muted);
  font-family: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.p6 .tool-row button:hover { color: var(--text); }
.p6 .tool-row .tool-ico { font-size: 20px; line-height: 1; }

/* ===== .sheet (§1.3) ===== */
.p6-sheet-overlay {
  position: fixed; inset: 0; z-index: 90000;
  background: rgba(4, 7, 15, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: flex-end; justify-content: center;
}
.p6-sheet-overlay .sheet {
  width: 100%; max-width: 520px;
  box-sizing: border-box;
  background: rgba(14, 21, 36, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 82vh;
  overflow-y: auto;
}
.p6-sheet-overlay .sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 17px; font-weight: 800; color: #fff;
  margin-bottom: 14px;
}
.p6-sheet-overlay .p6-sheet-close {
  width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2);
  color: var(--text); font-size: 16px;
  cursor: pointer;
}
.p6 .sheet-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 28px 0; line-height: 1.5; }
.p6 .lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.p6 .lib-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--panel-2);
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.p6 .lib-item.selected { border-color: var(--accent); box-shadow: var(--glow-accent); }
.p6 .lib-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p6 .lib-item .lib-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 10px; font-weight: 600; color: #fff;
  background: rgba(7, 11, 20, 0.82);
  backdrop-filter: blur(4px);
  padding: 4px 6px;
  text-align: left;
}
.p6 .list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--panel-2-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.p6 .list-row .list-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ===== Э1: hero + буллеты ===== */
.p6 .hero-art { width: 100%; max-width: 320px; margin: 4px auto 0; display: block; filter: drop-shadow(0 10px 25px rgba(124, 77, 255, 0.25)); }
.p6 .p6-h1 { font-size: 22px; font-weight: 800; color: #fff; text-align: center; margin: 0; line-height: 1.3; letter-spacing: -0.02em; }
.p6 .p6-bullets { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 8px; padding: 0; list-style: none; }
.p6 .p6-bullets li { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; color: var(--text); }
.p6 .bullet-ico {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 50%;
  background: var(--panel-2-glass);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* ===== Э5: подсказка ===== */
.p6 .hint-link {
  background: none; border: none; padding: 0;
  color: var(--muted); font-size: 13px; font-family: inherit;
  text-decoration: underline dotted;
  text-align: left;
  cursor: pointer;
}
.p6 .hint-box {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: none;
}
.p6 .hint-box.visible { display: block; }

/* ===== Toast ===== */
#p6-toast.p6 {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 10px 16px;
  font-size: 13px;
  max-width: 86vw;
  text-align: center;
  z-index: 95000;
  display: none;
}

/* ===================================================================
   Э6: ШАБЛОН/СТИЛЬ (TZ §6). Превью = статичные CSS-градиенты по палитре
   (НЕ генерация). Каталог шаблонов = Phase 10.
   =================================================================== */
.p6 .chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.p6 .tpl-grid { margin-top: 12px; }
.p6 .tpl-card {
  position: relative;
  border-radius: var(--radius-card);
  border: 2px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: inherit;
}
.p6 .tpl-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-card); }
.p6 .tpl-preview { aspect-ratio: 3 / 4; width: 100%; display: flex; align-items: center; justify-content: center; }
.p6 .tpl-preview .tpl-plus { font-size: 34px; color: var(--muted); font-weight: 300; }
.p6 .tpl-check {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; color: var(--accent);
  display: none; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.p6 .tpl-card.is-selected .tpl-check { display: flex; }
.p6 .tpl-name {
  display: block; padding: 8px 10px;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: rgba(7, 11, 20, 0.72);
}
/* Статичные градиенты-заглушки по палитре референса */
.p6 .tpl-empty  { background: var(--panel-2); }
.p6 .tpl-dark   { background: radial-gradient(120% 120% at 30% 20%, #7C4DFF 0%, #2E1A5E 45%, #0B0620 100%); }
.p6 .tpl-white  { background: linear-gradient(160deg, #F5F7FA 0%, #E2E8F0 60%, #CBD5E1 100%); }
.p6 .tpl-green  { background: linear-gradient(150deg, #34D399 0%, #059669 55%, #064E3B 100%); }
.p6 .tpl-blue   { background: linear-gradient(150deg, #38BDF8 0%, #2563EB 55%, #1E3A8A 100%); }
.p6 .tpl-red    { background: linear-gradient(150deg, #F87171 0%, #EF4444 50%, #991B1B 100%); }

/* ===================================================================
   Э10: ПРОВЕРКА И ЭКСПОРТ
   =================================================================== */
.p6 .p6-subhead { font-size: 15px; font-weight: 700; color: var(--text); margin: 18px 0 10px; }
.p6 .check-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.p6 .check-thumb {
  width: 54px; height: 72px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--muted);
  overflow: hidden;
}
.p6 .check-thumb img { width: 100%; height: 100%; object-fit: cover; }
.p6 .check-circle.warn { background: #F59E0B; }
.p6 .check-circle.err  { background: var(--danger); }

/* ===================================================================
   Э11: ЭКСПОРТ ЗАВЕРШЁН
   =================================================================== */
.p6 .done-body { align-items: center; text-align: center; }
.p6 .done-circle {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--success);
  color: #fff; font-size: 40px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 12px auto 16px;
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.35);
}
.p6 .done-sub { margin: 0 0 18px; }
.p6 .done-body .btn-cta, .p6 .done-body .btn-secondary { text-decoration: none; }
/* Конфетти: чистый CSS, частицы генерятся в app.js (span.confetti-bit) */
.p6 .confetti { position: absolute; inset: 0 0 auto 0; height: 46vh; overflow: hidden; pointer-events: none; z-index: 5; }
.p6 .confetti-bit {
  position: absolute; top: -12px;
  width: 8px; height: 12px; border-radius: 2px;
  opacity: 0.9;
  animation: p6-confetti-fall linear forwards;
}
@keyframes p6-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(48vh) rotate(540deg); opacity: 0; }
}

/* ===================================================================
   Э12: WEEKLY BATTLE (заглушка .is-soon, Phase 11)
   =================================================================== */
.p6 .is-soon-wrap { position: relative; }
.p6 .countdown-pill {
  align-self: center;
  border-radius: var(--radius-chip);
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  padding: 8px 16px;
  margin: 8px 0 16px;
}
.p6 .battle-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 14px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.p6 .battle-card.is-leader { border-color: var(--accent); }
/* TZ §11: выбранная пользователем карточка до отправки голоса. */
.p6 .battle-card { cursor: pointer; }
.p6 .battle-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent), var(--shadow-card);
}
.p6 .battle-letter {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.p6 .battle-preview {
  flex: 1; height: 64px; border-radius: 10px;
  overflow: hidden; background: var(--panel-2);
}
.p6 .battle-preview img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.p6 .bp-a { background: linear-gradient(140deg, #7C4DFF, #2E1A5E); }
.p6 .bp-b { background: linear-gradient(140deg, #CBD5E1, #64748B); }
.p6 .bp-c { background: linear-gradient(140deg, #FBBF24, #B45309); }
.p6 .battle-votes { font-size: 13px; color: var(--muted); white-space: nowrap; }
.p6 .battle-reward {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--muted);
  margin: 14px 0 8px;
}
.p6 .star-chip { color: var(--star); }
.p6 .soon-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
/* .is-soon уже задан выше (opacity .5 + pointer-events none) — клики игнорируются */

/* ===================================================================
   Э7/Э8: P6-оболочка редактора (bridge поверх #screen-smart-editor)
   =================================================================== */
/* В P6-режиме прячем нативные top-bar и tool-rail smart-editor */
#screen-smart-editor.p6-editor-mode #editor-top-bar,
#screen-smart-editor.p6-editor-mode #editor-tool-rail { display: none; }
/* Рамка артборда (§2.1): фон канваса (#0f172a) сливается с фоном экрана,
   поэтому лист сцены выделяется светлым контуром и тенью — как на референсе. */
#screen-smart-editor.p6-editor-mode .canvas-container {
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.38), 0 16px 48px rgba(0, 0, 0, 0.55);
}
#p6-editor-chrome { position: absolute; inset: 0; pointer-events: none; z-index: 40; display: flex; flex-direction: column; justify-content: space-between; }
#p6-editor-chrome > * { pointer-events: auto; }
#p6-editor-chrome .p6-editor-topbar {
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
#p6-editor-chrome .step-chips { flex: 1; justify-content: center; overflow-x: auto; }
#p6-editor-chrome .p6-editor-toolrow {
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  /* Chrome — space-between из 3 детей: без этого тулбар уезжал в середину
     экрана полосой (2026-10-13). Прижимаем его к нижней панели. */
  margin-top: auto;
}
#p6-editor-chrome .tool-row button.is-soon { opacity: 0.5; position: relative; }
#p6-editor-chrome .tool-row button.is-soon .soon-badge {
  position: absolute; top: -2px; right: 2px; bottom: auto;
  font-size: 8px; padding: 1px 4px;
  background: var(--accent-pink); color: #fff;
  border-radius: 6px; text-transform: uppercase;
}
#p6-editor-chrome .p6-editor-bottombar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(7, 11, 20, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}
#p6-editor-chrome .p6-eb-btn {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text); font-size: 17px;
  cursor: pointer;
}
/* Недоступные undo/redo (пустая история) — приглушены и некликабельны. */
#p6-editor-chrome .p6-eb-btn:disabled,
#p6-editor-chrome .p6-eb-btn.is-disabled { opacity: 0.35; cursor: default; }
#p6-editor-chrome .p6-zoom {
  display: flex; align-items: center; gap: 6px;
  color: var(--text); font-size: 13px; font-weight: 600;
}
#p6-editor-chrome .p6-zoom #p6ZoomVal { min-width: 44px; text-align: center; }
#p6-editor-chrome .p6-editor-save { flex: 1; margin-left: auto; }

/* ===================================================================
   Э9: PRO-ИНСТРУМЕНТЫ (bottom-sheet контент)
   =================================================================== */
.p6 .pro-section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 14px 0 8px; }
.p6 .pro-layer-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 13px; color: var(--text);
}
.p6 .pro-layer-row.active { border-color: var(--accent); }
.p6 .pro-layer-ico { width: 22px; text-align: center; flex: 0 0 22px; }
.p6 .pro-layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.p6 .pro-layer-eye, .p6 .pro-layer-lock, .p6 .pro-layer-drag {
  background: none; border: none; color: var(--muted);
  font-size: 15px; cursor: pointer; padding: 2px 4px;
}
.p6 .pro-align-row { display: flex; gap: 8px; }
.p6 .pro-align-row button {
  flex: 1; height: 38px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text); font-size: 15px;
  cursor: pointer;
}
.p6 .pro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.p6 .pro-grid button {
  position: relative;
  padding: 13px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-family: inherit;
  cursor: pointer;
}
.p6 .pro-grid button.is-soon { opacity: 0.5; }
.p6 .pro-grid button.is-soon::after {
  content: 'Скоро';
  position: absolute; top: 6px; right: 6px;
  font-size: 8px; padding: 1px 5px;
  background: var(--accent-pink); color: #fff;
  border-radius: 6px; text-transform: uppercase;
}
.p6 .pro-slider-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.p6 .pro-slider-row label { font-size: 13px; color: var(--text); flex: 0 0 104px; }
.p6 .pro-slider-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.p6 .pro-slider-row .pro-slider-val { font-size: 13px; color: var(--muted); flex: 0 0 44px; text-align: right; }

/* Phase 7: AI-тени — вид «Скоро» (.is-soon), но кнопка кликабельна:
   клик показывает тост про отсутствие capability в Control Plane. */
.p6 .pro-grid button.is-soon[data-pro="ai_shadows"] { pointer-events: auto; cursor: pointer; }

/* ===================================================================
   PHASE 7: ПЕРСПЕКТИВА / МАСКИ / ТИПОГРАФИКА
   =================================================================== */
/* Плавающая панель активного режима (перспектива, рисование маски/кривой) */
.p7-mode-bar {
  position: absolute; left: 10px; right: 10px; bottom: 96px; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px;
  background: rgba(10, 15, 29, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.p7-mode-hint { font-size: 12px; color: var(--text); line-height: 1.25; flex: 1; min-width: 0; }
.p7-mode-actions { display: flex; gap: 8px; flex: none; }
.p7-mode-btn {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text); font-size: 12px; font-family: inherit; font-weight: 600;
  cursor: pointer;
}
.p7-mode-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Диалоги типографики (градиент/обводка/кривая) внутри bottom-sheet */
.p7-dialog { display: flex; flex-direction: column; gap: 12px; }
.p7-dialog label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
.p7-dialog input[type="color"] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); cursor: pointer; }
.p7-dialog input[type="range"] { flex: 1; accent-color: var(--accent); }
.p7-dialog select {
  flex: 1; padding: 8px 10px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-family: inherit;
}
.p7-dialog .p7-row { flex-wrap: wrap; }
.p7-note { font-size: 12px; color: var(--muted); line-height: 1.4; margin: 0; }
.p7-danger { border-color: rgba(244, 63, 94, 0.5) !important; color: #fb7185 !important; }

/* ===== Marketplace selector (TZ v3.0 Этап 3, Э3 screen) ===== */
.p6 .p6-mp-select { margin-bottom: 14px; }
.p6 .p6-mp-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 8px; letter-spacing: 0.02em;
}
.p6 .p6-mp-select .chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.p6 .p6-mp-select .chip-row::-webkit-scrollbar { display: none; }
.p6 .p6-mp-select .chip { flex: 0 0 auto; padding: 8px 14px; font-size: 12px; }
.p6 .p6-mp-select .card-sub { margin: 8px 0 0; font-size: 12px; }

/* ===== Resolution selector (TZ v3.0 Фаза 2 В1, Э10 screen) ===== */
.p6 .p6-res-select { margin: 10px 0; }
.p6 .p6-res-select .chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.p6 .p6-res-select .card-sub { margin: 8px 0 0; font-size: 12px; }

/* ===== Sticker picker (TZ v3.0 Фаза 2 В7) ===== */
.p6 .sticker-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0 12px;
}
.p6 .sticker-cell {
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-glass); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 10px; cursor: pointer;
  transition: border-color 0.15s ease;
}
.p6 .sticker-cell:hover { border-color: rgba(34, 211, 238, 0.55); }
.p6 .sticker-cell img { display: block; }

/* ===== Brand Kit sheet (TZ v3.0 Фаза 2 В8) ===== */
.p6 .brand-kit-sheet { padding: 4px 0 12px; }
.p6 .brand-kit-logo-row {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-card);
  background: var(--panel-glass);
}
.p6 .brand-logo-preview { max-width: 96px; max-height: 48px; object-fit: contain; cursor: pointer; }
.p6 .brand-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.p6 .brand-swatch {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer;
}
.p6 .brand-kit-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.p6 .brand-kit-actions input[type="color"] {
  width: 36px; height: 32px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel-glass); cursor: pointer;
}

/* ===== Э6.5: Структура набора 1–7 (p6-screen-pack) ===== */
.p6 .pack-hint { color: var(--text-muted, #94a3b8); font-size: 13px; margin: 0 0 12px; line-height: 1.45; }
.p6 .pack-list { display: flex; flex-direction: column; gap: 8px; }
.p6 .pack-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--panel-glass);
}
.p6 .pack-row.is-info { border-style: dashed; }
.p6 .pack-num {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px;
  background: rgba(56, 189, 248, 0.14); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.p6 .pack-thumb {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border);
}
.p6 .pack-thumb.is-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted, #94a3b8); font-size: 18px;
}
.p6 .pack-info { flex: 1; min-width: 0; }
.p6 .pack-type { font-size: 13px; font-weight: 600; color: var(--text, #e2e8f0); }
.p6 .pack-type .pack-badge-info {
  font-size: 10px; padding: 1px 6px; margin-left: 6px; border-radius: 6px;
  background: rgba(168, 85, 247, 0.18); color: #c084fc;
}
.p6 .pack-purpose { font-size: 11px; color: var(--text-muted, #94a3b8); margin-top: 2px; }
.p6 .pack-tpl {
  font-size: 11px; color: #38bdf8; margin-top: 2px; cursor: pointer;
  text-decoration: underline dotted;
}
.p6 .pack-actions { display: flex; gap: 4px; }
.p6 .pack-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text, #e2e8f0); cursor: pointer; font-size: 13px;
}
.p6 .pack-btn:disabled { opacity: 0.3; cursor: default; }


/* Session 4: поле ввода в шторках (например, название товара для пробы). */
.p6 .p6-input,
.p6-input {
  display: block; width: 100%; box-sizing: border-box;
  margin: 0 0 12px; padding: 12px 14px; font-size: 14px;
  font-family: inherit; color: #E5E7EB;
  background: #181B22; border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px; outline: none;
}
.p6 .p6-input:focus,
.p6-input:focus { border-color: #6366F1; }
.p6 .p6-input::placeholder { color: #6B7280; }
