/* ВекторЛаб — тёмная карточка на сером фоне: слева результат, справа чат. */

:root {
  --page: #8d8d8d;
  --shell: #121712;
  --panel: #1a201a;
  --panel-2: #1e241e;
  --ink: #f2f2f0;
  --muted: #8f8f8d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #f4f5f7;
  --on-accent: #0b0b0c;
  --glow: rgba(126, 224, 192, 0.28);
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --ring: 0 0 0 2px rgba(126, 224, 192, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(60% 50% at 16% 10%, rgba(126, 224, 192, 0.22) 0%, transparent 62%),
    radial-gradient(55% 45% at 84% 14%, rgba(88, 166, 255, 0.17) 0%, transparent 60%),
    radial-gradient(75% 60% at 50% 98%, rgba(139, 92, 246, 0.15) 0%, transparent 64%),
    conic-gradient(from 210deg at 50% 45%, rgba(126, 224, 192, 0.045), rgba(88, 166, 255, 0.045) 25%, transparent 50%, rgba(139, 92, 246, 0.045) 75%, rgba(126, 224, 192, 0.045)),
    linear-gradient(165deg, #172019 0%, #121813 40%, #0e140f 100%);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: radial-gradient(1100px 600px at 15% -5%, rgba(126, 224, 192, 0.10), transparent 60%),
    radial-gradient(900px 500px at 85% 110%, rgba(143, 199, 255, 0.08), transparent 55%);
}

.shell {
  /* Высота задаётся только экраном: содержимое не может её растянуть. */
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  grid-template-rows: minmax(0, 1fr);
  background-color: var(--shell);
  background-image: radial-gradient(1100px 620px at 12% -8%, rgba(126, 224, 192, 0.17), transparent 60%),
    radial-gradient(900px 520px at 88% 112%, rgba(143, 199, 255, 0.12), transparent 55%);
  border-radius: 0;
  overflow: hidden;
  border: none;
  box-shadow: none;
}

/* ---------- левая половина: результат ---------- */

.viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  min-width: 0;
  min-height: 0;
}

.art {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #101012;
  display: flex;
  flex-direction: column;
}

.art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 8, 14, 0.35) 0%,
    rgba(6, 8, 14, 0) 35%,
    rgba(6, 8, 14, 0.55) 100%
  );
  pointer-events: none;
}

.badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f4f5f7;
  background: rgba(10, 12, 16, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
}

.badge.ghost {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(10, 12, 16, 0.22);
}

.drop {
  position: relative;
  z-index: 2;
  margin: auto;
  width: min(420px, 78%);
  padding: 34px 30px;
  text-align: center;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.32);
  background: rgba(8, 10, 14, 0.34);
  backdrop-filter: blur(18px);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease;
  cursor: pointer;
}

.drop.over {
  border-color: #ffffff;
  transform: translateY(-2px);
  background: rgba(8, 10, 14, 0.5);
}

.drop.compact {
  margin: 0 auto 18px;
  width: min(360px, 70%);
  padding: 18px 22px;
}

.drop-icon {
  font-size: 22px;
  color: #fff;
  opacity: 0.9;
}

.drop-title {
  margin: 8px 0 4px;
  font-size: 17px;
  font-weight: 500;
}

.drop-sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.drop-note {
  margin: 12px 0 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* результат поверх картинки */

.result {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  /* Верхний отступ — чтобы подпись «Исходник» не липла к краю. */
  padding: 12px 12px 12px;
}

/*
 * Высота превью задаётся только свободным местом: height: 0 + flex: 1
 * означает, что картинки внутри вообще не влияют на высоту панели.
 */
.previews {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* Исходник — меньше, вектор — больше. */
  grid-template-rows: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 10px;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow: hidden;
}

.previews figure {
  margin: 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.previews figcaption {
  padding-left: 2px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.canvas {
  position: relative;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* Картинка вынута из потока: её собственный размер не может растянуть панель. */
.canvas img,
.canvas svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.canvas.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e4e4e4 25%, transparent 25%),
    linear-gradient(-45deg, #e4e4e4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e4e4e4 75%),
    linear-gradient(-45deg, transparent 75%, #e4e4e4 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
}

.glass {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px 14px;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.stats div {
  min-width: 0;
}

.stats dt {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.stats dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats div:last-child dd {
  font-size: 11px;
  letter-spacing: -0.01em;
}

.glass-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- кнопки и плашки ---------- */

.cta {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    opacity 0.12s ease;
}

.cta:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.cta.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  font-weight: 500;
}

.cta:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 11px;
  color: #d5d5d3;
  white-space: nowrap;
}

.pill.toggle,
.pill.select {
  cursor: pointer;
}

.pill input {
  margin: 0;
  accent-color: #f4f5f7;
}

.pill select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
  outline: none;
}

.pill select option {
  background: #171718;
  color: var(--ink);
}

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

/* ---------- правая половина: чат ---------- */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 26px 30px 20px;
  gap: 14px;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.8);
}

.brand i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ee0c0;
  box-shadow: 0 0 12px #7ee0c0;
}

.nav {
  display: flex;
  gap: 6px;
}

.chat-title h1 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 550;
  text-wrap: balance;
}

.chat-title h1 em {
  font-style: normal;
  background: linear-gradient(92deg, #9ff0e2 0%, #8fc7ff 45%, #d4a6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chat-title p {
  margin: 10px 0 0;
  max-width: 44ch;
  color: #9a9a98;
  font-size: 13px;
  line-height: 1.6;
}

.messages {
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #2c2c2e transparent;
}

.msg {
  border-radius: 16px;
  padding: 12px 14px;
}

.msg.assistant {
  background: var(--panel);
  border: 1px solid var(--line);
  align-self: flex-start;
  max-width: 92%;
}

.msg.assistant p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #d9d9d7;
}

.msg.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line-strong);
  max-width: 82%;
}

.msg.user p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}

.msg .msg-head {
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.msg.pending {
  opacity: 0.65;
}

.chat-composer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.chat-form input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.chat-form input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
}

.cta.send {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}

.settings {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.02);
}

.settings summary {
  cursor: pointer;
  padding: 9px 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
}

.settings summary::-webkit-details-marker {
  display: none;
}

.settings[open] summary {
  color: var(--ink);
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 4px 0 12px;
}

.msg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #e8e8e6;
  margin-bottom: 10px;
}

.bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 12px;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #7ee0c0, #8fc7ff);
  transition: width 0.25s ease;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--muted);
}

.step-body {
  min-width: 0;
}

.step-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.step.active {
  color: var(--ink);
}

.step.done .step-mark {
  color: #7ee0c0;
}

.step-mark {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

.step-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-detail {
  flex-shrink: 0;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
}

/* текст и шрифт */

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

.text-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.text-row i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}

.text-row small {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.text-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 1px dashed var(--line-strong);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 2px 4px;
}

.text-input:hover,
.text-input:focus {
  border-bottom-color: var(--ink);
  outline: none;
}

.text-row select {
  flex-shrink: 0;
  max-width: 46%;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 6px;
  font: inherit;
  font-size: 11px;
}

.font-note {
  margin: 10px 0 0;
  padding: 8px 10px 8px 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0 8px 8px 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #d9d9d7;
}

.font-note.exact {
  border-left-color: #7ee0c0;
  color: var(--muted);
}

.msg .pills {
  margin-top: 10px;
}

/* предупреждения и рейтинг */

