/* ===== Айзек Learn — дизайн по Apple HIG ===== */

:root {
  /* системные цвета iOS */
  --bg: #f2f2f7;              /* systemGroupedBackground */
  --surface: #ffffff;         /* secondarySystemGroupedBackground */
  --surface-2: #efeff4;       /* tertiary */
  --ink: #000000;             /* label */
  --ink-2: #3c3c43;           /* secondaryLabel @ 60% */
  --muted: #8a8a8e;           /* tertiaryLabel */
  --separator: rgba(60, 60, 67, .18);
  --accent: #007aff;          /* systemBlue */
  --accent-soft: #e8f1ff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --fill: rgba(120, 120, 128, .12);

  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Inter", "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 74px;
}

/* Тёмной темы нет намеренно: приложение всегда светлое. */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;                 /* iOS body */
  line-height: 1.4;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }

.wrap { padding: 8px 16px; max-width: 700px; margin: 0 auto; }

/* ---------- типографика ---------- */
.large-title { font-size: 34px; font-weight: 700; letter-spacing: -.024em; line-height: 1.12; margin: 10px 0 2px; }
.title-2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.headline { font-size: 17px; font-weight: 600; letter-spacing: -.012em; }
.subhead { font-size: 15px; color: var(--ink-2); opacity: .75; }
.footnote { font-size: 13px; color: var(--muted); }
.caption { font-size: 12px; color: var(--muted); }

/* заголовок группы, как в Настройках */
.group-title {
  font-size: 20px; font-weight: 700; color: var(--ink);
  letter-spacing: -.02em; margin: 28px 2px 12px;
}

/* ---------- шапка ---------- */
.head { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; }
.head .t { flex: 1; min-width: 0; }
.head .greet { font-size: 26px; font-weight: 700; letter-spacing: -.024em; line-height: 1.15; }
.head .greet .name { color: var(--muted); font-weight: 600; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--surface-2) center/cover;
}

/* ---------- баннер ---------- */
.banner {
  position: relative; border-radius: 20px; overflow: hidden;
  background: #232326; color: #fff; padding: 22px 20px 20px;
  min-height: 200px; display: flex; flex-direction: column;
  border: 0; width: 100%; text-align: left;
}
.banner h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  max-width: 56%; line-height: 1.28; }
.banner .sub { color: rgba(255, 255, 255, .55); font-size: 14px; margin-top: 8px; max-width: 52%; }
.banner .bottom { margin-top: auto; display: flex; align-items: center; gap: 10px; }
.banner .dots { display: flex; }
.banner .dots i {
  width: 26px; height: 26px; border-radius: 50%; display: block; margin-right: -7px;
  border: 2px solid #232326; background: var(--d);
}
.banner .hint { color: rgba(255, 255, 255, .55); font-size: 14px; margin-left: 14px; }
.banner .cta {
  position: absolute; right: 16px; bottom: 18px; z-index: 3;
  background: #fff; color: #000; border: 0; border-radius: 999px;
  padding: 13px 20px; font-weight: 600; font-size: 15px; white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.banner .mark {
  position: absolute; right: 18px; top: 18px; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .92);
}
/* Персонаж: крупно, прижат к правому нижнему углу, слегка выходит за карточку.
   Подсветка сзади отделяет его от тёмного фона. */
.banner img.char {
  position: absolute; right: -12px; bottom: -2px; height: 218px;
  object-fit: contain; object-position: bottom right;
  pointer-events: none; z-index: 2;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .45));
}
.banner .glow {
  position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px;
  border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.13) 0%, rgba(255,255,255,0) 68%);
}
.banner h2 { max-width: 52%; }
.banner .sub { max-width: 50%; }

