:root {
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --accent: #e6a93c;
  --radius-card: 15px;
  --radius-pill: 999px;
  --max-w: 480px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tg-vh: 100dvh; /* вне Telegram остаётся обычный 100dvh */
}

[data-theme="dark"] {
  --bg: #0b0b0d;
  --surface: #141418;
  --surface2: #1b1b20;
  --text: #f1f0ea;
  --muted: #94949c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --accent: #e6a93c;
  --accent-soft: rgba(230, 169, 60, 0.16);
  --good: #54c08a;
  --good-soft: rgba(84, 192, 138, 0.15);
  --topbar: rgba(11, 11, 13, 0.72);
  --tabbar: rgba(15, 15, 18, 0.86);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.28), 0 3px 10px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.32), 0 12px 30px rgba(0, 0, 0, 0.30);
  --shadow-3: 0 4px 12px rgba(0, 0, 0, 0.38), 0 20px 50px rgba(0, 0, 0, 0.36);
  --glow-sm: 0 0 12px rgba(230, 169, 60, 0.16);
  --glow-md: 0 0 22px rgba(230, 169, 60, 0.20), 0 0 60px rgba(230, 169, 60, 0.08);
  --hairline-gold: linear-gradient(135deg, rgba(230, 169, 60, 0.50), rgba(255, 255, 255, 0.10) 30%, rgba(230, 169, 60, 0.06) 62%, rgba(230, 169, 60, 0.38));
  --gold-text: linear-gradient(180deg, #ffd98a 8%, #e6a93c 55%, #c9871f 100%);
}

[data-theme="light"] {
  --bg: #f2f0e8;
  --surface: #ffffff;
  --surface2: #f7f5ee;
  --text: #191919;
  --muted: #6c6c72;
  /* приказ 25.07: серая нейтральная окантовка была «вялой» — берём тон
     из золотого кольца портала (уже проверенный светлый акцент #9e6a10),
     единый источник для всех var(--border)/var(--border-strong) в проекте */
  --border: rgba(158, 106, 16, 0.26);
  --border-strong: rgba(158, 106, 16, 0.42);
  --accent: #bd7a17;
  --accent-soft: rgba(189, 122, 23, 0.13);
  --good: #2f9d68;
  --good-soft: rgba(47, 157, 104, 0.13);
  --topbar: rgba(242, 240, 232, 0.78);
  --tabbar: rgba(248, 246, 239, 0.9);
  --shadow-1: 0 1px 2px rgba(40, 30, 10, 0.06), 0 3px 8px rgba(40, 30, 10, 0.05);
  --shadow-2: 0 2px 6px rgba(40, 30, 10, 0.07), 0 10px 26px rgba(40, 30, 10, 0.08);
  --shadow-3: 0 4px 10px rgba(40, 30, 10, 0.08), 0 18px 44px rgba(40, 30, 10, 0.10);
  --glow-sm: 0 0 10px rgba(189, 122, 23, 0.12);
  --glow-md: 0 0 18px rgba(189, 122, 23, 0.14), 0 0 48px rgba(189, 122, 23, 0.06);
  --hairline-gold: linear-gradient(135deg, rgba(189, 122, 23, 0.45), rgba(189, 122, 23, 0.10) 35%, rgba(189, 122, 23, 0.05) 62%, rgba(189, 122, 23, 0.32));
  --gold-text: linear-gradient(180deg, #d18f1e, #a96c0e 75%);
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  /* WKWebView (Telegram iOS) иногда игнорирует user-scalable=no из <meta viewport>
     на двойной тап / жест — глушим зум явно на уровне touch-action. */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #f0c069;
}

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

.app-shell {
  min-height: var(--tg-vh);
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: var(--max-w);
  height: var(--tg-vh);
  min-height: var(--tg-vh);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--topbar);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
  padding: calc(var(--safe-top) + 10px) 10px 10px;
}

/* На home — «кристалл» в шапке */
.topbar.topbar-crystal,
.topbar:has(.brand-crystal) {
  border-bottom-color: rgba(230, 169, 60, 0.22);
  background:
    radial-gradient(140px 50px at 18% 50%, rgba(230, 169, 60, 0.16), transparent 70%),
    radial-gradient(100px 40px at 70% 20%, rgba(230, 169, 60, 0.06), transparent 65%),
    var(--topbar);
  box-shadow:
    0 1px 0 rgba(230, 169, 60, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.25),
    inset 0 -1px 0 rgba(230, 169, 60, 0.06);
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  padding: 0 0 3px;
  border-radius: 10px;
  transition: transform 0.12s ease;
}

.icon-btn:active {
  transform: scale(0.88);
}

.brand {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  padding-left: 6px;
  padding-right: 4px;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Одна строка: facet orb + АБСОЛЮТ | lang | тема */
.brand-crystal {
  gap: 8px;
  max-width: min(46vw, 160px);
  padding: 4px 12px 4px 5px;
  border-radius: 12px;
  border: 1px solid rgba(230, 169, 60, 0.38);
  background:
    radial-gradient(60px 28px at 12% 50%, rgba(230, 169, 60, 0.28), transparent 70%),
    linear-gradient(135deg, rgba(230, 169, 60, 0.12), transparent 55%),
    rgba(12, 12, 16, 0.72);
  box-shadow:
    0 0 22px rgba(230, 169, 60, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 14px rgba(230, 169, 60, 0.08);
}

.brand-crystal .brand-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
  line-height: 1.15;
  max-width: 100%;
  text-shadow:
    0 0 18px rgba(230, 169, 60, 0.5),
    0 1px 0 rgba(0, 0, 0, 0.45);
}

.topbar-orb.crystal-orb.mini {
  width: 24px;
  height: 24px;
  margin: 0;
  flex: none;
}

.topbar-orb.crystal-orb.mini span {
  border-color: rgba(230, 169, 60, 0.6);
}

.topbar-orb.crystal-orb.mini span:nth-child(2) {
  inset: 5px;
}

.topbar-orb.crystal-orb.mini span:nth-child(3) {
  inset: 9px;
}

.topbar-orb.crystal-orb.mini.facet b {
  width: 5px;
  height: 5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px; /* кнопки не слипаются */
  flex: none;
  margin-left: auto;
}

.brand-sub {
  display: none;
}

[data-theme="light"] .topbar.topbar-crystal,
[data-theme="light"] .topbar:has(.brand-crystal) {
  background:
    radial-gradient(140px 50px at 18% 50%, rgba(189, 122, 23, 0.14), transparent 70%),
    var(--topbar);
}

[data-theme="light"] .brand-crystal {
  background:
    radial-gradient(80px 36px at 12% 50%, rgba(189, 122, 23, 0.18), transparent 70%),
    rgba(255, 255, 255, 0.82);
  border-color: rgba(189, 122, 23, 0.35);
  box-shadow:
    0 0 20px rgba(189, 122, 23, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 0 14px rgba(189, 122, 23, 0.06);
}

.top-title {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  padding-left: 4px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-btn {
  margin-left: 2px;
  width: 40px;
  height: 40px;
  flex: none;
  overflow: visible;
}

.theme-btn:active {
  transform: scale(0.88) rotate(-18deg);
}

.theme-glyph {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: linear-gradient(105deg, var(--text) 0 48%, transparent 52% 100%);
  box-shadow:
    0 0 0 1px rgba(230, 169, 60, 0.25),
    0 0 12px rgba(230, 169, 60, 0.18);
  flex: none;
}

[data-theme="light"] .theme-glyph {
  border-color: rgba(189, 122, 23, 0.65);
  background: linear-gradient(105deg, #1a1a1c 0 48%, #f2f0e8 52% 100%);
}

/* Home */
.page {
  padding: 16px 16px 26px;
}

.page.tight {
  padding-top: 14px;
}

.progress-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 22px;
}
/* Фоновый график активности: золотая кривая играет по всей плитке, контент поверх */
.progress-spark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 82%;
  color: var(--accent);
  opacity: 0.4;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(230, 169, 60, 0.45));
}
.progress-spark polyline {
  stroke-width: 1.6;
}
.progress-card > *:not(.progress-spark) {
  position: relative;
  z-index: 1;
}

.progress-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.progress-nums {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}

.progress-nums .big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.progress-nums .of {
  font-size: 15px;
  color: var(--muted);
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
}

.bar {
  margin-top: 14px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 2px 12px;
}

.topic-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: inherit;
  font: inherit;
  margin-bottom: 9px;
  transition: transform 0.12s ease;
}

.topic-btn:active {
  transform: scale(0.985);
}

.topic-n {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  min-width: 30px;
}

.topic-n.hot {
  color: var(--accent);
}

.topic-n.cold {
  color: var(--muted);
}

.topic-mid {
  flex: 1;
  min-width: 0;
}

.topic-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Подзаголовок раздела: до двух строк вместо обрезки в одну (3.1.9).
   На длинных локалях (hy 330px, kk 266px при ширине колонки 244px) строка
   резалась многоточием и половина смысла пропадала — теперь переносится. */
.topic-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.topic-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 62px;
}

.topic-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.mini-bar {
  width: 54px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.mini-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* Topic cards */
.topic-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.topic-head-n {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.topic-head-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-wrap: pretty;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
}

.card.learned {
  background: var(--surface2);
  border-left-color: var(--good);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.card-title {
  flex: 1;
  min-width: 0;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.card.learned .card-title {
  color: var(--muted);
}

.fav-btn {
  width: 40px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  margin: -4px -6px 0 0;
  font-size: 19px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.12s ease;
}

.fav-btn.on {
  color: var(--accent);
}

.fav-btn:active {
  transform: scale(0.85);
}

.card-p {
  margin: 9px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  opacity: 0.92;
  text-wrap: pretty;
}

.card-items {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-item {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  opacity: 0.92;
  padding-left: 17px;
  text-indent: -17px;
  text-wrap: pretty;
}

.card-item .bullet {
  color: var(--accent);
  font-weight: 700;
}

.card-meta {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-line {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

.meta-line strong {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-right: 6px;
}

.learn-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 36px;
  margin-top: 14px;
  transition: transform 0.12s ease;
}

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

.learn-btn.on {
  border-color: transparent;
  background: var(--good-soft);
  color: var(--good);
}

/* Search composer: text + clear × + mic + send (unicode/CSS icons — TG-safe) */
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 4px 4px 4px 14px;
  min-height: 48px;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px; /* <16px → iOS авто-зум при фокусе; держим ровно 16 */
  height: 40px;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}

.search-box input::-webkit-search-decoration,
.search-box input::-webkit-search-cancel-button,
.search-box input::-webkit-search-results-button,
.search-box input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.search-icon-btn:active {
  transform: scale(0.92);
  color: var(--text);
}

.clear-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border-radius: 50%;
}

.clear-btn .ico-x {
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
}

.mic-btn {
  color: var(--muted);
}

/* Иконка микрофона — SVG в разметке (капсула + дуга + ножка), CSS только позиционирует */
.mic-btn .ico-mic {
  display: block;
}

.mic-btn:active {
  color: var(--accent);
}
/* «Слушаю»: кнопка микрофона пульсирует акцентом, пока идёт запись */
.mic-btn.listening {
  color: var(--accent);
  animation: micPulse 1.1s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 169, 60, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(230, 169, 60, 0); }
}

.search-send-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0;
  cursor: pointer;
}

.search-send-btn .ico-send {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  transform: translateX(1px);
}

.search-send-btn:active {
  transform: scale(0.94);
  filter: brightness(1.08);
}

.empty-state {
  padding: 44px 16px;
  text-align: center;
}

.empty-state .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 8px;
}

.empty-state .msg {
  font-size: 14.5px;
  color: var(--muted);
  text-wrap: pretty;
  line-height: 1.55;
}

.empty-state .count {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 12px;
  color: var(--muted);
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.result-card.learned {
  background: var(--surface2);
  border-left-color: var(--good);
}

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.result-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.result-card.learned .result-title {
  color: var(--muted);
}

.result-snippet {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 5px;
  text-wrap: pretty;
}

/* Flashcards */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 36px;
  white-space: nowrap;
  transition: transform 0.12s ease;
}

.chip:active {
  transform: scale(0.95);
}

.chip.on {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.deck-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 10px;
}

.deck-counter {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.deck-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shuffle-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-transform: uppercase;
}

.shuffle-btn:active {
  transform: scale(0.95);
}

.flip-stage {
  perspective: 1600px;
  cursor: pointer;
  height: 360px;
}

.flip-stage:active {
  transform: scale(0.992);
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.34, 1.15, 0.4, 1); /* slight overshoot: the card settles */
  transform-style: preserve-3d;
}

