/* Нейросеточки · мини-апп · дизайн-канон «Конфетти»
   (docs/superpowers/plans/2026-07-20-v04-miniapp-proto.md, .superpowers/sdd/design-reference-confetti.html)
   Токены: белый канвас, Ink #0f101a, CTA-оранжевый #ff8a00, акцент-розовый #ff54bb,
   radial-бурст #99eeff→#c5b3ff→#ffb3e2 в шапках, радиусы 20-32, светящиеся inset-тени.
   Иконки — ТОЛЬКО инлайн Lucide-спрайт (icons.svg), никаких эмодзи. */

:root {
  --ink: #0f101a;
  --muted: #777885;
  --muted2: #6d6d78;
  --orange: #ff8a00;
  --pink: #ff54bb;
  --pink-hot: #ff2e95;
  --track: #f1f3f6;
  --white: #fff;
  --border: #f1f3f6;
  --green-bg: #d9f7e5;
  --green-fg: #0f9d58;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, textarea { font-family: inherit; }

svg.i {
  width: 1em; height: 1em;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.12em;
  flex: none;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 560px;
  margin: 0 auto;
  background: var(--white);
}

/* ---------- демо-баннер ---------- */
.demo-banner {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.demo-banner svg.i { color: #ffd166; width: 16px; height: 16px; }
#app.demo .demo-banner { display: flex; }

/* ---------- экраны (табы) ---------- */
.screen { display: none; flex-direction: column; flex: 1; padding-bottom: calc(84px + var(--safe-bottom)); }
.screen.active { display: flex; }

.content { padding: 0 16px; flex: 1; }

/* ---------- hero (Главная) ---------- */
.hero {
  padding: 26px 18px 20px;
  background: radial-gradient(130% 150% at 18% 0%, #99eeff 0%, #c5b3ff 42%, #ffb3e2 78%, #fff 100%);
}
.hero .hi { font-size: 24px; font-weight: 900; letter-spacing: -0.03em; }
.hero .sub { font-size: 13px; line-height: 1.45; margin-top: 6px; font-weight: 600; opacity: .85; max-width: 300px; }

.models { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.m {
  background: rgba(255,255,255,.85); border-radius: 99px; padding: 6px 12px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 3px 10px rgba(140,100,255,.16);
  display: inline-flex; align-items: center; gap: 4px;
}
.m svg.i { width: 11px; height: 11px; color: var(--orange); }

.limit {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  background: #fff; border-radius: 99px; padding: 7px 13px; font-size: 12px; font-weight: 700;
  box-shadow: inset 0 1px 4px rgba(255,255,255,.44), 0 4px 14px rgba(140,100,255,.18);
}
.limit .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink); opacity: .3; }

/* ---------- план обучения (карточка-переход на Уроки) ---------- */
.lesson-card {
  border-radius: 24px; padding: 15px 16px; margin: 16px 0 14px;
  background: linear-gradient(120deg, #ffe9d6, #ffd6ec);
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; border: none; width: 100%; text-align: left;
  min-height: 44px;
}
.lesson-card .ic {
  width: 42px; height: 42px; border-radius: 14px; background: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
  box-shadow: 0 4px 12px rgba(255,138,0,.25);
}
.lesson-card .ic svg.i { width: 21px; height: 21px; color: var(--orange); }
.lesson-card b { font-size: 13px; display: block; letter-spacing: -0.01em; }
.lesson-card small { font-size: 10.5px; color: var(--muted2); display: block; margin-top: 2px; }
.bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.8); margin-top: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--orange), var(--pink)); }
.lesson-card .go { margin-left: auto; color: var(--pink); }