/* ---------- сегменты категорий ---------- */
.tabs {
  display: flex; gap: 4px; align-items: center; overflow-x: auto;
  margin: 20px -16px 14px; padding: 2px 16px 6px; scrollbar-width: none;
}
.tabs .divider { flex: none; width: 1px; height: 22px; background: var(--separator); margin: 0 10px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; border: 0; background: transparent; color: var(--muted);
  padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: 16px;
  white-space: nowrap; transition: background .18s, color .18s;
}
.tab.on { background: var(--ink); color: #fff; }

/* ---------- сгруппированный список (iOS Settings) ---------- */
.list {
  background: var(--surface); border-radius: var(--r-md); overflow: hidden;
  margin-bottom: 18px;
}
.list > * + * { border-top: .5px solid var(--separator); }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 0; padding: 13px 16px; min-height: 52px;
  font-size: 17px; color: var(--ink);
}
.item:active { background: var(--fill); }
.item .t { flex: 1; min-width: 0; }
.item .t small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.item .val { color: var(--muted); font-size: 16px; }
.item .chev { color: var(--muted); font-size: 15px; flex: none; opacity: .55; }
.item .num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--fill);
  color: var(--muted); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.item.done .num { background: var(--green); color: #fff; }
.item.locked { opacity: .5; }

/* ---------- сетка курсов ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: transparent; border: 0; padding: 0; text-align: left; }
.card .cover {
  position: relative; aspect-ratio: 1/1; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface) center/cover;
  display: flex; align-items: center; justify-content: center; font-size: 68px;
}
.card:active .cover { transform: scale(.97); transition: transform .12s; }
.card .badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(255, 255, 255, .72); color: #000;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}
.card .lock {
  position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .55); color: #fff;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 999px;
}
.card h3 { margin: 9px 1px 2px; font-size: 15px; font-weight: 600; line-height: 1.25; letter-spacing: -.012em; }
.card .meta { margin: 0 1px; font-size: 13px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.card .price { color: var(--ink); font-weight: 600; }

/* ---------- таб-бар с блюром ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50;
  display: flex; gap: 4px; padding: 6px;
  background: rgba(255, 255, 255, .86); border-radius: 999px;
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .05);
}
.tabbar button {
  border: 0; background: transparent; color: var(--muted); font-size: 16px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; display: flex; align-items: center; gap: 8px;
  transition: background .18s, color .18s;
}
.tabbar button .ic { font-size: 18px; line-height: 1; }
.tabbar button.on { background: var(--ink); color: #fff; }

/* ---------- экраны курса / урока ---------- */
.nav {
  display: flex; align-items: center; gap: 6px; margin: 2px 0 10px;
  color: var(--accent); font-size: 17px;
}
.nav button { border: 0; background: transparent; color: var(--accent); padding: 6px 0; font-size: 17px; }

.hero {
  border-radius: 20px; padding: 20px; min-height: 152px; position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--surface); overflow: hidden; margin-bottom: 20px;
}
.hero h2 { margin: 0 0 8px; font-size: 28px; font-weight: 700; letter-spacing: -.024em;
  max-width: 76%; line-height: 1.14; }
.hero .meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; }
.hero .emoji { position: absolute; right: 16px; top: 16px; font-size: 58px; }

.article { font-size: 17px; line-height: 1.53; color: var(--ink); }
.article h3 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 28px 0 8px; }
.article p { margin: 0 0 15px; }
.article p.lead { font-size: 19px; font-weight: 500; letter-spacing: -.016em; line-height: 1.4; }
.article img { width: 100%; border-radius: var(--r-md); margin: 12px 0; }

video { width: 100%; border-radius: var(--r-md); background: #000; display: block; }

/* прогресс */
.bar { height: 4px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; border: 0; border-radius: 999px; padding: 17px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 17px;
  letter-spacing: -.012em;
}
.btn:active { opacity: .78; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--separator); }
.btn.dark { background: var(--accent); color: #fff; }
.btn.danger { background: var(--fill); color: var(--red); }
.btn:disabled { opacity: .4; }
.btn.sm { padding: 10px 18px; font-size: 15px; width: auto; }

.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(249, 249, 249, .82);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-top: .5px solid var(--separator);
}
.sticky .inner { max-width: 700px; margin: 0 auto; }

/* ---------- онбординг / гейт ---------- */
.sheet { padding: 8px 0 20px; }
.sheet .pic {
  display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-radius: 20px; padding: 20px 14px 0; margin-bottom: 22px; overflow: hidden;
}
.sheet .pic img { height: 190px; object-fit: contain; display: block; }
.sheet h2 { text-align: center; margin: 0 0 8px; font-size: 28px; font-weight: 700; letter-spacing: -.024em; }
.sheet .lead { text-align: center; color: var(--muted); font-size: 15px; margin: 0 auto 22px;
  line-height: 1.45; max-width: 340px; }