.warnings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.warnings li {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 196, 120, 0.08);
  border: 1px solid rgba(255, 196, 120, 0.22);
  font-size: 11.5px;
  color: #f0d9b5;
}

.ranking {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.ranking th {
  text-align: left;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px 6px 0;
}

.ranking td {
  padding: 3px 6px 3px 0;
  color: #d6d6d4;
  border-top: 1px solid var(--line);
}

.ranking tr.best td {
  color: #fff;
}

/* ---------- композер ---------- */



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

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: #d5d5d3;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.06);
}

.chip.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 600;
}

.algo-settings select {
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.sliders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.slider {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slider output {
  color: var(--ink);
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  background: transparent;
  cursor: pointer;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
}

.compose-actions {
  display: flex;
  gap: 8px;
}

.compose-actions .cta:first-child {
  flex: 1;
}

.status {
  margin: 0;
  min-height: 16px;
  font-size: 11.5px;
  color: var(--muted);
}

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

.small {
  font-size: 11px;
}

/* ---------- адаптив ---------- */

@media (max-width: 1080px) {
  .stage {
    padding: 14px;
  }

  .shell {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .viewer {
    min-height: 62vh;
  }

  .chat {
    padding: 22px;
  }

  .thread {
    max-height: 40vh;
  }
}

/* Шаги обработки — плавающая панель поверх картинки слева. */
.progress {
  /* Панель шагов висит над вектором — нижней половиной картинки. */
  content-visibility: auto;
  position: absolute;
  z-index: 3;
  top: 56%;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 84%);
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(10, 12, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  animation: progress-in 0.25s ease-out;
}

@keyframes progress-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.progress .msg-head {
  color: #f2f2f0;
}

.progress .steps {
  max-height: 190px;
  overflow: hidden;
}

.progress .step {
  font-size: 11.5px;
}

.purposes-label {
  margin: 2px 0 -2px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* Список похожих шрифтов: превью тем же текстом, как в WhatTheFont. */
.font-choices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.font-choice {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.font-choice:hover {
  background: rgba(255, 255, 255, 0.07);
}

.font-choice.active {
  border-color: rgba(126, 224, 192, 0.55);
  background: rgba(126, 224, 192, 0.08);
}

.font-sample {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.font-meta {
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--muted);
}

/* Клавиатурный фокус виден и не мешает мыши. */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 8px;
}

button:active {
  transform: translateY(1px);
}

/* Сообщения: лёгкая полоска-акцент у ответов ВЕКТЫ. */
.msg.assistant {
  position: relative;
}

.msg.assistant::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #7ee0c0, #8fc7ff);
  opacity: 0.55;
}

.msg.user {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
}

/* Пустая область вектора подсказывает, что здесь будет. */
.canvas.checker::after {
  content: 'здесь появится вектор';
  position: absolute;
  inset: auto 0 18px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(20, 20, 22, 0.35);
  pointer-events: none;
}

.canvas.checker:has(svg)::after {
  content: '';
}

/* Полоса загрузки шагов: мягкое свечение. */
.bar i {
  box-shadow: 0 0 12px rgba(126, 224, 192, 0.5);
}

/* Кнопки-плашки: легкий подъём. */
.chip:hover,
.pill:hover {
  border-color: rgba(255, 255, 255, 0.32);
}

.chip:active {
  transform: translateY(1px);
}

/* Скроллбар в ленте — тоньше и темнее. */
.messages::-webkit-scrollbar {
  width: 6px;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Знак сомнения у строки: распознано неуверенно — проверьте текст. */
.text-warn {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 196, 120, 0.18);
  border: 1px solid rgba(255, 196, 120, 0.55);
  color: #f0d9b5;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
}

/* Подсказка от Lens: семейства, которые предложила обученная модель. */
.lens-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.lens-hint::before {
  content: '◆ ';
  color: #7ee0c0;
}

/* Скелетон подбора шрифта: видно, что система работает. */
.font-skeleton {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.font-skeleton span {
  height: 26px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.16) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: font-shimmer 1.4s ease infinite;
}

.font-skeleton span:nth-child(2) {
  animation-delay: 0.12s;
  opacity: 0.8;
}

.font-skeleton span:nth-child(3) {
  animation-delay: 0.24s;
  opacity: 0.6;
}

.font-skeleton em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

@keyframes font-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* Настройки текста: появляются, когда текст распознан. */
.text-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.text-tools .group-title {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* Список шрифтов внутри сообщения чата. */
.font-msg p {
  margin: 0 0 8px;
}

.font-msg .font-choices {
  margin-top: 0;
}

/* ===== Панель инструментов над превью ===== */
.toolbar {
  flex-wrap: wrap;
  row-gap: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 10px;
}

.toolbar-gap {
  flex: 1;
}

.tool {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #ececea;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.tool:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.tool[aria-pressed='true'] {
  background: rgba(126, 224, 192, 0.16);
  border-color: rgba(126, 224, 192, 0.6);
  color: #d9fff2;
}

.tool.icon {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.zoom-value {
  min-width: 44px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ===== Режим сравнения: вектор поверх исходника со шторкой ===== */
.previews.compare {
  position: relative;
  display: block;
  grid-template-rows: none;
}

.previews.compare figure {
  position: absolute;
  inset: 0;
  margin: 0;
}

.previews.compare figure figcaption {
  position: absolute;
  z-index: 3;
  left: 12px;
  top: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(12, 12, 14, 0.72);
  backdrop-filter: blur(8px);
}

.previews.compare figure:last-of-type {
  clip-path: inset(0 0 0 var(--split, 50%));
}

.previews.compare figure:first-of-type figcaption {
  left: auto;
  right: 12px;
}

.split-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 2px;
  margin-left: -1px;
  background: rgba(126, 224, 192, 0.9);
  box-shadow: 0 0 18px rgba(126, 224, 192, 0.6);
  cursor: ew-resize;
  z-index: 5;
  touch-action: none;
}

.split-handle i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: #101012;
  border: 2px solid rgba(126, 224, 192, 0.9);
}

/* ===== Боковые панели: слои и палитра ===== */
.side-panel {
  position: absolute;
  right: 14px;
  top: 52px;
  z-index: 20;
  width: 232px;
  max-height: 60%;
  overflow: auto;
  padding: 12px;
  border-radius: 16px;
  background: rgba(16, 16, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
}

.side-panel h3 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
}

.layer-row,
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.layer-row:hover,
.color-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.layer-row input {
  accent-color: #7ee0c0;
}

.layer-thumb {
  flex: none;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #ddd 25%, transparent 25%),
    linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%),
    linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
}

.layer-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
}

.layer-name {
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
}

.layer-name:hover {
  border-color: var(--line);
}

.layer-name:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.25);
}

.layer-row b,
.color-row b {
  margin-left: auto;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.color-row i {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

.color-row.picked {
  background: rgba(126, 224, 192, 0.14);
}

/* Сравнение сохраняет высоту обычного режима, иначе область схлопывается. */
.previews.compare {
  height: 100%;
  min-height: 0;
}

/* ===== Чат: аккуратная лента ===== */
.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 8px;
  scroll-behavior: smooth;
}

.msg {
  position: relative;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.msg.user {
  align-self: flex-end;
  max-width: 85%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.09));
  border-color: rgba(255, 255, 255, 0.16);
  border-bottom-right-radius: 6px;
}

.msg.assistant {
  align-self: flex-start;
  max-width: 94%;
  border-bottom-left-radius: 6px;
}

