/* ===========================================================================
   ElevenHouse — рабочий кабинет астролога
   Палитра «Космос / мистика». Тёмный космический SaaS, плотность рабочей CRM.
   =========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* --- Палитра из брифа --- */
  --night:        #0B0B1F;  /* фон / ночь */
  --violet-deep:  #2A1B4E;  /* тёмный фиолет */
  --amethyst:     #8B5CF6;  /* аметист */
  --gold:         #F4C430;  /* золото */
  --moon:         #D8D4EC;  /* лунный */

  /* --- Производные поверхности (слои тёмного космоса) --- */
  --bg-0:  #07060F;            /* самый глубокий — за всем */
  --bg-1:  #0B0B1F;            /* база приложения */
  --surface-1: #110F26;        /* сайдбар, борта */
  --surface-2: #16142F;        /* карточки */
  --surface-3: #1E1B3E;        /* приподнятые / hover */
  --surface-4: #272252;        /* активные / выделенные */

  --line:        rgba(216, 212, 236, 0.08);
  --line-strong: rgba(216, 212, 236, 0.14);
  --line-amethyst: rgba(139, 92, 246, 0.32);

  /* --- Текст --- */
  --text-1: #ECEAF7;   /* основной */
  --text-2: #A7A2C8;   /* вторичный */
  --text-3: #6F6A93;   /* приглушённый / подписи */
  --text-on-accent: #0B0B1F;

  /* --- Акцент (управляется Tweaks: аметист / золото) --- */
  --accent: var(--amethyst);
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-line: rgba(139, 92, 246, 0.40);
  --accent-text: #B79CFB;
  --accent-glow: rgba(139, 92, 246, 0.45);

  /* семантические */
  --pos: #4EC8A0;
  --pos-soft: rgba(78, 200, 160, 0.14);
  --warn: #F4C430;
  --warn-soft: rgba(244, 196, 48, 0.14);
  --info: #6FA8FF;

  /* радиусы / тени (крутятся в Tweaks) */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 40px -24px rgba(0,0,0,0.8);
  --glow: 1;  /* множитель свечений, Tweaks */

  --font: 'Onest', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --sidebar-w: 248px;
  --topbar-h: 68px;
  --subheader-h: 60px;      /* высота под-шапки модуля */
  --panel-w: 340px;         /* правые панели деталей/инспектора */
  --panel-bg: rgba(13, 12, 32, 0.6);
}

/* Акцент = золото */
[data-accent="gold"] {
  --accent: var(--gold);
  --accent-soft: rgba(244, 196, 48, 0.14);
  --accent-line: rgba(244, 196, 48, 0.42);
  --accent-text: #F6D266;
  --accent-glow: rgba(244, 196, 48, 0.40);
  --text-on-accent: #2A1B0B;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

::selection { background: var(--accent-soft); color: var(--text-1); }

/* Космический фон с туманностями.
   absolute (не fixed): визуально идентично — обёртка имеет height:100% и не скроллится,
   скролл живёт во внутренних контейнерах. Так фон корректно остаётся ПОД контентом. */
.cosmos-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  background: var(--bg-1);
}
.cosmos-bg::before {
  content: ''; position: absolute; inset: -20%;
  background:
    radial-gradient(46% 40% at 18% 8%, rgba(139,92,246,calc(0.20 * var(--glow))), transparent 60%),
    radial-gradient(40% 38% at 92% 92%, rgba(42,27,78,calc(0.85 * var(--glow))), transparent 65%),
    radial-gradient(30% 30% at 80% 12%, rgba(244,196,48,calc(0.06 * var(--glow))), transparent 60%);
  filter: blur(8px);
}
.cosmos-bg .stars { position: absolute; inset: 0; opacity: calc(0.6 * var(--glow)); }

/* Скроллбары */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-4); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- утилиты ---- */
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: -0.01em; }
.tnum { font-variant-numeric: tabular-nums; }

.card {
  background: linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--surface-2) 92%, black));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.btn {
  font-family: var(--font); font-size: 14px; font-weight: 600;
  border-radius: var(--r-md); border: 1px solid transparent;
  padding: 10px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent); color: var(--text-on-accent);
  box-shadow: 0 0 0 1px var(--accent-line), 0 10px 26px -10px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 0 0 1px var(--accent-line), 0 14px 30px -8px var(--accent-glow); }
.btn-ghost { background: var(--surface-3); color: var(--text-1); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-4); }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { color: var(--text-1); background: var(--surface-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line-strong); color: var(--text-2); background: var(--surface-2);
  cursor: pointer; transition: all .14s ease; white-space: nowrap;
}
.chip:hover { border-color: var(--accent-line); color: var(--text-1); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

.kicker {
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3);
}