.check {
  display: flex; align-items: center; gap: 12px; background: transparent;
  padding: 13px 16px; border: 0; width: 100%; text-align: left; min-height: 56px;
}
.check .box {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--separator); display: flex; align-items: center;
  justify-content: center; color: transparent; font-size: 13px; font-weight: 700;
}
.check.on .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.check .t { font-size: 17px; }
.check .t small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }

.foot-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 14px; line-height: 1.4; }

/* ---------- профиль ---------- */
.p-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 22px; }
.p-head .avatar { width: 66px; height: 66px; }
.p-head .n { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.p-head .u { color: var(--muted); font-size: 15px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; }
.tile .lbl { color: var(--muted); font-size: 13px; }
.tile .val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }

.knob {
  width: 51px; height: 31px; border-radius: 99px; background: var(--fill); position: relative;
  transition: background .2s; flex: none; border: 0;
}
.knob::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
  border-radius: 50%; background: #fff; transition: left .2s;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16);
}
.knob.on { background: var(--green); }
.knob.on::after { left: 22px; }

/* ---------- служебное ---------- */
.empty { text-align: center; color: var(--muted); padding: 60px 24px; font-size: 16px; line-height: 1.5; }
.skeleton { background: var(--fill); border-radius: var(--r-md); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 99;
  background: rgba(28, 28, 30, .92); color: #fff; padding: 12px 20px; border-radius: 999px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: 15px; font-weight: 500; max-width: 88%; text-align: center;
  animation: up .28s cubic-bezier(.32, .72, 0, 1);
}
@keyframes up { from { opacity: 0; transform: translate(-50%, 14px) } }

/* ---------- квиз ---------- */
.q { background: var(--surface); border-radius: var(--r-md); padding: 16px; margin-bottom: 12px; }
.q .qt { font-weight: 600; margin-bottom: 12px; font-size: 17px; line-height: 1.35; letter-spacing: -.012em; }
.opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--fill); border: 1.5px solid transparent; border-radius: 12px;
  padding: 13px; margin-bottom: 8px; font-size: 16px;
}
.opt.right { border-color: var(--green); background: rgba(52, 199, 89, .12); }
.opt.wrong { border-color: var(--red); background: rgba(255, 59, 48, .12); }
.q .expl { font-size: 15px; color: var(--muted); margin-top: 10px; line-height: 1.45; }

/* ---------- админка ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin: 0 4px 6px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--surface); border: .5px solid var(--separator);
  border-radius: 12px; padding: 13px 14px; outline: none; font-size: 17px;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.chip { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: var(--fill); color: var(--muted); white-space: nowrap; }
.chip.live { background: rgba(52, 199, 89, .16); color: var(--green); }
.chip.draft { background: rgba(255, 149, 0, .16); color: var(--orange); }
.chip.paid { background: var(--accent-soft); color: var(--accent); }

.icon-btn { border: 0; background: var(--fill); border-radius: 9px; width: 34px; height: 34px;
  font-size: 15px; flex: none; }

.bstat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.bstat div { background: var(--surface); border-radius: 12px; padding: 12px 8px; text-align: center; }
.bstat b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.bstat span { font-size: 11px; color: var(--muted); }
.bstat .s b { color: var(--green); }
.bstat .b b { color: var(--red); }
.bstat .f b { color: var(--orange); }

/* ================= АНИМАЦИИ ================= */

/* Персонаж чуть дышит — иначе баннер выглядит мёртвой картинкой */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-9px) rotate(-1.2deg); }
}
.banner img.char {
  animation: float 4.5s ease-in-out infinite;
  transform-origin: bottom center;
}
.sheet .pic img { animation: float 5s ease-in-out infinite; transform-origin: bottom center; }

/* Появление экрана */
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* Telegram Desktop WebKit can leave the entire animated wrapper unpainted.
   Keep content visible; individual cards and the startup screen still animate. */
.wrap { animation: none; }