.msg.assistant::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #7ee0c0, #8fc7ff);
  opacity: 0.5;
}

.msg p {
  margin: 0;
}

.msg p + p {
  margin-top: 8px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.38);
}

/* Точки «печатает», пока считается. */
.typing {
  display: inline-flex;
  gap: 4px;
  padding: 2px 0;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  animation: typing-bounce 1.1s infinite ease-in-out;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Приветственный экран: что умеет система. */
.welcome {
  display: grid;
  gap: 8px;
  padding: 4px 2px;
}

.welcome-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.welcome-card:hover {
  border-color: rgba(126, 224, 192, 0.45);
  background: rgba(126, 224, 192, 0.07);
}

.welcome-card b {
  display: block;
  font-weight: 500;
  margin-bottom: 2px;
}

.welcome-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.welcome-card u {
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}

/* Кнопка «вниз» появляется, когда лента прокручена. */
.scroll-down {
  position: absolute;
  right: 14px;
  bottom: 96px;
  z-index: 15;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 18, 20, 0.9);
  color: #ececea;
  cursor: pointer;
}

.scroll-down.hidden {
  display: none;
}

/* Пакетный режим: таблица файлов над превью. */
.batch-panel {
  margin: 0 4px 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(16, 16, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.batch-panel h3 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
}

.batch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.batch-row.busy {
  background: rgba(126, 224, 192, 0.08);
}

.batch-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.batch-status {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Строка статистики не должна обрезаться на узкой панели. */
.glass .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 11px;
}

.glass .stats dd {
  white-space: nowrap;
}

.glass .stats div {
  min-width: 62px;
}

/* На узкой панели подписи не обрезаются: переносим строку целиком. */
.glass .stats dd {
  font-size: 12px;
}

/* Разбор строки на буквы — шаг «уточни текст» из WhatTheFont. */
.glyph-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.glyph-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.glyph-tile img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
}

.glyph-tile input {
  width: 34px;
  padding: 2px 4px;
  text-align: center;
  font: inherit;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
}

/* Инструменты плитки: разрезать и склеить. */
.glyph-tools {
  display: flex;
  gap: 2px;
}

.glyph-tools button {
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 10px;
  line-height: 1;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #b9c4cc;
  cursor: pointer;
}

.glyph-tools button:hover {
  background: rgba(126, 224, 192, 0.16);
  border-color: rgba(126, 224, 192, 0.5);
  color: #d9fff2;
}

/* Команды над чатом: подпись и плашки в одну строку. */
.quick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.quick-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* Обратная связь, когда точного шрифта нет. */
.font-low {
  color: #f0d9b5;
  border-left: 2px solid rgba(255, 196, 120, 0.6);
  padding-left: 8px;
}

/* ===== Главная кнопка «Распознать шрифт» ===== */
.cta.accent {
  background: linear-gradient(135deg, #7ee0c0, #5cc9a8);
  color: #08120e;
  font-weight: 600;
  border: none;
  box-shadow: 0 0 22px rgba(126, 224, 192, 0.35);
}

.cta.accent:hover {
  box-shadow: 0 0 30px rgba(126, 224, 192, 0.55);
  transform: translateY(-1px);
}

/* ===== Чат: аватар ВЕКТЫ и вид сообщений ===== */
.msg.assistant {
  padding-left: 42px;
}

.msg.assistant::before {
  content: 'В';
  position: absolute;
  left: 0;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7ee0c0, #8fc7ff);
  color: #08120e;
  font-size: 14px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
}

.msg.assistant .msg-meta {
  margin-top: 4px;
}

.msg.user {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.1));
}

/* Сообщение с результатами подбора шрифта — заметная карточка-результат. */
.msg.font-msg {
  border: 1px solid rgba(126, 224, 192, 0.22);
  background: rgba(126, 224, 192, 0.05);
}

.msg.font-msg::after {
  content: 'ПОДБОР ШРИФТА';
  display: block;
  margin-top: 8px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(126, 224, 192, 0.75);
}

/* ===== Лендинг (экран входа) ===== */
.landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
  padding: 32px;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(126, 224, 192, 0.14), transparent 60%),
    linear-gradient(180deg, #0b0b0c, #101014);
  transition: opacity 320ms ease, visibility 320ms ease;
}

.landing.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-mark {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: linear-gradient(135deg, #7ee0c0, #8fc7ff);
  color: #08120e;
  font-size: 42px;
  font-weight: 700;
  line-height: 84px;
  box-shadow: 0 0 60px rgba(126, 224, 192, 0.4);
}

.landing-title {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  letter-spacing: 0.16em;
  font-weight: 600;
}

.landing-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #2b8b74;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7ee0c0;
  box-shadow: 0 0 12px #7ee0c0;
  animation: landing-pulse 2.4s ease-in-out infinite;
}

@keyframes landing-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.landing-sub {
  margin: 0;
  max-width: 52ch;
  color: #9a9a98;
  font-size: 15px;
  line-height: 1.6;
}

.landing-feats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-feats {
  position: relative;
  z-index: 1;
}

.landing-feats span {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 24, 32, 0.1);
  background: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  color: #4e5560;
  backdrop-filter: blur(10px);
}

.cta.big {
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 14px;
}

.landing-note {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(20, 24, 32, 0.42);
}

/* ===== Футтер ===== */
.app-footer {
  flex-shrink: 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.35);
  background: #0b0b0c;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== Анимация сообщений ===== */
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.msg {
  animation: msg-in 0.22s ease both;
}

.msg.user {
  animation-duration: 0.18s;
}

.msg:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ===== Команды крупнее и красивее ===== */
.quick-label {
  font-size: 11px;
}