/* ---------- быстрые действия ---------- */
.quick { display: flex; gap: 8px; margin: 0 0 16px; }
.qcard {
  flex: 1; border-radius: 20px; padding: 12px 11px; display: flex; flex-direction: column; gap: 3px;
  background: #fff; box-shadow: inset 0 1px 5px rgba(255,255,255,.4), 0 6px 18px rgba(140,100,255,.14);
  border: none; text-align: left; min-height: 44px; cursor: pointer;
}
.qcard svg.i { width: 19px; height: 19px; color: var(--pink); margin-bottom: 3px; }
.qcard b { font-size: 11.5px; letter-spacing: -0.01em; }
.qcard span { font-size: 9.5px; color: var(--muted); line-height: 1.3; }

/* ---------- «Твои работы» / галерея ---------- */
.gtitle { font-size: 13.5px; font-weight: 900; margin: 0 2px 8px; letter-spacing: -0.01em; }
.gal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.tile {
  position: relative; border-radius: 24px; overflow: hidden; height: 112px;
  box-shadow: inset 0 2px 10px rgba(255,255,255,.35), 0 8px 22px rgba(15,16,26,.10);
  background: linear-gradient(135deg, #f1f3f6, #e9ecf1);
  border: none; padding: 0; cursor: pointer; min-height: 44px;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* .placeholder используется и внутри .tile (галерея), и напрямую в .lightbox-media
   (когда открываем работу без urls) — стили общие, не завязаны на предка .tile. */
.placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; color: var(--muted);
}
.placeholder svg.i { width: 26px; height: 26px; }
.placeholder span { font-size: 9.5px; font-weight: 700; }
.lightbox-media .placeholder svg.i { width: 36px; height: 36px; }
.lightbox-media .placeholder span { font-size: 12px; }
.badge {
  position: absolute; left: 8px; bottom: 8px; font-size: 9px; font-weight: 800; padding: 4px 9px;
  border-radius: 99px; color: #fff; background: rgba(15,16,26,.5); backdrop-filter: blur(4px);
  display: inline-flex; align-items: center; gap: 4px;
}
.badge svg.i { width: 11px; height: 11px; stroke-width: 2.4; }
.gallery-empty { font-size: 12px; color: var(--muted); padding: 10px 2px 4px; line-height: 1.5; }

/* ---------- fab ---------- */
.fab {
  position: fixed; right: max(16px, calc((100% - 560px) / 2 + 16px)); bottom: calc(84px + var(--safe-bottom) + 8px);
  border-radius: 99px; padding: 14px 22px; font-weight: 900; font-size: 14px; display: flex; gap: 7px; align-items: center;
  background: var(--orange); color: #fff; box-shadow: 0 10px 26px rgba(255,138,0,.4);
  border: none; cursor: pointer; min-height: 44px; z-index: 5;
}
.fab svg.i { width: 17px; height: 17px; }

/* ---------- нижняя навигация ---------- */
.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px;
  display: flex; padding: 8px 4px calc(10px + var(--safe-bottom)); background: #fff; border-top: 1px solid var(--border);
  z-index: 10;
}
.tab {
  flex: 1; text-align: center; font-size: 9.5px; font-weight: 700; display: flex; flex-direction: column; gap: 4px;
  align-items: center; color: #b8b9c2; background: none; border: none; padding: 6px 2px; min-height: 44px; cursor: pointer;
}
.tab.on { color: var(--pink); }
.tab svg.i { width: 20px; height: 20px; }