/* Карточки выезжают лесенкой */
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.grid .card { animation: card-in .42s cubic-bezier(.32, .72, 0, 1) backwards; }
.grid .card:nth-child(1) { animation-delay: .02s }
.grid .card:nth-child(2) { animation-delay: .06s }
.grid .card:nth-child(3) { animation-delay: .10s }
.grid .card:nth-child(4) { animation-delay: .14s }
.grid .card:nth-child(5) { animation-delay: .18s }
.grid .card:nth-child(6) { animation-delay: .22s }
.grid .card:nth-child(n+7) { animation-delay: .26s }

/* Строки списка — тем же приёмом */
.list .item { animation: card-in .38s cubic-bezier(.32, .72, 0, 1) backwards; }
.list .item:nth-child(2) { animation-delay: .04s }
.list .item:nth-child(3) { animation-delay: .08s }
.list .item:nth-child(4) { animation-delay: .12s }
.list .item:nth-child(n+5) { animation-delay: .16s }

/* Нажатия — упругий отклик */
.card, .btn, .tab, .tabbar button, .banner, .item { transition: transform .16s cubic-bezier(.32,.72,0,1); }
.card:active { transform: scale(.965); }
.btn:active { transform: scale(.975); }
.banner:active { transform: scale(.985); }
.item:active { transform: scale(.99); }
.tabbar button:active { transform: scale(.94); }

/* Правильный ответ в тесте — короткий кивок */
@keyframes pop { 0% { transform: scale(1) } 45% { transform: scale(1.035) } 100% { transform: scale(1) } }
.opt.right { animation: pop .34s cubic-bezier(.32, .72, 0, 1); }
@keyframes shake {
  0%, 100% { transform: translateX(0) } 20% { transform: translateX(-6px) }
  40% { transform: translateX(5px) } 60% { transform: translateX(-3px) } 80% { transform: translateX(2px) }
}
.opt.wrong { animation: shake .4s; }

/* Прогресс-бар рассылки — живая полоска */
.bar > i { position: relative; overflow: hidden; }
.bar > i::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: sheen 1.4s linear infinite;
}
@keyframes sheen { from { transform: translateX(-100%) } to { transform: translateX(100%) } }
.bar.done > i::after { display: none; }

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  *, *::after { animation: none !important; transition: none !important; }
}

/* ================= ПОД РЕФЕРЕНС ================= */