.chip.quick {
  padding: 9px 15px;
  font-size: 13.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chip.quick:hover {
  background: rgba(126, 224, 192, 0.14);
  border-color: rgba(126, 224, 192, 0.5);
  color: #d9fff2;
}

/* ===== Футтер ===== */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.app-footer span {
  color: rgba(255, 255, 255, 0.4);
}

.footer-link {
  color: rgba(126, 224, 192, 0.85);
  text-decoration: none;
}

.footer-link:hover {
  color: #d9fff2;
  text-decoration: underline;
}

/* ===== Анимация ВЕКТА на лендинге ===== */
@keyframes brand-in {
  0% {
    opacity: 0;
    letter-spacing: 0.5em;
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    letter-spacing: 0.16em;
    filter: blur(0);
  }
}

.landing-title {
  animation: brand-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.landing-sub {
  animation: msg-in 0.6s ease 0.25s both;
}

.landing .cta.big {
  animation: msg-in 0.6s ease 0.4s both;
}

/* ===== Баблы в чате — живее ===== */
.msg {
  border-radius: 16px;
}

.msg.assistant {
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 0 rgba(126, 224, 192, 0.35);
}

.msg.user {
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 0 rgba(143, 199, 255, 0.4);
}

.msg.assistant::before {
  box-shadow: 0 0 0 3px rgba(126, 224, 192, 0.18);
}

/* ===== Стекло (glassmorphism) ===== */
.glass,
.settings,
.side-panel,
.font-choice,
.font-choices .font-choice,
.msg,
.progress,
.chip {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.msg.user {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
}

.msg.assistant {
  background: linear-gradient(180deg, rgba(126, 224, 192, 0.10), rgba(255, 255, 255, 0.04));
}

.font-choice.active {
  background: linear-gradient(180deg, rgba(126, 224, 192, 0.16), rgba(126, 224, 192, 0.05));
}

/* ===== Панель действий в редакторе ===== */
.actionbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 2px 2px 4px;
}

.actionbar .status {
  margin-left: auto;
  flex: 0 0 auto;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Баблы — более живой дизайн ===== */
.msg {
  position: relative;
  padding: 12px 14px;
  border-radius: 16px;
}

.msg.assistant::after {
  content: '';
  position: absolute;
  left: -6px;
  bottom: 14px;
  border: 7px solid transparent;
  border-right-color: rgba(126, 224, 192, 0.14);
  border-left: 0;
}

.msg.user::after {
  content: '';
  position: absolute;
  right: -6px;
  bottom: 14px;
  border: 7px solid transparent;
  border-left-color: rgba(143, 199, 255, 0.22);
  border-right: 0;
}

/* ===== Лендинг — живой фон без текста ===== */
.landing {
  overflow: hidden;
}

.landing::before {
  content: '';
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(40% 40% at 30% 30%, rgba(126, 224, 192, 0.28), transparent 70%),
    radial-gradient(35% 35% at 70% 60%, rgba(139, 92, 246, 0.22), transparent 70%),
    radial-gradient(30% 30% at 60% 25%, rgba(88, 166, 255, 0.22), transparent 70%);
  filter: blur(70px);
  z-index: -1;
  animation: landing-float 9s ease-in-out infinite alternate;
}

@keyframes landing-float {
  from {
    transform: translate(-3%, -2%) scale(1);
  }
  to {
    transform: translate(3%, 2%) scale(1.1);
  }
}

/* ===== Чистые лаконичные баблы (без аватара и хвостиков) ===== */
.msg {
  border-radius: 14px;
  padding: 11px 14px;
  box-shadow: none;
}

.msg.assistant {
  padding-left: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 2px solid rgba(126, 224, 192, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  border-radius: 5px 14px 14px 14px;
}

.msg.user {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  border-radius: 14px 5px 14px 14px;
}

.msg.assistant::before,
.msg.assistant::after,
.msg.user::after {
  display: none;
}

/* ===== Футтер ===== */
.app-footer {
  gap: 12px;
}

.footer-brand {
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
}

.footer-sep {
  color: rgba(255, 255, 255, 0.35);
}

.footer-year {
  color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
}

/* ==========================================================================
   Дизайн-слой: тёмный холст, глубокие градиентные поверхности, светлый блик
   и пиксельное растворение. Структура, тексты и поведение не меняются.
   ========================================================================== */

:root {
  --page: #0a0a0b;
  --shell: #0a0a0b;
  --panel: #10161d;
  --panel-2: #141c25;
  --ink: #f6f8fa;
  --muted: #87909a;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.15);
  --accent: #e9f2f9;
  --on-accent: #0a0e12;
  --glow: rgba(150, 200, 235, 0.2);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --ring: 0 0 0 2px rgba(165, 205, 240, 0.55);
}

/* Холст — ровный почти чёрный, цвет живёт в поверхностях. */
body,
.stage,
.shell {
  background-color: #0a0a0b;
}

body {
  background-image: none;
}

.stage,
.shell {
  background-image: none;
}

/* ---- Подпись дизайна: глубокая поверхность с бликом сверху-справа ---- */
.art,
.settings,
.drop,
.progress,
.side-panel,
.font-choice,
.msg.assistant {
  background-color: transparent;
  background-image:
    radial-gradient(120% 92% at 84% -14%, rgba(198, 229, 249, 0.2) 0%, rgba(198, 229, 249, 0) 52%),
    radial-gradient(95% 78% at 8% 110%, rgba(74, 126, 178, 0.13) 0%, rgba(74, 126, 178, 0) 62%),
    linear-gradient(168deg, #1a232f 0%, #131b24 42%, #0d131a 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 50px -30px rgba(0, 0, 0, 0.9);
}

/* Пиксельное растворение в углу — только декор, без разметки и текста. */
.art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.16) 0 5px, transparent 5px 12px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.16) 0 5px, transparent 5px 12px),
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.07) 0 6px, transparent 6px 25px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.07) 0 6px, transparent 6px 25px);
  -webkit-mask-image: radial-gradient(
    54% 46% at 90% 6%,
    #000 0%,
    rgba(0, 0, 0, 0.6) 42%,
    transparent 76%
  );
  mask-image: radial-gradient(
    54% 46% at 90% 6%,
    #000 0%,
    rgba(0, 0, 0, 0.6) 42%,
    transparent 76%
  );
  mix-blend-mode: screen;
}

/* ---- Типографика: светлые крупные заголовки, мелкие капс-метки ---- */
.drop-title,
.landing-title {
  font-weight: 300;
  letter-spacing: -0.01em;
}

.landing-title {
  letter-spacing: 0.04em;
}

.group-title,
.settings summary,
.quick-label,
.msg .msg-head {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

/* ---- Зона загрузки: стеклянная карточка с тонким пунктиром ---- */
.drop {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background-color: rgba(9, 12, 16, 0.32);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
}

.drop:hover,
.drop.over {
  border-color: rgba(198, 229, 249, 0.42);
  background-color: rgba(12, 18, 24, 0.42);
}

/* ---- Кнопки ---- */
.cta {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.cta:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.cta.ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.82);
}

.cta.ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