.flip-inner.flipped {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  padding: 26px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.flip-front {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.flip-back {
  transform: rotateY(180deg);
  background: var(--surface2);
  border-color: var(--border-strong);
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flip-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.flip-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.flip-hint {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.deck-nav {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.nav-sq {
  flex: none;
  width: 54px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  padding-bottom: 3px;
}

.nav-sq:active {
  transform: scale(0.94);
}

.nav-learn {
  flex: 1;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.nav-learn.on {
  border-color: transparent;
  background: var(--good-soft);
  color: var(--good);
}

.nav-learn:active {
  transform: scale(0.98);
}

.deck-empty {
  padding: 48px 20px;
  text-align: center;
}

.deck-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.deck-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-wrap: pretty;
  line-height: 1.55;
}

.fav-empty {
  padding: 56px 22px;
  text-align: center;
}

.fav-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.fav-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-wrap: pretty;
  line-height: 1.55;
}

/* Tab bar */
.tabbar {
  flex: none;
  display: flex;
  padding: 6px 8px calc(var(--safe-bottom) + 6px);
  gap: 2px;
  background: var(--tabbar);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--border);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 2px 6px;
  background: transparent;
  border: none;
  border-radius: 12px;
  min-height: 52px;
  transition: transform 0.12s ease;
}

.tab:active {
  transform: scale(0.92);
}

.tab-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s ease;
}

.tab.on .tab-dot {
  background: var(--accent);
}

.tab-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.tab.on .tab-label {
  color: var(--text);
}

/* Loading / error */
.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #0b0b0d;
  color: #94949c;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.boot.error {
  color: #ff8a80;
  padding: 24px;
  text-align: center;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* Home entry chips (Profile / Today) */
.home-chips {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.home-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 14px 15px;
  min-height: 62px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  color: inherit;
  font: inherit;
  transition: transform 0.12s ease;
}

.home-chip:active {
  transform: scale(0.97);
}

.home-chip.primary {
  border-color: transparent;
  background: var(--accent-soft);
}

.home-chip .chip-k {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.home-chip.primary .chip-k {
  color: var(--accent);
}

.home-chip .chip-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Profile form */
.pf-updated {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 14px;
}

.pf-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pf-legend {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.pf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pf-field > span {
  font-size: 12.5px;
  color: var(--muted);
}

.pf-input {
  width: 100%;
  min-height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}

.pf-input:focus {
  border-color: var(--accent);
}

.axis-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.axis-label {
  flex: none;
  width: 76px;
  font-size: 13.5px;
}

.axis-range {
  flex: 1;
  min-width: 0;
  height: 36px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.axis-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
}

.axis-range::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
}

.axis-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.axis-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}

.axis-val {
  flex: none;
  width: 22px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
}

.pf-save {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: #0b0b0d;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.12s ease;
}

.pf-save:active {
  transform: scale(0.98);
}

/* Today / Daily Matrix (шапка экрана — единая полоска .pg-strip, см. конец файла) */
.today-date {
  font-size: 15px;
  font-weight: 600;
}

.today-formula {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.today-hello {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.matrix-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 4px 16px 12px;
  margin-bottom: 16px;
}

.matrix-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.matrix-block:last-child {
  border-bottom: none;
}

.block-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.focus-card {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 13px;
  min-height: 44px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  color: inherit;
  font: inherit;
  margin-bottom: 8px;
  transition: transform 0.12s ease;
}

.focus-card:last-child {
  margin-bottom: 0;
}

.focus-card:active {
  transform: scale(0.985);
}

.focus-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.focus-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.matrix-line {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  opacity: 0.92;
  text-wrap: pretty;
}

.matrix-line .risk-axis {
  color: var(--accent);
  font-weight: 600;
}

.matrix-line.drill {
  padding: 11px 13px;
  background: var(--good-soft);
  border-radius: 12px;
  color: var(--good);
  opacity: 1;
}

/* 3-axis hologram strip */
.axes-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.strip-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.axes3 {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.axis3-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.axis3-pole {
  flex: none;
  width: 68px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}

.axis3-pole.right {
  text-align: right;
}

.axis3-line {
  flex: 1;
  height: 2px;
  background: var(--border-strong);
  position: relative;
}

.axis3-line > i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
}

.companions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.companion {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

/* 6-axis self-score strip */
.score-strip {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 16px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-label {
  flex: none;
  width: 76px;
  font-size: 13px;
  color: var(--muted);
}

.score-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.score-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.score-val {
  flex: none;
  width: 20px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

.score-row.risk .score-label {
  color: var(--text);
  font-weight: 600;
}

.score-row.risk .score-bar > i {
  background: var(--good);
}

.score-row.risk .score-val {
  color: var(--good);
}

.today-foot {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.today-empty {
  padding: 40px 20px;
  text-align: center;
}

.today-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.today-empty p {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.today-empty .pf-save {
  max-width: 240px;
  margin: 0 auto;
}

/* a11y focus */
.home-chip:focus-visible,
.pf-save:focus-visible,
.pf-input:focus-visible,
.focus-card:focus-visible,
.axis-range:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === Crystal Absolute · axes quiz · memory · lang === */

.lang-wrap {
  position: relative;
  flex: none;
  z-index: 40;
}

.lang-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--accent);
  border-radius: 50%;
  border: 1px solid rgba(230, 169, 60, 0.35);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 230, 170, 0.18), transparent 60%),
    rgba(20, 20, 28, 0.55);
  box-shadow: 0 0 14px rgba(230, 169, 60, 0.12);
}

.lang-btn.open {
  border-color: rgba(230, 169, 60, 0.7);
  box-shadow: 0 0 18px rgba(230, 169, 60, 0.28);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 230, 170, 0.28), transparent 60%),
    rgba(230, 169, 60, 0.12);
}

.lang-fan {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 999px;
  border: 1px solid rgba(230, 169, 60, 0.32);
  background:
    linear-gradient(180deg, rgba(20, 20, 28, 0.96), rgba(11, 11, 13, 0.94));
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(230, 169, 60, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: langFanIn 0.18s ease-out;
  z-index: 50;
}

@keyframes langFanIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lang-orb {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(230, 169, 60, 0.28);
  background: rgba(20, 20, 28, 0.9);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.lang-orb:active {
  transform: scale(0.9);
}

.lang-orb.on {
  color: #0b0b0d;
  border-color: rgba(230, 169, 60, 0.85);
  background: linear-gradient(160deg, #ffd98a 0%, #e6a93c 55%, #c9871f 100%);
  box-shadow: 0 0 16px rgba(230, 169, 60, 0.4);
}

[data-theme="light"] .lang-btn {
  background:
    radial-gradient(circle at 35% 30%, rgba(189, 122, 23, 0.14), transparent 60%),
    rgba(255, 255, 255, 0.85);
  border-color: rgba(189, 122, 23, 0.35);
}

[data-theme="light"] .lang-fan {
  background: linear-gradient(180deg, #fff, #f7f5ee);
  border-color: rgba(189, 122, 23, 0.28);
}

[data-theme="light"] .lang-orb {
  background: #fff;
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  .lang-fan {
    animation: none;
  }
}

.crystal-page {
  position: relative;
}

.crystal-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(230, 169, 60, 0.28);
  background:
    radial-gradient(120px 60px at 20% 40%, rgba(230, 169, 60, 0.18), transparent 70%),
    linear-gradient(135deg, rgba(20, 20, 28, 0.95), rgba(11, 11, 13, 0.4));
  box-shadow: 0 0 40px rgba(230, 169, 60, 0.08), inset 0 0 24px rgba(230, 169, 60, 0.05);
}

.crystal-banner-t {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

.crystal-orb {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 8px auto 16px;
}

.crystal-orb.mini {
  width: 36px;
  height: 36px;
  margin: 0;
  flex: none;
}

/* Facet crystal: hard edges, gold lattice — not soft blob */
.crystal-orb span {
  position: absolute;
  inset: 0;
  border-radius: 18% 42% 22% 48% / 28% 20% 52% 42%;
  border: 1px solid rgba(230, 169, 60, 0.55);
  background:
    linear-gradient(135deg, rgba(255, 236, 180, 0.28) 0%, transparent 42%),
    linear-gradient(320deg, rgba(230, 169, 60, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 35% 28%, rgba(255, 230, 170, 0.4), rgba(230, 169, 60, 0.08) 48%, transparent 72%);
  box-shadow:
    0 0 28px rgba(230, 169, 60, 0.28),
    inset 0 0 12px rgba(255, 220, 140, 0.12);
  animation: crystalPulse 5.5s ease-in-out infinite;
  clip-path: polygon(50% 0%, 92% 28%, 78% 92%, 22% 92%, 8% 28%);
}

.crystal-orb span:nth-child(2) {
  inset: 10px;
  opacity: 0.78;
  animation-delay: -1.2s;
  clip-path: polygon(50% 6%, 86% 32%, 74% 88%, 26% 88%, 14% 32%);
  border-radius: 0;
}

.crystal-orb span:nth-child(3) {
  inset: 18px;
  opacity: 0.55;
  animation-delay: -2.4s;
  clip-path: polygon(50% 12%, 78% 38%, 68% 82%, 32% 82%, 22% 38%);
}

.crystal-orb.facet b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 1px;
  background: radial-gradient(circle, rgba(255, 240, 200, 0.95), rgba(230, 169, 60, 0.4) 60%, transparent 75%);
  box-shadow: 0 0 14px rgba(230, 169, 60, 0.65);
  animation: crystalCore 2.8s ease-in-out infinite;
  z-index: 2;
}

.crystal-orb.mini span:nth-child(2) {
  inset: 6px;
}

.crystal-orb.mini span:nth-child(3) {
  inset: 11px;
}

@keyframes crystalPulse {
  0%, 100% { transform: rotate(0deg) scale(1); filter: brightness(1); }
  50% { transform: rotate(10deg) scale(1.05); filter: brightness(1.18); }
}

@keyframes crystalSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes crystalCore {
  0%, 100% { opacity: 0.7; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.crystal-orb.crystal-spin span {
  animation: crystalSpin 14s linear infinite, crystalPulse 5.5s ease-in-out infinite;
}

.crystal-orb.crystal-spin span:nth-child(2) {
  animation-duration: 18s, 5.5s;
  animation-direction: reverse, normal;
}

.crystal-orb.crystal-spin span:nth-child(3) {
  animation-duration: 22s, 5.5s;
}

.topbar-orb.crystal-spin span {
  animation: crystalSpin 10s linear infinite, crystalPulse 5s ease-in-out infinite;
}

/* Profile personal crystal slot (tg-card right) */
.tg-meta {
  flex: 1;
  min-width: 0;
}

.pf-crystal-slot {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 12px;
  border: 1px solid rgba(230, 169, 60, 0.5);
  background:
    radial-gradient(circle at 40% 35%, rgba(255, 230, 170, 0.28), transparent 55%),
    linear-gradient(160deg, rgba(40, 32, 18, 0.9), rgba(12, 12, 16, 0.95));
  display: grid;
  place-items: center;
  grid-template-rows: 1fr auto;
  gap: 1px;
  padding: 4px 2px 3px;
  box-shadow:
    inset 0 0 14px rgba(230, 169, 60, 0.16),
    0 0 16px rgba(230, 169, 60, 0.12);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.pf-crystal-slot.off {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 0.55;
  filter: grayscale(0.35);
}

.pf-crystal {
  position: relative;
  width: 28px;
  height: 28px;
  --cr-rot: 0deg;
  --cr-hue: 38;
}

.pf-crystal i {
  position: absolute;
  inset: 0;
  border-radius: 28% 72% 68% 32% / 35% 30% 70% 65%;
  border: 1px solid hsla(var(--cr-hue), 72%, 58%, 0.55);
  background: radial-gradient(
    circle at 35% 30%,
    hsla(var(--cr-hue), 80%, 78%, 0.4),
    hsla(var(--cr-hue), 70%, 45%, 0.12) 50%,
    transparent 72%
  );
  transform: rotate(var(--cr-rot));
  animation: crystalSpin 16s linear infinite;
}

.pf-crystal i:nth-child(2) {
  inset: 5px;
  opacity: 0.75;
  animation-direction: reverse;
  animation-duration: 11s;
}

.pf-crystal i:nth-child(3) {
  inset: 10px;
  opacity: 0.55;
  animation-duration: 20s;
}

.crystal-mode-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.4;
  font-style: italic;
}

.crystal-mode-hint.solo {
  color: #e07070;
  background: rgba(180, 40, 40, 0.12);
  border: 1px solid rgba(200, 60, 60, 0.28);
  border-radius: 10px;
  padding: 8px 12px;
  filter: blur(0);
}

.pf-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.4;
}

.axis-score-only {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.axis-score-only .axis-val {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13px;
}

/* Library mother → child list */
.child-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.child-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  min-height: 56px;
  box-shadow: var(--shadow-1);
}

.child-btn:active {
  transform: scale(0.985);
  border-color: rgba(230, 169, 60, 0.35);
}

.child-btn-l {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.child-btn-t {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.child-btn-s {
  font-size: 12px;
  color: var(--muted);
}

.child-btn-r {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.child-crumb {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}

/* Memory residual pipeline */
.mem-pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mem-pipeline i {
  width: 14px;
  height: 1px;
  background: rgba(230, 169, 60, 0.45);
}

.mem-pipeline span {
  color: var(--accent);
  opacity: 0.9;
}

.mem-residual {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(230, 169, 60, 0.28);
  background: rgba(230, 169, 60, 0.08);
  text-align: left;
}

.mem-res-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.mem-res-p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.mem-res-meta {
  font-size: 11.5px;
  color: var(--muted);
  font-style: italic;
}

/* Crystal pure-pixel panel */
.crystal-panel {
  margin: 0 0 16px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(230, 169, 60, 0.35);
  background:
    radial-gradient(120px 60px at 90% 0%, rgba(230, 169, 60, 0.14), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-1);
}

.crystal-panel.apex {
  border-color: rgba(230, 169, 60, 0.65);
  box-shadow: var(--glow-sm), var(--shadow-2);
}

.crystal-panel.solo {
  border-color: rgba(200, 80, 80, 0.35);
}

.crystal-panel.muted {
  opacity: 0.9;
}

.cp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.cp-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.cp-pixel {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text);
  font-weight: 600;
}

.cp-place,
.cp-codes {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.cp-stage {
  font-size: 13px;
  margin: 8px 0 10px;
  line-height: 1.4;
}

.cp-tri {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 12px;
}

.cp-comps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.cp-comp {
  display: grid;
  grid-template-columns: 22px 1fr 28px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
}

.cp-comp-n {
  font-family: var(--font-mono);
  color: var(--accent);
}

.cp-comp-t {
  color: var(--text);
}

.cp-comp-s {
  font-family: var(--font-mono);
  text-align: right;
  color: var(--muted);
}

.cp-flag {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(200, 70, 70, 0.35);
  background: rgba(160, 40, 40, 0.12);
}

.cp-flag-t {
  font-weight: 650;
  font-size: 13px;
  color: #e07070;
  font-style: italic;
}

.cp-flag-m {
  font-size: 12.5px;
  margin: 4px 0;
  line-height: 1.4;
}

.cp-flag-d {
  font-size: 12px;
  color: var(--muted);
}

.cp-ok {
  font-size: 12.5px;
  color: var(--good);
  margin-bottom: 10px;
}

.cp-quals-wrap {
  margin: 10px 0;
}

.cp-quals-k {
  font-size: 11px;
  color: #e07070;
  font-style: italic;
  margin-bottom: 6px;
}

.cp-quals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cp-qual {
  font-size: 11.5px;
  font-style: italic;
  color: #e8a0a0;
  background: rgba(160, 40, 40, 0.14);
  border: 1px solid rgba(200, 70, 70, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
  filter: blur(0.15px);
}

.cp-apex-ref {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.cp-disc,
.cp-need {
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.4;
}

.pf-crystal-slot {
  flex-direction: column;
  gap: 2px;
}

.pf-crystal-slot.apex {
  border-color: rgba(230, 169, 60, 0.75);
  box-shadow: 0 0 16px rgba(230, 169, 60, 0.35);
}

.pf-crystal-px {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--accent);
  line-height: 1;
}

.crystal-day .cd-pixel {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
}

.crystal-day .cd-stage {
  font-size: 13px;
  margin-bottom: 4px;
}

.crystal-day .cd-quals {
  font-size: 12px;
  color: #e07070;
  font-style: italic;
}

.matrix-line.risk-m {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.cp-bio,
.cp-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.cp-bio-row,
.cp-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  gap: 8px;
}

.cp-field-row.on {
  color: var(--good);
}

.cp-field-row.off {
  color: var(--muted);
}

.cp-field-row.risk {
  color: #e07070;
  font-style: italic;
}

.cp-nutrition {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.home-chips.triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.home-chips.triple .home-chip {
  min-height: 70px;
  padding: 12px 10px;
}

.home-chip.crystal-chip {
  border-color: rgba(230, 169, 60, 0.4);
  background:
    radial-gradient(80px 40px at 50% 0%, rgba(230, 169, 60, 0.2), transparent 70%),
    var(--surface);
}

.home-chip.crystal-chip .chip-k {
  color: var(--accent);
}

.axes-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.axis-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface2);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(230, 169, 60, 0.04);
}

.axis-card.open {
  border-color: rgba(230, 169, 60, 0.35);
  box-shadow: 0 0 24px rgba(230, 169, 60, 0.1);
}

.axis-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  text-align: left;
  min-height: 40px;
}

.axis-name {
  display: block;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.axis-holo {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.axis-score-pill {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  min-width: 48px;
  text-align: right;
}

.axis-score-pill small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.axis-essence {
  margin: 10px 0 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  text-wrap: pretty;
}

.axis-link {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  font-family: var(--font-mono);
}

.axis-row.mini {
  margin: 8px 0;
  grid-template-columns: 90px 1fr 28px;
}

.axis-diag-btn {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.axis-quiz {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.axis-q-t {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.axis-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.axis-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.axis-opt.on {
  border-color: rgba(230, 169, 60, 0.55);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(230, 169, 60, 0.15);
}

.opt-sc {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

.axis-interpret {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(230, 169, 60, 0.06);
  border: 1px solid rgba(230, 169, 60, 0.15);
}

.ax-line {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.ax-line.drill-line {
  color: var(--good);
}

.ax-src {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Memory crystal */
.mem-streak {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}

.mem-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text);
}

.mem-intro {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 12px;
  text-wrap: pretty;
  text-align: center;
}

.mem-steps {
  margin: 0 0 16px;
  padding: 12px 14px 12px 32px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}

.mem-steps li {
  margin: 0 0 8px;
}

.mem-steps li:last-child {
  margin-bottom: 0;
}

.mem-steps strong {
  color: var(--accent);
  font-weight: 600;
}

.mem-res-what {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  font-style: italic;
}

.mem-orb {
  margin-bottom: 10px;
}

.mem-prompt-card {
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(230, 169, 60, 0.3);
  background:
    radial-gradient(180px 100px at 50% 0%, rgba(230, 169, 60, 0.16), transparent 70%),
    var(--surface);
  box-shadow: 0 0 48px rgba(230, 169, 60, 0.1);
  margin-bottom: 14px;
}

.mem-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.mem-prompt {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 500;
  text-wrap: pretty;
}

.mem-topic {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.mem-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mem-opt {
  width: 100%;
  min-height: 48px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.mem-opt:active {
  transform: scale(0.99);
  border-color: var(--accent);
}

.mem-result {
  padding: 20px 16px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface);
}

.mem-result.ok {
  border-color: rgba(84, 192, 138, 0.4);
  background: var(--good-soft);
}

.mem-result.bad {
  border-color: rgba(255, 138, 128, 0.35);
  background: rgba(255, 120, 100, 0.08);
}

.mem-result p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.mem-right {
  font-size: 16px;
}

[data-theme="light"] .crystal-banner {
  background:
    radial-gradient(120px 60px at 20% 40%, rgba(189, 122, 23, 0.15), transparent 70%),
    linear-gradient(135deg, #fff, #f7f5ee);
}

.app::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 1;
  background:
    radial-gradient(ellipse 90% 42% at 50% -8%, rgba(230, 169, 60, 0.13), transparent 58%),
    radial-gradient(ellipse 55% 30% at 10% 30%, rgba(126, 148, 255, 0.045), transparent 70%),
    radial-gradient(ellipse 70% 38% at 92% 80%, rgba(230, 169, 60, 0.05), transparent 70%),
    radial-gradient(ellipse 130% 95% at 50% 42%, transparent 55%, rgba(0, 0, 0, 0.42) 100%);
}

.app::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  opacity: 0.05;
}

[data-theme="light"] .app::before {
  background:
    radial-gradient(ellipse 90% 42% at 50% -8%, rgba(189, 122, 23, 0.10), transparent 58%),
    radial-gradient(ellipse 55% 30% at 10% 30%, rgba(90, 110, 220, 0.035), transparent 70%),
    radial-gradient(ellipse 130% 95% at 50% 42%, transparent 60%, rgba(60, 45, 15, 0.08) 100%);
}

[data-theme="light"] .app::after {
  opacity: 0.035;
}

.app > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 380px) {
  .home-chips.triple {
    grid-template-columns: 1fr;
  }
}

/* Telegram profile card */
.tg-card {
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(42, 171, 238, 0.35);
  background:
    radial-gradient(120px 60px at 10% 0%, rgba(42, 171, 238, 0.14), transparent 70%),
    var(--surface);
}

.tg-card.muted {
  border-color: var(--border);
  background: var(--surface);
  opacity: 0.92;
}

.tg-card.linked {
  box-shadow: 0 0 28px rgba(42, 171, 238, 0.1);
}

.tg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.tg-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid rgba(42, 171, 238, 0.45);
  background: var(--surface2);
}

.tg-avatar.ph {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  color: #2aabee;
}

.tg-card-t {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2aabee;
  margin-bottom: 4px;
}

.tg-card-p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.tg-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}

.tg-user {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.tg-prem {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.04em;
  background: rgba(230, 169, 60, 0.2);
  color: var(--accent);
  vertical-align: middle;
}

.tg-sync-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(42, 171, 238, 0.4);
  background: rgba(42, 171, 238, 0.12);
  color: #7ec8f0;
  font-size: 13px;
  font-weight: 600;
}

.tg-sync-btn:active {
  transform: scale(0.98);
}

[data-theme="light"] .tg-sync-btn {
  color: #0b6e99;
  background: rgba(42, 171, 238, 0.1);
}

/* === CRYSTAL ABSOLUTE polish pass === */

/* Tier 1 — content cards: matte, subtle lift, top sheen */
.card,
.result-card,
.pf-section,
.axes-strip,
.matrix-card {
  box-shadow: var(--shadow-1);
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 46%), var(--surface);
}

[data-theme="light"] .card {
  background: var(--surface);
}

/* Tier 2 — hero surfaces: 1px gradient hairline rim (padding-box/border-box trick) */
.progress-card {
  border: 1px solid transparent;
  background:
    radial-gradient(140% 90% at 50% -20%, rgba(230, 169, 60, 0.10), transparent 55%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--hairline-gold) border-box;
  box-shadow: var(--shadow-2);
}

.mem-prompt-card {
  border: 1px solid transparent;
  background:
    radial-gradient(180px 100px at 50% 0%, rgba(230, 169, 60, 0.16), transparent 70%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--hairline-gold) border-box;
  box-shadow: var(--shadow-3), var(--glow-md);
}

.crystal-banner {
  border: 1px solid transparent;
  background:
    radial-gradient(120px 60px at 20% 40%, rgba(230, 169, 60, 0.18), transparent 70%) padding-box,
    linear-gradient(180deg, rgba(20, 20, 28, 0.95), rgba(11, 11, 13, 0.75)) padding-box,
    var(--hairline-gold) border-box;
  box-shadow: var(--shadow-2), var(--glow-sm);
}

[data-theme="light"] .progress-card {
  background:
    radial-gradient(140% 90% at 50% -20%, rgba(189, 122, 23, 0.07), transparent 55%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--hairline-gold) border-box;
}

[data-theme="light"] .mem-prompt-card {
  background:
    radial-gradient(180px 100px at 50% 0%, rgba(189, 122, 23, 0.10), transparent 70%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--hairline-gold) border-box;
}

[data-theme="light"] .crystal-banner {
  background:
    radial-gradient(120px 60px at 20% 40%, rgba(189, 122, 23, 0.12), transparent 70%) padding-box,
    linear-gradient(180deg, #ffffff, #f7f5ee) padding-box,
    var(--hairline-gold) border-box;
}

/* Molten progress bars */
@keyframes barSheen {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(340%); }
}

.bar {
  margin-top: 14px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.bar > i {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(90deg, #b5791d, var(--accent) 55%, #ffd98a);
  box-shadow: 0 0 10px rgba(230, 169, 60, 0.45);
}

.bar > i::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: barSheen 3.4s ease-in-out infinite;
}

.mini-bar > i {
  background: linear-gradient(90deg, #c9871f, var(--accent) 70%, #f0c069);
  box-shadow: 0 0 6px rgba(230, 169, 60, 0.35);
}

[data-theme="light"] .bar {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.10);
}

[data-theme="light"] .bar > i {
  background: linear-gradient(90deg, #96620f, var(--accent) 55%, #dfa63d);
  box-shadow: 0 0 8px rgba(189, 122, 23, 0.28);
}

[data-theme="light"] .bar > i::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
}

[data-theme="light"] .mini-bar > i {
  background: linear-gradient(90deg, #96620f, var(--accent));
  box-shadow: none;
}

/* Gold glow discipline (only selected/CTA glows; green learned state stays matte) */
.chip.on {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(230, 169, 60, 0.65), rgba(230, 169, 60, 0.15) 60%, rgba(230, 169, 60, 0.45)) border-box;
  color: var(--accent);
  box-shadow: var(--glow-sm);
}

.fav-btn.on {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(230, 169, 60, 0.55);
}

.pf-save {
  background: linear-gradient(180deg, #f2c15c, #d9982a 60%, #c8871c);
  color: #0b0b0d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.40), 0 6px 20px rgba(230, 169, 60, 0.24);
}

.pf-save:active {
  transform: scale(0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 10px rgba(230, 169, 60, 0.18);
}

.home-chip.primary {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--hairline-gold) border-box;
  box-shadow: var(--glow-sm);
}

[data-theme="light"] .chip.on {
  background:
    linear-gradient(var(--accent-soft), var(--accent-soft)) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, rgba(189, 122, 23, 0.55), rgba(189, 122, 23, 0.15) 60%, rgba(189, 122, 23, 0.40)) border-box;
}

[data-theme="light"] .fav-btn.on {
  text-shadow: 0 0 10px rgba(189, 122, 23, 0.30);
}

[data-theme="light"] .pf-save {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 18px rgba(189, 122, 23, 0.22);
}
/* NOTE: .learn-btn.on / .nav-learn.on (green) intentionally stay matte — gold keeps exclusivity. */

/* Crystal-facet flip faces */
.flip-face {
  border: 1px solid transparent;
  box-shadow: var(--shadow-2);
}

.flip-front {
  background:
    linear-gradient(218deg, rgba(255, 255, 255, 0.045) 0 26%, rgba(255, 255, 255, 0) 26.5%) padding-box,
    linear-gradient(152deg, rgba(230, 169, 60, 0.09) 0 18%, rgba(230, 169, 60, 0) 18.5%) padding-box,
    linear-gradient(24deg, rgba(230, 169, 60, 0.05) 0 14%, rgba(230, 169, 60, 0) 14.5%) padding-box,
    radial-gradient(130% 85% at 50% -12%, rgba(230, 169, 60, 0.13), transparent 55%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--hairline-gold) border-box;
}

.flip-back {
  border: 1px solid transparent;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(230, 169, 60, 0.08), transparent 55%) padding-box,
    linear-gradient(var(--surface2), var(--surface2)) padding-box,
    var(--hairline-gold) border-box;
}

.flip-tag {
  letter-spacing: 0.08em;
  text-shadow: 0 0 14px rgba(230, 169, 60, 0.40);
}

.flip-hint {
  letter-spacing: 0.14em;
  opacity: 0.75;
}

[data-theme="light"] .flip-front {
  background:
    linear-gradient(218deg, rgba(189, 122, 23, 0.05) 0 26%, rgba(189, 122, 23, 0) 26.5%) padding-box,
    linear-gradient(152deg, rgba(189, 122, 23, 0.04) 0 18%, rgba(189, 122, 23, 0) 18.5%) padding-box,
    radial-gradient(130% 85% at 50% -12%, rgba(189, 122, 23, 0.08), transparent 55%) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--hairline-gold) border-box;
}

[data-theme="light"] .flip-back {
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(189, 122, 23, 0.06), transparent 55%) padding-box,
    linear-gradient(var(--surface2), var(--surface2)) padding-box,
    var(--hairline-gold) border-box;
}

[data-theme="light"] .flip-tag {
  text-shadow: none;
}

/* Topic rows — this rule owns .topic-btn's full transition (excluded from springy release list) */
.topic-btn {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 50%), var(--surface);
  box-shadow: var(--shadow-1);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.18s ease, box-shadow 0.18s ease;
}

@media (hover: hover) {
  .topic-btn:hover {
    border-color: rgba(230, 169, 60, 0.35);
    box-shadow: var(--shadow-1), var(--glow-sm);
  }
}

.topic-btn:active {
  transform: scale(0.985);
  border-color: rgba(230, 169, 60, 0.5);
  box-shadow: var(--shadow-1), var(--glow-sm);
}

.topic-n.hot {
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent); /* fallback */
}

[data-theme="light"] .topic-btn {
  background: var(--surface);
}

@media (hover: hover) {
  [data-theme="light"] .topic-btn:hover {
    border-color: rgba(189, 122, 23, 0.35);
  }
}

[data-theme="light"] .topic-btn:active {
  border-color: rgba(189, 122, 23, 0.45);
}

/* Typography polish */
.progress-pct,
.topic-head-n,
.axis-score-pill {
  background: var(--gold-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent); /* fallback */
  filter: drop-shadow(0 0 10px rgba(230, 169, 60, 0.28));
}

.axis-score-pill small {
  -webkit-text-fill-color: var(--muted);
}

.progress-nums .big {
  font-size: 32px;
  letter-spacing: -0.03em;
}

.progress-pct,
.deck-counter,
.topic-count,
.progress-nums .big {
  font-variant-numeric: tabular-nums;
}

.eyebrow,
.section-label {
  letter-spacing: 0.18em;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(230, 169, 60, 0.35), var(--border) 45%, transparent);
}

[data-theme="light"] .progress-pct,
[data-theme="light"] .topic-head-n,
[data-theme="light"] .axis-score-pill {
  filter: none;
}

[data-theme="light"] .section-label::after {
  background: linear-gradient(90deg, rgba(189, 122, 23, 0.35), var(--border) 45%, transparent);
}

/* Tab bar refinement */
.tabbar {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 45%),
    var(--tabbar);
}

.tabbar::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 4%, rgba(230, 169, 60, 0.30) 32%, rgba(230, 169, 60, 0.30) 68%, transparent 96%);
}

.tab.on .tab-dot {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(230, 169, 60, 0.9), 0 0 16px rgba(230, 169, 60, 0.45);
}

.tab.on .tab-label {
  color: var(--accent);
}

/* Активная вкладка: золотое подчёркивание под подписью (единственный маркер) */
.tab {
  position: relative;
}
.tab.on::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(3px, calc(var(--safe-bottom) * 0.15));
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(230, 169, 60, 0.6);
}

.topbar {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .tabbar {
  background: var(--tabbar);
}

[data-theme="light"] .tabbar::before {
  background: linear-gradient(90deg, transparent 4%, rgba(189, 122, 23, 0.30) 32%, rgba(189, 122, 23, 0.30) 68%, transparent 96%);
}

[data-theme="light"] .tab.on .tab-dot {
  box-shadow: 0 0 6px rgba(189, 122, 23, 0.5);
}

[data-theme="light"] .topbar {
  box-shadow: none;
}

/* Branded boot */
.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.boot-orb {
  width: 84px;
  height: 84px;
  margin: 0 0 18px;
}

.boot-word {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: #e6a93c;
  text-shadow: 0 0 24px rgba(230, 169, 60, 0.45);
  animation: fadeUp 0.5s ease both;
}

.boot-sub {
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #94949c;
  animation: fadeUp 0.5s ease 0.1s both;
}

.boot-shimmer {
  position: relative;
  width: 132px;
  height: 3px;
  margin-top: 20px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.boot-shimmer i {
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(230, 169, 60, 0.8), transparent);
  transform: translateX(-100%);
  animation: bootSweep 1.1s ease-in-out infinite;
}

@keyframes bootSweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(350%); }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 86px);
  transform: translateX(-50%) translateY(8px);
  max-width: min(420px, calc(100vw - 48px));
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface2);
  border: 1px solid rgba(230, 169, 60, 0.35);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 20px rgba(230, 169, 60, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[data-theme="light"] .toast {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Home hero */
.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 2px 14px;
}

.hero-hi {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-streak {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 4px 10px;
  border: 1px solid rgba(230, 169, 60, 0.3);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
}

/* Search highlight + shared dim orb */
mark.hl {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 3px;
  padding: 0 1px;
}

.result-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2px 2px 10px;
}

.crystal-orb.dim {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  opacity: 0.55;
}

/* focus-visible completeness */
.icon-btn:focus-visible,
.topic-btn:focus-visible,
.tab:focus-visible,
.chip:focus-visible,
.fav-btn:focus-visible,
.learn-btn:focus-visible,
.nav-sq:focus-visible,
.nav-learn:focus-visible,
.shuffle-btn:focus-visible,
.clear-btn:focus-visible,
.mem-opt:focus-visible,
.axis-opt:focus-visible,
.axis-head:focus-visible,
.axis-diag-btn:focus-visible,
.tg-sync-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tap targets (44px) */
.icon-btn {
  width: 44px;
  height: 44px;
}

.fav-btn {
  position: relative;
}

.fav-btn::after {
  content: "";
  position: absolute;
  inset: -5px -2px; /* 40x34 -> 44x44 hit area */
}

.clear-btn {
  position: relative;
}

.clear-btn::after {
  content: "";
  position: absolute;
  inset: -7px; /* 34px -> 48px hit area */
  border-radius: 50%;
}

/* === Motion system === */

/* One-shot entry classes (replaces the deleted always-on animations) */
.app.app-mounted {
  animation: fadeUp 0.4s ease both; /* boot fade — plays exactly once */
}

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

.page.screen-enter {
  animation: screenIn 0.3s cubic-bezier(0.25, 0.8, 0.35, 1) both;
}

/* Staggered cascade on screen entry */
@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.screen-enter .home-chip,
.screen-enter .progress-card,
.screen-enter .topic-btn,
.screen-enter .focus-card {
  animation: itemIn 0.34s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.screen-enter .home-chip {
  animation-delay: calc(40ms * var(--i, 0));
}

.screen-enter .progress-card {
  animation-delay: 100ms;
}

.screen-enter .topic-btn {
  animation-delay: min(calc(45ms * var(--i, 0) + 140ms), 420ms);
}

.screen-enter .focus-card {
  animation-delay: calc(50ms * var(--i, 0) + 60ms);
}

/* Flip physics */
.flip-stage {
  position: relative;
  touch-action: pan-y; /* horizontal swipes go to JS, vertical scroll stays native */
}

.flip-stage::before {
  content: "";
  position: absolute;
  inset: 12px 6px -8px;
  border-radius: 20px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5), 0 0 34px rgba(230, 169, 60, 0.12);
  opacity: 0; /* animated via opacity only */
  pointer-events: none;
  z-index: -1;
}

[data-theme="light"] .flip-stage::before {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.18), 0 0 34px rgba(189, 122, 23, 0.1);
}