/* Плашка подписки: серая карточка, синяя таблетка, подчёркнутая вторая строка */
.plus-strip {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 16px 16px; margin-bottom: 20px;
}
.plus-strip .plus {
  flex: none; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; letter-spacing: .01em;
}
.plus-strip .txt { font-size: 17px; line-height: 1.3; }
.plus-strip .txt u { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.plus-strip.off .plus { background: var(--muted); }

/* Обложки курсов: пастельная подложка под категорию */
.card .cover { background-image: var(--cov, none); }
.cov-ubt     { --cov: linear-gradient(160deg, #ece9ff, #dad4ff); }
.cov-ai      { --cov: linear-gradient(160deg, #e6f0ff, #d4e4ff); }
.cov-tiktok  { --cov: linear-gradient(160deg, #ffe6ef, #ffd2e2); }
.cov-vkshops { --cov: linear-gradient(160deg, #fff0e2, #ffe0c7); }
.cov-none    { --cov: linear-gradient(160deg, #f0f0f3, #e4e4e9); }

.card .badge {
  background: rgba(40, 40, 42, .78); color: #fff;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-size: 12px; font-weight: 500; padding: 5px 11px; top: 10px; left: 10px;
}
.card h3 { font-size: 17px; font-weight: 500; margin: 12px 1px 6px; line-height: 1.28; }
.card .meta { font-size: 15px; gap: 6px; }
.card .meta .clock { opacity: .55; font-size: 14px; }

/* Цветные иконки-плитки в профиле, как в Настройках iOS */
.tile-ic {
  flex: none; width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}
.ic-orange { background: linear-gradient(180deg, #ffa53d, #ff8a00); }
.ic-blue   { background: linear-gradient(180deg, #45a6ff, #007aff); }
.ic-violet { background: linear-gradient(180deg, #8b7bff, #6355ff); }
.ic-green  { background: linear-gradient(180deg, #3ecf8e, #0fa968); }
.ic-red    { background: linear-gradient(180deg, #ff6b63, #ff3b30); }
.ic-gray   { background: linear-gradient(180deg, #a9a9ae, #8a8a8e); }

/* Список в профиле — как сгруппированные секции */
.list.plain { background: var(--surface-2); }
.list.plain > * + * { border-top: .5px solid var(--separator); }

/* Галочка-строка */
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px; }
.check-row .mark {
  flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.check-row.off .mark { background: var(--fill); color: transparent; }
.check-row .t { font-size: 17px; }
.check-row .t small { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; line-height: 1.35; }

/* ---------- выбор обложки в админке ---------- */
.cover-pick { display: flex; gap: 14px; align-items: flex-start; }
.cover-prev {
  flex: none; width: 104px; height: 104px; border-radius: var(--r-md);
  background: var(--fill) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; text-align: center; padding: 8px;
}
.cover-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cover-actions .caption { line-height: 1.35; }


/* ---------- читаемость заголовка поверх обложки ---------- */
/* Без затемнения текст тонет в картинке — особенно на пёстрых обложках. */
.hero.has-cover { background-size: cover; background-position: center; }
.hero.has-cover::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top,
    rgba(0,0,0,.86) 0%, rgba(0,0,0,.62) 34%, rgba(0,0,0,.18) 64%, rgba(0,0,0,.05) 100%);
}
.hero.has-cover > * { position: relative; z-index: 2; }
.hero.has-cover h2 { color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,.4); }
.hero.has-cover .meta { color: rgba(255,255,255,.82); text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.hero.has-cover { min-height: 200px; }

/* Когда снизу висит кнопка покупки, плавающая панель её перекрывает — прячем панель. */
body.has-sticky .tabbar { display: none; }

/* метка статьи на карточке */
.card .kind-tag {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(255, 255, 255, .82); color: #000;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}

/* строка с прямой ссылкой в админке */
.link-row { display: flex; gap: 8px; align-items: center; }
.link-row input { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); }

.field .caption { margin: 6px 4px 0; }
.field input[readonly] { color: var(--muted); background: var(--fill); }

/* ================= НЕТВОРКИНГ ================= */

.person-row { align-items: flex-start; padding: 14px 16px; }
.pface {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: var(--fill) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; color: var(--muted); text-transform: uppercase;
}
.pface.big { width: 96px; height: 96px; font-size: 36px; margin-bottom: 14px; }

.person-row .t b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.012em; }
.person-row .t small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; line-height: 1.3; }

/* специализация — жёлтым, как просил */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags i {
  font-style: normal; font-size: 12px; font-weight: 600;
  background: #ffd60a; color: #241a00;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.tags.big { margin-top: 12px; justify-content: center; }
.tags.big i { font-size: 13px; padding: 5px 12px; }

.person-head { text-align: center; padding: 6px 0 18px; }
.person-head .pface { margin-left: auto; margin-right: auto; }

/* ---------- цветные метки типа материала ---------- */
.card .kind-tag {
  color: #fff; background: rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.card .kind-tag.k-course    { background: #007aff; }   /* курс — синий */
.card .kind-tag.k-article   { background: #8b5cf6; }   /* статья — фиолетовый */
.card .kind-tag.k-community { background: #34c759; }   /* сообщество — зелёный */

/* переключатель типа материала в админке */
.seg {
  display: flex; gap: 4px; background: var(--fill); border-radius: 12px; padding: 4px;
}
.seg button {
  flex: 1; border: 0; background: transparent; color: var(--ink);
  padding: 10px 6px; border-radius: 9px; font-size: 15px; font-weight: 500;
  transition: background .16s, color .16s;
}
.seg button.on { color: #fff; font-weight: 600; }
.seg button.on.k-course    { background: #007aff; }
.seg button.on.k-article   { background: #8b5cf6; }
.seg button.on.k-community { background: #34c759; }

/* Вебвью Телеграма не открывает диалог ни для скрытого поля, ни по клику
   из кода. Единственный надёжный способ — положить сам input прозрачным
   слоем поверх кнопки: палец попадает прямо в него. */
.file-pick { position: relative; overflow: hidden; display: inline-flex; }
.file-pick input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 200px;
}
label.btn { display: inline-flex; cursor: pointer; }

/* display:flex у .btn перебивал браузерное правило для [hidden] —
   кнопки, которые должны быть скрыты, оставались видимыми. */
[hidden] { display: none !important; }

/* ---------- золотые карточки в нетворкинге ---------- */
:root {
  --gold-1: #f5d16b;
  --gold-2: #d4a63c;
  --gold-3: #b8862a;
}

/* Обводка золотом: градиентная рамка поверх белой карточки. */
.person-row.gold {
  position: relative;
  background: linear-gradient(180deg, #fffdf5 0%, #fff9e8 100%);
}
.person-row.gold::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 2px; pointer-events: none;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3), var(--gold-1));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
/* Карточка в списке — единственная в своей группе, поэтому скругляем сама себя. */
.list .person-row.gold { border-radius: var(--r-md); }

/* Кольцо вокруг фото */
.pface.gold {
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--gold-2);
}
.pface.big.gold { box-shadow: 0 0 0 3px #fff, 0 0 0 6.5px var(--gold-2); }

.person-head.gold { position: relative; }
.person-head.gold::before {
  content: "★"; display: block; color: var(--gold-2); font-size: 15px; margin-bottom: 6px;
}

.chip.gold {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  color: #3d2c00;
}

/* Startup stays visible until the first usable screen is ready. */
[hidden] { display: none !important; }
:root { color-scheme: light; }
body.booting { overflow: hidden; }
.startup {
  position: fixed; inset: 0; z-index: 1000; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  padding: max(28px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom));
  background: #f2f2f7; text-align: center; opacity: 1;
  transition: opacity .32s ease, visibility .32s; overflow: auto;
}
.startup.leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.startup-art { position: relative; width: 220px; height: 220px; margin-bottom: 26px; flex-shrink: 0; }
.startup-halo { position: absolute; inset: 12px; border-radius: 50%; background: #e6dffa; animation: breathe 2.8s ease-in-out infinite; }
.startup-art img { position: absolute; bottom: 14px; left: 22px; width: 176px; height: 192px; object-fit: contain; object-position: bottom; animation: float-in 3s ease-in-out infinite; }
.startup-spark { position: absolute; z-index: 1; color: #8470c8; font-size: 28px; animation: breathe 2.8s ease-in-out infinite; }
.spark-one { top: 17px; left: 12px; }.spark-two { right: 5px; bottom: 35px; color: #e8ab41; font-size: 35px; animation-delay: -.9s; }
.startup-brand { font-size: 10px; font-weight: 700; letter-spacing: .2em; color: #77717f; }
.startup h1 { font-size: clamp(28px, 8vw, 34px); letter-spacing: -.04em; margin: 8px 0 12px; line-height: 1.15; }
.startup p { font-size: 15px; color: #77717f; margin: 0; max-width: 300px; }
.startup-progress { width: 116px; height: 4px; background: #dedbe5; overflow: hidden; border-radius: 4px; margin-top: 24px; }
.startup-progress i { display: block; height: 100%; width: 42%; background: #1d1b22; border-radius: inherit; animation: loading-slide 1.35s ease-in-out infinite; }
.startup-note { margin-top: 44px; font-size: 12px; color: #8a8491; }
.startup #startup-retry { width: auto; margin-top: 20px; min-width: 160px; }
.startup-failed .startup-progress { display: none; }
.startup-failed * { animation: none !important; }
.screen-error { padding-top: 70px; text-align: center; }
.screen-error h2 { font-size: 24px; }.screen-error p { color: var(--muted); }
.screen-error .btn { margin: 12px auto; max-width: 320px; }
@keyframes breathe { 0%,100% { transform: scale(.96); } 50% { transform: scale(1.04); } }
@keyframes float-in { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes loading-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(350%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .startup-progress i { width: 100%; opacity: .6; }
}
@media (max-height: 560px) {
  .startup-art { width: 180px; height: 160px; margin-bottom: 14px; }
  .startup-art img { width: 130px; height: 145px; left: 25px; bottom: 0; }
  .startup-note { margin-top: 24px; }
}