/* Главное действие — светлая плитка, как акцентные карточки в референсе. */
.cta.accent {
  background: linear-gradient(150deg, #f2f8fc 0%, #cfe3f3 55%, #a9c8e2 100%);
  border-color: transparent;
  color: #0a0e12;
  font-weight: 600;
  box-shadow: 0 10px 26px -14px rgba(190, 224, 245, 0.7);
}

.cta.accent:hover {
  background: linear-gradient(150deg, #ffffff 0%, #dcebf7 55%, #b7d3e8 100%);
  box-shadow: 0 14px 32px -14px rgba(200, 230, 250, 0.85);
}

/* ---- Плашки-команды ---- */
.chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.86);
  letter-spacing: 0.01em;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.chip.quick {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
}

.chip.quick:hover {
  background: linear-gradient(150deg, #f4f9fd 0%, #d3e5f4 100%);
  border-color: transparent;
  color: #0a0e12;
}

.chip.active {
  background: linear-gradient(150deg, #f4f9fd 0%, #d3e5f4 100%);
  color: #0a0e12;
  border-color: transparent;
  font-weight: 600;
}

/* ---- Сообщения чата ---- */
.msg {
  border-radius: 14px;
  box-shadow: none;
}

.msg.assistant {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding-left: 14px;
}

.msg.user {
  background-image: linear-gradient(168deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.msg.assistant p {
  color: rgba(255, 255, 255, 0.86);
}

/* ---- Настройки ---- */
.settings {
  border-radius: 16px;
  padding: 0 14px;
}

.settings-body {
  padding: 2px 0 14px;
}

/* ---- Карточки шрифта: активная — светлая плитка ---- */
.font-choice {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.font-choice:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.font-choice.active {
  border-color: transparent;
  background-image: linear-gradient(150deg, #f4f9fd 0%, #d9e8f5 100%);
  color: #0a0e12;
  box-shadow: 0 10px 26px -18px rgba(200, 230, 250, 0.8);
}

/* ---- Футтер ---- */
.app-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0a0a0b;
  gap: 10px;
}

.footer-brand {
  font-weight: 500;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.62);
}

.footer-sep {
  color: rgba(255, 255, 255, 0.28);
}

.footer-link {
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

.footer-link:hover {
  color: #fff;
}

/* ---- Лендинг ---- */
.landing {
  background:
    radial-gradient(70% 60% at 78% -10%, rgba(198, 229, 249, 0.16) 0%, transparent 58%),
    #0a0a0b;
}

.landing::before {
  opacity: 0.55;
  background:
    radial-gradient(42% 42% at 32% 32%, rgba(150, 200, 235, 0.26), transparent 72%),
    radial-gradient(36% 36% at 70% 62%, rgba(90, 140, 195, 0.2), transparent 72%);
}

.landing::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.14) 0 5px, transparent 5px 13px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.14) 0 5px, transparent 5px 13px);
  -webkit-mask-image: radial-gradient(46% 40% at 84% 12%, #000 0%, transparent 74%);
  mask-image: radial-gradient(46% 40% at 84% 12%, #000 0%, transparent 74%);
  mix-blend-mode: screen;
}

.landing-sub {
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
}

/* ---- Уточнение: глубже блик на поверхностях, мягкое свечение в чате ---- */
.art,
.settings,
.drop,
.progress,
.side-panel,
.font-choice,
.msg.assistant {
  background-image:
    radial-gradient(115% 88% at 82% -16%, rgba(214, 238, 253, 0.26) 0%, rgba(214, 238, 253, 0) 54%),
    radial-gradient(95% 76% at 6% 112%, rgba(74, 126, 178, 0.16) 0%, rgba(74, 126, 178, 0) 64%),
    linear-gradient(168deg, #1c2632 0%, #141c26 44%, #0d141b 100%);
}

/* Чат: глубина без рамки — только мягкий свет сверху. */
.chat {
  background-image:
    radial-gradient(78% 54% at 104% -14%, rgba(186, 220, 244, 0.09) 0%, rgba(186, 220, 244, 0) 62%),
    radial-gradient(60% 42% at -10% 108%, rgba(74, 126, 178, 0.07) 0%, rgba(74, 126, 178, 0) 66%);
}

/* Пиксельная россыпь крупнее и мягче — ближе к растворению. */
.art::before {
  background-image:
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.17) 0 7px, transparent 7px 18px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.17) 0 7px, transparent 7px 18px),
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.07) 0 9px, transparent 9px 37px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.07) 0 9px, transparent 9px 37px);
  -webkit-mask-image: radial-gradient(
    48% 42% at 91% 4%,
    #000 0%,
    rgba(0, 0, 0, 0.55) 40%,
    transparent 74%
  );
  mask-image: radial-gradient(
    48% 42% at 91% 4%,
    #000 0%,
    rgba(0, 0, 0, 0.55) 40%,
    transparent 74%
  );
}

