/* projme.ru — оркестратор. Палитра/типографика повторяют forms.projme (light). */
/* Локальный Inter (cyrillic/cyrillic-ext/latin/latin-ext, variable weight 400-700) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/inter-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7SUc.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/inter-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7SUc.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/inter-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/inter-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7SUc.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --background: #fcfcfd;
  --foreground: #232327;
  --card: #ffffff;
  --muted: #f4f4f6;
  --muted-fg: #767680;
  --border: #e3e3e8;
  --accent: #f4f4f6;
  --primary: #3d3df0;      /* oklch(0.49 0.24 264.38) */
  --primary-fg: #f6f7ff;
  --ring: #3d3df0;
  --wip-fg: #9a9aa4;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #17171a;
    --foreground: #f4f4f6;
    --card: #212125;
    --muted: #26262b;
    --muted-fg: #a8a8b2;
    --border: rgba(255,255,255,.12);
    --accent: #26262b;
    --primary: #6f6ff5;
    --primary-fg: #0e0e2a;
    --ring: #6f6ff5;
    --wip-fg: #8b8b96;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page { display: flex; flex-direction: column; height: 100dvh; }

/* ── Шапка ─────────────────────────────────────────── */
.topbar {
  display: flex; justify-content: center;
  padding: 20px 16px 6px;
  flex: none;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--foreground);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-fg);
  font-weight: 700; font-size: 20px; line-height: 1;
  padding-bottom: 2px; /* оптическое выравнивание строчной «p» */
}
.brand-name { font-weight: 600; font-size: 24px; letter-spacing: -0.5px; }

/* ── Каркас: левая панель | центр | правая панель ─── */
.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(420px, 44vw) minmax(300px, 1fr);
  gap: 28px;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 28px 8px;
  align-items: stretch;
}
.panel { position: relative; min-height: 0; }
.panel-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 0;
}

/* ── Центральная колонка с кнопками ────────────────── */
.center { display: flex; flex-direction: column; min-height: 0; }
.svc-list {
  flex: 1;
  min-height: 0;
  display: flex; flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 8px 2px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Кнопка сервиса ────────────────────────────────── */
.svc {
  flex: none;
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  min-height: 74px;
  padding: 14px 20px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--foreground);
  transition: border-color .25s ease, box-shadow .25s ease, transform .15s ease, background .25s ease;
  position: relative;
}
.svc:hover { transform: translateY(-1px); }
.svc:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

.svc.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 16%, transparent),
              0 10px 30px -12px color-mix(in oklab, var(--primary) 45%, transparent);
}

.svc-icon {
  flex: none; width: 40px; height: 40px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: var(--muted);
  transition: background .25s ease, color .25s ease, transform .25s ease;
}
.svc-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svc.is-active .svc-icon { background: var(--primary); color: var(--primary-fg); transform: scale(1.05); }

.svc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.svc-name { font-weight: 600; font-size: 17px; letter-spacing: -0.2px; display: flex; align-items: center; gap: 10px; }
.svc-sub { font-size: 13.5px; color: var(--muted-fg); }

.svc-tail { margin-left: auto; flex: none; color: var(--muted-fg); opacity: 0; transform: translateX(-4px); transition: all .25s ease; }
.svc-tail svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.svc.is-active .svc-tail { opacity: 1; transform: none; }

.svc.is-wip { cursor: default; }
.svc.is-wip:hover { transform: none; }
.svc.is-wip .svc-name { color: var(--muted-fg); }
.wip-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
  color: var(--muted-fg);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  text-transform: lowercase;
}

/* ── Блокы боковых панелей ─────────────────────────── */
.fblock {
  flex: 1 1 0;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
  opacity: 0; transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease, border-color .3s ease;
}
.fblock.is-in { opacity: 1; transform: none; }
.fblock.is-hot { border-color: color-mix(in oklab, var(--primary) 55%, var(--border)); }
.fblock h3 {
  margin: 0;
  font-size: 13px; font-weight: 600; letter-spacing: 0;
  color: var(--muted-fg);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.fblock h3 svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fblock p { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--foreground); }
.fblock p strong { font-weight: 600; }
.fblock .viz { margin-top: auto; padding-top: 8px; }
/* адаптация при нехватке высоты: ужимаем блок → прячем визуализацию → подрезаем текст до 3 строк */
.fblock.is-compact { padding: 10px 14px; gap: 6px; }
.fblock.is-compact p { font-size: 13.5px; line-height: 1.4; }
.fblock.is-compact .viz { display: none; }
.fblock.is-tight p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* мини-визуализации */
.mviz { margin-top: auto; position: relative; height: 34px; font-size: 12px; color: var(--muted-fg); }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.chip {
  font-size: 11.5px; font-weight: 500;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-fg);
  border-radius: 999px; padding: 3px 9px;
  white-space: nowrap;
}
.is-hot .chip { color: var(--foreground); border-color: color-mix(in oklab, var(--primary) 35%, var(--border)); }

.sparkline { width: 100%; height: 34px; display: block; }
.sparkline path { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; }
.sparkline .area { fill: color-mix(in oklab, var(--primary) 14%, transparent); stroke: none; }
.sparkline .dot { fill: var(--primary); }

.pulse-dot { width: 8px; height: 8px; border-radius: 999px; background: #22a55e; display: inline-block; margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* юзер-пилюли + строка (ИИ-конструктор) */
.ai-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ai-row .bar { height: 10px; border-radius: 999px; background: var(--muted); position: relative; overflow: hidden; flex: 1; }
.ai-row .bar::after {
  content: ""; position: absolute; inset: 0;
  width: var(--fill, 40%);
  background: color-mix(in oklab, var(--primary) 55%, transparent);
  border-radius: inherit;
  transition: width .9s cubic-bezier(.2,.7,.2,1);
}
.ai-row .k { flex: none; width: 74px; font-size: 11.5px; color: var(--muted-fg); }

/* подпись (signature) */
.sig { margin-top: auto; }
.sig path { fill: none; stroke: var(--foreground); stroke-width: 2; stroke-linecap: round; }
.is-hot .sig path { stroke: var(--primary); }

/* слайдер рейтинга */
.ratebar { margin-top: auto; }
.ratebar .track { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.ratebar .fill { height: 100%; width: var(--val, 70%); border-radius: inherit; background: var(--primary); transition: width .9s cubic-bezier(.2,.7,.2,1); }
.ratebar .stars { display: flex; gap: 3px; margin-top: 6px; color: var(--muted-fg); font-size: 12px; letter-spacing: 2px; }

/* стэгер-появление панелей при смене сервиса */
@keyframes riseIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Футер ─────────────────────────────────────────── */
.foot {
  flex: none;
  text-align: center;
  padding: 10px 16px 18px;
  color: var(--muted-fg);
  font-size: 13px;
}

/* ── Мобильная версия: без боковых панелей ─────────── */
@media (max-width: 1023px) {
  .layout {
    grid-template-columns: 1fr;
    max-width: 640px;
    gap: 0;
    padding: 8px 16px 8px;
  }
  .panel { display: none; }
  .svc-list { padding: 8px 0 16px; }
}

/* доступность: убрать автопереключение и анимации */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}