.flip-stage.flip-lift {
  animation: flipLift 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-stage.flip-lift::before {
  animation: flipShadow 0.6s ease;
}

@keyframes flipLift {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  45% {
    transform: scale(1.035) translateY(-4px);
  }
}

@keyframes flipShadow {
  0%, 100% {
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
}

/* "Learned" success moment */
.result-card {
  position: relative; /* anchor for the glow pseudo (.card is already relative) */
}

.card.just-learned::after,
.result-card.just-learned::after,
.flip-stage.just-learned::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(84, 192, 138, 0.55);
  box-shadow: 0 0 26px rgba(84, 192, 138, 0.3), inset 0 0 18px rgba(84, 192, 138, 0.14);
  opacity: 0;
  animation: learnedGlow 0.7s ease-out;
}

.flip-stage.just-learned::after {
  border-radius: 20px;
}

@keyframes learnedGlow {
  0% {
    opacity: 0;
    transform: scale(0.985);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.015);
  }
}

.check-pop {
  display: inline-block;
  animation: checkPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkPop {
  0% {
    transform: scale(0) rotate(-20deg);
  }
  60% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* Star favorite pop */
.fav-btn.fav-pop {
  animation: favPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes favPop {
  0% {
    transform: scale(0.3) rotate(-35deg);
  }
  55% {
    transform: scale(1.3) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* Memory verdict */
.mem-result.res-ok-in {
  animation: memOkIn 0.5s cubic-bezier(0.34, 1.45, 0.64, 1);
}

.mem-result.res-ok-in .mem-right {
  animation: checkPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s both;
}

@keyframes memOkIn {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.mem-result.res-bad-in {
  animation: memShake 0.5s ease;
}

@keyframes memShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  35% { transform: translateX(7px); }
  55% { transform: translateX(-5px); }
  75% { transform: translateX(3px); }
  90% { transform: translateX(-1px); }
}

/* Count-up pop */
.progress-nums .big.big-pop {
  display: inline-block;
  animation: bigPop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes bigPop {
  0% { transform: scale(0.9); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Unified springy press states (.topic-btn owns its transition above) */
.icon-btn,
.home-chip,
.chip,
.learn-btn,
.fav-btn,
.tab,
.nav-sq,
.nav-learn,
.shuffle-btn,
.mem-opt,
.axis-opt,
.clear-btn,
.focus-card,
.pf-save,
.tg-sync-btn,
.axis-diag-btn,
.flip-stage {
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-btn:active,
.topic-btn:active,
.home-chip:active,
.chip:active,
.learn-btn:active,
.fav-btn:active,
.tab:active,
.nav-sq:active,
.nav-learn:active,
.shuffle-btn:active,
.mem-opt:active,
.axis-opt:active,
.clear-btn:active,
.focus-card:active,
.pf-save:active,
.tg-sync-btn:active,
.axis-diag-btn:active,
.flip-stage:active {
  transition-duration: 0.08s;
  transition-timing-function: ease-out;
}

/* Reduced-motion kill-switch — MUST stay the last block in this file */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important; /* also stops infinite crystalPulse / barSheen / bootSweep */
    transition-duration: 0.01ms !important;
  }
}


/* === REDESIGN v2.0 — Crystal Absolute shell (Fable pack) === */
:root {
  --danger: #e07070;
  --violet-dot: #c77dff;
  --bar-void: rgba(5, 5, 10, 0.97);
  --touch: 44px;
}

/* Black crystal zone: topbar always dark-ish for home+hero */
.app.redesign .topbar {
  background: var(--bar-void) !important;
  border-bottom-color: rgba(230, 169, 60, 0.12);
  padding-left: 12px;
  padding-right: 12px;
}
.app.redesign .topbar .brand-crystal {
  max-width: none;
  flex: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 10px;
}
.app.redesign .brand-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.app.redesign .brand-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
  text-shadow: 0 0 18px rgba(230, 169, 60, 0.35);
}
.app.redesign .brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.app.redesign .brand-crystal-img {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 16px rgba(230, 169, 60, 0.35);
}
.app.redesign .brand-ring-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
}
.app.redesign .brand-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(230,169,60,.85), transparent 30%, rgba(199,125,255,.45), transparent 65%, rgba(230,169,60,.8));
  animation: brandSpin 8s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
}
@keyframes brandSpin { to { transform: rotate(360deg); } }

/* Theme crown */
.app.redesign .theme-glyph {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  position: relative;
}
.app.redesign .theme-glyph::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 42%, var(--accent) 42% 58%, transparent 58%),
    linear-gradient(225deg, transparent 42%, var(--accent) 42% 58%, transparent 58%),
    linear-gradient(var(--accent), var(--accent));
  background-size: 100% 100%, 100% 100%, 28% 55%;
  background-position: center, center, center 62%;
  background-repeat: no-repeat;
  clip-path: polygon(50% 8%, 72% 38%, 92% 42%, 76% 62%, 82% 88%, 50% 74%, 18% 88%, 24% 62%, 8% 42%, 28% 38%);
  filter: drop-shadow(0 0 1px #000);
}
[data-theme="light"] .app.redesign .theme-glyph::before {
  background:
    linear-gradient(135deg, transparent 42%, #1b1b1f 42% 58%, transparent 58%),
    linear-gradient(225deg, transparent 42%, #1b1b1f 42% 58%, transparent 58%),
    linear-gradient(#1b1b1f, #1b1b1f);
  background-size: 100% 100%, 100% 100%, 28% 55%;
  background-position: center, center, center 62%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 1px var(--accent));
}
.app.redesign .theme-btn,
.app.redesign .lang-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0; /* центровка содержимого в круге */
  border-radius: 50%;
  border: 1px solid rgba(230, 169, 60, 0.4); /* золотая окантовка у всех кнопок топбара */
  background: #17171c;
  color: var(--muted);
}
/* Светлая тема: тонкое тёмное кольцо внутри + золотое чуть больше снаружи */
[data-theme="light"] .app.redesign .theme-btn,
[data-theme="light"] .app.redesign .lang-btn {
  background: #f4f3ee;
  border-color: rgba(20, 20, 28, 0.35);
  box-shadow: 0 0 0 2px rgba(158, 106, 16, 0.45);
  color: #3f3f47;
}
[data-theme="light"] .app.redesign .lang-btn {
  color: #9a6a10;
}
.app.redesign .lang-btn {
  border-color: rgba(230,169,60,.4);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px; /* крупнее и жирнее — под стать иконке темы */
  letter-spacing: 0.06em;
  font-weight: 700;
}
/* Веер языков: овальный «язычок» выезжает из круглой кнопки; внутри — кружки
   в пару к ней (не квадраты), зазор 3px, окантовка у КАЖДОГО, снизу язычок
   перекрывает последний кружок с небольшим запасом. */
.app.redesign .lang-fan {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 7px 7px 12px;
  min-width: 0;
  gap: 3px;
  box-shadow: var(--shadow-3);
}
.app.redesign .lang-orb {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(230, 169, 60, 0.38);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
[data-theme="light"] .app.redesign .lang-orb {
  border-color: rgba(189, 122, 23, 0.42);
}

/* Hero video */
.home-hero-video {
  position: relative;
  width: 100%;
  height: 252px;
  margin: 0 0 0;
  overflow: hidden;
  background: #05050a;
}
.home-hero-video .hero-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-hero-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.home-hero-video video.is-on {
  opacity: 1;
}
.home-hero-fade {
  height: 48px;
  margin-top: -48px;
  position: relative;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.home-greet-block {
  padding: 8px 16px 4px;
}
.home-greet-block .hero-hi {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.home-greet-block .hero-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* Fav banner in base */
.fav-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 18px 0 8px;
  padding: 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(230,169,60,.35);
  background:
    linear-gradient(120deg, rgba(230,169,60,.14), transparent 55%),
    url("../assets/lattice.jpg") center/cover;
  color: var(--text);
  text-align: left;
  min-height: 64px;
  box-shadow: 0 0 28px rgba(230,169,60,.12);
}
.fav-banner .fb-crystal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 14px rgba(230,169,60,.4);
}
.fav-banner .fb-k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}
.fav-banner .fb-s {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Tabbar 5 */
.app.redesign .tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: var(--bar-void);
  border-top: 1px solid rgba(230,169,60,.1);
  padding-bottom: max(8px, var(--safe-bottom));
}
.app.redesign .tab {
  min-height: 56px;
  flex-direction: column;
  gap: 4px;
  padding: 8px 2px;
}
.app.redesign .tab-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.app.redesign .tab.on {
  color: var(--accent);
}
.app.redesign .tab.on .tab-dot {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(230,169,60,.5);
}
.app.redesign .tab-ico {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}
.app.redesign .tab.on .tab-ico {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(230,169,60,.45));
}

/* Search send round gold */
.app.redesign .search-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(230,169,60,.2);
  color: var(--accent);
  border: 1px solid rgba(230,169,60,.45);
}
.app.redesign .search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.app.redesign .search-hint-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* Profile crystal slot image */
.app.redesign .pf-crystal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #0a0a0e;
}
.app.redesign .pf-crystal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.app.redesign .pf-crystal-slot.off .pf-crystal img {
  filter: grayscale(0.8) brightness(0.55);
}

/* Splash */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #05050a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s ease;
}
.splash-overlay.hide {
  opacity: 0;
  pointer-events: none;
}
.splash-stage {
  position: relative;
  width: min(100vw, 430px);
  height: 100%;
  max-height: 100dvh;
  background: #05050a;
  overflow: hidden;
}
.splash-stage video,
.splash-stage .splash-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.splash-stage video {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.splash-stage video.is-on { opacity: 1; }
.splash-skip {
  position: absolute;
  left: 0; right: 0; bottom: max(28px, var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(241,240,234,.85);
  background: none;
  border: none;
  min-height: 44px;
  text-transform: uppercase;
  z-index: 2;
}
.splash-skip .dot-g,
.splash-skip .dot-v {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: splashBlink 1.1s ease-in-out infinite;
}
.splash-skip .dot-g { background: var(--accent); }
.splash-skip .dot-v { background: var(--violet-dot); animation-delay: .35s; }
@keyframes splashBlink {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Empty crystal image */
.empty-state .crystal-img,
.deck-empty .crystal-img,
.fav-empty .crystal-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 14px;
  display: block;
  box-shadow: 0 0 28px rgba(230,169,60,.3);
}

/* Page home no side padding on hero */
.page.home-redesign {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}
.page.home-redesign .home-body {
  padding: 0 16px 26px;
}

/* section labels mono */
.app.redesign .eyebrow,
.app.redesign .section-label,
.app.redesign .pf-legend {
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
}

/* TG sync button удалена из разметки (эталон: кнопки НЕТ, автоподтяжка остаётся) */

/* Light theme: honest tokens already; bar void stays dark for home top */
[data-theme="light"] {
  --bg: #f2f1ec;
  --surface: #ffffff;
  --surface2: #f7f5ee;
  --text: #1b1b1f;
  --muted: #6c6c72;
  --accent: #a87413;
  --accent-soft: rgba(168, 116, 19, 0.13);
  --good: #2f9d68;
  --border: rgba(0,0,0,.09);
  --border-strong: rgba(0,0,0,.16);
}

.boot-crystal {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 32px rgba(230,169,60,.4); margin: 0 auto 14px; display: block;
}

/* === CLUB LOCK v2.4 — гейт закрытого клуба: прогрузка → ТВ-выключение → выброс === */
.club-lock {
  position: fixed;
  inset: 0;
  z-index: 400; /* выше сплеша (200) и тостов (100) */
  background: #000;
  overflow: hidden;
}
.cl-tv {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 30%, rgba(230, 169, 60, 0.07), transparent 60%),
    #0b0b0d;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 50%;
  will-change: transform, filter, opacity;
}
.cl-inner {
  text-align: center;
  padding: 0 28px;
  max-width: 340px;
}
.cl-crystal {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
  box-shadow: 0 0 32px rgba(230, 169, 60, 0.4);
  animation: clPulse 2.2s ease-in-out infinite;
}
.cl-brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.34em;
  color: #f1f0ea;
  margin-bottom: 26px;
}
.cl-status {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  color: #e6a93c;
  margin-bottom: 14px;
  white-space: nowrap;
}
.cl-bar {
  height: 2px;
  border-radius: 2px;
  background: rgba(230, 169, 60, 0.18);
  overflow: hidden;
  margin: 0 12px 12px;
}
.cl-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #96620f, #e6a93c 60%, #ffd98a);
  box-shadow: 0 0 12px rgba(230, 169, 60, 0.55);
  animation: clFill 1.7s cubic-bezier(0.3, 0.7, 0.3, 1) forwards;
}
.cl-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #94949c;
}
.cl-scan {
  /* лёгкие ТВ-полосы поверх экрана */
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
.club-lock.denied .cl-status {
  color: #e07070;
  text-shadow: 0 0 14px rgba(224, 112, 112, 0.45);
  animation: clFlicker 0.55s steps(2) 3;
}
.club-lock.denied .cl-bar i {
  width: 100%;
  background: linear-gradient(90deg, #7a2c2c, #e07070);
  box-shadow: 0 0 12px rgba(224, 112, 112, 0.5);
  animation: none;
}
.club-lock.denied .cl-crystal {
  animation: none;
  filter: grayscale(0.6) brightness(0.7);
  box-shadow: 0 0 18px rgba(224, 112, 112, 0.28);
}
/* ТВ выключается: вспышка → схлоп по вертикали в линию → линия в точку */
.club-lock.off .cl-tv {
  animation: clTvOff 0.72s cubic-bezier(0.7, 0, 0.9, 1) forwards;
}
@keyframes clTvOff {
  0% { transform: scale(1, 1); filter: brightness(1); }
  18% { transform: scale(1.012, 1.02); filter: brightness(2.2); }
  48% { transform: scale(1, 0.006); filter: brightness(3); }
  70% { transform: scale(0.5, 0.004); filter: brightness(3.4); }
  100% { transform: scale(0.001, 0.002); filter: brightness(4); }
}
.cl-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 18px 6px rgba(255, 224, 160, 0.9), 0 0 46px 16px rgba(230, 169, 60, 0.5);
  opacity: 0;
  pointer-events: none;
}
.club-lock.off .cl-dot {
  animation: clDot 0.9s ease-out 0.5s forwards;
}
@keyframes clDot {
  0% { opacity: 0; transform: scale(1); }
  12% { opacity: 1; transform: scale(1.6); }
  55% { opacity: 0.9; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(0.1); }
}
.cl-final {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(241, 240, 234, 0.4);
  opacity: 0;
  pointer-events: none;
}
.club-lock.dead .cl-final {
  animation: clFinalIn 1.2s ease 0.2s forwards;
}
/* Кнопка повтора на бут-ошибке (сети за VPN/прокси) */
.boot-err-msg {
  margin-bottom: 18px;
  max-width: 320px;
  text-align: center;
}
.boot-retry {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #e6a93c;
  background: rgba(230, 169, 60, 0.1);
  border: 1px solid rgba(230, 169, 60, 0.45);
  border-radius: 999px;
  padding: 12px 26px;
  min-height: 44px;
}
.boot-retry:active {
  background: rgba(230, 169, 60, 0.22);
  transform: scale(0.96);
}
@keyframes clFinalIn {
  to { opacity: 1; }
}
@keyframes clPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(230, 169, 60, 0.3); }
  50% { box-shadow: 0 0 44px rgba(230, 169, 60, 0.55); }
}
@keyframes clFill {
  0% { width: 0%; }
  100% { width: 86%; }
}
@keyframes clFlicker {
  0% { opacity: 1; }
  50% { opacity: 0.35; }
  100% { opacity: 1; }
}

/* === REDESIGN v2.1 — последний эталон (handoff 2026-07-21) === */

/* Кнопка музыки — круг как тема/язык, три круга в шапке */
.app.redesign .music-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0; /* убирает сдвиг иконки вниз-влево от базового .icon-btn */
  border-radius: 50%;
  border: 1px solid rgba(230, 169, 60, 0.4); /* золотая окантовка в пару к theme/lang */
  background: #17171c;
  color: var(--accent); /* цвет в тон остальным кнопкам */
}
/* Иконка звука крупнее и жирнее — под стать иконке темы */
.app.redesign .music-btn svg {
  width: 19px;
  height: 19px;
}
.app.redesign .music-btn svg path {
  stroke-width: 2;
}
.app.redesign .music-btn.on {
  color: var(--accent);
  border-color: rgba(230, 169, 60, 0.4);
}
[data-theme="light"] .app.redesign .music-btn {
  background: #f4f3ee;
  border-color: rgba(20, 20, 28, 0.35);
  box-shadow: 0 0 0 2px rgba(158, 106, 16, 0.45);
  color: #3f3f47;
}
[data-theme="light"] .app.redesign .music-btn.on {
  color: #9a6a10;
}
.music-ico {
  display: block;
}