/* ---------- Уроки ---------- */
.lhero {
  padding: 26px 18px 18px;
  background: radial-gradient(130% 140% at 80% 0%, #ffe9d6 0%, #ffd6ec 45%, #e9dcff 85%, #fff 100%);
}
.lhero .hi { font-size: 22px; font-weight: 900; letter-spacing: -0.03em; }
.lhero .sub { font-size: 13px; line-height: 1.45; margin-top: 6px; font-weight: 600; opacity: .85; }

.lprog { margin: 14px 2px 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.lprog .bar { background: var(--track); }

.steps { padding: 4px 2px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 11px 6px; background: none; border: none; width: 100%; text-align: left; min-height: 44px; cursor: pointer; }
.step .n {
  width: 35px; height: 35px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px; position: relative;
}
.step .n svg.i { width: 16px; height: 16px; }
.step .line { position: absolute; top: 37px; left: 50%; transform: translateX(-50%); width: 2px; height: 30px; background: #f1e6f6; }
.step.done .n { background: var(--green-bg); color: var(--green-fg); }
.step.act .n { background: linear-gradient(120deg, var(--orange), var(--pink)); color: #fff; box-shadow: 0 6px 16px rgba(255,84,187,.35); }
.step.lock .n { background: var(--track); color: #b8b9c2; }
.step b { font-size: 12.5px; display: block; letter-spacing: -0.01em; color: var(--ink); }
.step small { font-size: 10.5px; color: var(--muted); display: block; margin-top: 2px; line-height: 1.35; }
.step .tagrow { margin-top: 6px; display: flex; gap: 5px; }
.step .tag { font-size: 8.5px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--track); color: #55565f; }
.step.act .tag.hot { background: #ffe3f2; color: var(--pink-hot); }
.step .right { margin-left: auto; align-self: center; color: #b8b9c2; }
.step.done .right { color: var(--green-fg); }
.step.act .right { color: var(--pink); }

.step-action { margin: 4px 6px 12px 47px; }
.step-action button {
  border: none; border-radius: 14px; padding: 10px 16px; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(120deg, var(--orange), var(--pink)); display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; cursor: pointer;
}
.step-action button svg.i { width: 15px; height: 15px; }

/* ---------- Создать ---------- */
.preset-list { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.preset-card {
  display: flex; align-items: center; gap: 13px; border-radius: 22px; padding: 14px 15px;
  background: #fff; box-shadow: inset 0 1px 5px rgba(255,255,255,.4), 0 6px 18px rgba(140,100,255,.12);
  border: none; text-align: left; width: 100%; cursor: pointer; min-height: 44px;
}
.preset-card .ic {
  width: 44px; height: 44px; border-radius: 16px; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffe9d6, #ffd6ec); color: var(--orange);
}
.preset-card .ic svg.i { width: 21px; height: 21px; }
.preset-card b { font-size: 13px; display: block; }
.preset-card span { font-size: 11px; color: var(--muted); line-height: 1.4; display: block; margin-top: 2px; }
.preset-card .go { margin-left: auto; color: #b8b9c2; }

.create-header { padding: 20px 16px 4px; }
.create-header .hi { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; }
.create-header .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: 12.5px; font-weight: 700;
  max-width: 88%; text-align: center; box-shadow: 0 12px 30px rgba(15,16,26,.3); z-index: 30;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast svg.i { color: var(--orange); width: 16px; height: 16px; flex: none; }

/* ---------- Тарифы ---------- */
.tariff-header { padding: 20px 16px 4px; }
.tariff-header .hi { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; }
.tariff-header .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.tariff-list { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.tariff-card {
  border-radius: 24px; padding: 18px; background: #fff;
  box-shadow: inset 0 1px 5px rgba(255,255,255,.4), 0 8px 22px rgba(140,100,255,.14);
  position: relative;
}
.tariff-card.pro { background: linear-gradient(150deg, #fff 0%, #fff3fb 100%); border: 1px solid #ffd6ec; }
.tariff-card .row { display: flex; align-items: center; gap: 10px; }
.tariff-card .ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--track); color: var(--ink); flex: none; }
.tariff-card.pro .ic { background: linear-gradient(120deg, var(--orange), var(--pink)); color: #fff; }
.tariff-card .ic svg.i { width: 19px; height: 19px; }
.tariff-card .name { font-size: 15px; font-weight: 900; letter-spacing: -0.01em; }
.tariff-card .price { font-size: 13px; font-weight: 800; color: var(--muted2); margin-left: auto; white-space: nowrap; }
.tariff-card ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.tariff-card li { font-size: 12px; color: var(--ink); display: flex; align-items: flex-start; gap: 7px; line-height: 1.4; }
.tariff-card li svg.i { color: var(--green-fg); width: 14px; height: 14px; margin-top: 2px; flex: none; }
.tariff-card .soon {
  margin-top: 14px; width: 100%; border: none; border-radius: 14px; padding: 12px; font-size: 12.5px; font-weight: 800;
  background: var(--track); color: var(--muted2); min-height: 44px; cursor: default;
}
.tariff-card.pro .soon { background: var(--ink); color: #fff; }

/* ---------- Профиль ---------- */
.profile-header { padding: 26px 18px 22px; background: radial-gradient(130% 140% at 20% 0%, #99eeff 0%, #c5b3ff 45%, #ffb3e2 85%, #fff 100%); display: flex; align-items: center; gap: 14px; }
.profile-avatar { width: 56px; height: 56px; border-radius: 20px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(140,100,255,.2); flex: none; }
.profile-avatar svg.i { width: 26px; height: 26px; color: var(--pink); }
.profile-header .name { font-size: 18px; font-weight: 900; letter-spacing: -0.02em; }
.profile-header .plat { font-size: 11.5px; font-weight: 700; opacity: .75; margin-top: 3px; }

.profile-limits { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.plimit-card { border-radius: 20px; padding: 14px 15px; background: #fff; box-shadow: inset 0 1px 5px rgba(255,255,255,.4), 0 6px 18px rgba(140,100,255,.12); display: flex; align-items: center; gap: 12px; }
.plimit-card .ic { width: 38px; height: 38px; border-radius: 13px; background: var(--track); display: flex; align-items: center; justify-content: center; color: var(--orange); flex: none; }
.plimit-card .ic svg.i { width: 18px; height: 18px; }
.plimit-card b { font-size: 12.5px; display: block; }
.plimit-card .val { font-size: 11px; color: var(--muted); margin-top: 2px; }

.profile-link {
  display: flex; align-items: center; gap: 10px; padding: 14px 15px; margin: 0 16px 16px; border-radius: 18px;
  background: var(--track); border: none; width: calc(100% - 32px); text-align: left; font-size: 12.5px; font-weight: 700;
  color: var(--ink); min-height: 44px; cursor: pointer;
}
.profile-link svg.i { color: var(--muted2); width: 17px; height: 17px; }
.profile-link .chev { margin-left: auto; color: #b8b9c2; }

/* ---------- модалки (правила / лайтбокс галереи) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,16,26,.45); z-index: 40; display: none; align-items: flex-end; }
.modal-backdrop.open { display: flex; }
.modal-sheet { background: #fff; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 26px 26px 0 0; padding: 18px 18px calc(20px + var(--safe-bottom)); max-height: 82vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal-head h3 { font-size: 15px; font-weight: 900; margin: 0; }
.modal-close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; background: var(--track); border: none; display: flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; min-height: 34px; }
.modal-close svg.i { width: 16px; height: 16px; }
.modal-body { font-size: 12.5px; color: var(--muted2); line-height: 1.6; }
.modal-body p { margin: 0 0 10px; }

.lightbox-media { border-radius: 20px; overflow: hidden; margin-bottom: 14px; background: var(--track); min-height: 200px; display: flex; align-items: center; justify-content: center; }
.lightbox-media img, .lightbox-media video { width: 100%; display: block; max-height: 50vh; object-fit: contain; }
.lightbox-actions { display: flex; gap: 10px; }
.lightbox-actions button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; border: none; border-radius: 16px;
  padding: 12px; font-size: 12.5px; font-weight: 800; background: var(--track); color: var(--ink); min-height: 44px; cursor: pointer;
}
.lightbox-actions svg.i { width: 16px; height: 16px; }

@media (max-width: 360px) {
  .quick { gap: 6px; }
  .qcard { padding: 10px 8px; }
}