.input {
  width: 100%; font-family: var(--font); font-size: 15px; color: var(--text-1);
  background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 12px 14px; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: none; line-height: 1.55; }
select.input { padding-top: 0; padding-bottom: 0; line-height: 1.2; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A7A2C8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; display: block; }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

/* placeholder для изображений (полоски + моно подпись) */
.ph {
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(135deg, rgba(216,212,236,0.05) 0 2px, transparent 2px 9px);
  border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
}

/* плавные появления */
/* Входные «анимации» отключены намеренно: окружение предпросмотра замораживает
   CSS-анимации на кадре 0, а захват экрана пропускает поддеревья с активной
   keyframe-анимацией. Контент должен быть виден всегда и без анимации.
   Движение в прототипе несут наведения/раскрытия/переходы. */
@keyframes rise { from { transform: translateY(12px); } to { transform: none; } }
@keyframes fade { from { transform: translateY(-3px); } to { transform: none; } }
.rise { }
.fade { }

@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes twinkle { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes pulse-glow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast-in { animation: toast-in .28s cubic-bezier(.2,.7,.2,1) both; }
.cal-slot:hover { background: rgba(139,92,246,0.10) !important; box-shadow: inset 0 0 0 1px var(--accent-line); }

/* Анимированный декор солнце/луна */
@keyframes dn-spin { to { transform: rotate(360deg); } }
@keyframes dn-spin-rev { to { transform: rotate(-360deg); } }
@keyframes dn-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes dn-aura { 0%,100% { opacity: .12; transform: scale(1); } 50% { opacity: .30; transform: scale(1.05); } }
@keyframes dn-tw { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes dn-ray { 0%,100% { transform: scaleY(0.7); } 50% { transform: scaleY(1.15); } }
.dn-spin     { animation: dn-spin 70s linear infinite; }
.dn-spin-rev { animation: dn-spin-rev 50s linear infinite; }
.dn-bob      { animation: dn-bob 5s ease-in-out infinite; }
.dn-aura     { animation: dn-aura 6s ease-in-out infinite; transform-origin: 100px 100px; }
.dn-tw       { animation: dn-tw 2.6s ease-in-out infinite; }
.dn-tw2      { animation: dn-tw 3.4s ease-in-out -1.2s infinite; }
.dn-ray-pulse { animation: dn-ray 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.dn-orbit     { animation: dn-spin 26s linear infinite; }
.dn-orbit-rev { animation: dn-spin-rev 34s linear infinite; }
.dn-ring      { animation: dn-spin 90s linear infinite; }

/* ===== Адаптивная сетка дашборда ===== */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  align-content: start;
  padding: 24px 28px 60px;
}
.d-banner   { grid-column: span 12; }
.d-stat     { grid-column: span 3; }
.d-kpis     { grid-column: span 12; }
.kpi-grid   { display: grid; grid-template-columns: repeat(4, 1fr); }
.kpi-cell {
  position: relative; text-align: left; min-width: 0;
  background: transparent; border: none; border-left: 1px solid var(--line);
  padding: 18px 20px 17px; cursor: pointer;
  color: var(--text-1); font-family: var(--font);
  transition: background .15s ease;
}
.kpi-cell:first-child { border-left: none; }
.kpi-cell:hover { background: var(--surface-3); }
.kpi-cell .kpi-go { opacity: 0; transition: opacity .15s ease; }
.kpi-cell:hover .kpi-go { opacity: 1; }
.kpi-spark { position: absolute; right: 16px; bottom: 12px; opacity: 0.55; pointer-events: none; }
.d-sessions { grid-column: span 7; }
.d-astro    { grid-column: span 5; }
.d-third    { grid-column: span 4; }
.d-attn     { grid-column: span 12; }
.d-briefs   { grid-column: span 5; }
.d-feed     { grid-column: span 7; }

/* планшет */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .d-banner, .d-sessions, .d-astro, .d-third, .d-kpis, .d-attn, .d-briefs, .d-feed { grid-column: 1 / -1; }
  .d-stat { grid-column: span 1; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-cell:nth-child(3) { border-left: none; }
  .kpi-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}
/* мобайл */
@media (max-width: 640px) {
  .dash-grid { grid-template-columns: 1fr; gap: 14px; padding: 16px 14px 48px; }
  .d-stat, .d-banner, .d-sessions, .d-astro, .d-third, .d-kpis, .d-attn, .d-briefs, .d-feed { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-cell { border-left: none !important; border-top: 1px solid var(--line); }
  .kpi-cell:first-child { border-top: none; }
}

/* ===== Адаптивные сетки аналитики ===== */
.ana-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
/* KPI-полоса аналитики: 2 ряда по 4, разделители-линии */
.kpi-grid-8 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-8 .kpi-cell { padding: 16px 18px 15px; }
.kpi-grid-8 .kpi-cell:nth-child(4n+1) { border-left: none; }
.kpi-grid-8 .kpi-cell:nth-child(n+5) { border-top: 1px solid var(--line); }
.kpi-cell.static { cursor: default; }
.kpi-cell.static:hover { background: transparent; }
.ana-2col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.ana-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.ana-3col:last-child { margin-bottom: 0; }
@media (max-width: 1080px) {
  .ana-kpi { grid-template-columns: repeat(2, 1fr); }
  .ana-2col, .ana-3col { grid-template-columns: 1fr; }
  .kpi-grid-8 { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid-8 .kpi-cell:nth-child(odd) { border-left: none; }
  .kpi-grid-8 .kpi-cell:nth-child(even) { border-left: 1px solid var(--line); }
  .kpi-grid-8 .kpi-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .ana-kpi { grid-template-columns: 1fr 1fr; gap: 10px; }
  .src-grid { grid-template-columns: 1fr !important; }
}

/* ===== Адаптив календаря ===== */
@media (max-width: 900px) {
  .cal-body { flex-direction: column; }
  .cal-aside { width: auto !important; height: auto !important; max-height: 48vh; border-left: none !important; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .cal-subhead { overflow-x: auto; gap: 10px !important; padding: 0 14px !important; }
  .cal-subhead > * { flex-shrink: 0; }
}

/* ===== Адаптив отзывов ===== */
.rev-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .rev-grid { grid-template-columns: 1fr; } }

/* ===== Адаптив финансов ===== */
.fin-balances { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.fin-2col { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1080px) {
  .fin-balances { grid-template-columns: repeat(2, 1fr); }
  .fin-2col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .fin-balances { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ===== Адаптив движка карт ===== */
@media (max-width: 900px) {
  .eng-body { flex-direction: column; }
  .eng-wheel { flex: none !important; min-height: 60vh; }
  .eng-panel { width: auto !important; border-left: none !important; border-top: 1px solid var(--line); max-height: 52vh; }
}

/* ===== Адаптив инбокса ===== */
@media (max-width: 1180px) {
  .inbox-ctx { display: none !important; }
}
@media (max-width: 860px) {
  .inbox-body { flex-direction: column; }
  .inbox-list { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); max-height: 34vh; }
}

/* ===== Адаптив CRM ===== */
@media (max-width: 780px) {
  .crm-body { flex-direction: column; }
  .crm-list { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .crm-card-head { flex-wrap: wrap; }
  .crm-stats { width: 100%; justify-content: space-between; gap: 14px !important; padding-top: 4px; }
}

/* ===== Конструктор продукта ===== */
.pc-overlay { position: absolute; inset: 0; z-index: 45; background: rgba(7,6,15,0.7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px; }
.pc-shell { width: min(1080px, 100%); max-height: 92%; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.pc-crumb { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; margin-bottom: 5px; white-space: nowrap; }
.pc-title { font-size: 20px; font-weight: 700; color: var(--text-1); }
.pc-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 0; flex: 1; min-height: 0; overflow: hidden; }
.pc-col { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px 28px; overflow-y: auto; }
.pc-col:first-child { border-right: 1px solid var(--line); }
.pc-block { display: flex; flex-direction: column; }
.pc-lbl { font-size: 11px; letter-spacing: 0.12em; color: var(--text-3); text-transform: uppercase; margin-bottom: 9px; font-weight: 600; }
.pc-hint { font-size: 12px; color: var(--text-3); margin: -4px 0 10px; }
.pc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-cube { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 12px; border-radius: 10px; cursor: pointer; font-family: var(--font); transition: all .14s;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text-2); }
.pc-cube:hover { border-color: var(--accent-line); color: var(--text-1); }
.pc-cube.on { background: var(--accent-soft); border-color: var(--gold); color: var(--gold); }
.pc-cube-suffix { font-size: 11.5px; opacity: 0.85; }
.pc-inc { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; }
.pc-tag { font-size: 10.5px; color: var(--text-3); background: var(--surface-1); border: 1px solid var(--line-strong); padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.pc-iconbtn { background: transparent; border: none; color: var(--text-3); cursor: pointer; display: flex; padding: 2px; border-radius: 6px; transition: color .12s; }
.pc-iconbtn:hover { color: var(--text-1); }
.pc-add { display: flex; align-items: center; gap: 9px; background: var(--surface-1); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 12px; }
.pc-add-input { flex: 1; background: transparent; border: none; outline: none; font-family: var(--font); font-size: 13px; color: var(--text-1); }
.pc-add-input::placeholder { color: var(--text-3); }
.pc-preview { background: var(--surface-1); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.pc-cabinet { background: var(--surface-1); border: 1px solid var(--line); border-radius: 14px; padding: 15px; }
.pc-step { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-1); cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; font-family: var(--font); }
.pc-step:hover { border-color: var(--accent-line); }
.pc-mini-lbl { font-size: 11px; color: var(--text-3); margin-bottom: 7px; }
.pc-note { font-size: 12px; color: var(--text-2); margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.pc-mod { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 7px 9px; transition: opacity .14s; }
.pc-mod.off { opacity: 0.5; }
.pc-check { width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface-1); color: var(--text-on-accent); cursor: pointer; display: grid; place-items: center; }
.pc-mod:not(.off) .pc-check { background: var(--accent); border-color: var(--accent); }
.pc-mod-name { flex: 1; min-width: 0; background: transparent; border: none; outline: none; font-family: var(--font); font-size: 13px; color: var(--text-1); padding: 4px 2px; border-bottom: 1px solid transparent; }
.pc-mod-name:focus { border-bottom-color: var(--accent-line); }
.pc-mod-price { width: 64px; flex-shrink: 0; background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: 7px; outline: none; font-size: 12.5px; color: var(--text-1); padding: 5px 7px; text-align: right; }
.pc-mod-price:focus { border-color: var(--accent-line); }
.pc-kind { display: flex; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.pc-kind-btn { border: none; background: var(--surface-1); color: var(--text-3); cursor: pointer; font-size: 11px; padding: 5px 7px; font-family: var(--font); border-right: 1px solid var(--line-strong); }
.pc-kind-btn:last-child { border-right: none; }
.pc-kind-btn.on { background: var(--accent); color: var(--text-on-accent); }
.pc-nudge { background: transparent; border: none; color: var(--text-3); cursor: pointer; padding: 0; height: 11px; display: flex; }
.pc-nudge:hover { color: var(--text-1); }
.pc-upsell { font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px; }
.pc-iconbtn.on { color: var(--accent-text); }
.pc-inc.off { opacity: 0.7; }
.pc-icbtn { background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: 7px; padding: 4px; cursor: pointer; display: flex; flex-shrink: 0; }
.pc-icbtn:hover { border-color: var(--accent-line); }
.pc-iconpop { position: absolute; right: 8px; top: calc(100% + 4px); z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0,0,0,0.7); width: 210px; }
.pc-icpick { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: var(--surface-1); color: var(--text-2); cursor: pointer; }
.pc-icpick:hover { border-color: var(--accent-line); color: var(--text-1); }
.pc-icpick.on { background: var(--accent); color: var(--text-on-accent); }

/* ===== AI-узлы воронок ===== */
.ai-task { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line-strong); cursor: pointer; font-family: var(--font); text-align: left; transition: all .13s; }
.ai-task:hover { border-color: var(--accent-line); }
.ai-model { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-strong); cursor: pointer; font-family: var(--font); text-align: left; transition: all .13s; }
.ai-model:hover { border-color: var(--accent-line); }
.ai-var { font-family: var(--mono, monospace); font-size: 11px; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 7px; padding: 4px 8px; cursor: pointer; transition: all .12s; }
.ai-var:hover { background: var(--accent); color: var(--text-on-accent); }
.ai-guard { display: flex; align-items: center; gap: 10px; padding: 8px 4px; background: transparent; border: none; cursor: pointer; font-family: var(--font); text-align: left; width: 100%; }
.ai-out { background: var(--surface-1); border: 1px solid var(--line-strong); border-radius: 12px; padding: 13px 14px; }
.ai-dots { display: inline-flex; gap: 3px; }
.ai-dots i { width: 5px; height: 5px; border-radius: 999px; background: var(--accent-text); animation: aiBlink 1s infinite; }
.ai-dots i:nth-child(2) { animation-delay: .2s; } .ai-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes aiBlink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.eng-shimmer { background: linear-gradient(100deg, var(--surface-1) 30%, var(--surface-3) 50%, var(--surface-1) 70%); background-size: 200% 100%; animation: engShim 1.2s infinite; }
.l-navlink { font-size: 13.5px; color: var(--text-2); cursor: pointer; padding: 6px 4px; transition: color .14s; }
.l-navlink:hover { color: var(--text-1); }
@media (max-width: 760px) { .reg-wrap { grid-template-columns: 1fr !important; } .reg-side { display: none !important; } .l-navlink { display: none; } }
.l-feat { transition: transform .2s, border-color .2s; }
.l-feat:hover { transform: translateY(-3px); border-color: var(--accent-line); }
@keyframes lbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@media (max-width: 820px) { .l-show-grid { grid-template-columns: 1fr !important; } }
.l-bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.l-bento-card { display: flex; flex-direction: column; }
@media (max-width: 860px) { .l-bento { grid-template-columns: repeat(2, 1fr); } .l-bento-card { grid-column: span 1 !important; } }
@media (max-width: 560px) { .l-bento { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .l-feat-panel { grid-template-columns: 1fr !important; } .l-feat-panel > div:last-child { min-height: 160px; } }
/* Космический путь «Как начать» */
.l-orbit { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.l-orbit-path { position: absolute; top: -10px; left: 0; width: 100%; height: 120px; pointer-events: none; }
.l-orbit-step { position: relative; display: flex; flex-direction: column; align-items: center; z-index: 1; }
.l-planet { position: relative; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; animation: cosFloat 7s ease-in-out infinite alternate; }
.l-orbit-step:nth-child(3) .l-planet { animation-delay: -2s; } .l-orbit-step:nth-child(4) .l-planet { animation-delay: -4s; } .l-orbit-step:nth-child(5) .l-planet { animation-delay: -1s; }
.l-planet-ring { position: absolute; inset: -20% -12%; border-radius: 50%; border: 1.5px solid; transform: rotate(-20deg); }
.l-planet-glyph { position: absolute; top: -10px; right: -6px; font-size: 20px; text-shadow: 0 0 10px currentColor; }
.l-step-num { position: absolute; bottom: -6px; left: -8px; font-size: 14px; font-weight: 800; background: rgba(12,8,34,0.85); border-radius: 8px; padding: 1px 6px; }
@media (max-width: 760px) { .l-orbit { grid-template-columns: 1fr 1fr; } .l-orbit-path { display: none; } .l-orbit-step { margin-top: 0 !important; } }
@media (max-width: 460px) { .l-orbit { grid-template-columns: 1fr; } }
.l-price-card { transition: transform .2s, box-shadow .2s, border-color .2s; }
@media (max-width: 820px) { .l-price-grid { grid-template-columns: 1fr !important; max-width: 420px !important; } }
.l-foot-link { display: block; font-size: 13.5px; color: rgba(236,232,247,0.6); cursor: pointer; text-decoration: none; padding: 5px 0; transition: color .14s; }
.l-foot-link:hover { color: var(--gold); }
@media (max-width: 720px) { .l-footer-grid { grid-template-columns: 1fr 1fr !important; } }
/* ===== Мобильная адаптация лендинга ===== */
@media (max-width: 680px) {
  .cos-navlink { display: none; }
  .cos-title { font-size: 44px !important; }
  .cos-h2 { font-size: 30px !important; }
  .l-show-grid { grid-template-columns: 1fr !important; }
  .l-feat-panel { grid-template-columns: 1fr !important; }
  .l-nav-cta { font-size: 12px !important; padding: 8px 13px !important; }
}
@media (max-width: 440px) {
  .cos-title { font-size: 36px !important; }
  .l-hero-stats { gap: 22px !important; }
}
/* ===== Дрим-космос стилистика лендинга/входа ===== */
@keyframes cosFloat { 0% { transform: translateY(-10px) translateX(-4px); } 100% { transform: translateY(14px) translateX(6px); } }
@keyframes cosBlob { 0% { transform: translate(-4%, -3%) scale(1); } 100% { transform: translate(6%, 5%) scale(1.15); } }
.cos-title { font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; background: linear-gradient(108deg, #F4C430 0%, #F47A7A 28%, #E59CC4 50%, #B79CFB 70%, #6FA8FF 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 4px 22px rgba(229,156,196,0.35)); }
.cos-pill { background: linear-gradient(100deg, #F4C430, #F47A7A 40%, #E59CC4 70%, #B79CFB); color: #1a1230; border: none; border-radius: 999px; font-weight: 700; white-space: nowrap; box-shadow: 0 10px 36px -8px rgba(244,122,122,0.5); transition: transform .16s, box-shadow .16s; }
.cos-pill:hover { transform: translateY(-2px); box-shadow: 0 16px 44px -8px rgba(244,122,122,0.6); }
.cos-bg { background: radial-gradient(120% 90% at 50% 22%, #3a2a6e 0%, #1c1342 46%, #0c0822 100%); }
/* непрерывный космо-фон лендинга + стеклянные карточки */
.cos-page { background: linear-gradient(180deg, #0e0a2a 0%, #160f38 35%, #130c30 65%, #0c0822 100%); }
.cos-page > * { position: relative; }
.cos-page > div:not(:first-child) { z-index: 1; }
.l-glass { background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.1); border-radius: 22px; backdrop-filter: blur(8px); transition: transform .2s, border-color .2s, background .2s; }
.l-glass:hover { transform: translateY(-4px); border-color: rgba(244,196,48,0.4); background: rgba(255,255,255,0.07); }
.cos-h2 { font-weight: 800; letter-spacing: -0.025em; background: linear-gradient(100deg, #F4C430, #E59CC4 45%, #B79CFB 75%, #6FA8FF); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.l-kick { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.cos-navlink { font-size: 13.5px; color: rgba(236,232,247,0.7); cursor: pointer; padding: 6px 4px; transition: color .14s; }
.cos-navlink:hover { color: #fff; }
@keyframes engShim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes heroTwinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.95; } }
@keyframes heroDraw { to { stroke-dashoffset: 0; } }
@keyframes heroDot { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
@keyframes heroPop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes heroFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.hero-aurora { position: absolute; inset: -30% -10% auto -10%; height: 70%; background: radial-gradient(60% 100% at 30% 0%, rgba(139,92,246,0.35), transparent 70%), radial-gradient(50% 100% at 80% 10%, rgba(244,196,48,0.18), transparent 70%); filter: blur(20px); animation: heroAurora 9s ease-in-out infinite alternate; }
@keyframes heroAurora { from { transform: translateX(-6%) translateY(-2%); } to { transform: translateX(8%) translateY(3%); } }
@keyframes heroSpark { 0%, 100% { opacity: 0.25; transform: scale(0.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(20deg); } }
@media (max-width: 720px) { .hero-wrap { grid-template-columns: 1fr !important; } .hero-sky { min-height: 220px !important; } }

/* ===== Публичная страница астролога ===== */
.pp-cta-bar { display: none; }
@media (max-width: 760px) {
  .pp-stats { grid-template-columns: 1fr 1fr !important; }
  .pp-flow { grid-template-columns: 1fr 1fr !important; }
  .pp-rev-grid { grid-template-columns: 1fr !important; }
  .pp-about { grid-template-columns: 1fr !important; }
  .pp-hero-row { flex-direction: column !important; align-items: center !important; text-align: center; margin-top: -52px !important; gap: 14px !important; }
  .pp-hero-meta { justify-content: center; }
  .pp-url { display: none !important; }
  .pp-cta-bar { display: flex; }
  .pp-hero-cta { width: 100%; flex-direction: row !important; flex-wrap: wrap; }
  .pp-hero-cta .btn { flex: 1 1 auto; }
  .pp-pad { padding-left: 18px !important; padding-right: 18px !important; }
  .pp-leadcol { flex: 1 1 100% !important; border-left: none !important; border-top: 1px solid var(--line); min-height: 150px !important; }
  .pp-rev-agg { gap: 12px !important; }
  .pp-app { flex-direction: column !important; align-items: flex-start !important; }
}
/* Публичная страница в узком контейнере (мобильное приложение) — те же правила по ширине контейнера */
@container ppwrap (max-width: 720px) {
  .pp-stats { grid-template-columns: 1fr 1fr !important; }
  .pp-flow { grid-template-columns: 1fr 1fr !important; }
  .pp-rev-grid { grid-template-columns: 1fr !important; }
  .pp-about { grid-template-columns: 1fr !important; }
  .pp-hero-row { flex-direction: column !important; align-items: flex-start !important; margin-top: -40px !important; gap: 12px !important; }
  .pp-hero-cta { width: 100%; flex-direction: row !important; flex-wrap: wrap; }
  .pp-hero-cta .btn { flex: 1 1 auto; }
  .pp-leadcol { flex: 1 1 100% !important; border-left: none !important; border-top: 1px solid var(--line); min-height: 140px !important; }
  .pp-app { flex-direction: column !important; align-items: flex-start !important; }
}
/* Панель редактора страницы — на узких на весь экран */
.cl-home-top { display: grid; grid-template-columns: 1fr 1.1fr; gap: 14px; align-items: start; margin-bottom: 8px; }
.cl-home-top .kicker { margin-top: 0; }
.cl-home-next { min-width: 0; }
.cl-sess-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px !important; align-items: start; }
@media (max-width: 560px) {
  .pp-edit-panel { width: 100% !important; }
}
.clreg-side { display: flex; }
@media (max-width: 760px) {
  .clreg-wrap { grid-template-columns: 1fr !important; }
  .clreg-side { display: none !important; }
}
@media print {
  body * { visibility: hidden !important; }
  .export-doc, .export-doc * { visibility: visible !important; }
  .export-doc { position: fixed !important; inset: 0 !important; width: 100% !important; max-height: none !important; overflow: visible !important; border-radius: 0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print { display: none !important; }
}

/* Галерея воронок */
.fg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fg-card { display: flex; flex-direction: column; text-align: left; cursor: pointer; padding: 0; overflow: hidden; transition: border-color .14s, transform .12s; }
.fg-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
@media (max-width: 720px) { .fg-grid { grid-template-columns: 1fr; } }
image-slot { background: var(--surface-2); border-radius: 12px; overflow: hidden; }
.pc-preview image-slot { background: var(--surface-3); }
@media (max-width: 820px) {
  .pc-grid { grid-template-columns: 1fr; overflow-y: auto; }
  .pc-col { overflow-y: visible; }
  .pc-col:first-child { border-right: none; border-bottom: 1px solid var(--line); }
}

/* ===== Мобильный drawer-сайдбар + общая адаптация кабинета ===== */
.eh-scrim { display: none; }
@media (max-width: 760px) {
  .eh-burger { display: inline-flex !important; }
  .eh-sidebar { position: fixed !important; top: 0; left: 0; bottom: 0; width: 264px !important; transform: translateX(-104%); transition: transform .24s ease; z-index: 60; box-shadow: 0 0 60px rgba(0,0,0,0.5); }
  .eh-shell.drawer-open .eh-sidebar { transform: translateX(0); }
  .eh-shell.drawer-open .eh-scrim { display: block; position: fixed; inset: 0; background: rgba(5,4,12,0.6); backdrop-filter: blur(2px); z-index: 55; }
  /* свёрнутый режим неактуален на мобиле — прячем стрелку-тоггл */
  .eh-sidebar button[title="Свернуть меню"], .eh-sidebar button[title="Развернуть меню"] { display: none !important; }
  /* настройки и подобные двухколоночные рейлы — в столбик */
  .set-rail { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); display: flex !important; flex-direction: row; overflow-x: auto; gap: 6px; }
  .set-rail button { white-space: nowrap; margin-bottom: 0 !important; }
  .jrn-list { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); max-height: 30vh; }
  .jrn-body { flex-direction: column; }
  .num-panel, .mx-panel, .hd-panel { width: auto !important; border-left: none !important; border-top: 1px solid var(--line); }
  .num-body, .mx-body, .hd-body { flex-direction: column; }
  .hd-rail { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); max-height: 34vh; }
  .mx-rail { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); max-height: 34vh; }
  .num-rail { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); max-height: 34vh; }
  .eng-rail { display: none; }
  .ref-cats { width: 150px !important; }
  .cal-subhead { overflow-x: auto; }
  .cal-subhead > * { flex-shrink: 0; }
}
@media (max-width: 560px) {
  .ref-body { flex-direction: column; }
  .ref-cats { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 4px; }
  .ref-cats button { white-space: nowrap; margin-bottom: 0 !important; }
}

/* ===== Мобильный кабинет (внутри рамки iPhone) ===== */
.mob-iconbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text-1); cursor: pointer; flex-shrink: 0; transition: background .14s; }
.mob-iconbtn:active { background: var(--surface-3); }
.mob-hscroll { scrollbar-width: none; }
.mob-hscroll::-webkit-scrollbar { display: none; }
.mob-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.mob-more-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 8px; text-align: center; transition: transform .12s, border-color .12s; }
.mob-more-cell:active { transform: scale(0.96); border-color: var(--accent-line); }
/* Переиспользованные десктоп-карточки на дашборде — сбросить grid-привязку */
.mob-card-reset .d-third, .mob-card-reset .d-banner, .mob-card-reset .d-sessions, .mob-card-reset .d-astro, .mob-card-reset .d-briefs, .mob-card-reset .d-feed, .mob-card-reset .d-attn { grid-column: auto !important; }
.eh-mobile .card { border-radius: var(--r-lg); }
@keyframes mobspin { to { transform: rotate(360deg); } }
/* Мобильная карточка клиента: обзор в одну колонку */
.mob-crm-ov > div { grid-template-columns: 1fr !important; }
.mob-crm-ov > div > * { grid-column: auto !important; }
/* Мобильная аналитика: «детально по источнику» — стек в одну колонку */
.mob-src .src-grid { grid-template-columns: 1fr !important; }
/* Мобильные настройки: переиспользуем SettingsView, разворачивая раскладку */
.mob-src .src-grid > div:last-child { grid-template-columns: 1fr 1fr !important; }
.eh-mobile .set-root { height: 100% !important; }
.eh-mobile .set-subhead { display: none !important; }
.eh-mobile .set-body { flex-direction: column !important; }
.eh-mobile .set-rail { width: auto !important; border-right: none !important; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 6px; padding: 9px 12px !important; scrollbar-width: none; }
.eh-mobile .set-rail::-webkit-scrollbar { display: none; }
.eh-mobile .set-rail button { margin-bottom: 0 !important; white-space: nowrap; flex-shrink: 0; padding: 8px 13px !important; font-size: 13px !important; }
/* Нативные мобильные настройки: детальный экран категории */
.eh-mobile .set-root { height: 100% !important; }
.eh-mobile .set-mob-head { background: rgba(13,12,32,0.85); }
.eh-mobile .set-content [style*="repeat(auto-fit, minmax(180px"], .eh-mobile .set-content [style*="repeat(auto-fill, minmax(180px"] { grid-template-columns: 1fr !important; }
.eh-mobile .set-content [style*="repeat(3, 1fr)"] { grid-template-columns: 1fr 1fr 1fr !important; }
.eh-mobile .set-content { padding: 16px 14px 36px !important; }
.eh-mobile .set-content > div { max-width: 100% !important; }
/* Мобильный Контент: переиспользуем ContentView */
.eh-mobile .cnt-root { height: 100% !important; }
.eh-mobile .cnt-root .cal-subhead { height: auto !important; flex-wrap: wrap; padding: 10px 14px !important; gap: 8px !important; }
.eh-mobile .cnt-root > div:last-child { padding: 14px 14px 36px !important; }
.eh-mobile .cnt-root .prod-grid { grid-template-columns: 1fr !important; }
/* Мобильные инструменты (движок/нумерология/матрица/HD/астрокалендарь/дневник/справочник) — переиспользуем десктоп-вью */
.eh-mobile .mob-reuse, .eh-mobile .mob-reuse > div { height: 100% !important; }
.eh-mobile .cal-subhead { height: auto !important; min-height: 0 !important; flex-wrap: wrap; padding: 9px 12px !important; gap: 8px !important; }
.eh-mobile .eng-body, .eh-mobile .mx-body, .eh-mobile .num-body, .eh-mobile .hd-body, .eh-mobile .jrn-body, .eh-mobile .ref-body {
  flex-direction: column !important; overflow-y: auto !important; }
.eh-mobile .eng-body > *, .eh-mobile .mx-body > *, .eh-mobile .num-body > *, .eh-mobile .hd-body > *, .eh-mobile .jrn-body > *, .eh-mobile .ref-body > * {
  flex: 0 0 auto !important; height: auto !important; min-height: 0 !important; overflow: visible !important; }
.eh-mobile .eng-panel, .eh-mobile .mx-panel, .eh-mobile .num-panel, .eh-mobile .hd-panel {
  width: 100% !important; border-left: none !important; border-top: 1px solid var(--line); }
.eh-mobile .jrn-list, .eh-mobile .ref-cats {
  width: 100% !important; border-right: none !important; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 6px; padding: 9px 12px !important; }
.eh-mobile .jrn-list > *, .eh-mobile .ref-cats > * { flex-shrink: 0; white-space: nowrap; margin-bottom: 0 !important; }
.eh-mobile .eng-wheel { padding: 16px !important; }
/* Движок карт на мобильном: компактнее управление, колесо не во весь экран */
.eh-mobile .cal-subhead .btn { padding: 8px 12px !important; font-size: 12.5px !important; }
.eh-mobile .eng-wheel > svg, .eh-mobile .eng-wheel svg.natal-wheel { max-width: 300px; max-height: 300px; }
.eh-mobile .eng-panel { border-top: 2px solid var(--accent-line); }
.eh-mobile .eng-rail { display: none !important; }
/* В переиспользуемых инструментах прячем дублирующий заголовок секции (он уже в шапке) */
.eh-mobile .tool-subhead-ico, .eh-mobile .tool-subhead-title { display: none !important; }
/* Конструктор продукта и выбор типа — одна колонка внутри телефона */
.eh-mobile .pc-overlay { padding: 0; }
.eh-mobile .pc-shell { max-height: 100%; height: 100%; border-radius: 0; }
.eh-mobile .pc-grid { grid-template-columns: 1fr !important; overflow-y: auto; }
.eh-mobile .pc-col { overflow-y: visible; }
.eh-mobile .pc-col:first-child { border-right: none; border-bottom: 1px solid var(--line); }
/* Масштаб рамки под невысокие окна предпросмотра */
@media (max-height: 900px) { body { --mob-scale: 0.96; } }
@media (max-height: 820px) { body { --mob-scale: 0.86; } }
@media (max-height: 740px) { body { --mob-scale: 0.76; } }
@media (max-height: 660px) { body { --mob-scale: 0.66; } }

/* ===== Продающие секции лендинга ===== */
.l-vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
@media (max-width: 760px) { .l-vs-grid { grid-template-columns: 1fr; } }
.l-vs-row { display: flex; gap: 11px; align-items: flex-start; padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.07); font-size: 13.5px; line-height: 1.55; }
.l-vs-row:first-of-type { border-top: none; margin-top: 8px; }
.l-results-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 760px) { .l-results-grid { grid-template-columns: 1fr 1fr; } }
.l-replace-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 20px; align-items: stretch; }
@media (max-width: 820px) { .l-replace-grid { grid-template-columns: 1fr; } }
.l-quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 860px) { .l-quote-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; } }
.l-faq-item { cursor: pointer; }
.l-faq-item .l-faq-a { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .32s ease, opacity .26s ease, margin .32s ease; }
.l-faq-item.open .l-faq-a { max-height: 260px; opacity: 1; margin-top: 10px; }
.l-faq-chev { transition: transform .25s; flex-shrink: 0; }
.l-faq-item.open .l-faq-chev { transform: rotate(180deg); }