/* Таббар: SVG-иконки эталона */
.app.redesign .tab {
  color: var(--muted);
}
.app.redesign .tab svg.tab-ico {
  width: 21px;
  height: 21px;
}

/* Матрица дня — карточка на главной */
.md-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin: 12px 0 18px;
  color: var(--text);
  transition: border-color 0.18s ease;
}
.md-card:active {
  border-color: rgba(230, 169, 60, 0.45);
}
.md-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.md-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.md-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.3);
  border-radius: 999px;
  padding: 3px 9px;
  flex: none;
}
.md-line {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 11px;
}
.md-line b {
  color: var(--text);
  font-weight: 600;
}
.md-meaning {
  margin-top: 4px;
  font-size: 12.5px;
}
.md-drill {
  display: flex;
  gap: 8px;
  /* 3.1.9: ромб выравнивается по ПЕРВОЙ строке практики, а не по центру
     всего абзаца — на тексте в 3 строки он оказывался напротив второй */
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  margin-top: 8px;
}
.md-diamond {
  width: 7px;
  height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
  margin-top: 5px;
  flex: none;
}
.md-drill .md-diamond {
  /* оптический центр первой строки: (13.5px * 1.55 - 7) / 2 ≈ 6px */
  margin-top: 6px;
}
.md-drill span {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}
/* Дрилл всегда выровнен по левому краю (по требованию 22.07 — не центрировать) */
.md-drill,
.md-drill.cols {
  justify-content: flex-start;
  text-align: left;
}
.drill-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}
.drill-li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.drill-li .md-diamond.sm {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  box-shadow: 0 0 5px rgba(230, 169, 60, 0.5);
}
.drill-li span {
  flex: 1;
  min-width: 0;
}
.md-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}
.md-foot-chip {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  border-radius: 999px;
  padding: 4px 9px;
}
.md-foot-chip.on {
  color: var(--good);
  background: var(--good-soft);
}
.md-foot-chip.solo {
  color: var(--danger);
  background: rgba(224, 112, 112, 0.12);
}
.md-foot-role {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.md-cta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-top: 10px;
}

/* База — свой экран */
.lib-title {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lib-sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.lib-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.lib-rows .topic-btn {
  margin: 0;
}
.topic-chev {
  flex: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  opacity: 0.7;
}
.topic-chev.gold {
  color: var(--accent);
  opacity: 1;
}
.fav-banner .fb-mid {
  flex: 1;
  min-width: 0;
}
.fav-banner .fb-t {
  font-size: 15.5px;
  font-weight: 600;
  margin-top: 3px;
  color: var(--text);
}
.fav-banner {
  position: relative;
  overflow: hidden;
}
.fav-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 11, 13, 0.9) 34%, rgba(11, 11, 13, 0.45));
  pointer-events: none;
}
.fav-banner > * {
  position: relative;
  z-index: 1;
}
.fav-banner .fb-crystal {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(230, 169, 60, 0.5);
}
[data-theme="light"] .fav-banner .fb-s,
.fav-banner .fb-s {
  color: #94949c;
}
[data-theme="light"] .fav-banner .fb-t {
  color: #f1f0ea;
}

/* Мои избранные — страница коллекции */
.fav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 0;
  min-height: 44px;
}
.fav-back:active {
  color: var(--accent);
}
.fav-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.fav-count-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.3);
  border-radius: 999px;
  padding: 5px 11px;
  flex: none;
}
.fav-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.fav-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.fav-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: var(--surface);
  border: 1px solid rgba(230, 169, 60, 0.25);
  border-radius: 14px;
  padding: 12px 13px;
  color: var(--text);
  min-height: 56px;
}
.fav-open:active {
  border-color: rgba(230, 169, 60, 0.55);
}
.fr-crystal {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(230, 169, 60, 0.35);
}
.fr-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.fr-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fr-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.fav-unfav {
  width: 48px;
  flex: none;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-size: 16px;
}
.fav-unfav:active {
  border-color: rgba(230, 169, 60, 0.5);
}
.fav-page .fav-empty {
  background: var(--surface);
  border: 1px dashed rgba(230, 169, 60, 0.35);
  border-radius: var(--radius-card);
  padding: 28px 16px;
  text-align: center;
  margin-top: 14px;
}
.fav-page .fav-empty .crystal-img {
  border-radius: 18px;
  border: 1px solid rgba(230, 169, 60, 0.5);
  box-shadow: 0 0 30px rgba(230, 169, 60, 0.4);
}
.fav-page .fav-empty h3 {
  margin: 13px 0 0;
  font-size: 15px;
  font-weight: 600;
}
.fav-page .fav-empty p {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* Заголовок экрана (Поиск) */
.screen-title {
  margin: 2px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Бут — нейтральный тёмный, без второй заставки */
.boot {
  background: #05050a;
}
.boot .boot-crystal,
.boot .boot-word,
.boot .boot-sub,
.boot .boot-shimmer {
  display: none;
}
.boot.error {
  display: grid;
  place-items: center;
  color: #e07070;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 24px;
  text-align: center;
}

/* === REDESIGN v2.2 — 1:1 с эталоном NEUROGENESIS Redesign.dc.html === */
:root {
  --text-soft: #c9c8c0;
  --input-bg: #101014;
  --dim: #55555e;
}
[data-theme="light"] {
  --text-soft: #3d3d44;
  --input-bg: #f4f3ee;
  --dim: #8f8f96;
}

/* Главная: приветствие + дата в одну строку */
.home-greet-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 0 4px;
}
.home-greet-row .hero-hi {
  font-size: 19px;
  font-weight: 600;
}
.home-greet-row .hero-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex: none;
}

/* Матрица дня: чипы осей */
.md-axes {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 11px;
}
.md-axis-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 6px 10px;
}
.md-card.empty {
  border-style: dashed;
  border-color: rgba(230, 169, 60, 0.35);
}
.md-line,
.md-drill span {
  color: var(--text-soft);
}

/* Прогресс 1:1 */
.app.redesign .progress-card {
  border-radius: var(--radius-card);
  padding: 14px;
  margin: 0 0 18px;
}
.app.redesign .eyebrow.gold {
  color: var(--accent);
  letter-spacing: 0.16em;
  font-size: 10px;
}
.app.redesign .progress-head {
  align-items: baseline;
  margin-top: 9px;
}
.app.redesign .progress-nums {
  margin-top: 0;
}
.app.redesign .progress-nums .big {
  font-size: 29px;
  color: var(--accent);
}
.app.redesign .progress-nums .of {
  font-size: 13px;
}
.app.redesign .progress-pct {
  font-size: 15px;
}
.app.redesign .bar.shine {
  height: 8px;
  border-radius: 999px;
  background: var(--surface2);
  margin-top: 9px;
}
.app.redesign .bar.shine > i {
  border-radius: 999px;
  background: linear-gradient(90deg, #8a6420, #e6a93c 40%, #f6d98a 50%, #e6a93c 60%, #8a6420);
  background-size: 200% 100%;
  animation: barShine 3.2s linear infinite;
}
@keyframes barShine {
  from { background-position: -160% 0; }
  to { background-position: 160% 0; }
}
.progress-foot {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 9px;
  text-transform: uppercase;
}
/* Приёмов применено (48ч-обязательства) — тонкая полоска под серией, v2.6.x */
.progress-applied {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 7px;
  text-transform: uppercase;
}
.progress-applied .pa-pct {
  color: var(--accent);
}
.mini-bar.pa-bar {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 5px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 8px;
}
.section-head .section-label {
  margin: 0;
}
.section-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

/* Поиск: активное поле */
.search-box.has-q {
  border-color: rgba(230, 169, 60, 0.5);
}
.learn-btn.compact {
  min-height: 36px;
  font-size: 12.5px;
}

/* ===== Кристалл памяти 1:1 ===== */
.mem-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.mem-head .mem-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
/* Чип серии: мягкий манящий пульс — тап скроллит к блокам серий */
.mem-series-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.45);
  border-radius: 999px;
  padding: 5px 11px;
  flex: none;
  cursor: pointer;
  animation: serChipPulse 2.4s ease-in-out infinite;
}
.mem-series-chip:active {
  transform: scale(0.95);
}
@keyframes serChipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 169, 60, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(230, 169, 60, 0); }
}

/* Блоки серий: «В работе» (48ч окно) и «Завершённые» — история обязательств.
   Самостоятельная плитка с воздухом с обеих сторон — не липнет к соседям. */
.mem-series {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin: 16px 0;
}
/* Завершённая серия: зелёная подушка с галочкой, тап раскрывает деталь */
.ser-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  margin-top: 6px;
  border-radius: 999px;
  border: 1px solid rgba(84, 192, 138, 0.45);
  background: var(--good-soft);
  color: var(--text);
  text-align: left;
}
.ser-pill:active {
  transform: scale(0.985);
}
.ser-check {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--good);
  color: #0b0b0d;
  font-size: 11px;
  font-weight: 700;
}
.ser-arr {
  flex: none;
  color: var(--muted);
  font-size: 10px;
}
.ser-detail {
  margin: 6px 6px 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.ser-detail-row {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.ser-open-card {
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid rgba(230, 169, 60, 0.45);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}
.ser-empty {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
}
.ser-k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 10px 0 6px;
}
.ser-k b {
  color: var(--accent);
}
.ser-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  text-align: left;
}
.ser-row:active {
  border-color: rgba(230, 169, 60, 0.5);
  background: var(--accent-soft);
}
.ser-dot {
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 6px rgba(230, 169, 60, 0.55);
}
.ser-row.done .ser-dot {
  background: var(--good);
  box-shadow: none;
  opacity: 0.7;
}
.ser-t {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ser-meta {
  flex: none;
  font-size: 10px;
  color: var(--muted);
}
.ser-more {
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

/* Тумблер «следующий — админ» в шапке блока доступов */
.adm-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.adm-admin-tgl {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(230, 169, 60, 0.6); /* яркая окантовка — индикатор заметен */
  background: var(--surface2);
  padding: 0;
  box-shadow: 0 0 5px rgba(230, 169, 60, 0.25);
}
.adm-admin-tgl.on {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(230, 169, 60, 0.55);
}
.adm-admin-note {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.usr-badge.usr-adm {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--border-strong);
}
.mem-how {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-top: 12px;
}
.mh-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.mh-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 11px;
}
.mh-num {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.mh-txt {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-soft);
}
.mh-foot {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.mem-quiz {
  background: linear-gradient(162deg, #17171c, #111114);
  border: 1px solid rgba(230, 169, 60, 0.28);
  border-radius: 18px;
  padding: 16px;
  margin-top: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .mem-quiz {
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.mq-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mq-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.mq-kicker.step2 {
  margin-top: 16px;
}
.mq-topic {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mq-claim {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.5;
  margin-top: 10px;
  text-wrap: pretty;
}
.mem-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.app.redesign .mem-opt {
  min-height: 46px;
  border-radius: 12px;
  text-align: left;
  padding: 12px 13px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: all 0.18s ease;
  width: 100%;
}
.app.redesign .mem-opt.right {
  background: var(--accent-soft);
  border-color: rgba(230, 169, 60, 0.7);
  color: var(--accent);
}
.app.redesign .mem-opt.wrong {
  background: rgba(224, 112, 112, 0.1);
  border-color: rgba(224, 112, 112, 0.55);
  color: var(--danger);
}
.app.redesign .mem-opt.dim {
  color: var(--muted);
}
.mem-banner {
  margin-top: 12px;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.5;
}
.mem-banner.ok {
  background: rgba(84, 192, 138, 0.1);
  border: 1px solid rgba(84, 192, 138, 0.45);
  color: var(--good);
}
.mem-banner.bad {
  background: rgba(224, 112, 112, 0.08);
  border: 1px solid rgba(224, 112, 112, 0.4);
  color: #e0a3a3;
}
[data-theme="light"] .mem-banner.bad {
  color: #b25050;
}
.mem-step3 {
  background: linear-gradient(162deg, #1a160e, #111114);
  border: 1px solid rgba(230, 169, 60, 0.45);
  border-radius: 18px;
  padding: 16px;
  margin-top: 12px;
  animation: fadeUp 0.3s ease both;
}
[data-theme="light"] .mem-step3 {
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.ms-action {
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
  margin-top: 9px;
  text-wrap: pretty;
}
.ms-take {
  width: 100%;
  margin-top: 12px;
  min-height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.5);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.ms-take.on {
  background: var(--good-soft);
  border-color: rgba(84, 192, 138, 0.55);
  color: var(--good);
}
.ms-next {
  width: 100%;
  margin-top: 10px;
  min-height: 46px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

/* ===== Профиль 1:1 ===== */
.pf2-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.pf2-top .screen-title {
  margin-bottom: 0;
}
.pf2-updated {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
  flex: none;
}
.pf2-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-top: 10px;
}
.pf2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pf2-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.pf2-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 18px; /* единый воздух над метками — ФИО и ДАТА дышат одинаково */
  letter-spacing: 0.06em;
}
.pf2-input {
  width: 100%;
  margin-top: 6px;
  height: 46px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 16px; /* <16px → iOS авто-зум при фокусе; держим ровно 16 */
  padding: 0 12px;
}
.pf2-input:focus {
  outline: none;
  border-color: rgba(230, 169, 60, 0.5);
}
.pf2-input.mono {
  font-family: var(--font-mono);
}
.pf2-input + .pf2-input {
  margin-top: 7px;
}
/* Поле даты в «КТО ТЫ»: тот же воздух подпись→поле (6px), что у ФИО (.pf2-input),
   иначе ДАТА РОЖДЕНИЯ липнет к своей метке — ритм блока рвётся (приказ 23.07).
   Скоуп .pf-date: админ-форму (.adm-row2) не трогаем. */
.pf-date {
  margin-top: 6px;
}
.pf2-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--dim);
  margin-top: 9px;
}

/* TG-карта */
.tg2-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Фото-круг с золотой окантовкой: тонкое кольцо + мягкое свечение под стиль клуба */
.tg2-ava {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(160deg, #26262d, #17171c);
  border: 1.5px solid var(--accent);
  box-shadow:
    0 0 0 3px rgba(230, 169, 60, 0.14),
    0 0 12px rgba(230, 169, 60, 0.22);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}
.tg2-ava.photo {
  object-fit: cover;
}
[data-theme="light"] .tg2-ava {
  background: linear-gradient(160deg, #f4f3ee, #e8e6de);
}
.tg2-mid {
  flex: 1;
  min-width: 0;
}
.tg2-kicker-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.tg2-kicker {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.tg2-prem {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.35);
  border-radius: 999px;
  padding: 2px 7px;
  flex: none;
}
.tg2-name {
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}
.tg2-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg2-slot {
  flex: none;
  background: none;
  border: none;
  padding: 0;
  text-align: center;
}
.tg2-slot img {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
}
.tg2-slot.on img {
  border-color: rgba(230, 169, 60, 0.6);
  box-shadow: 0 0 18px rgba(230, 169, 60, 0.45);
}
.tg2-slot.off img {
  filter: grayscale(0.75) brightness(0.55);
}
.tg2-slot-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  margin-top: 4px;
  color: var(--dim);
}
.tg2-slot.on .tg2-slot-label {
  color: var(--accent);
}

/* Чистый пиксель */
.cp2-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
  flex: none;
}
.cp2-boxes {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.cp2-box {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 9px;
  text-align: center;
}
.cp2-box-k {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.cp2-box-v {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 3px;
}
.cp2-objs {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}
.cp2-obj {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cp2-obj-n {
  width: 126px;
  flex: none;
  font-size: 12.5px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp2-obj-bar {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--surface2);
  overflow: hidden;
}
.cp2-obj-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #8a6420, #e6a93c);
}
.cp2-obj-v {
  width: 20px;
  flex: none;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
/* Чипы флагов: ЖАТВА к левому краю, МАТЬ СМЕРТИ к правому */
.cp2-checks {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 13px;
}
.cp2-check {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--good);
  background: var(--good-soft);
  border-radius: 999px;
  padding: 4px 9px;
}
.cp2-check.bad {
  color: var(--danger);
  background: rgba(224, 112, 112, 0.12);
}
/* Плитка флага (Горизонт Сопротивления): градиент с мягким живым переливом */
.cp2-flag {
  margin-top: 10px;
  border-radius: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(224, 112, 112, 0.35);
  background:
    linear-gradient(115deg,
      rgba(224, 112, 112, 0.05) 0%,
      rgba(230, 169, 60, 0.10) 30%,
      rgba(224, 112, 112, 0.07) 55%,
      rgba(230, 169, 60, 0.08) 80%,
      rgba(224, 112, 112, 0.05) 100%);
  background-size: 220% 220%;
  animation: flagShimmer 9s ease-in-out infinite;
}
@keyframes flagShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
/* Кикер флага: это ПОСТОЯННОЕ свойство кристалла, не дневная зона внимания */
.cp2-flag-k {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 5px;
}
.cp2-flag-t {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--danger);
}
.cp2-flag-m {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-soft);
  margin-top: 3px;
}
.cp2-flag-d {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 4px;
}
.cp2-meta {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 8px;
}
.cp2-meta.mono {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
}
/* Единый читаемый блок смысла (стадия / буст / режим решётки) — один шрифт и размер */
.cp2-summary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cp2-summary-row {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-soft);
}
.cp2-summary-row + .cp2-summary-row {
  margin-top: 6px;
}
.cp2-summary-row b {
  color: var(--text);
  font-weight: 600;
}
/* Сырые буквенно-цифровые коды — второстепенная техническая строка внизу блока */
.cp2-codes {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.cp2-codes-legend {
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
}

/* Связка с основателем */
.lat-card {
  position: relative;
  border: 1px solid rgba(230, 169, 60, 0.3);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-top: 10px;
}
.lat-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  transition: opacity 0.4s ease;
}
.lat-card.off .lat-bg {
  opacity: 0.12;
}
.lat-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 11, 13, 0.92) 30%, rgba(11, 11, 13, 0.55));
}
.lat-body {
  position: relative;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lat-mid {
  flex: 1;
  min-width: 0;
}
.lat-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #c9c8c0;
  margin-top: 7px;
  text-wrap: pretty;
}
.lat-switch {
  flex: none;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  position: relative;
  transition: all 0.25s ease;
  background: #1b1b20;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.lat-card.on .lat-switch {
  background: rgba(230, 169, 60, 0.25);
  border-color: rgba(230, 169, 60, 0.6);
}
.lat-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #55555e;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  display: block;
}
.lat-card.on .lat-knob {
  background: var(--accent);
  transform: translateX(22px);
}

/* Оси силы */
.ax2-mode {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  flex: none;
}
.ax2-mode.on {
  color: var(--good);
}
.ax2-mode.solo {
  color: var(--danger);
}
.ax2-rows {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 13px;
}
.ax2-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: var(--text);
}
.ax2-name {
  font-size: 13.5px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}
.ax2-boost {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 8px;
  flex: none;
}
.ax2-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--input-bg);
  border: 1px solid rgba(230, 169, 60, 0.3);
  border-radius: 8px;
  padding: 3px 8px;
  flex: none;
}
.ax2-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--surface2);
  overflow: hidden;
  margin-top: 7px;
}
.ax2-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #8a6420, #e6a93c);
  transition: width 0.4s ease;
}
.ax2-row .axis-quiz {
  margin-top: 10px;
}

/* ===== Страница матери 1:1 ===== */
.mp-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-top: 12px;
}
.mp-title {
  margin: 4px 0 0;
  font-size: 21px;
  font-weight: 700;
}
.mp-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.mp-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 18px 0 8px;
  text-transform: uppercase;
}
.mp-branches {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mp-branch {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  min-height: 46px;
  width: 100%;
}
.mp-branch:active {
  border-color: rgba(230, 169, 60, 0.45);
}
.mp-branch .md-diamond {
  margin-top: 0;
}
.mp-branch-t {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
}
.mp-branch-c {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  flex: none;
}
.mp-deck-btn {
  width: 100%;
  margin-top: 14px;
  min-height: 48px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.5);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.mp-deck-btn:active {
  background: rgba(230, 169, 60, 0.24);
  box-shadow: 0 0 18px rgba(230, 169, 60, 0.2);
}

/* ===== Колода 1:1 (шапка — единая полоска .pg-strip, см. конец файла) ===== */
.deck2-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.deck2-fav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--dim);
  font-size: 16px;
  line-height: 1;
}
.deck2-fav.on {
  color: var(--accent);
  border-color: rgba(230, 169, 60, 0.5);
}
.app.redesign .flip-stage {
  height: 398px;
  margin-top: 10px;
  perspective: 1200px;
}
.app.redesign .flip-face.f2 {
  background: linear-gradient(162deg, #17171c, #111114);
  border: 1px solid rgba(230, 169, 60, 0.28);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
  /* Высоту сцены задаёт JS (fitDeckCard) под контент; если текста больше лимита —
     грань скроллится с тонким видимым баром (не обрезаем текст молча). */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 169, 60, 0.55) transparent;
  -webkit-overflow-scrolling: touch;
}
.app.redesign .flip-face.f2::-webkit-scrollbar {
  display: block;
  width: 4px;
}
.app.redesign .flip-face.f2::-webkit-scrollbar-thumb {
  background: rgba(230, 169, 60, 0.55);
  border-radius: 4px;
}
.app.redesign .flip-face.f2::-webkit-scrollbar-track {
  background: transparent;
}
/* Подсказка «есть ещё ниже»: мягкое затухание у нижней кромки, пока грань скроллится */
.app.redesign .flip-stage.is-scroll::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 0;
  height: 34px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(to bottom, transparent, rgba(17, 17, 20, 0.92));
  pointer-events: none;
  z-index: 3;
}
[data-theme="light"] .app.redesign .flip-stage.is-scroll::after {
  background: linear-gradient(to bottom, transparent, rgba(242, 240, 232, 0.92));
}
.app.redesign .flip-face.f2.f2b {
  background: linear-gradient(162deg, #1a160e, #111114);
  border-color: rgba(230, 169, 60, 0.45);
}
[data-theme="light"] .app.redesign .flip-face.f2 {
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.f2-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.f2-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.f2-learned {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--good);
  background: var(--good-soft);
  border-radius: 999px;
  padding: 3px 8px;
  flex: none;
}
.f2-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 12px;
}
.f2-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-soft);
  margin-top: 10px;
  text-wrap: pretty;
  /* НИКАКОГО внутреннего скролла: абзац «Смысл» сжимался в невидимую прокрутку
     (скроллбары глобально скрыты) и текст «пропадал», а fitDeckCard не видел
     переполнения. Абзац растёт свободно — тянется/скроллится ГРАНЬ целиком (v2.8.2) */
  overflow: visible;
}
.f2-foot {
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--dim);
}
.f2-pr {
  font-size: 15.5px;
  line-height: 1.6;
  font-weight: 500;
  margin-top: 10px;
  text-wrap: pretty;
  overflow: visible; /* как .f2-body — не красть текст внутренним скроллом */
}
.f2-kicker.f2-srck {
  margin-top: 18px;
}
.f2-src {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 7px;
}