/* Лендинг: россыпь тоже крупнее. */
.landing::after {
  background-image:
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.15) 0 7px, transparent 7px 17px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.15) 0 7px, transparent 7px 17px),
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.07) 0 9px, transparent 9px 35px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.07) 0 9px, transparent 9px 35px);
  -webkit-mask-image: radial-gradient(48% 44% at 88% 10%, #000 0%, rgba(0, 0, 0, 0.5) 44%, transparent 76%);
  mask-image: radial-gradient(48% 44% at 88% 10%, #000 0%, rgba(0, 0, 0, 0.5) 44%, transparent 76%);
}

/* ---- Финальная доводка: диагональный свет как в референсе ---- */
.art,
.settings,
.drop,
.progress,
.side-panel,
.font-choice,
.msg.assistant {
  background-image:
    radial-gradient(118% 92% at 86% -18%, rgba(222, 242, 255, 0.28) 0%, rgba(222, 242, 255, 0) 56%),
    radial-gradient(100% 80% at 4% 114%, rgba(64, 112, 162, 0.14) 0%, rgba(64, 112, 162, 0) 66%),
    linear-gradient(152deg, #25323f 0%, #18222d 38%, #0e151c 72%, #0a1015 100%);
}

/* Россыпь мягче: блоки ниже контрастом, растворение плавнее. */
.art::before {
  background-image:
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.13) 0 7px, transparent 7px 18px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.13) 0 7px, transparent 7px 18px),
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.05) 0 9px, transparent 9px 37px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.05) 0 9px, transparent 9px 37px);
  -webkit-mask-image: radial-gradient(52% 46% at 92% 2%, #000 0%, rgba(0, 0, 0, 0.45) 38%, transparent 78%);
  mask-image: radial-gradient(52% 46% at 92% 2%, #000 0%, rgba(0, 0, 0, 0.45) 38%, transparent 78%);
}

.landing::after {
  background-image:
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.11) 0 7px, transparent 7px 17px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.11) 0 7px, transparent 7px 17px),
    repeating-linear-gradient(0deg, rgba(206, 233, 251, 0.05) 0 9px, transparent 9px 35px),
    repeating-linear-gradient(90deg, rgba(206, 233, 251, 0.05) 0 9px, transparent 9px 35px);
  -webkit-mask-image: radial-gradient(50% 46% at 90% 8%, #000 0%, rgba(0, 0, 0, 0.4) 42%, transparent 78%);
  mask-image: radial-gradient(50% 46% at 90% 8%, #000 0%, rgba(0, 0, 0, 0.4) 42%, transparent 78%);
}

/* Чат: чуть больше света, чтобы не читался пустотой. */
.chat {
  background-image:
    radial-gradient(80% 56% at 106% -16%, rgba(198, 228, 250, 0.11) 0%, rgba(198, 228, 250, 0) 64%),
    radial-gradient(62% 44% at -12% 110%, rgba(74, 126, 178, 0.08) 0%, rgba(74, 126, 178, 0) 68%);
}

/* ---- Фон редактора: глубокий сине-графитовый, не чёрный ---- */
body,
.stage,
.shell {
  background-color: #141b24;
}

body {
  background-image: linear-gradient(168deg, #18202a 0%, #141b24 46%, #10161e 100%);
}

.stage,
.shell {
  background-image: linear-gradient(168deg, #18202a 0%, #141b24 46%, #10161e 100%);
}

.app-footer {
  background: #121922;
}

/* Лендинг — тот же не-чёрный тон. */
.landing {
  background:
    radial-gradient(72% 62% at 78% -10%, rgba(198, 229, 249, 0.16) 0%, transparent 58%),
    linear-gradient(168deg, #18202a 0%, #141b24 46%, #10161e 100%);
}

/* ==========================================================================
   Три разные страницы:
   1) лендинг — тёмный редакционный холст с пиксельной россыпью;
   2) редактор — синяя «презентация» с карточками и белой плиткой метрик;
   3) технологии — светлая страница (см. opensource.html).
   ========================================================================== */

/* ---------- 1. Лендинг: почти чёрный, только россыпь и блик ---------- */
.landing {
  background:
    radial-gradient(64% 52% at 82% -12%, rgba(198, 229, 249, 0.13) 0%, transparent 58%),
    linear-gradient(170deg, #0b1016 0%, #080c11 52%, #06090d 100%);
}

.landing::before {
  opacity: 0.5;
}

/* ---------- 2. Редактор: синий холст с тонкими окружностями ---------- */
body,
.stage,
.shell {
  background-color: #102a3c;
}

body,
.stage,
.shell {
  background-image:
    radial-gradient(1200px 820px at 82% -12%, rgba(96, 168, 214, 0.3) 0%, transparent 62%),
    radial-gradient(920px 720px at -6% 112%, rgba(42, 104, 150, 0.24) 0%, transparent 66%),
    linear-gradient(170deg, #16374f 0%, #112b3e 46%, #0b1e2b 100%);
}

/* Крупные тонкие окружности — декор фона. */
.stage::before,
.stage::after {
  content: '';
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  border: 1px solid rgba(186, 224, 250, 0.09);
  pointer-events: none;
}

.stage::before {
  width: 64vw;
  height: 64vw;
  left: -22vw;
  top: -30vw;
}

.stage::after {
  width: 48vw;
  height: 48vw;
  right: -16vw;
  bottom: -22vw;
  border-color: rgba(186, 224, 250, 0.07);
}

.shell {
  position: relative;
  z-index: 1;
}

/* Карточки редактора — тёмно-синие с холодным бликом. */
.art,
.settings,
.drop,
.progress,
.side-panel,
.font-choice,
.msg.assistant {
  background-image:
    radial-gradient(118% 92% at 86% -18%, rgba(178, 220, 248, 0.18) 0%, rgba(178, 220, 248, 0) 56%),
    radial-gradient(100% 80% at 2% 116%, rgba(40, 96, 142, 0.2) 0%, rgba(40, 96, 142, 0) 66%),
    linear-gradient(158deg, #1a3748 0%, #122a39 40%, #0a1b26 74%, #081520 100%);
  border: 1px solid rgba(170, 214, 245, 0.12);
  border-radius: 18px;
}

.chat {
  background-image:
    radial-gradient(80% 56% at 106% -16%, rgba(178, 220, 248, 0.12) 0%, rgba(178, 220, 248, 0) 64%),
    radial-gradient(62% 44% at -12% 110%, rgba(40, 96, 142, 0.14) 0%, rgba(40, 96, 142, 0) 68%);
}

/* Белая плитка метрик — контрастная карточка, как в референсе. */
.glass {
  background: linear-gradient(160deg, #ffffff 0%, #e9f2f9 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  color: #0b1a24;
  box-shadow: 0 22px 46px -30px rgba(0, 0, 0, 0.9);
}

.glass .stats dt {
  color: rgba(11, 26, 36, 0.52);
}

.glass .stats dd {
  color: #0b1a24;
}

.glass .cta {
  background: rgba(11, 26, 36, 0.05);
  border: 1px solid rgba(11, 26, 36, 0.2);
  color: #0b1a24;
}

.glass .cta:hover {
  background: rgba(11, 26, 36, 0.11);
  border-color: rgba(11, 26, 36, 0.34);
}

/* Плашка «ВЕКТА» в чате. */
.brand {
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.26em;
  font-size: 10px;
}

/* Футер под синий холст. */
.app-footer {
  background: #0b1e2b;
  border-top: 1px solid rgba(170, 214, 245, 0.1);
}

.footer-link {
  color: rgba(196, 228, 250, 0.62);
}

.footer-link:hover {
  color: #fff;
}

/* Скрепка и поле ввода. */
.chat-form .attach {
  padding: 0;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
}

.chat-form .attach:hover {
  color: #fff;
}

.messages.over {
  outline: 1px dashed rgba(186, 224, 250, 0.5);
  outline-offset: -6px;
  border-radius: 14px;
}

.attach-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attach-line::before {
  content: '📎';
  font-size: 12px;
  opacity: 0.8;
}

/* ==========================================================================
   Apple-minimal. Никаких цветных градиентов, свечений и пикселей:
   только чистые поверхности, волосяные линии, точная типографика
   и один акцент — чёрный/белый.
   ========================================================================== */

:root {
  --page: #ffffff;
  --shell: #131315;
  --panel: #1c1c1e;
  --panel-2: #242426;
  --ink: #f5f5f7;
  --muted: #86868b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #f5f5f7;
  --on-accent: #131315;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ring: 0 0 0 3px rgba(245, 245, 247, 0.22);
}

/* --- декоративный слой убираем полностью --- */
.art::before,
.stage::before,
.stage::after,
.landing::before,
.landing::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

/* --- редактор: нейтральный графит, без цветных заливок --- */
body,
.stage,
.shell {
  background-color: #131315;
  background-image: none;
}

.art,
.settings,
.drop,
.progress,
.side-panel,
.font-choice,
.msg.assistant {
  background-color: #1c1c1e;
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  box-shadow: none;
}

.chat {
  background-image: none;
}

.chat-head .brand,
.brand {
  color: #86868b;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

/* --- сообщения --- */
.msg {
  box-shadow: none;
}

.msg.assistant {
  background-color: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
}

.msg.user {
  background-color: #2c2c2e;
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}

.msg.assistant p {
  color: #f5f5f7;
}

/* --- кнопки: монохром --- */
.cta {
  border-radius: 980px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
}

.cta:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.cta.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
  color: #d2d2d7;
}

.cta.ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.cta.accent {
  background: #f5f5f7;
  border-color: transparent;
  color: #131315;
  font-weight: 600;
  box-shadow: none;
}

.cta.accent:hover {
  background: #ffffff;
  box-shadow: none;
}

/* --- чипы --- */
.chip {
  border-radius: 980px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #d2d2d7;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.chip.quick,
.chip.quick:hover {
  background: transparent;
  color: #d2d2d7;
  border-color: rgba(255, 255, 255, 0.12);
}

.chip.quick:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.chip.active {
  background: #f5f5f7;
  border-color: transparent;
  color: #131315;
  font-weight: 600;
}

/* --- метрики: светлая карточка без градиента --- */
.glass {
  background: #f5f5f7;
  background-image: none;
  border: none;
  border-radius: 14px;
  color: #1d1d1f;
  box-shadow: none;
}

.glass .stats dt {
  color: rgba(29, 29, 31, 0.5);
  letter-spacing: 0.06em;
}

.glass .stats dd {
  color: #1d1d1f;
}

.glass .cta {
  background: transparent;
  border: 1px solid rgba(29, 29, 31, 0.18);
  color: #1d1d1f;
}

.glass .cta:hover {
  background: rgba(29, 29, 31, 0.06);
  border-color: rgba(29, 29, 31, 0.32);
}

/* --- микроподписи --- */
.group-title,
.settings summary,
.quick-label,
.msg .msg-head {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #86868b;
}

/* --- футер --- */
.app-footer {
  background: #131315;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  gap: 10px;
}

.footer-brand {
  color: #d2d2d7;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.footer-sep {
  color: #6e6e73;
}

.footer-year {
  color: #6e6e73;
}

.footer-link {
  color: #86868b;
}

.footer-link:hover {
  color: #f5f5f7;
}

/* --- зона загрузки --- */
.drop {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: #1c1c1e;
  border-radius: 16px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.drop:hover,
.drop.over {
  border-color: rgba(255, 255, 255, 0.34);
  background: #202022;
}

/* ==========================================================================
   Лендинг: светлый, чистый, как страница продукта
   ========================================================================== */
.landing {
  background: #ffffff;
  background-image: radial-gradient(120% 70% at 50% -20%, #f5f5f7 0%, #ffffff 62%);
  color: #1d1d1f;
}

.landing-title {
  color: #1d1d1f;
  font-weight: 600;
  font-size: clamp(52px, 8vw, 104px);
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0;
}

.landing-sub {
  color: #6e6e73;
  font-size: clamp(15px, 1.4vw, 19px);
  letter-spacing: 0;
  margin: 18px 0 0;
  max-width: 42ch;
}

.landing .cta.big {
  margin-top: 34px;
  background: #1d1d1f;
  color: #ffffff;
  border: none;
  border-radius: 980px;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  box-shadow: none;
}

.landing .cta.big:hover {
  background: #000000;
  transform: none;
  box-shadow: none;
}

/* Анимация входа — едва заметная, без мигания. */
@keyframes quiet-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-title {
  animation: quiet-in 0.5s ease both;
}

.landing-sub {
  animation: quiet-in 0.5s ease 0.06s both;
}

.landing .cta.big {
  animation: quiet-in 0.5s ease 0.12s both;
}

/* --- Светлые страницы: не белые, а мягкий серый градиент --- */
.landing {
  background-color: #ececf0;
  background-image:
    radial-gradient(120% 80% at 50% -24%, #fafafc 0%, rgba(250, 250, 252, 0) 58%),
    linear-gradient(180deg, #f4f4f7 0%, #ebebef 46%, #e2e2e8 100%);
  color: #1d1d1f;
}

.landing-title {
  color: #1d1d1f;
}

.landing-sub {
  color: #6e6e73;
}

/* ==========================================================================
   Лендинг «живее»: рисующиеся векторные линии, свет за курсором,
   буквы вордмарка пружинят при наведении. Всё монохромное.
   ========================================================================== */

.landing {
  position: fixed;
  --mx: 50%;
  --my: 42%;
}

.landing-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    360px 360px at var(--mx) var(--my),
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0) 72%
  );
  transition: background 120ms linear;
}

.landing-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: art-drift 18s ease-in-out infinite alternate;
}

.landing-art svg {
  width: min(74vw, 700px);
  height: auto;
  overflow: visible;
}

.draw {
  stroke: #b9b9c0;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
  animation: draw-line 2.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.d1 {
  --len: 780;
  animation-delay: 0.1s;
  opacity: 0.85;
}

.d2 {
  --len: 760;
  animation-delay: 0.28s;
  opacity: 0.7;
}

.d3 {
  --len: 1060;
  animation-delay: 0.46s;
  opacity: 0.55;
}

.d4 {
  --len: 320;
  animation-delay: 0.62s;
  opacity: 0.45;
}

.d5 {
  --len: 100;
  animation-delay: 0.74s;
  opacity: 0.35;
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes art-drift {
  from {
    transform: translate3d(-8px, 4px, 0) rotate(-0.5deg);
  }
  to {
    transform: translate3d(8px, -4px, 0) rotate(0.5deg);
  }
}

/* Вордмарк: буквы по очереди подпрыгивают. */
.landing-title {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.02em;
}

.landing-title span {
  display: inline-block;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.landing-title:hover span {
  transform: translateY(-10px);
}

.landing-title:hover span:nth-child(2) {
  transform: translateY(-14px);
  transition-delay: 30ms;
}

.landing-title:hover span:nth-child(3) {
  transform: translateY(-8px);
  transition-delay: 60ms;
}

.landing-title:hover span:nth-child(4) {
  transform: translateY(-12px);
  transition-delay: 90ms;
}

.landing-title:hover span:nth-child(5) {
  transform: translateY(-6px);
  transition-delay: 120ms;
}

.landing-sub,
.landing .cta.big {
  position: relative;
  z-index: 1;
}

/* Линии не лезут в текст: центр мягко вырезан маской. */
.landing-art {
  -webkit-mask-image: radial-gradient(closest-side at 50% 50%, transparent 30%, #000 68%);
  mask-image: radial-gradient(closest-side at 50% 50%, transparent 30%, #000 68%);
}

.landing-glow {
  background: radial-gradient(
    340px 340px at var(--mx) var(--my),
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 255, 255, 0) 72%
  );
}

.landing-title {
  gap: 0.005em;
}

/* --- Стартовый фон: многослойный градиент с прохладным подтоном --- */
.landing {
  background-color: #e8ebf1;
  background-image:
    radial-gradient(130% 96% at 16% -12%, #fbfcfe 0%, rgba(251, 252, 254, 0) 54%),
    radial-gradient(92% 74% at 88% 4%, #e4eef6 0%, rgba(228, 238, 246, 0) 58%),
    radial-gradient(86% 66% at 50% 112%, #d9dee7 0%, rgba(217, 222, 231, 0) 62%),
    linear-gradient(178deg, #f3f5f9 0%, #e9ecf2 46%, #dee2ea 100%);
  background-size: 100% 100%, 120% 120%, 120% 120%, 100% 100%;
  background-repeat: no-repeat;
  animation: landing-shift 22s ease-in-out infinite alternate;
}

@keyframes landing-shift {
  from {
    background-position: 0% 0%, 100% 0%, 50% 100%, 0 0;
  }
  to {
    background-position: 10% 6%, 88% 8%, 44% 92%, 0 0;
  }
}

/* Линии чуть контрастнее на новом фоне. */
.draw {
  stroke: #a9aeb8;
}

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

/* --- Оверлей страницы «Технологии»: редактор остаётся под ним --- */
.page-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(19, 19, 21, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  animation: overlay-in 180ms ease both;
}

.page-overlay.hidden {
  display: none;
}

.page-overlay iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f4f4f7;
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== Первое сообщение ВЕКТЫ «приходит» ===== */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 14px;
}

.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #86868b;
  animation: typing-dot 1.05s ease-in-out infinite;
}

.typing i:nth-child(2) {
  animation-delay: 0.14s;
}

.typing i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes typing-dot {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  35% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.msg.typing-bubble {
  padding: 14px 16px;
}

@keyframes msg-arrive {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    filter: blur(3px);
  }
  55% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.msg.arrive {
  animation: msg-arrive 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Ссылка на скачивание шрифта в подписи о подборе. */
.font-download {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.font-download:hover {
  opacity: 0.75;
}

/* ===== «ВЕКТА думает»: живые сигналы вместо ощущения зависания ===== */

/* Точка в шапке дышит, пока идёт обработка. */
body.busy .brand i {
  animation: brand-pulse 1.4s ease-in-out infinite;
}

@keyframes brand-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(126, 224, 192, 0.45);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.82);
    box-shadow: 0 0 0 6px rgba(126, 224, 192, 0);
  }
}

/* Полоска прогресса бежит, даже когда процент ещё неизвестен. */
body.busy .bar i {
  min-width: 18%;
  background-image:
    linear-gradient(90deg, #7ee0c0, #8fc7ff),
    linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  background-size:
    100% 100%,
    42% 100%;
  background-repeat: no-repeat;
  background-position:
    0 0,
    -42% 0;
  animation: bar-sweep 1.5s linear infinite;
}

@keyframes bar-sweep {
  from {
    background-position:
      0 0,
      -42% 0;
  }
  to {
    background-position:
      0 0,
      120% 0;
  }
}

/* Пузырь «думаю»: точки и счётчик секунд — видно, что процесс живой. */
.thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.thinking-bubble .thinking-timer {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  body.busy .brand i,
  body.busy .bar i {
    animation: none;
  }
}

/* ===== Панель алгоритмов: сравнение портфеля ===== */
.algo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 46vh;
  overflow: auto;
}

.algo-row {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.algo-row.picked {
  border-color: rgba(126, 224, 192, 0.55);
  background: rgba(126, 224, 192, 0.08);
}

.algo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.algo-head b {
  font-size: 13px;
  font-weight: 600;
}

.algo-engine {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.algo-metrics {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
}

.algo-why {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
}

.algo-row .cta {
  align-self: flex-start;
  margin-top: 4px;
}

/* Главные настройки выбранного алгоритма в панели настроек. */
.algo-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.algo-settings .slider small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
}

/* Данные файла спрятаны: по умолчанию видна только кнопка скачивания. */
.stats-details {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-top: 4px;
}

.stats-details > summary {
  cursor: pointer;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  list-style: none;
}

.stats-details > summary::-webkit-details-marker {
  display: none;
}

.stats-details > summary::before {
  content: '▸ ';
  opacity: 0.6;
}

.stats-details[open] > summary::before {
  content: '▾ ';
}

.stats-details .stats {
  margin-top: 10px;
}

/* Панорамирование: курсор подсказывает, что картинку можно тащить. */
.canvas {
  cursor: grab;
}

.canvas.panning {
  cursor: grabbing;
}

.canvas.panning img,
.canvas.panning svg {
  transition: none;
}

/* ---------- мобильная версия ---------- */
@media (max-width: 700px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .stage {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .viewer {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 8px;
    gap: 6px;
  }

  .actionbar {
    flex: 0 0 auto;
    min-height: 20px;
  }

  /* Настройки — компактная строка сверху. По умолчанию закрыты. */
  .viewer .settings {
    order: 1;
    flex: 0 0 auto;
    margin: 0;
    border-radius: 12px;
  }

  .viewer .settings summary {
    padding: 9px 12px;
    font-size: 10px;
  }

  .viewer .settings .settings-body {
    max-height: 34dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 12px 12px;
  }

  .viewer .art {
    order: 2;
    flex: 1 1 auto;
    min-height: 0;
  }

  .result {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 7px;
    gap: 5px;
  }

  /* Все функции — аккуратной сеткой 4×2 сверху. */
  .toolbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 0;
    overflow: visible;
  }

  .toolbar-gap {
    display: none;
  }

  .toolbar .tool {
    min-width: 0;
    min-height: 33px;
    padding: 6px 3px;
    border-radius: 9px;
    font-size: 10px;
    white-space: nowrap;
  }

  .toolbar .tool.icon {
    min-height: 33px;
  }

  #zoom-value {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
  }

  /* Только вектор, крупно и по центру. */
  .previews {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
  }

  .previews figure:first-child {
    display: none;
  }

  .previews figcaption {
    display: none;
  }

  .previews .canvas {
    border-radius: 11px;
  }

  .glass {
    display: none;
  }

  /* Панели поверх, чтобы не ломать вертикаль. */
  .side-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 86px;
    bottom: auto;
    width: auto;
    max-height: 44dvh;
    z-index: 30;
  }

  .drop {
    width: min(100%, 320px);
    padding: 18px 14px;
  }

  .drop-title {
    font-size: 17px;
  }

  .drop-sub {
    font-size: 12px;
  }

  /* Чат прибит к низу; крутится только лента сообщений. */
  .chat {
    flex: 0 0 36dvh;
    width: 100%;
    height: 36dvh;
    min-height: 0;
    padding: 7px 9px calc(7px + env(safe-area-inset-bottom));
    gap: 5px;
    overflow: hidden;
    border-top: 1px solid var(--line);
  }

  .chat-head {
    display: none;
  }

  .messages {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    max-height: none;
    padding: 2px 0;
    justify-content: flex-end;
  }

  .msg {
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
  }

  .chat-composer {
    flex: 0 0 auto;
    gap: 5px;
    padding-top: 5px;
  }

  .quick-row {
    display: block;
    margin: 0;
  }

  .quick-label {
    display: none;
  }

  .quick-row .pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
  }

  .chip.quick {
    width: 100%;
    min-height: 27px;
    padding: 5px 3px;
    border-radius: 8px;
    font-size: 9px;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-form {
    gap: 5px;
  }

  .chat-form input {
    font-size: 16px;
    padding: 8px 12px;
  }

  .chat-form .cta.send {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .attach {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .app-footer {
    display: none;
  }

  /* Стартовый экран */
  #landing:not(.hidden) ~ .stage {
    display: none;
  }

  .landing {
    min-height: 100dvh;
    padding: 20px 16px;
    gap: 13px;
    overflow: hidden;
  }

  .landing::before {
    content: '';
    position: absolute;
    inset: -20%;
    z-index: -1;
    background:
      radial-gradient(240px 240px at 18% 22%, rgba(126, 224, 192, 0.18), transparent 70%),
      radial-gradient(260px 260px at 84% 72%, rgba(143, 199, 255, 0.14), transparent 72%);
    animation: landing-drift 9s ease-in-out infinite alternate;
  }

  @keyframes landing-drift {
    from { transform: translate3d(-2%, -1%, 0) scale(1); }
    to { transform: translate3d(2%, 2%, 0) scale(1.08); }
  }

  .landing-kicker {
    font-size: 9px;
  }

  .landing-title {
    font-size: clamp(42px, 14vw, 58px);
  }

  .landing-sub {
    max-width: 300px;
    font-size: 13px;
    line-height: 1.45;
  }

  .landing-feats {
    gap: 5px;
    max-width: 320px;
  }

  .landing-feats span {
    padding: 5px 9px;
    font-size: 10px;
  }

  .landing-note {
    font-size: 9px;
  }

  .cta.big {
    padding: 12px 24px;
    font-size: 14px;
  }
}

/* Общие элементы мобильных панелей: на десктопе скрыты. */
.panel-backdrop,
.panel-close {
  display: none;
}

@media (max-width: 700px) {
  /* Затемнение и крупная кнопка закрытия — панель больше не «запирает» экран. */
  .panel-backdrop:not(.hidden) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(5, 7, 10, 0.62);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  .panel-close:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 76px;
    right: 14px;
    z-index: 70;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(18, 20, 24, 0.94);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  .side-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 68px;
    bottom: 8px;
    width: auto;
    max-height: none;
    z-index: 60;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 48px 14px 18px;
    border-radius: 18px;
    background: #17191d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  }

  .side-panel h3,
  .side-panel .panel-title {
    margin-top: 0;
    padding-right: 42px;
  }

  .settings summary {
    cursor: pointer;
    user-select: none;
  }
}

@media (max-width: 700px) {
  /* «Готово» больше не занимает верхнюю строку. */
  .actionbar {
    display: none;
  }

  /* Все кнопки панели — строго равные ячейки, без разъезжающихся «−» и «+». */
  .toolbar > * {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .toolbar .tool,
  .toolbar .tool.icon,
  #zoom-value {
    width: 100%;
    min-width: 0;
  }

  /* Панели точно по ширине экрана. */
  .side-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
    overflow-x: hidden;
    margin: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .side-panel .algo-list {
    max-height: none;
    overflow: visible;
    gap: 6px;
  }

  .side-panel .algo-row {
    padding: 8px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 2px 8px;
  }

  .side-panel .algo-head {
    grid-column: 1;
    display: block;
  }

  .side-panel .algo-head b {
    font-size: 12.5px;
  }

  .side-panel .algo-why {
    grid-column: 1;
    font-size: 10px;
    line-height: 1.3;
  }

  .side-panel .algo-row .cta {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    margin: 0;
    padding: 6px 10px;
    font-size: 10.5px;
    white-space: nowrap;
  }

  /* Команды чуть крупнее, но всё ещё компактные. */
  .chip.quick {
    min-height: 29px;
    font-size: 10.5px;
    padding: 6px 3px;
  }
}

@media (max-width: 700px) {
  /* Панель по высоте содержимого: без пустого «полотна» на весь экран. */
  .side-panel {
    bottom: auto;
    max-height: calc(100dvh - 76px);
  }
}