/* Королевский шрифт приветствия */
.home-greet-row .hero-hi {
  font-family: "Playfair Display", "IBM Plex Sans", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  /* королевская шлифовка как у имён в профиле (v2.8.0) */
  color: #f7f3e9;
  -webkit-text-stroke: 0.3px rgba(230, 169, 60, 0.45);
  text-shadow: 0 0 10px rgba(230, 169, 60, 0.16), 0 1px 0 rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .home-greet-row .hero-hi {
  color: #2b2413;
  -webkit-text-stroke: 0.25px rgba(189, 122, 23, 0.5);
  text-shadow: 0 0 8px rgba(189, 122, 23, 0.12);
}
/* Кнопка темы: SVG-корона по центру */
.app.redesign .theme-btn svg {
  display: block;
}

/* Голограмма: живой подсчёт + развертка активных осей (v2.3.1) */
.h3-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.h3-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(36px, 1.35fr) minmax(0, 1fr) 22px;
  align-items: center;
  gap: 6px;
}
.h3-pole {
  width: auto;
  min-width: 0;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h3-pole.right {
  text-align: right;
}
.h3-pole.hot {
  color: var(--accent);
  font-weight: 600;
}
.h3-line {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--surface2);
  position: relative;
}
.h3-line i {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(230, 169, 60, 0.6);
  transition: left 0.4s ease;
}
.h3-val {
  width: 18px;
  flex: none;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.companions2-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.companion2 {
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  transition: all 0.18s ease;
}
.companion2 b {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}
.companion2.on {
  border-color: rgba(230, 169, 60, 0.45);
  color: var(--text-soft);
}
.companion2.on b {
  color: var(--accent);
}
.companion2.open {
  background: var(--accent-soft);
  border-color: rgba(230, 169, 60, 0.7);
  color: var(--accent);
}
.companion2.open b {
  color: var(--accent);
}
.holo-detail {
  margin-top: 10px;
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid rgba(230, 169, 60, 0.3);
  animation: fadeUp 0.25s ease both;
}
.hd-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.hd-t {
  font-size: 13.5px;
  font-weight: 600;
}
.hd-v {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}
.hd-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--surface2);
  overflow: hidden;
  margin-top: 8px;
}
.hd-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #8a6420, #e6a93c);
}
.hd-axis {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.hd-axis b {
  color: var(--accent);
  font-weight: 600;
}

/* Голограмма: активные бары объектов (v2.3.2) */
.holo-objs {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}
.holo-obj {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  color: var(--text);
  min-height: 24px;
}
.holo-obj .cp2-obj-n {
  color: var(--muted);
}
.holo-obj.on .cp2-obj-n {
  color: var(--text-soft);
}
.holo-obj.open .cp2-obj-n {
  color: var(--accent);
  font-weight: 600;
}
.holo-axis-line {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 4px;
  padding-left: 2px;
  animation: fadeUp 0.22s ease both;
}
.holo-axis-line b {
  color: var(--accent);
  font-weight: 600;
}

/* Вектор на цели: боль/цель → приём (v2.4.0) */
.tgt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  margin-top: 8px;
  min-height: 52px;
}
.tgt-row:active {
  border-color: rgba(230, 169, 60, 0.45);
}
.tgt-k {
  flex: none;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  border-radius: 999px;
  padding: 4px 8px;
}
.tgt-k.pain {
  color: var(--danger);
  background: rgba(224, 112, 112, 0.12);
}
.tgt-k.goal {
  color: var(--accent);
  background: var(--accent-soft);
}
.tgt-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tgt-text {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tgt-card {
  font-size: 13.5px;
  font-weight: 600;
}
.md-target {
  margin-top: 6px;
  font-size: 12.5px;
}
.md-target b {
  color: var(--accent);
  font-weight: 600;
}
.drill-for {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--danger);
  background: rgba(224, 112, 112, 0.12);
  border-radius: 999px;
  padding: 3px 7px;
  margin-right: 4px;
}

/* ===== ГЛОССАРИЙ: расшифровка терминов курсивом (v2.4.3) ===== */
.md-gloss {
  margin-top: 8px;
  text-align: left;
  /* 3.1.9: коридор под уголок-подворот карточки (44px * scale 1.12 = 49.3px
     минус padding 14px = 35.3px реального вылета) — строки глосса больше
     не заезжают под золотое ухо */
  padding-right: 42px;
}
.md-gloss i,
.cd-gloss i {
  display: block;
  font-style: italic;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted, rgba(255, 255, 255, 0.45));
  opacity: 0.85;
}
.cd-gloss {
  margin: 2px 0 8px;
}
i.gloss {
  font-style: italic;
  opacity: 0.78;
  font-weight: 400;
}

/* ===== Шлифовка блока ЧИСТЫЙ ПИКСЕЛЬ · ГОЛОГРАММА (v2.4.6) ===== */
.crystal-day .cd-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  margin: 6px 0 8px;
}
.crystal-day .cd-cell {
  border: 1px solid rgba(230, 169, 60, 0.2);
  background: rgba(230, 169, 60, 0.06);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 0;
}
.crystal-day .cd-cell-k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  opacity: 0.6;
  margin-bottom: 4px;
}
.crystal-day .cd-cell-v {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crystal-day .cd-cell.status .cd-cell-v {
  font-size: 13px;
  padding-top: 2px;
}
.crystal-day .cd-stage-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.6;
}

/* === АДМИН-БЛОК «ДОСТУПЫ» (только основатель) === */
.adm-card {
  border-color: rgba(230, 169, 60, 0.32);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(230, 169, 60, 0.06), transparent 60%),
    var(--surface);
}
.adm-card .adm-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
}
.adm-input {
  margin-top: 8px;
}
.adm-add {
  margin-top: 12px;
}
/* Форма выдачи доступа: ФИО на всю ширину, дата + Telegram ID бок о бок (v2.7.0) */
.adm-field {
  flex: 1;
  min-width: 0;
}
/* Внутри .adm-field отступ даёт лейбл — у инпутов свой margin глушим, иначе поля «плывут» */
.adm-field .pf2-input {
  margin-top: 0;
}
.adm-field-k {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 5px;
}
.adm-row1 {
  margin-top: 10px;
}
.adm-row2 {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.adm-date-input {
  height: 46px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
}
.adm-date-input .usr-cal {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--accent);
  opacity: 0.85;
}
.adm-date-input:active {
  border-color: rgba(230, 169, 60, 0.5);
  background: var(--accent-soft);
}
.adm-date-val {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-date-val.ph {
  color: var(--muted);
}
.adm-status {
  min-height: 16px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.adm-status.ok { color: var(--good); }
.adm-status.bad { color: var(--danger); }
.adm-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.adm-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 8px 0;
}
.adm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.adm-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-id {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
}
.adm-del {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.adm-del:active {
  color: var(--danger);
  border-color: rgba(224, 112, 112, 0.5);
  transform: scale(0.94);
}

/* === PG-STRIP v2.4 — единая верхняя полоска [‹ пилюля | центр | экшен] === */
.pg-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
}
.pg-strip > :first-child {
  justify-self: start;
}
.pg-mid {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.pg-side {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
}
.pg-spacer {
  width: 38px;
  height: 38px;
}
/* Пилюля-назад: пара к кругу-звезде, стиль нижних «подушечек» */
.fav-back.pg-back {
  width: 46px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
}
.fav-back.pg-back:active {
  color: var(--accent);
  border-color: rgba(230, 169, 60, 0.5);
  transform: scale(0.94);
}
/* Центр: счётчик колоды и заголовки — в пилюле того же языка */
.pg-strip .deck2-counter,
.pg-strip .pg-title,
.pg-strip .today-date {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-strip .today-date {
  font-size: 13px;
  font-weight: 600;
}
.pg-strip .pg-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.pg-strip .mp-kicker {
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(230, 169, 60, 0.3);
  background: var(--accent-soft);
}
.pg-strip .fav-title {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pg-strip .today-formula {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === DECK TURN v2.5 — полный 3D-переворот на следующую карту ===
   Вращается .flip-inner (inline-стили из step()); грани прячет backface-visibility,
   так что «другая сторона» — следующая карта — видна с середины поворота.
   Классы turn-next/turn-prev лишь блокируют тапы и поднимают тень на время полёта. */
.flip-stage.turn-next,
.flip-stage.turn-prev {
  pointer-events: none;
}
.flip-stage.turn-next::before,
.flip-stage.turn-prev::before {
  animation: flipShadow 0.62s ease;
}

/* ===== Пояснялочки блоков курсивом (v2.4.10) ===== */
.block-gloss {
  margin: -2px 0 10px;
}
.block-gloss i.gloss {
  display: block;
  font-size: 11px;
  line-height: 1.45;
}

/* ===== ДОСТУПЫ · ПОЛЬЗОВАТЕЛИ (v2.6.0) ===== */
.adm-granted {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(230, 169, 60, 0.28);
  background: var(--accent-soft);
}
.adm-granted-k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.adm-granted b {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
}
.usr-card .adm-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.35);
  border-radius: 999px;
  padding: 3px 10px;
}
.usr-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.usr-row {
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.usr-row.founder {
  border-color: rgba(230, 169, 60, 0.5);
  background:
    radial-gradient(130% 90% at 0% 0%, rgba(230, 169, 60, 0.1), transparent 55%),
    var(--surface2);
}
.usr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.usr-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.8;
}
.usr-cal {
  flex: none;
  color: var(--accent);
  opacity: 0.8;
  margin-left: -2px;
}
.usr-name {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.usr-badge {
  flex: none;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.4);
  border-radius: 999px;
  padding: 3px 8px;
}
.usr-tools {
  flex: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.usr-eye {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(230, 169, 60, 0.45);
  background: var(--surface);
  color: var(--accent);
}
.usr-eye:active {
  transform: scale(0.94);
  background: var(--accent-soft);
}
.usr-revoke {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}
.usr-revoke:active {
  color: var(--danger);
  border-color: rgba(224, 112, 112, 0.5);
  transform: scale(0.94);
}
/* Спросили «Убрать?» — кнопка раскрывается в красную пилюлю, второй тап отзывает */
.usr-revoke.ask {
  width: auto;
  padding: 0 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffd7d7;
  background: rgba(180, 60, 60, 0.22);
  border-color: rgba(224, 112, 112, 0.65);
  box-shadow: 0 0 9px rgba(224, 112, 112, 0.3);
}
.usr-fields {
  display: flex;
  flex-direction: row;
  gap: 7px;
}
.usr-field {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 7px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.usr-field.editable {
  cursor: pointer;
}
.usr-field.editable:active {
  border-color: rgba(230, 169, 60, 0.5);
  background: var(--accent-soft);
}
.usr-field-k {
  position: absolute;
  top: 5px;
  left: 9px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.usr-field-v {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.usr-field-v.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.usr-copy {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.usr-copy svg {
  width: 11px;
  height: 11px;
}
.usr-copy:active {
  transform: scale(0.9);
  background: var(--accent-soft);
}
.usr-copy svg { display: block; }
.usr-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.usr-pg-nums {
  display: flex;
  gap: 6px;
}
.usr-pg-num {
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}
.usr-pg-num.on {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
.usr-pg-arrow {
  width: 38px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.usr-pg-arrow.off {
  color: var(--border-strong);
  opacity: 0.5;
}
.usr-pg-arrow:not(.off):active {
  transform: scale(0.92);
  background: var(--accent-soft);
}
.usr-pg-info {
  margin-top: 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* === DATE PICKER v2.7.0 — кастомный пикер даты: годовая лента (scroll-snap) + день/месяц.
   Открывается openDatePicker() поверх всего (adm-birth форма, тап по дате на плитке юзера). === */
.dp-overlay {
  position: fixed;
  inset: 0;
  z-index: 500; /* выше клуб-гейта (400), сплеша (200), тостов (100) */
  background: rgba(5, 5, 8, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px max(12px, var(--safe-bottom));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.dp-panel {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
}
.dp-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  text-align: center;
}
/* Три вертикальных колеса (день | месяц | год) — как барабаны будильника iOS */
.dp-wheels {
  position: relative;
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.dp-wheel {
  flex: 1;
  min-width: 0;
  height: 200px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  padding: 80px 0; /* (200 - 40) / 2 — чтобы крайние элементы доезжали до центра */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dp-wheel::-webkit-scrollbar {
  display: none;
}
.dp-wheel.mono .dp-item {
  font-family: var(--font-mono);
}
.dp-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  scroll-snap-align: center;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 15px;
  opacity: 0.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-item.on {
  color: var(--accent);
  font-weight: 600;
  font-size: 16.5px;
  opacity: 1;
}
/* Центральная полоса выбора */
.dp-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 40px;
  transform: translateY(-50%);
  border-top: 1px solid rgba(230, 169, 60, 0.4);
  border-bottom: 1px solid rgba(230, 169, 60, 0.4);
  background: rgba(230, 169, 60, 0.06);
  border-radius: 10px;
  pointer-events: none;
}
/* Затухание сверху/снизу — эффект барабана */
.dp-wheels::before,
.dp-wheels::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 1;
  pointer-events: none;
}
.dp-wheels::before {
  top: 0;
  background: linear-gradient(180deg, var(--surface), transparent);
}
.dp-wheels::after {
  bottom: 0;
  background: linear-gradient(0deg, var(--surface), transparent);
}
.dp-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.dp-btn {
  flex: 1;
  height: 46px;
  min-height: 44px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
}
.dp-cancel {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.dp-done {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #0b0b0d;
}
.dp-cancel:active,
.dp-done:active {
  transform: scale(0.97);
}

/* ===== Вращающееся свечение по грани — аватар и кристалл (v2.7.3, как brand-ring) ===== */
.ava-ring {
  position: relative;
  width: 46px;
  height: 46px;
  flex: none;
  display: block;
  /* свой композитный слой: repaint смены темы/анимаций не трогает фото — не мигает (v2.8.1) */
  transform: translateZ(0);
  backface-visibility: hidden;
}
.ava-ring .tg2-ava {
  position: relative;
  z-index: 1;
}
.ava-ring .ring-c {
  position: absolute;
  inset: -3.5px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 0deg, rgba(230,169,60,.9), transparent 30%, rgba(199,125,255,.5), transparent 65%, rgba(230,169,60,.85));
  animation: brandSpin 8s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  filter: drop-shadow(0 0 6px rgba(230, 169, 60, 0.45));
}
.slot-ring {
  position: relative;
  display: block;
  width: 50px;
  height: 50px;
  margin: 0 auto;
}
.slot-ring img {
  position: relative;
  z-index: 1;
}
.slot-ring .ring-sq {
  position: absolute;
  inset: -3.5px;
  border-radius: 16px;
  padding: 2px;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  overflow: hidden;
  filter: drop-shadow(0 0 6px rgba(230, 169, 60, 0.45));
}
.slot-ring .ring-sq::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(230,169,60,.9), transparent 30%, rgba(199,125,255,.5), transparent 65%, rgba(230,169,60,.85));
  animation: ringSpinC 8s linear infinite;
}
@keyframes ringSpinC {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
/* Кристалл выключен — свечение гаснет вместе с ним */
.tg2-slot.off .ring-sq {
  opacity: 0.25;
  filter: grayscale(0.8);
}

/* ===== Автосейв профиля (v2.7.7) — кнопки «Сохранить профиль» больше нет.
   Ушёл из поля → записано: золотая галочка в поле на 1.6с + один тост на серию. ===== */
.pf2-input.saved-tick,
.pf-date.saved-tick {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 12.5 L9.5 18 L20 6.5' fill='none' stroke='%23e6a93c' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 17px 17px;
  border-color: rgba(230, 169, 60, 0.55) !important;
}
/* в поле даты справа живёт календарик — галочку левее */
.pf-date.saved-tick {
  background-position: right 46px center;
}

/* ===== Плейсхолдеры-примеры (v2.7.8): «напр. …» — курсив, мягче и мельче,
   как образец для заполнения, а не «деревянные большие буквы» ===== */
.pf2-input::placeholder {
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  opacity: 0.68;
  letter-spacing: 0.01em;
}
/* «Выбери дату» в поле даты — тот же образцовый курсив */
.adm-date-val.ph {
  font-style: italic;
  font-size: 14px;
  opacity: 0.68;
}

/* ===== Королевские имена (v2.7.8): Playfair Display + тонкая золотая окантовка букв —
   имя в плашке Telegram и имена всех узлов в «ДОСТУПЫ · ПОЛЬЗОВАТЕЛИ» ===== */
.tg2-name,
.usr-name {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f7f3e9;
  -webkit-text-stroke: 0.3px rgba(230, 169, 60, 0.45);
  text-shadow: 0 0 10px rgba(230, 169, 60, 0.16), 0 1px 0 rgba(0, 0, 0, 0.55);
}
.tg2-name {
  font-size: 17px;
}
.usr-name {
  font-size: 15.5px;
}
[data-theme="light"] .tg2-name,
[data-theme="light"] .usr-name {
  color: #2b2413;
  -webkit-text-stroke: 0.25px rgba(189, 122, 23, 0.5);
  text-shadow: 0 0 8px rgba(189, 122, 23, 0.12);
}

/* === Прошлая жизнь — блок по книге Говарда Картера (изд. 1992) === */
.plife-card {
  border-color: rgba(230, 169, 60, 0.28);
}
.plife-hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 10px 0 2px;
}
.plife-hero-l {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.plife-hero-v {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.02em;
  color: #f7f3e9;
  -webkit-text-stroke: 0.3px rgba(230, 169, 60, 0.45);
  text-shadow: 0 0 10px rgba(230, 169, 60, 0.16), 0 1px 0 rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .plife-hero-v {
  color: #2b2413;
  -webkit-text-stroke: 0.25px rgba(189, 122, 23, 0.5);
  text-shadow: 0 0 8px rgba(189, 122, 23, 0.12);
}
.plife-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.plife-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 4px;
}
.plife-text {
  font-size: 14.5px;
  line-height: 1.5;
}
.plife-row.dest {
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(230, 169, 60, 0.07), transparent 70%);
}
.plife-note {
  margin-top: 4px;
}
.plife-src {
  margin-top: 12px;
}
.plife-empty {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 8px;
}

/* === Знаки книги Картера: SVG-гексаграмма расчёта + плитки знаков ===
   Палитра жёлто-чёрно-серо-белая через переменные темы; фиксация внимания —
   двойная чёрно-золотая окантовка на каждом узле и плитке (в обеих темах) */
.plife-crystal {
  display: block;
  width: 100%;
  max-width: 344px;
  margin: 14px auto 2px;
}
.plc-hex {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1;
  opacity: 0.3;
}
.plc-ray {
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0.5;
}
.plc-stepnum circle {
  fill: var(--surface);
  stroke: var(--muted);
  stroke-width: 1;
}
.plc-stepnum text {
  fill: var(--muted);
  font-size: 9px;
  font-family: "IBM Plex Mono", monospace;
  text-anchor: middle;
}
.plc-node-outer {
  fill: var(--surface);
  stroke: rgba(0, 0, 0, 0.72);
  stroke-width: 2.4;
}
.plc-node-inner {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
}
.plc-diamond-outer {
  fill: var(--surface);
  stroke: rgba(0, 0, 0, 0.78);
  stroke-width: 2.6;
}
.plc-diamond-inner {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}
.plc-kick {
  fill: var(--accent);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-anchor: middle;
}
.plc-date {
  fill: var(--text);
  font-size: 13px;
  font-family: "IBM Plex Mono", monospace;
  text-anchor: middle;
}
.plc-code {
  fill: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: "IBM Plex Mono", monospace;
  text-anchor: middle;
}
.plc-label {
  fill: var(--muted);
  font-size: 8.6px;
  letter-spacing: 0.1em;
  text-anchor: middle;
}
.plg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}
.plg-ray {
  stroke: var(--muted);
  stroke-width: 1.1;
}
.plg-ray.on {
  stroke: var(--accent);
  stroke-width: 2.2;
}
.plg-tip,
.plg-dot {
  fill: var(--accent);
}
.plg-ar {
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}
.plife-signs .pl-sym-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.pl-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 0 1.5px rgba(230, 169, 60, 0.38);
  color: var(--text);
  cursor: pointer;
}
.pl-tile svg {
  width: 34px;
  height: 34px;
  display: block;
}
.pl-tile-name {
  font-size: 9px;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
}
.pl-tile.on {
  border-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 0 2px var(--accent), 0 0 14px rgba(230, 169, 60, 0.28);
}
.pl-tile.on .pl-tile-name {
  color: var(--accent);
}
[data-theme="light"] .pl-tile {
  border-color: rgba(0, 0, 0, 0.62);
  box-shadow: 0 0 0 1.5px rgba(189, 122, 23, 0.5);
}
[data-theme="light"] .pl-tile.on {
  box-shadow: 0 0 0 2px #bd7a17, 0 0 12px rgba(189, 122, 23, 0.3);
}
.pl-az-row,
.pl-tgt-row {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.pl-az-row {
  grid-template-columns: repeat(4, 1fr);
}
.pl-tgt-row {
  grid-template-columns: repeat(7, 1fr);
}
.pl-az-tile {
  cursor: default;
}
.pl-tgt-row .pl-tile {
  padding: 6px 2px;
}
.pl-tgt-row .pl-tile svg {
  width: 28px;
  height: 28px;
}
.pl-open {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 1.5px rgba(230, 169, 60, 0.35);
  background: linear-gradient(90deg, rgba(230, 169, 60, 0.06), transparent 75%);
  font-size: 13.5px;
  line-height: 1.5;
}
[data-theme="light"] .pl-open {
  box-shadow: 0 0 0 1.5px rgba(189, 122, 23, 0.42);
}

/* === Манускрипт-стиль: уголки-завитки, пергаментный тон, орнамент-разделители.
   Неприкасаемое: логотип, аватар, .plife-card (прошлая жизнь), .lat-card (решётка). */
:root {
  --ms-c1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1.5 22.5 C1.5 9.5 9.5 1.5 22.5 1.5 M1.5 14.5 C1.5 8 8 1.5 14.5 1.5 M5 5 c2.3 0 3.5 2.7 1.7 4 c-1.4 1 -3.2 -0.3 -2.6 -2' fill='none' stroke='%23e6a93c' stroke-width='1.1' stroke-linecap='round' opacity='0.5'/%3E%3C/svg%3E");
  --ms-c2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(24 0) scale(-1 1)'%3E%3Cpath d='M1.5 22.5 C1.5 9.5 9.5 1.5 22.5 1.5 M1.5 14.5 C1.5 8 8 1.5 14.5 1.5 M5 5 c2.3 0 3.5 2.7 1.7 4 c-1.4 1 -3.2 -0.3 -2.6 -2' fill='none' stroke='%23e6a93c' stroke-width='1.1' stroke-linecap='round' opacity='0.5'/%3E%3C/g%3E%3C/svg%3E");
  --ms-c3: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(0 24) scale(1 -1)'%3E%3Cpath d='M1.5 22.5 C1.5 9.5 9.5 1.5 22.5 1.5 M1.5 14.5 C1.5 8 8 1.5 14.5 1.5 M5 5 c2.3 0 3.5 2.7 1.7 4 c-1.4 1 -3.2 -0.3 -2.6 -2' fill='none' stroke='%23e6a93c' stroke-width='1.1' stroke-linecap='round' opacity='0.5'/%3E%3C/g%3E%3C/svg%3E");
  --ms-c4: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(24 24) scale(-1 -1)'%3E%3Cpath d='M1.5 22.5 C1.5 9.5 9.5 1.5 22.5 1.5 M1.5 14.5 C1.5 8 8 1.5 14.5 1.5 M5 5 c2.3 0 3.5 2.7 1.7 4 c-1.4 1 -3.2 -0.3 -2.6 -2' fill='none' stroke='%23e6a93c' stroke-width='1.1' stroke-linecap='round' opacity='0.5'/%3E%3C/g%3E%3C/svg%3E");
  --ms-rule: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 10'%3E%3Cpath d='M0 5 h88 M132 5 h88' stroke='%23e6a93c' stroke-width='1' opacity='0.42'/%3E%3Cpath d='M106.6 2.8 h5 v5 h-5 Z M108.6 0.8 h5 v5 h-5 Z M106.6 2.8 L108.6 0.8 M111.6 2.8 L113.6 0.8 M111.6 7.8 L113.6 5.8 M106.6 7.8 L108.6 5.8' fill='none' stroke='%23e6a93c' stroke-width='1.1' opacity='0.8'/%3E%3Cpath d='M96 5 h5 M119 5 h5' stroke='%23e6a93c' stroke-width='1.6' opacity='0.65'/%3E%3Ccircle cx='102.6' cy='5' r='1' fill='%23e6a93c' opacity='0.7'/%3E%3Ccircle cx='117.4' cy='5' r='1' fill='%23e6a93c' opacity='0.7'/%3E%3C/svg%3E");
}
.pf2-card:not(.plife-card):not(.lat-card),
.adm-card,
.usr-card {
  background-image: var(--ms-c1), var(--ms-c2), var(--ms-c3), var(--ms-c4),
    linear-gradient(158deg, rgba(230, 169, 60, 0.045), transparent 46%);
  background-repeat: no-repeat;
  background-position: 5px 5px, calc(100% - 5px) 5px, 5px calc(100% - 5px), calc(100% - 5px) calc(100% - 5px), 0 0;
  background-size: 20px 20px, 20px 20px, 20px 20px, 20px 20px, 100% 100%;
}
.topic-btn {
  background-image: var(--ms-c1), var(--ms-c4);
  background-repeat: no-repeat;
  background-position: 4px 4px, calc(100% - 4px) calc(100% - 4px);
  background-size: 13px 13px, 13px 13px;
}
.screen-title::after {
  content: "";
  display: block;
  height: 10px;
  margin-top: 7px;
  background: var(--ms-rule) center / auto 10px no-repeat;
  opacity: 0.9;
}
[data-theme="light"] .screen-title::after {
  filter: saturate(1.15) brightness(0.82);
}

/* === Знаки книги v2: плотная компоновка без пустот + модалка-манускрипт + мост === */
.plife-signs .pl-sym-grid,
.pl-tgt-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.plife-signs .pl-sym-grid .pl-tile {
  flex: 0 0 calc(25% - 6px);
}
.pl-tgt-row .pl-tile {
  flex: 0 0 calc(14.28% - 7px);
  min-width: 42px;
}
.pl-modal-ov {
  position: fixed;
  inset: 0;
  z-index: 340;
  background: rgba(5, 5, 7, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 18px;
}
.pl-modal {
  position: relative;
  max-width: 360px;
  width: 100%;
  max-height: 72vh;
  /* Скролл перенесён внутрь (.pl-modal-scroll): крестик и орнаменты не уезжают */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.75);
  box-shadow: 0 0 0 2px var(--accent), 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 26px rgba(230, 169, 60, 0.18);
  padding: 0;
  /* Верхне-правый орнамент убран — его угол занимает крестик закрытия */
  background-image: var(--ms-c1), var(--ms-c3), var(--ms-c4);
  background-repeat: no-repeat;
  background-position: 5px 5px, 5px calc(100% - 5px), calc(100% - 5px) calc(100% - 5px);
  background-size: 20px 20px, 20px 20px, 20px 20px;
}
.pl-modal-scroll {
  overflow-y: auto;
  min-height: 0;
  padding: 16px 16px 18px;
}
.pl-modal-x {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 1.4px rgba(230, 169, 60, 0.55);
  background: var(--surface);
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  /* × съезжал внутрь круга (нативный паддинг кнопки в WKWebView) — жёсткая центровка (приказ 23.07) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pl-modal-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 26px 10px 2px;
}
.pl-modal-h svg {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}
.pl-modal-k {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.pl-modal-t {
  font-size: 14.5px;
  line-height: 1.55;
}
[data-theme="light"] .pl-modal-ov {
  background: rgba(46, 40, 26, 0.45);
}
.plife-bridge .plb-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.plb-ax {
  font-size: 13.5px;
  font-weight: 600;
  flex: 0 0 92px;
}
.plb-bar {
  flex: 1 1 90px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
[data-theme="light"] .plb-bar {
  background: rgba(0, 0, 0, 0.09);
}
.plb-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(230, 169, 60, 0.5), var(--accent));
}
.plb-v {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  color: var(--accent);
  flex: 0 0 auto;
}
.plb-tag {
  flex: 1 1 100%;
  font-size: 11.5px;
  font-style: italic;
  color: var(--muted);
}
.plb-tag.res {
  color: var(--accent);
  opacity: 0.85;
}

/* === 2.9.4: интерактив гексаграммы + 3 блока знаков + линейка без заголовка === */
.plc-node {
  cursor: pointer;
}
.plc-node.on {
  animation: plcPulse 0.5s ease;
}
@keyframes plcPulse {
  0% { opacity: 0.45; }
  100% { opacity: 1; }
}
.plc-node.on .plc-node-inner {
  stroke-width: 2.6;
}
.plc-label.on {
  fill: var(--accent);
  font-weight: 700;
}
.plc-sel {
  margin: 2px 2px 12px;
  padding: 10px 12px 11px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  box-shadow: 0 0 0 1.5px rgba(230, 169, 60, 0.5);
  background: rgba(230, 169, 60, 0.05);
}
.plc-sel-k {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 5px;
}
.plc-sel-v {
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-left: 4px;
}
.plc-sel-t {
  font-size: 13.5px;
  line-height: 1.5;
}
.pl-grp {
  margin-top: 12px;
}
.pl-grp-t {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  margin-bottom: 2px;
}
/* 7 стрелок предназначения — строго в один ряд, без переноса */
.pl-tgt-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}
.pl-tgt-row .pl-tile {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 2px 6px;
}
.pl-modal-t.plm-years {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
  margin-top: 6px;
  font-size: 15px;
  letter-spacing: 0.04em;
}
/* Сечение-линейка манускрипта без слова-заголовка (страница профиля) */
.screen-rule {
  height: 10px;
  background: var(--ms-rule) center / auto 10px no-repeat;
  opacity: 0.9;
  flex: 1;
}
[data-theme="light"] .screen-rule {
  filter: saturate(1.15) brightness(0.82);
}

/* ms-cube: ромб линейки заменён сферическим кубом-в-кубе (гейт 2.9.5) */

/* flip-auto (2.9.6): карточка тренировки растёт под текст — ни одна строка
   не обрезается; грани лежат в одной grid-ячейке, высота = большей грани */
.flip-stage {
  height: auto;
  min-height: 360px;
}
.flip-inner {
  display: grid;
  height: auto;
  min-height: 360px;
}
.flip-face {
  position: static;
  grid-area: 1 / 1;
  inset: auto;
}

/* === Обучающий модуль-тур (2.9.7): подсветка блока + стрелка + окошко === */
.tour-ov {
  position: fixed;
  inset: 0;
  z-index: 400;
}
.tour-hi {
  position: fixed;
  border-radius: 12px;
  border: 1.6px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(5, 5, 7, 0.78), 0 0 24px rgba(230, 169, 60, 0.4);
  pointer-events: none;
  z-index: 401;
}
[data-theme="light"] .tour-hi {
  box-shadow: 0 0 0 9999px rgba(46, 40, 26, 0.55), 0 0 24px rgba(189, 122, 23, 0.4);
}
.tour-arrow {
  position: fixed;
  width: 40px;
  height: 46px;
  color: var(--accent);
  z-index: 402;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.tour-tip {
  position: fixed;
  z-index: 402;
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.75);
  box-shadow: 0 0 0 2px var(--accent), 0 14px 44px rgba(0, 0, 0, 0.55);
  padding: 14px 14px 12px;
  background-image: var(--ms-c1), var(--ms-c2), var(--ms-c3), var(--ms-c4);
  background-repeat: no-repeat;
  background-position: 5px 5px, calc(100% - 5px) 5px, 5px calc(100% - 5px), calc(100% - 5px) calc(100% - 5px);
  background-size: 20px 20px, 20px 20px, 20px 20px, 20px 20px;
}
.tour-k {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 6px;
}
.tour-t {
  font-size: 13.5px;
  line-height: 1.5;
}
.tour-btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.tour-skip {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 4px;
}
.tour-next {
  background: var(--accent);
  color: #0b0b0d;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* === PORTAL-BACK v1 (Grok) — read-only info bars; no open/close controls === */
.portal-card {
  border-color: rgba(230, 169, 60, 0.28);
}
.portal-sub {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.45;
  margin: 2px 0 10px;
}
.portal-status {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(230, 169, 60, 0.35);
  color: var(--accent);
  white-space: nowrap;
}
.portal-status.on {
  background: rgba(80, 180, 100, 0.12);
  border-color: rgba(80, 180, 100, 0.45);
  color: #7dcea0;
  box-shadow: 0 0 8px rgba(80, 180, 100, 0.22);
  animation: portalStatusBreath 3.6s ease-in-out infinite;
}
.portal-status.mid {
  background: rgba(230, 169, 60, 0.1);
  color: var(--accent);
}
.portal-status.off {
  background: rgba(180, 80, 80, 0.1);
  border-color: rgba(180, 80, 80, 0.4);
  color: #e07a7a;
}
/* Чипы Пиксель/Хранитель/Сила — три РАВНЫЕ плитки в ряд (приказ 23.07 «выровнять») */
.portal-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}
.portal-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  font-size: 13px;
  font-family: "IBM Plex Mono", monospace;
  padding: 7px 4px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(230, 169, 60, 0.22);
  color: var(--text);
  min-height: 44px;
  justify-content: center;
}
.portal-chip b {
  color: var(--dim);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 0;
}
.portal-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.portal-bar-row {
  min-height: 36px;
}
.portal-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}
.portal-bar-k {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--dim);
  text-transform: uppercase;
}
.portal-bar-v {
  font-size: 11px;
  color: var(--accent);
}
.portal-bar {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.portal-bar i {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 4px;
  /* градиент осей (#8a6420→accent) + мягкое свечение — один стиль с ax2-bar */
  background: linear-gradient(90deg, #8a6420, var(--accent));
  box-shadow: 0 0 5px rgba(230, 169, 60, 0.28);
  overflow: hidden;
}
.portal-bar i::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  animation: barSheen 4.6s ease-in-out infinite;
}
.portal-meta {
  font-size: 10px;
  color: var(--dim);
  line-height: 1.4;
  margin-bottom: 8px;
  word-break: break-all;
}
.portal-flag {
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(230, 169, 60, 0.3);
  background: rgba(230, 169, 60, 0.08);
  color: var(--text);
}
.portal-weak {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.portal-weak-k {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.portal-weak-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  min-height: 36px; /* touch-цель ≥36px (бриф Grok) */
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.portal-weak-row:last-of-type {
  border-bottom: none;
}
.portal-weak-note {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.45;
  margin-top: 6px;
}
.portal-ethics {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 11.5px !important;
  line-height: 1.45;
}
[data-theme="light"] .portal-card {
  border-color: rgba(180, 120, 20, 0.25);
}
[data-theme="light"] .portal-bar {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .portal-chip {
  background: rgba(158, 106, 16, 0.04);
  border-color: var(--border);
}

/* === PORTAL-BACK SVG scheme (Grok) — vortex / cube / arcs === */
.portal-crystal { display: block; width: 100%; max-width: 344px; margin: 10px auto 4px; }
.pbg-ell {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
  stroke-linecap: round;
  /* медленное вращение эллипсов вокруг своего центра = дыхание вихря;
     transform-box: fill-box не конфликтует с inline rotate(spin) на группе */
  transform-box: fill-box;
  transform-origin: center;
  animation: pbgSwirl 36s linear infinite;
}
.pbg-vortex ellipse:nth-of-type(2) { animation-duration: 52s; animation-direction: reverse; }
.pbg-vortex ellipse:nth-of-type(3) { animation-duration: 70s; }
.pbg-ray { stroke: var(--muted); stroke-width: 1; opacity: 0.45; }
.pbg-ray.on { stroke: var(--accent); stroke-width: 1.6; opacity: 0.85; }
.pbg-cube-f { fill: rgba(230,169,60,0.1); stroke: var(--accent); stroke-width: 1.3; }
.pbg-cube-t { fill: rgba(230,169,60,0.2); stroke: var(--accent); stroke-width: 1.2; }
.pbg-cube-s { fill: rgba(0,0,0,0.34); stroke: var(--accent); stroke-width: 1.2; }
.pbg-cube { filter: drop-shadow(0 0 4px rgba(230, 169, 60, 0.25)); }
.pbg-cube-lab {
  fill: var(--muted);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-anchor: middle;
  font-family: "IBM Plex Mono", monospace;
}
.pbg-arc { fill: none; stroke: var(--accent); stroke-width: 2; }
.pbg-arc.mother { stroke: #7dcea0; }
.pbg-arc.father { stroke: #e6a93c; }
.pbg-force {
  fill: var(--accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-family: "IBM Plex Mono", monospace;
  text-anchor: middle;
  filter: drop-shadow(0 0 5px rgba(230, 169, 60, 0.45));
}
.pbg-point {
  fill: var(--accent);
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(230, 169, 60, 0.4));
}
.pbg-circle { stroke: var(--muted); stroke-width: 1.6; opacity: 0.85; }
.portal-hint { margin: 4px 0 0; text-align: center; }
.portal-calc-line { font-size: 12px; word-break: break-word; }
.portal-mini { flex: 1; max-width: 120px; height: 6px; margin: 0 8px; display: inline-block; vertical-align: middle; }
.portal-mini i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #8a6420, var(--accent));
  border-radius: 3px;
}
.portal-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.portal-field-col {
  padding: 8px 10px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.portal-field-t {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 4px;
}
/* Ряд внутри плитки поля: подпись — своя строка (длинные «Цели и связь с Небом»
   не давят бар), ниже бар во всю ширину + балл справа (приказ 23.07) */
.portal-fields .portal-weak-row {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 3px;
  min-height: 40px;
  font-size: 12.5px;
  padding: 5px 0;
}
.portal-fields .portal-weak-row > span:first-child {
  grid-column: 1 / -1;
  line-height: 1.3;
}
.portal-fields .portal-mini {
  margin: 0 8px 0 0;
  max-width: none;
  width: 100%;
  align-self: center;
}
.portal-fields .portal-weak-row > .mono { align-self: center; }
.portal-card .plife-hero-v.portal-status { font-size: 12px; letter-spacing: 0.04em; }
.plc-node.on .plc-node-outer { stroke: var(--accent); }
.plc-label.on { fill: var(--accent); }

/* --- Fable polish 23.07: движение и светлая тема (глобальный reduced-motion гасит всё) --- */
@keyframes pbgSwirl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes portalStatusBreath {
  0%, 100% { box-shadow: 0 0 6px rgba(80, 180, 100, 0.16); }
  50% { box-shadow: 0 0 12px rgba(80, 180, 100, 0.34); }
}
.portal-ethics {
  font-style: italic;
  color: var(--dim);
}
[data-theme="light"] .pbg-cube-s { fill: rgba(120, 80, 10, 0.2); }
[data-theme="light"] .pbg-cube-t { fill: rgba(189, 122, 23, 0.18); }
[data-theme="light"] .pbg-cube-f { fill: rgba(189, 122, 23, 0.09); }
[data-theme="light"] .portal-bar {
  background: rgba(0, 0, 0, 0.07);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
[data-theme="light"] .portal-field-col,
[data-theme="light"] .portal-weak {
  background: rgba(158, 106, 16, 0.04);
  border-color: var(--border);
}
[data-theme="light"] .portal-weak-row { border-bottom-color: var(--border); }

/* === Шлифовка 2.9.8 (колизиум): flip-auto скоуплен под .app.redesign ===
   Старый кап .app.redesign .flip-stage{height:398px} + внутренний скролл граней
   упразднены: сцена растёт под контент, скроллится страница. */
.app.redesign .flip-stage {
  height: auto;
  min-height: 360px;
}
.app.redesign .flip-face.f2 {
  overflow-y: visible;
}
.app.redesign .flip-stage.is-scroll::after {
  display: none;
}
/* Светлая тема: панель выбранного узла гексаграммы в светлом золоте */
[data-theme="light"] .plc-sel {
  box-shadow: 0 0 0 1.5px rgba(189, 122, 23, 0.5);
  background: rgba(189, 122, 23, 0.06);
}

/* ===== 3.0.2: ФИО узлов в «ДОСТУПЫ · ПОЛЬЗОВАТЕЛИ» — компактный аккуратный
   кегль, имя влазит целиком (перенос вместо обрезки многоточием) ===== */
.app.redesign .usr-name {
  font-size: 13px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}

/* ===== 3.0.7: явная галочка «Модератор» в форме выдачи доступа
   (вместо безликого кружка в шапке; вкл = узел добавится модератором) ===== */
.app.redesign .adm-mod-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 12px 0 4px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid rgba(230, 169, 60, 0.25);
  border-radius: 12px;
  color: var(--text);
}
.app.redesign .adm-mod-row.on {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(230, 169, 60, 0.35);
}
.app.redesign .adm-mod-box {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(230, 169, 60, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: #0b0b0d;
}
.app.redesign .adm-mod-row.on .adm-mod-box {
  background: var(--accent);
  border-color: var(--accent);
}
.app.redesign .adm-mod-lab {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-align: left;
}

/* ===== 3.0.8: «?» — золотой, жирный, в стилистике логотипа NEUROGENESIS ===== */
.app.redesign .help-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(230, 169, 60, 0.35);
}
[data-theme="light"] .app.redesign .help-btn {
  text-shadow: 0 0 14px rgba(168, 116, 19, 0.3);
}

/* ===== 3.0.9: легенда POINT/CIRCLE — плитки вместо голых кружков в SVG ===== */
.app.redesign .pbg-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 2px 2px;
}
.app.redesign .pbg-leg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(230, 169, 60, 0.22);
}
.app.redesign .pbg-leg-item.on {
  border-color: rgba(230, 169, 60, 0.6);
  background: rgba(230, 169, 60, 0.06);
  box-shadow: 0 0 10px rgba(230, 169, 60, 0.18);
}
.app.redesign .pbg-leg-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(230, 169, 60, 0.5);
}
.app.redesign .pbg-leg-ring {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.6px solid var(--muted);
}
.app.redesign .pbg-leg-k {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.app.redesign .pbg-leg-v {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}
[data-theme="light"] .app.redesign .pbg-leg-item {
  background: rgba(168, 116, 19, 0.05);
  border-color: rgba(168, 116, 19, 0.3);
}
[data-theme="light"] .app.redesign .pbg-leg-item.on {
  border-color: rgba(168, 116, 19, 0.6);
  box-shadow: 0 0 8px rgba(168, 116, 19, 0.15);
}

/* ===== 3.0.9: «Поля матери/отца» — прагматичная разбивка: лейбл + крупное
   число в строке, чистая тонкая полоса под ними (без золотой каши) ===== */
.app.redesign .portal-fields .portal-weak-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  row-gap: 5px;
}
.app.redesign .portal-fields .portal-weak-row > span:first-child {
  grid-area: 1 / 1;
  line-height: 1.25;
}
.app.redesign .portal-fields .portal-weak-row > .mono {
  grid-area: 1 / 2;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent);
  padding-left: 8px;
}
.app.redesign .portal-fields .portal-weak-row > .ax2-bar {
  grid-area: 2 / 1 / 3 / 3;
  height: 4px;
  margin-top: 0;
}
.app.redesign .portal-fields .ax2-bar i {
  background: var(--accent);
  border-radius: 99px;
}
[data-theme="light"] .app.redesign .portal-fields .ax2-bar {
  background: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .app.redesign .portal-fields .ax2-bar i {
  background: #a87413;
}
[data-theme="light"] .app.redesign .portal-field-col {
  background: rgba(168, 116, 19, 0.04);
  border-color: rgba(168, 116, 19, 0.35);
}

/* ===== 3.0.8: СВЕТЛАЯ ТЕМА — чёткая золотая окантовка у всех блоков
   (по образцу кольца аватара .tg2-ava, тоньше; приказ 24.07).
   Не трогаем: hairline-карточки (progress/mem-prompt/crystal-banner/flip),
   синюю .tg-card, семантические .mem-banner, .fav-banner, .lat-card,
   гейт клуба и сплеш. ===== */
[data-theme="light"] .card,
[data-theme="light"] .result-card,
[data-theme="light"] .matrix-card,
[data-theme="light"] .md-card,
[data-theme="light"] .mem-series,
[data-theme="light"] .mem-how,
[data-theme="light"] .pf2-card,
[data-theme="light"] .tg2-card,
[data-theme="light"] .dp-panel {
  border-color: rgba(168, 116, 19, 0.5);
  box-shadow: 0 0 0 2px rgba(168, 116, 19, 0.08), 0 0 10px rgba(168, 116, 19, 0.1);
}
/* Эти — только цвет рамки: у них свои тени/inset, не перекрываем */
[data-theme="light"] .focus-card,
[data-theme="light"] .axis-card,
[data-theme="light"] .crystal-panel,
[data-theme="light"] .mem-quiz,
[data-theme="light"] .mem-step3,
[data-theme="light"] .ser-open-card,
[data-theme="light"] .adm-card,
[data-theme="light"] .plife-card,
[data-theme="light"] .portal-card {
  border-color: rgba(168, 116, 19, 0.55);
}

/* ===== 3.1.0: активный язык в веере — золотая подсветка и в светлой теме
   (правило [data-theme="light"] .lang-orb перебивало .lang-orb.on по каскаду) ===== */
[data-theme="light"] .lang-orb.on {
  background: linear-gradient(135deg, #bd7a17, #a87413);
  color: #ffffff;
  border-color: #a87413;
  box-shadow: 0 0 10px rgba(168, 116, 19, 0.4);
}

/* ===== 3.1.0: СВЕТЛАЯ ТЕМА — окантовка плиток ЗАМЕТНАЯ, по образцу круглых
   кнопок шапки (тёмное тонкое кольцо + золотое 2px): «чёрно-жёлтая» окантовка,
   приказ 24.07. Тонкая версия 3.0.8 была еле видна. ===== */
[data-theme="light"] .card,
[data-theme="light"] .result-card,
[data-theme="light"] .matrix-card,
[data-theme="light"] .md-card,
[data-theme="light"] .mem-series,
[data-theme="light"] .mem-how,
[data-theme="light"] .pf2-card,
[data-theme="light"] .tg2-card,
[data-theme="light"] .dp-panel {
  border-color: rgba(20, 20, 28, 0.32);
  box-shadow: 0 0 0 2px rgba(158, 106, 16, 0.42), 0 2px 10px rgba(20, 20, 28, 0.06);
}
[data-theme="light"] .focus-card,
[data-theme="light"] .axis-card,
[data-theme="light"] .crystal-panel,
[data-theme="light"] .mem-quiz,
[data-theme="light"] .mem-step3,
[data-theme="light"] .ser-open-card,
[data-theme="light"] .adm-card,
[data-theme="light"] .plife-card,
[data-theme="light"] .portal-card,
[data-theme="light"] .portal-field-col,
[data-theme="light"] .pbg-leg-item {
  border-color: rgba(20, 20, 28, 0.32);
  box-shadow: 0 0 0 2px rgba(158, 106, 16, 0.42);
}
/* 3.1.9: у .focus-card слева фирменная золотая полоса (база: border-left 3px
   solid var(--accent)). Шорткат border-color выше затирал её нейтральным
   тёмным — возвращаем тёплое золото, тем же токеном, что и кольцо. */
[data-theme="light"] .focus-card {
  border-left-color: #9e6a10;
}
/* Волосяные карточки: рамка-градиент своя (border transparent — не трогаем),
   добавляем только золотое кольцо снаружи */
[data-theme="light"] .progress-card,
[data-theme="light"] .mem-prompt-card,
[data-theme="light"] .crystal-banner,
[data-theme="light"] .app.redesign .flip-front,
[data-theme="light"] .app.redesign .flip-back {
  box-shadow: 0 0 0 2px rgba(158, 106, 16, 0.42);
}

/* --- 3.1.3: форма голограммы (первоисточник: «Консультация Предназначение», Сизиф, стр.2) ---
   Мини-рисунок на главной вместо чипа ПИКСЕЛЬ + крупный с номерами на «Сегодня».
   Персонализация в разметке (скоры объектов/сердце/сид дня), тут только краски.
   Глобальный prefers-reduced-motion (3789) гасит пульс и подворот сам. */
.holo-fig { display: block; }
.holo-fig .hf-ring { fill: none; stroke: rgba(230, 169, 60, 0.5); stroke-width: 1.1; }
.holo-fig .hf-ray { stroke: rgba(230, 169, 60, 0.28); stroke-width: 1; }
.holo-fig .hf-edge { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.holo-fig .hf-hid { fill: none; stroke: rgba(230, 169, 60, 0.55); stroke-width: 1; stroke-dasharray: 2.6 2.4; }
.holo-fig .hf-heart {
  fill: var(--accent);
  opacity: 0.95;
  animation: hfPulse 3.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes hfPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.holo-fig .hf-node { fill: #17151a; stroke: var(--accent); stroke-width: 1.3; }
.holo-fig .hf-node.on { fill: var(--accent); }
.holo-fig .hf-num { font: 700 7px "IBM Plex Mono", monospace; fill: #d9d0bb; text-anchor: middle; }
.holo-fig .hf-num.on { fill: #17151a; }
.md-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.md-top-left {
  flex: 1;
  min-width: 0;
}
.md-holo {
  flex: none;
  align-self: flex-start;
  margin: -4px -8px 0 0;
}
.cd-row { display: flex; align-items: center; gap: 14px; }
.cd-row .cd-grid { flex: 1; margin: 0; }
.cd-holo { flex: none; }
/* компактнее плитка КОД ДНЯ (приказ 25.07: «можно немного поменьше») */
.cd-row .cd-cell { padding: 8px 12px; }
.cd-row .cd-cell-v { font-size: 17px; }
/* подворот-уголок: сигнал «плитку можно открыть» (md-card уже кнопка).
   Честный сгиб (приказ 25.07): чёрный язычок (::before) тянется до линии
   сгиба, золотое ухо (::after) ОБРЫВАЕТСЯ, не доходя до неё, — обе фигуры
   резаны clip-path по параллельным диагоналям, кромкам вылезать некуда.
   Дышат оба синхронно от угла — совмещение не ломается. */
.md-card {
  position: relative;
  overflow: hidden;
}
/* 3.2.0: НАСТОЯЩИЙ ЗАГНУТЫЙ УГОЛОК СТРАНИЦЫ (приказ 25.07 — «должна быть
   естественность, тень, образность завёрнутого краешка»).
   Два слоя, как у живой бумаги:
   ::before — МЯГКАЯ ТЕНЬ, которую отогнутый лист роняет на страницу под собой
              (размытая, уходит вверх-влево от линии сгиба);
   ::after  — сама ИЗНАНКА листа: скруглённая у сгиба, с градиентом объёма
              (светлый блик по сгибу → глубокая тень к внешнему краю).
   Дышит медленно и плавно — уголок то подгибается сильнее, то отпускается. */
/* ::before — тень, которую отогнутый лист роняет на страницу: мягкая полоса
   вдоль дуги сгиба, гуще у внешнего угла. Без clip-path — иначе она была бы
   срезана ровно там, где должна читаться. */
.md-card::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 78px;
  height: 78px;
  background: radial-gradient(
    circle at 116% 116%,
    rgba(0, 0, 0, 0.62) 34%,
    rgba(0, 0, 0, 0.3) 46%,
    rgba(0, 0, 0, 0.1) 56%,
    rgba(0, 0, 0, 0) 66%
  );
  filter: blur(4px);
  transform-origin: 100% 100%;
  animation: cornerFoldShadow 4.6s ease-in-out infinite;
  pointer-events: none;
}
/* ::after — сам загнутый лист. Линия сгиба у настоящей бумаги ДУГА, а не
   прямая, поэтому форма нарисована path'ом в SVG: кривая сгиба, градиент
   объёма поперёк неё (свет у сгиба → тень к внешнему углу) и собственная
   тень листа. Один data-URI, ноль запросов. */
.md-card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 52px;
  height: 52px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0.95' y1='0.05' x2='0.2' y2='0.8'%3E%3Cstop offset='0' stop-color='%23fffaf0'/%3E%3Cstop offset='0.12' stop-color='%23ffe7b0'/%3E%3Cstop offset='0.34' stop-color='%23edb63a'/%3E%3Cstop offset='0.58' stop-color='%23a97313'/%3E%3Cstop offset='0.8' stop-color='%235d3f0b'/%3E%3Cstop offset='1' stop-color='%23241804'/%3E%3C/linearGradient%3E%3ClinearGradient id='e' x1='1' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff' stop-opacity='0.85'/%3E%3Cstop offset='0.16' stop-color='%23ffffff' stop-opacity='0.12'/%3E%3Cstop offset='1' stop-color='%23ffffff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='s' x='-60%25' y='-60%25' width='240%25' height='240%25'%3E%3CfeDropShadow dx='-2.4' dy='-2.4' stdDeviation='2.4' flood-color='%23000' flood-opacity='0.72'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M52 1 Q 15 15 1 52 L 52 52 Z' fill='url(%23f)' filter='url(%23s)'/%3E%3Cpath d='M52 1 Q 15 15 1 52 L 52 52 Z' fill='url(%23e)'/%3E%3Cpath d='M52 1 Q 15 15 1 52' fill='none' stroke='%23fff4d8' stroke-opacity='0.55' stroke-width='0.9'/%3E%3C/svg%3E")
    no-repeat 100% 100% / 100% 100%;
  transform-origin: 100% 100%;
  animation: cornerFold 4.6s ease-in-out infinite;
  pointer-events: none;
}
/* лист отгибается сильнее и мягко возвращается — медленно, «по-бумажному» */
@keyframes cornerFold {
  0%,
  100% { transform: scale(0.82); }
  50%  { transform: scale(1); }
}
/* тень идёт за листом: чем больше отгиб, тем длиннее и мягче */
@keyframes cornerFoldShadow {
  0%,
  100% { transform: scale(0.7); opacity: 0.55; }
  50%  { transform: scale(0.95); opacity: 0.9; }
}
/* светлая тема */
[data-theme="light"] .holo-fig .hf-ring { stroke: rgba(158, 106, 16, 0.55); }
[data-theme="light"] .holo-fig .hf-ray { stroke: rgba(158, 106, 16, 0.3); }
[data-theme="light"] .holo-fig .hf-edge { stroke: #9e6a10; }
[data-theme="light"] .holo-fig .hf-hid { stroke: rgba(158, 106, 16, 0.6); }
[data-theme="light"] .holo-fig .hf-heart { fill: #b07a14; }
[data-theme="light"] .holo-fig .hf-node { fill: #fffdf7; stroke: #9e6a10; }
[data-theme="light"] .holo-fig .hf-node.on { fill: #c9920f; }
[data-theme="light"] .holo-fig .hf-num { fill: #5c5342; }
[data-theme="light"] .holo-fig .hf-num.on { fill: #fffdf7; }
/* светлая тема: тень мягче (бумага на светлом фоне), изнанка та же форма —
   меняются только краски градиента и плотность тени */
[data-theme="light"] .md-card::before {
  background: radial-gradient(
    circle at 116% 116%,
    rgba(58, 44, 12, 0.42) 34%,
    rgba(58, 44, 12, 0.2) 46%,
    rgba(58, 44, 12, 0.07) 56%,
    rgba(58, 44, 12, 0) 66%
  );
}
[data-theme="light"] .md-card::after {
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0.95' y1='0.05' x2='0.2' y2='0.8'%3E%3Cstop offset='0' stop-color='%23fffdf6'/%3E%3Cstop offset='0.12' stop-color='%23ffeec4'/%3E%3Cstop offset='0.34' stop-color='%23e2ab2c'/%3E%3Cstop offset='0.58' stop-color='%23a2700f'/%3E%3Cstop offset='0.8' stop-color='%23684709'/%3E%3Cstop offset='1' stop-color='%233a2706'/%3E%3C/linearGradient%3E%3ClinearGradient id='e' x1='1' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff' stop-opacity='0.9'/%3E%3Cstop offset='0.16' stop-color='%23ffffff' stop-opacity='0.14'/%3E%3Cstop offset='1' stop-color='%23ffffff' stop-opacity='0'/%3E%3C/linearGradient%3E%3Cfilter id='s' x='-60%25' y='-60%25' width='240%25' height='240%25'%3E%3CfeDropShadow dx='-2.2' dy='-2.2' stdDeviation='2.2' flood-color='%233a2706' flood-opacity='0.45'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M52 1 Q 15 15 1 52 L 52 52 Z' fill='url(%23f)' filter='url(%23s)'/%3E%3Cpath d='M52 1 Q 15 15 1 52 L 52 52 Z' fill='url(%23e)'/%3E%3Cpath d='M52 1 Q 15 15 1 52' fill='none' stroke='%23fffaea' stroke-opacity='0.7' stroke-width='0.9'/%3E%3C/svg%3E")
    no-repeat 100% 100% / 100% 100%;
}

/* --- 3.1.5: пульс активной цифры + тап-обозначения + перенос СТАДИИ (приказ 25.07) --- */
.holo-fig .hf-nodeg {
  transform-box: fill-box;
  transform-origin: center;
}
.holo-fig .hf-nodeg.on {
  animation: hfNodePulse 2.4s ease-in-out infinite;
}
@keyframes hfNodePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}
.holo-fig g[data-act="holo-node"] {
  cursor: pointer;
  pointer-events: auto;
}
.cd-note {
  margin: 10px 2px 2px;
  padding: 8px 12px;
  border: 1px solid rgba(230, 169, 60, 0.4);
  border-radius: 10px;
  background: rgba(230, 169, 60, 0.07);
  font: 600 12.5px "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  color: var(--accent);
}
[data-theme="light"] .cd-note {
  border-color: rgba(158, 106, 16, 0.5);
  background: rgba(201, 146, 15, 0.08);
  color: #9e6a10;
}
/* СТАДИЯ: значение с новой строки */
.cd-stage-k {
  display: block;
  margin-bottom: 3px;
}

/* --- 3.1.5: веер языков = плашка ~7 шариков со скроллом (приказ 25.07:
   «не километровая очередь») --- */
.app.redesign .lang-fan {
  max-height: 318px; /* 7 орбов x40 + 6 зазоров x3 + паддинги 7/12 */
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(230, 169, 60, 0.55) transparent;
}
.app.redesign .lang-fan::-webkit-scrollbar {
  width: 3px;
}
.app.redesign .lang-fan::-webkit-scrollbar-thumb {
  background: rgba(230, 169, 60, 0.55);
  border-radius: 3px;
}
.app.redesign .lang-fan::-webkit-scrollbar-track {
  background: transparent;
}
.app.redesign .lang-orb {
  scroll-snap-align: center;
  flex: none;
}
[data-theme="light"] .app.redesign .lang-fan {
  scrollbar-color: rgba(158, 106, 16, 0.6) transparent;
}
[data-theme="light"] .app.redesign .lang-fan::-webkit-scrollbar-thumb {
  background: rgba(158, 106, 16, 0.6);
}

/* === MD-RISK: «Зона внимания» под шапкой матрицы (приказ 25.07, скрин 05:58) ===
   Кикер-заголовок → ось С НОВОЙ СТРОКИ жирно + балл золотой пилюлей; блок на всю
   ширину под md-top — дыр нет при любой длине оси и локали. */
/* приказ 25.07 07:09: всё кверху, без пустых строк — центрирование отменено */
.md-top { align-items: flex-start; }
.md-risk { margin-top: 9px; text-align: left; }
.md-risk-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.md-risk-v {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.md-risk-score {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(230, 169, 60, 0.32);
  border-radius: 999px;
  padding: 2px 9px;
}
.md-risk-m {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.md-risk + .md-drill,
.md-risk + .md-drill.cols { margin-top: 10px; }

/* --- 3.1.6: подсказки кликабельности (приказ 25.07: «люди путаются, что нажимается») --- */
.help-wrap {
  position: relative;
  display: inline-block;
}
.help-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  min-width: 216px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-3);
}
.help-mi {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(230, 169, 60, 0.38);
  background: rgba(230, 169, 60, 0.07);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.help-mi:active {
  transform: scale(0.97);
}
.app.hints-on [data-act] {
  outline: 2px dashed rgba(230, 169, 60, 0.75);
  outline-offset: 2px;
  animation: hintsBlink 1.2s ease-in-out infinite;
}
@keyframes hintsBlink {
  0%, 100% { outline-color: rgba(230, 169, 60, 0.78); }
  50% { outline-color: rgba(230, 169, 60, 0.22); }
}
.hints-legend {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 86px;
  z-index: 70;
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(11, 11, 13, 0.93);
  border: 1px solid rgba(230, 169, 60, 0.55);
  color: #f2e9d4;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
.cd-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 2px 0;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}
.cd-hint-arr {
  display: inline-block;
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
  animation: hintArr 1.6s ease-in-out infinite;
}
@keyframes hintArr {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(3px, -3px); }
}
.fan-hint {
  position: absolute;
  top: calc(100% + 10px);
  right: 54px;
  z-index: 61;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(11, 11, 13, 0.93);
  border: 1px solid rgba(230, 169, 60, 0.55);
  color: #f2e9d4;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
[data-theme="light"] .hints-legend,
[data-theme="light"] .fan-hint {
  background: rgba(255, 253, 247, 0.96);
  border-color: rgba(158, 106, 16, 0.6);
  color: #4a3c1e;
}
[data-theme="light"] .app.hints-on [data-act] {
  outline-color: rgba(158, 106, 16, 0.8);
}

/* 3.1.7: курсивная приписка последнего шага тура (приказ 25.07) */
.tour-extra {
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--accent);
}
.tour-extra i {
  font-style: italic;
}

/* --- 3.1.8: разворот страницы (тап по карточке матрицы → лист растёт на
   весь экран и «перелистывается», приказ 25.07). Один DOM-узел, только
   transform/opacity — GPU, нагрузки нет. Стартовый transform ставит JS
   (FLIP из геометрии карточки), transition уводит его в полный экран. --- */
/* 3.1.9: лист разворачивается ИЗ ПРАВОГО НИЖНЕГО УГЛА — там, где язычок, —
   и строго ВНУТРИ окна: шапка NEUROGENESIS и нижнее меню не перекрываются
   (границы top/bottom ставит JS по фактической геометрии). Пергаментная
   подложка проявляется по мере разворота. */
.page-unfold {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 25; /* ниже топбара (30) и таббара (40) — они остаются сверху */
  background:
    radial-gradient(120% 80% at 88% 92%, rgba(244, 201, 107, 0.16), transparent 58%),
    radial-gradient(140% 90% at 10% 6%, rgba(154, 106, 18, 0.12), transparent 55%),
    var(--surface);
  border: 1px solid rgba(230, 169, 60, 0.4);
  border-radius: var(--radius-card);
  /* растёт от правого нижнего угла — за тот самый уголок */
  transform-origin: 100% 100%;
  will-change: transform, opacity, clip-path;
  overflow: hidden;
  transition:
    transform 0.58s cubic-bezier(0.2, 0.86, 0.3, 1),
    clip-path 0.58s cubic-bezier(0.2, 0.86, 0.3, 1),
    opacity 0.3s ease;
}
.page-unfold.fade {
  opacity: 0;
}
/* пергамент проявляется по мере разворота: волокна + тёплая подсветка сгиба */
.page-unfold.go {
  background:
    repeating-linear-gradient(
      118deg,
      rgba(230, 169, 60, 0.035) 0 2px,
      rgba(0, 0, 0, 0) 2px 7px
    ),
    radial-gradient(120% 80% at 88% 92%, rgba(244, 201, 107, 0.16), transparent 58%),
    radial-gradient(140% 90% at 10% 6%, rgba(154, 106, 18, 0.12), transparent 55%),
    var(--surface);
}
/* пробегающий по диагонали золотой блик — линия сгиба листа */
.page-unfold::before {
  content: "";
  position: absolute;
  inset: -45%;
  background: linear-gradient(
    315deg,
    transparent 32%,
    rgba(230, 169, 60, 0.2) 46%,
    rgba(244, 201, 107, 0.34) 50%,
    rgba(230, 169, 60, 0.2) 54%,
    transparent 68%
  );
  transform: translate(40%, 40%);
  transition: transform 0.62s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.page-unfold.go::before {
  transform: translate(-40%, -40%);
}
/* уголок-подворот распрямляется, когда лист развернулся */
.page-unfold::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44px;
  height: 44px;
  clip-path: polygon(100% 22%, 100% 100%, 22% 100%);
  background: linear-gradient(135deg, #f4c96b 22%, #e6a93c 55%, #9a6a12 100%);
  transform-origin: 100% 100%;
  transition:
    transform 0.5s ease,
    opacity 0.5s ease;
}
.page-unfold.go::after {
  transform: scale(0.08);
  opacity: 0;
}
[data-theme="light"] .page-unfold {
  border-color: rgba(169, 108, 14, 0.5);
}
[data-theme="light"] .page-unfold::after {
  background: linear-gradient(135deg, #f0c258 22%, #c9920f 55%, #7c5a10 100%);
}

/* ===== 3.2.3 · СТРАНИЦЫ КУРАТОРА: сравнения и живые спутники =====
   Профиль был длиннее 4200px — панель доступов и список узлов уехали на свои
   страницы, внизу остались четыре кнопки. Ни одного нового шрифта и ни одной
   тяжёлой тени: всё собрано из уже существующих карточек .pf2-card. */
.set-card .set-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.set-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(230, 169, 60, 0.05);
  color: var(--text);
  font: 600 14px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.set-nav:active { background: rgba(230, 169, 60, 0.12); }
.set-nav-t { flex: 1 1 auto; }
.set-nav-n {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(230, 169, 60, 0.16);
  color: var(--accent);
  font: 600 12px/1.5 "IBM Plex Mono", monospace;
  text-align: center;
}
.set-nav-go { flex: 0 0 auto; color: var(--accent); font-size: 18px; line-height: 1; }
.set-page .pg-title {
  font: 600 13px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- форма и результат --- */
.cmp-gender, .cmp-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-kinds { margin: 10px 0 2px; }
.cmp-g {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 12.5px/1 "IBM Plex Sans", system-ui, sans-serif;
  cursor: pointer;
}
.cmp-g.on { border-color: var(--accent); color: var(--accent); background: rgba(230, 169, 60, 0.12); }
.cmp-approx {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  margin: 10px 0 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 400 12.5px/1.3 "IBM Plex Sans", system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}
.cmp-approx.on { color: var(--text); }

.cmp-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "k v" "t t";
  gap: 2px 8px;
  margin-top: 9px;
}
.cmp-bar-k { grid-area: k; font-size: 12.5px; color: var(--muted); }
.cmp-bar-v { grid-area: v; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.cmp-bar-t {
  grid-area: t;
  height: 4px;
  border-radius: 3px;
  background: rgba(230, 169, 60, 0.13);
  overflow: hidden;
}
.cmp-bar-t i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(230, 169, 60, 0.55), var(--accent));
}

.cmp-role {
  margin-top: 6px;
  font: 700 20px/1.2 "Playfair Display", Georgia, serif;
  color: var(--accent);
}
.cmp-master {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(230, 169, 60, 0.16);
  font: 600 10.5px/1.6 "IBM Plex Mono", monospace;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.cmp-shadow { margin-top: 5px; font-size: 12px; color: var(--muted); }
.cmp-chip {
  display: inline-block;
  margin: 0 0 0 5px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px;
}
.cmp-split { display: flex; gap: 10px; margin-top: 12px; }
.cmp-col { flex: 1 1 0; min-width: 0; }
.cmp-col-k {
  font: 600 10.5px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.cmp-line { margin-top: 4px; font-size: 12.5px; overflow-wrap: anywhere; }
.cmp-line.dim { color: var(--muted); }
.cmp-line.owe { color: var(--accent); }
.cmp-balance {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.cmp-balance .mono { color: var(--text); font-weight: 600; }
.cmp-balance.plus .mono { color: #6fbf73; }
.cmp-balance.minus .mono { color: #d98b5f; }
.cmp-balance-h { margin-left: auto; font-size: 11.5px; }

.cmp-verdict {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(230, 169, 60, 0.06);
}
.cmp-verdict-t {
  flex: 1 1 auto;
  font: 700 13px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.06em;
}
.cmp-verdict-n { font: 700 19px/1 "IBM Plex Mono", monospace; color: var(--accent); }
.cmp-verdict.v-support { border-color: rgba(111, 191, 115, 0.5); }
.cmp-verdict.v-support .cmp-verdict-t { color: #6fbf73; }
.cmp-verdict.v-avoid { border-color: rgba(217, 139, 95, 0.5); }
.cmp-verdict.v-avoid .cmp-verdict-t { color: #d98b5f; }
.cmp-caveat {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font: italic 400 11.5px/1.45 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--muted);
}

.cmp-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cmp-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: 500 13px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}
.cmp-row-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-row-r { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }
.cmp-row-s { flex: 0 0 auto; font-weight: 600; color: var(--accent); }
.cmp-row-s.v-support { color: #6fbf73; }
.cmp-row-s.v-avoid { color: #d98b5f; }

[data-theme="light"] .set-nav { background: rgba(158, 106, 16, 0.06); }
[data-theme="light"] .cmp-bar-t { background: rgba(158, 106, 16, 0.16); }
[data-theme="light"] .cmp-verdict { background: rgba(158, 106, 16, 0.07); }
[data-theme="light"] .cmp-balance.plus .mono { color: #2f7a3a; }
[data-theme="light"] .cmp-balance.minus .mono { color: #a8541f; }
[data-theme="light"] .cmp-verdict.v-support .cmp-verdict-t { color: #2f7a3a; }
[data-theme="light"] .cmp-verdict.v-avoid .cmp-verdict-t { color: #a8541f; }
[data-theme="light"] .cmp-row-s.v-support { color: #2f7a3a; }
[data-theme="light"] .cmp-row-s.v-avoid { color: #a8541f; }

/* ===== 3.2.4 · РОЛЬ ВЫБИРАЕТ ЧЕЛОВЕК ===== */
.cmp-role-pick { margin-top: 12px; }
.cmp-role-grp { margin-top: 9px; }
.cmp-role-rank {
  font: 600 10px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.09em;
  color: var(--muted);
  opacity: 0.85;
}
.cmp-role-grp .cmp-kinds { margin: 5px 0 0; }
.cmp-role-pad { font-size: 12px; padding: 7px 11px; }
.cmp-role-wait {
  margin-top: 12px;
  font: italic 400 12px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--muted);
}
.cmp-suggest { opacity: 0.75; font-style: italic; }
.cmp-rank {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--muted);
}
.cmp-rank-v { color: var(--text); font-weight: 600; letter-spacing: 0.04em; }
.cmp-rank-l { margin-left: auto; font-size: 11.5px; }
.cmp-rank-l.l-up { color: #6fbf73; }
.cmp-rank-l.l-drain { color: #d98b5f; }
.cmp-flip {
  display: block;
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(217, 139, 95, 0.45);
  border-radius: 11px;
  background: rgba(217, 139, 95, 0.07);
}
.cmp-flip-t {
  display: block;
  font: 700 11.5px/1.3 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.07em;
  color: #d98b5f;
}
.cmp-flip-p { display: block; margin-top: 4px; font-size: 12.5px; }
.cmp-road {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cmp-road-k {
  font: 600 10.5px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.cmp-road-s { margin-top: 6px; font-size: 12.5px; overflow-wrap: anywhere; }
.cmp-road-s b { color: var(--accent); font-weight: 600; }
[data-theme="light"] .cmp-flip { background: rgba(168, 84, 31, 0.08); border-color: rgba(168, 84, 31, 0.4); }
[data-theme="light"] .cmp-flip-t { color: #a8541f; }
[data-theme="light"] .cmp-rank-l.l-up { color: #2f7a3a; }
[data-theme="light"] .cmp-rank-l.l-drain { color: #a8541f; }

/* ===== 3.2.5 · РОКИРОВКА ВЕДУЩЕГО + ЖЕСТЫ НА ЗАПИСЯХ ===== */
.cmp-role-line { display: flex; align-items: center; gap: 10px; }
.cmp-role-line .cmp-role { flex: 1 1 auto; min-width: 0; }
.cmp-swap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: rgba(230, 169, 60, 0.08);
  color: var(--accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cmp-swap:active { background: rgba(230, 169, 60, 0.2); }
/* мигает, пока человек её не трогал — это главная ручка экрана */
.cmp-swap.hint { animation: swapPulse 1.9s ease-in-out infinite; }
@keyframes swapPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 169, 60, 0); }
  50% { box-shadow: 0 0 0 4px rgba(230, 169, 60, 0.18); }
}
.cmp-lead { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* строки истории: закрепление, меню по зажатию, смах */
.cmp-row-wrap { position: relative; }
.cmp-row { transition: transform 0.18s ease; will-change: transform; }
.cmp-row.pinned { border-color: var(--border-strong); background: rgba(230, 169, 60, 0.06); }
.cmp-pin { flex: 0 0 auto; color: var(--accent); font-size: 11px; line-height: 1; }
.cmp-row-r.auto { opacity: 0.6; font-style: italic; }
.cmp-row-menu { display: flex; gap: 6px; margin: 6px 0 2px; }
.cmp-row-act {
  flex: 1 1 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(230, 169, 60, 0.07);
  color: var(--text);
  font: 600 12px/1 "IBM Plex Sans", system-ui, sans-serif;
  cursor: pointer;
}
.cmp-row-act.del { color: #d98b5f; border-color: rgba(217, 139, 95, 0.4); background: rgba(217, 139, 95, 0.07); }
.cmp-undo {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 500 12.5px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  cursor: pointer;
}
.cmp-undo-a { margin-left: auto; color: var(--accent); font-weight: 600; }
/* палец должен попадать: подушечки ролей не ниже 34px */
.cmp-role-pad { min-height: 34px; padding: 9px 13px; }
[data-theme="light"] .cmp-swap { background: rgba(158, 106, 16, 0.09); }
[data-theme="light"] .cmp-row.pinned { background: rgba(158, 106, 16, 0.07); }
[data-theme="light"] .cmp-row-act.del { color: #a8541f; border-color: rgba(168, 84, 31, 0.4); background: rgba(168, 84, 31, 0.07); }
@media (prefers-reduced-motion: reduce) {
  .cmp-swap.hint { animation: none; }
}

/* 3.2.6 · жесты: iOS не должен поднимать лупу и выделение поверх меню,
   вертикаль остаётся системе, горизонталь забирает JS (эталон — .flip-stage) */
.cmp-row-wrap .cmp-row {
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.cmp-row.dragging { transition: none; }
.cmp-row-wrap { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.cmp-row-wrap .cmp-row { flex: 1 1 auto; min-width: 0; }
.cmp-row-r {
  max-width: 26%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmp-row-more {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: 600 15px/1 "IBM Plex Sans", system-ui, sans-serif;
  cursor: pointer;
}
.cmp-row-menu { flex: 1 0 100%; }
/* предохранитель не должен быть тише обвинения */
.cmp-caveat { font-size: 12.5px; opacity: 0.95; }

/* 3.3.1 · азбука имени + аватар в списке узлов */
.usr-ava {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-right: 8px;
}
.usr-ava .usr-ava-img,
.usr-ava .tg2-ava {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 10px;
}
.usr-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nw-card { margin-top: 12px; }
.nw-card .pf2-kicker,
.plife-card .pf2-kicker {
  letter-spacing: 0.08em;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  text-transform: uppercase;
}
.nw-lead {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin: 8px 0 12px;
}
.nw-part { margin-top: 14px; }
.nw-part-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-size: 14.5px;
}
.nw-part-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap;
}
.nw-letters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  margin-top: 8px;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.nw-let {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  color: var(--accent);
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  min-width: 18px;
  min-height: 32px;
  padding: 4px 2px;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
  letter-spacing: 0;
  flex: 0 0 auto;
}
.nw-let.on {
  background: rgba(230, 169, 60, 0.16);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.nw-sep {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 0 2px;
  user-select: none;
  line-height: 1;
  opacity: 0.72;
  flex: 0 0 auto;
}
.nw-hint {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.nw-alpha {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 10px;
}
.nw-sec {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(230, 169, 60, 0.28);
}
.nw-sec-h {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}
.nw-wave {
  margin-top: 12px;
  padding: 10px 10px 10px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(230, 169, 60, 0.07), transparent 70%);
}
.nw-wave-k {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 4px;
}
.nw-wave-n {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: #f7f3e9;
  -webkit-text-stroke: 0.3px rgba(230, 169, 60, 0.45);
  text-shadow: 0 0 10px rgba(230, 169, 60, 0.16), 0 1px 0 rgba(0, 0, 0, 0.55);
  line-height: 1.15;
}
[data-theme="light"] .nw-wave-n {
  color: #2b2413;
  -webkit-text-stroke: 0.25px rgba(189, 122, 23, 0.5);
  text-shadow: 0 0 8px rgba(189, 122, 23, 0.12);
}
.nw-wave-p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  margin-top: 6px;
}
.nw-p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 8px;
}
.nw-p.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}
.nw-em { color: var(--muted); font-style: italic; margin-top: 10px; }
.nw-k { color: var(--muted); font-size: 11.5px; letter-spacing: 0.04em; }
.nw-skel { margin-top: 10px; }
.nw-skel-k {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 4px;
}
.nw-skel .nw-letters { margin-top: 2px; }
.nw-hear { margin-top: 14px; }
.nw-date-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}
.nw-date-head .nw-sec-h {
  margin-bottom: 0;
  width: 100%;
  text-align: center;
  font-size: 14.5px;
}
.nw-pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
  margin: 10px 0 4px;
}
.nw-pill {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 0;
  width: auto;
  max-width: 124px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 6px 14px;
  border: 1px solid rgba(230, 169, 60, 0.58);
  border-radius: 16px;
  background: #1c1914;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(230, 169, 60, 0.10);
  color: inherit;
  cursor: pointer;
  transform-origin: 50% 50%;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.nw-pill[data-slot="year"] {
  flex: 1.4 1 0;
  max-width: 152px;
}
.nw-pill[data-slot="year"] .nw-pill-calc {
  font-size: 10.5px;
  letter-spacing: -0.04em;
}
.nw-pills.landed .nw-pill {
  animation: nwPillBreath 2.8s ease-in-out infinite;
}
.nw-pills.landed .nw-pill.on {
  animation: none;
  transform: scale(1.05);
  z-index: 2;
  border-color: #f0c05a;
  background: #221e16;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 0 12px rgba(230, 169, 60, 0.26),
    0 0 28px rgba(230, 169, 60, 0.10),
    inset 0 0 0 1px rgba(240, 192, 90, 0.35);
}
@keyframes nwPillBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}
.nw-pill-calc {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  margin: 0 0 12px;
  width: 100%;
  opacity: 0.95;
}
.nw-flap {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  perspective: 240px;
  flex: 0 0 auto;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.nw-flap.wide { width: 56px; }
.nw-flap-top,
.nw-flap-bot {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1.6px solid #e6a93c;
}
.nw-flap-top {
  clip-path: inset(0 0 50% 0);
  border-radius: 6px 6px 0 0;
  transform-origin: 50% 50%;
  background: linear-gradient(180deg, #2c261c 0%, #1a1712 100%);
}
.nw-flap-bot {
  clip-path: inset(50% 0 0 0);
  border-radius: 0 0 6px 6px;
  transform-origin: 50% 50%;
  background: linear-gradient(180deg, #14110d 0%, #0c0b09 100%);
}
.nw-flap-mid {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  background: #e6a93c;
  z-index: 2;
  pointer-events: none;
  opacity: 0.95;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}
.nw-flap-top i,
.nw-flap-bot i {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: 100%;
  padding: 0;
  box-sizing: border-box;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  font-style: normal;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  color: #e6a93c;
  -webkit-text-stroke: 0;
  text-shadow: none;
  filter: none;
}
.nw-flap.wide i { font-size: 22px; }
.nw-flap.tick .nw-flap-top {
  animation: nwFlapTop 0.12s ease-in;
}
.nw-flap.tick .nw-flap-bot {
  animation: nwFlapBot 0.12s ease-out;
}
.nw-flap.land .nw-flap-top,
.nw-flap.land .nw-flap-bot {
  animation: none;
  transform: none;
}
@keyframes nwFlapTop {
  0% { transform: rotateX(0); }
  100% { transform: rotateX(-80deg); }
}
@keyframes nwFlapBot {
  0% { transform: rotateX(80deg); }
  100% { transform: rotateX(0); }
}
.nw-pill-k {
  margin-top: auto;
  padding-top: 0;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.92;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nw-date-gloss {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
}
.nw-date-gloss p { margin: 0 0 10px; }
.nw-date-gloss p:last-child { margin-bottom: 0; }
.nw-date-gloss b {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
@media (max-width: 400px) {
  .nw-pill { padding: 10px 4px 12px; }
  .nw-flap { width: 44px; height: 44px; margin-bottom: 12px; }
  .nw-flap.wide { width: 52px; }
  .nw-flap-top i,
  .nw-flap-bot i { font-size: 28px; }
  .nw-flap.wide i { font-size: 18px; }
  .nw-pill-calc { font-size: 11px; margin-bottom: 10px; }
  .nw-pill[data-slot="year"] .nw-pill-calc { font-size: 9.5px; }
}
@media (max-width: 340px) {
  .nw-flap { width: 40px; height: 40px; }
  .nw-flap-top i,
  .nw-flap-bot i { font-size: 24px; }
  .nw-pill-calc { font-size: 10px; }
  .nw-pill[data-slot="year"] .nw-pill-calc { font-size: 8.5px; }
  .nw-pill-k { font-size: 9.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .nw-flap.tick .nw-flap-top,
  .nw-flap.tick .nw-flap-bot { animation: none; }
  .nw-pills.landed .nw-pill { animation: none; }
}
[data-theme="light"] .nw-pill {
  background: #f7f1e4;
  border-color: rgba(189, 122, 23, 0.5);
  box-shadow: 0 3px 10px rgba(40, 30, 10, 0.12), inset 0 1px 0 rgba(255, 248, 230, 0.7);
}
[data-theme="light"] .nw-pills.landed .nw-pill.on {
  background: #fbf6ea;
  box-shadow:
    0 3px 10px rgba(40, 30, 10, 0.12),
    0 0 10px rgba(189, 122, 23, 0.22),
    0 0 22px rgba(189, 122, 23, 0.08);
}
[data-theme="light"] .nw-flap-top i,
[data-theme="light"] .nw-flap-bot i {
  color: #bd7a17;
  -webkit-text-stroke: 0.35px #a86a12;
}
[data-theme="light"] .nw-flap-top {
  background: linear-gradient(180deg, #f6ead0, #e8d7b0);
}
[data-theme="light"] .nw-flap-bot {
  background: linear-gradient(180deg, #e2d0a6, #d4c091);
}
.nw-ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.nw-ul li { margin: 0 0 4px; }
.nw-date-row {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  line-height: 1.55;
  margin: 0 0 4px;
}
.nw-out-line {
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 600;
  color: #f7f3e9;
  margin: 0 0 8px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  overflow-wrap: anywhere;
}
[data-theme="light"] .nw-out-line { color: #2b2413; }
.nw-reveal {
  margin-top: 8px;
  min-height: 28px;
}
.nw-script-lead {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 7px;
}
.nw-scripts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nw-script {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 8px 5px;
  border-radius: 9px;
  border: 1px solid rgba(230, 169, 60, 0.28);
  background: rgba(230, 169, 60, 0.06);
}
.nw-script b {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}
.nw-script i {
  font-style: normal;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 16px;
  color: #f7f3e9;
}
[data-theme="light"] .nw-script i { color: #2b2413; }
.guest-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(230, 169, 60, 0.45);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(230, 169, 60, 0.14), transparent 60%),
    var(--surface2);
}
.guest-banner-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.guest-banner-t {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
}
.guest-ro {
  pointer-events: none;
  opacity: 0.95;
}
.nw-reveal-lets { margin-top: 0; }
.nw-reveal-m {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 1.6em;
  gap: 4px 6px;
  align-items: baseline;
  margin-top: 6px;
}
.nw-ch {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.15;
  color: var(--accent);
  text-align: center;
}
.nw-dash { color: var(--muted); font-size: 13px; }
.nw-gloss {
  font-size: 13.5px;
  line-height: 1.35;
  min-width: 0;
  color: var(--text);
}
.nw-d {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}
.nw-let.nw-glyph {
  cursor: default;
  min-height: 28px;
}
[data-theme="light"] .nw-ch,
[data-theme="light"] .nw-part-h,
[data-theme="light"] .nw-let { color: #bd7a17; }
[data-theme="light"] .nw-let.on { background: rgba(189, 122, 23, 0.14); }
