/* ============ Токены и сброс ============ */
:root {
  --bg: #05070f;
  --bg-soft: #0a0e1b;
  --panel: rgba(15, 21, 38, 0.72);
  --panel-solid: #0b1020;
  --stroke: rgba(150, 165, 210, 0.14);
  --stroke-strong: rgba(150, 165, 210, 0.26);
  --text: #eef1fb;
  --muted: #98a2bd;
  --dim: #6c7793;
  --accent: #7c6bff;
  --accent-2: #48d6ff;
  --mint: #5eead4;
  --lime: #b6f36b;
  --warn: #ffb86b;
  --danger: #ff7a7a;
  --grad: linear-gradient(115deg, #a99bff 0%, #6cb8ff 48%, #5eead4 100%);
  --grad-btn: linear-gradient(135deg, #8b7bff 0%, #5aa8ff 55%, #4fd6e8 100%);
  --radius: 20px;
  --font: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(140, 160, 220, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 160, 220, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 75%);
}

body.no-scroll {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1, h2, h3, p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

::selection {
  background: rgba(124, 107, 255, 0.4);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}

.bg-orbs span:nth-child(1) {
  width: 560px;
  height: 560px;
  top: -220px;
  left: 8%;
  background: radial-gradient(circle, rgba(104, 86, 255, 0.5), transparent 65%);
  animation: drift 22s ease-in-out infinite alternate;
}

.bg-orbs span:nth-child(2) {
  width: 480px;
  height: 480px;
  top: -140px;
  right: 2%;
  background: radial-gradient(circle, rgba(55, 190, 255, 0.32), transparent 65%);
  animation: drift 26s ease-in-out infinite alternate-reverse;
}

.bg-orbs span:nth-child(3) {
  width: 520px;
  height: 520px;
  top: 46vh;
  left: 38%;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.12), transparent 65%);
  animation: drift 30s ease-in-out infinite alternate;
}

/* ============ Шапка ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(150, 165, 210, 0.1);
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #0a0714;
  background: var(--grad-btn);
  box-shadow: 0 8px 24px -10px rgba(124, 107, 255, 0.9);
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-name span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  gap: 24px;
  font-size: 13.5px;
  color: var(--muted);
}

.nav a {
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 11.5px;
  font-weight: 600;
  color: #a9f0c4;
  background: rgba(70, 220, 140, 0.08);
  border: 1px solid rgba(70, 220, 140, 0.22);
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55);
  animation: pulse 2.2s infinite;
}

.status-pill.offline {
  color: #ffd29a;
  background: rgba(255, 170, 60, 0.08);
  border-color: rgba(255, 170, 60, 0.25);
}

.status-pill.offline i {
  background: #ffb44d;
  animation: none;
}

/* ============ Кнопки ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

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

.btn-ghost {
  color: #cbd3e8;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--stroke-strong);
}

.btn-primary {
  color: #070a14;
  background: var(--grad-btn);
  box-shadow: 0 12px 30px -16px rgba(124, 107, 255, 0.9);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px -16px rgba(124, 107, 255, 1);
}

.btn-chat {
  padding: 9px 14px;
}

.btn-ai {
  flex: 0 0 auto;
  padding: 13px 19px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 800;
  color: #08060f;
  background: var(--grad-btn);
  box-shadow: 0 14px 34px -16px rgba(124, 107, 255, 0.95);
  position: relative;
  overflow: hidden;
}

.btn-ai::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.6s;
}

.btn-ai:hover::after {
  transform: translateX(120%);
}

.btn-ai:hover {
  transform: translateY(-1px);
}

.btn-ai:disabled {
  opacity: 0.75;
  cursor: progress;
  transform: none;
}

.btn-ai.is-loading svg {
  animation: spin 1.4s linear infinite;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: 0.18s;
}

.icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--stroke);
}

.link-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px dashed rgba(150, 165, 210, 0.3);
  padding: 0 0 1px;
  transition: color 0.2s;
}

.link-btn:hover {
  color: var(--accent-2);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 66px 24px 22px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c6cdf0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(8px);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 12px 2px rgba(94, 234, 212, 0.65);
}

h1 {
  margin: 22px 0 0;
  font-size: clamp(34px, 5.4vw, 62px);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.035em;
}

h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  padding-bottom: 0.08em;
}

.hero-lead {
  max-width: 640px;
  margin: 20px auto 0;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 880px;
  margin: 32px auto 0;
  padding: 9px 9px 9px 15px;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.searchbar:focus-within {
  border-color: rgba(124, 107, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(124, 107, 255, 0.13), 0 30px 70px -40px rgba(80, 60, 255, 0.8);
}

.searchbar-icon {
  flex: 0 0 auto;
  color: var(--dim);
}

.searchbar input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 2px;
  font-size: 15px;
  font-weight: 500;
  background: none;
  border: 0;
  outline: none;
}

.searchbar input::placeholder {
  color: #6f7a97;
}

.searchbar input::-webkit-search-cancel-button {
  display: none;
}

.searchbar-clear {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  transition: 0.2s;
}

.searchbar-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.chips-label {
  font-size: 11.5px;
  color: var(--dim);
  margin-right: 2px;
}

.chip {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #b9c3de;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  transition: 0.18s;
}

.chip:hover {
  color: #fff;
  border-color: rgba(124, 107, 255, 0.55);
  background: rgba(124, 107, 255, 0.12);
  transform: translateY(-1px);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  font-size: 12px;
  color: var(--dim);
}

.web-hint-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  border-bottom: 1px dashed rgba(72, 214, 255, 0.35);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.web-hint-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.hero-stats b {
  color: #dfe5f6;
  font-weight: 700;
}

.stat-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(150, 165, 210, 0.35);
}

/* ============ Панель агента ============ */
.agent-shell {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 34px auto 0;
  padding: 0 24px;
}

.agent-panel {
  padding: 1px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(139, 123, 255, 0.85), rgba(90, 168, 255, 0.35) 45%, rgba(94, 234, 212, 0.55));
  box-shadow: 0 40px 90px -60px rgba(124, 107, 255, 0.9);
  animation: panelIn 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.agent-inner {
  border-radius: 23px;
  padding: 22px 24px 20px;
  background: linear-gradient(180deg, #0b1020 0%, #080b16 100%);
}

.agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.agent-ident {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.orb {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #b7aaff, #6a55f2 42%, #1b1b45 78%);
  box-shadow: 0 0 26px -4px rgba(124, 107, 255, 0.85), inset 0 0 14px rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
}

.orb::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, rgba(94, 234, 212, 0.9) 72%, transparent 88%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: spin 4.5s linear infinite;
  opacity: 0.85;
}

.orb span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
  filter: blur(1px);
  animation: orbPulse 3s ease-in-out infinite;
}

.orb-sm {
  width: 36px;
  height: 36px;
}

.agent-title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.tag-ai {
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
  padding: 4px 5px;
  border-radius: 5px;
  color: #0a0714;
  background: var(--grad-btn);
}

.agent-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.agent-sub.working {
  color: #cfc7ff;
}

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

.agent-mode {
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 8px;
  border-radius: 6px;
  color: #9de9d8;
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.28);
}

.agent-mode.local {
  color: #ffd29a;
  background: rgba(255, 184, 107, 0.1);
  border-color: rgba(255, 184, 107, 0.3);
}

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
}

.step {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid rgba(150, 165, 210, 0.12);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s, background 0.3s;
  min-width: 0;
}

.step[data-status="running"] {
  border-color: rgba(124, 107, 255, 0.6);
  background: rgba(124, 107, 255, 0.09);
}

.step[data-status="done"] {
  border-color: rgba(94, 234, 212, 0.22);
}

.step-dot {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 10px/1 var(--mono);
  color: var(--dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
}

.step[data-status="running"] .step-dot {
  background: transparent;
  border: 2px solid rgba(124, 107, 255, 0.22);
  border-top-color: #a79bff;
  animation: spin 0.85s linear infinite;
  color: transparent;
}

.step[data-status="done"] .step-dot {
  color: #07110d;
  background: var(--mint);
  border-color: transparent;
}

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

.step-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #dde4f6;
}

.step-detail {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--dim);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.agent-result {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(150, 165, 210, 0.12);
  animation: fadeUp 0.4s ease both;
}

.agent-summary {
  font-size: 15.5px;
  line-height: 1.68;
  color: #dde4f6;
  max-width: 980px;
}

.plan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: #c3cbf0;
  background: rgba(124, 107, 255, 0.1);
  border: 1px solid rgba(124, 107, 255, 0.25);
}

.plan-chip span {
  color: var(--dim);
  font-weight: 500;
}

.picks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 11px;
  margin-top: 16px;
}

.pick {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(124, 107, 255, 0.09), rgba(255, 255, 255, 0.015));
  transition: 0.2s;
  cursor: pointer;
  text-align: left;
}

.pick:hover {
  border-color: rgba(124, 107, 255, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -30px rgba(124, 107, 255, 0.9);
}

.pick-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pick-rank {
  font: 700 9.5px/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #cfc7ff;
  background: rgba(124, 107, 255, 0.16);
  border: 1px solid rgba(124, 107, 255, 0.32);
  padding: 5px 7px;
  border-radius: 6px;
}

.pick-score {
  font: 700 11px/1 var(--mono);
  color: var(--accent-2);
}

.pick-name {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--text);
}

.pick-price {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #e7ecfa;
}

.pick-why {
  display: block;
  font-size: 11.8px;
  line-height: 1.5;
  color: var(--muted);
}

.pick-lists {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}

.pick-li {
  display: flex;
  gap: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: #aab5d1;
}

.pick-li b {
  font-weight: 700;
}

.pick-li.pro b {
  color: #7fe3bd;
}

.pick-li.con b {
  color: #ffb86b;
}

.agent-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.agent-note {
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.5;
}

.agent-note:empty {
  display: none;
}

/* ============ Рабочая область ============ */
.workspace {
  position: relative;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 24px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 30px 24px 70px;
  scroll-margin-top: 84px;
}

.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 24, 44, 0.8), rgba(9, 13, 24, 0.85));
  border: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 165, 210, 0.25) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(150, 165, 210, 0.25);
  border-radius: 10px;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
}

.sidebar-head .link-btn {
  margin-left: auto;
}

.sidebar-close {
  display: none;
}

.sidebar-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.sidebar-title svg {
  color: var(--accent-2);
}

.filter-group {
  padding: 14px 0;
  border-top: 1px solid rgba(150, 165, 210, 0.1);
}

.filter-group h3 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.options-scroll {
  max-height: 186px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 165, 210, 0.2) transparent;
}

.options-scroll::-webkit-scrollbar {
  width: 5px;
}

.options-scroll::-webkit-scrollbar-thumb {
  background: rgba(150, 165, 210, 0.2);
  border-radius: 10px;
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 5px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option .box {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--stroke-strong);
  display: grid;
  place-items: center;
  transition: 0.15s;
}

.option input:checked + .box {
  background: var(--grad-btn);
  border-color: transparent;
}

.option input:checked + .box::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #071018;
  border-bottom: 2px solid #071018;
  transform: rotate(-45deg) translateY(-1px);
}

.option input:checked ~ .option-label {
  color: var(--text);
  font-weight: 600;
}

.option input:focus-visible + .box {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.option-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-count {
  font: 500 10px/1 var(--mono);
  color: var(--dim);
}

.price-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.price-row label {
  flex: 1 1 0;
  min-width: 0;
  display: block;
  padding: 6px 8px 5px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke);
  transition: border-color 0.2s;
}

.price-row label:focus-within {
  border-color: rgba(124, 107, 255, 0.65);
}

.price-row label span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.price-row input {
  width: 100%;
  padding: 2px 0;
  font-size: 12.5px;
  font-weight: 600;
  background: none;
  border: 0;
  outline: none;
  -moz-appearance: textfield;
}

.price-row input::-webkit-outer-spin-button,
.price-row input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.price-row input::placeholder {
  color: #596580;
  font-weight: 500;
}

.dash {
  color: var(--dim);
  padding-bottom: 8px;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.preset {
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  border-radius: 6px;
  border: 1px solid transparent;
  transition: 0.15s;
}

.preset:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.preset.active {
  color: #cfc7ff;
  border-color: rgba(124, 107, 255, 0.45);
  background: rgba(124, 107, 255, 0.12);
}

.seg-row {
  display: flex;
  gap: 5px;
}

.seg {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--stroke);
  transition: 0.15s;
}

.seg:hover {
  color: var(--text);
  border-color: var(--stroke-strong);
}

.seg.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124, 107, 255, 0.32), rgba(72, 214, 255, 0.16));
  border-color: rgba(124, 107, 255, 0.6);
}

.sidebar-foot {
  padding-top: 12px;
  border-top: 1px solid rgba(150, 165, 210, 0.1);
}

.hint {
  display: flex;
  gap: 7px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--dim);
}

.hint svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent-2);
  opacity: 0.75;
}

/* ============ Тулбар и результаты ============ */
.content {
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.results-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.results-info h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.count {
  font-size: 12px;
  color: var(--dim);
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-toggle {
  display: none;
  padding: 9px 12px;
  font-size: 12px;
}

.sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--dim);
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap svg {
  position: absolute;
  right: 9px;
  color: var(--muted);
  pointer-events: none;
}

.sort select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 30px 9px 11px;
  font-size: 12px;
  font-weight: 600;
  color: #d5dcf0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 9px;
  outline: none;
  cursor: pointer;
}

.sort select:focus {
  border-color: rgba(124, 107, 255, 0.6);
}

.sort select option {
  background: #0c1120;
  color: var(--text);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #cfd7ee;
  background: rgba(124, 107, 255, 0.12);
  border: 1px solid rgba(124, 107, 255, 0.28);
  border-radius: 7px;
}

.filter-chip button {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  color: #aeb8d4;
  transition: 0.15s;
}

.filter-chip button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(286px, 1fr));
  gap: 15px;
  align-items: stretch;
}

/* ============ Карточка ============ */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 17px;
  background: linear-gradient(170deg, rgba(23, 30, 52, 0.85), rgba(11, 15, 28, 0.92));
  border: 1px solid var(--stroke);
  overflow: hidden;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
  animation: cardIn 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 150px at 15% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(140, 125, 255, 0.4);
  box-shadow: 0 26px 50px -34px rgba(80, 60, 220, 0.8);
}

.card.is-pick {
  border-color: rgba(124, 107, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(124, 107, 255, 0.12), 0 22px 50px -40px rgba(124, 107, 255, 0.8);
}

.card-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 40px;
}

.brand-tile {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), rgba(10, 14, 26, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 18px -12px var(--accent);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.card-meta {
  min-width: 0;
  flex: 1 1 auto;
  padding-top: 1px;
}

.card-brand {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.card-cat {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffd47e;
  background: rgba(255, 196, 84, 0.08);
  border: 1px solid rgba(255, 196, 84, 0.18);
  white-space: nowrap;
}

.rating svg {
  width: 11px;
  height: 11px;
}

.card-name {
  position: relative;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.015em;
  min-height: 40px;
}

.card-ai {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #d8d2ff;
  background: linear-gradient(90deg, rgba(124, 107, 255, 0.24), rgba(72, 214, 255, 0.1));
  border: 1px solid rgba(124, 107, 255, 0.35);
}

.card-ai svg {
  width: 10px;
  height: 10px;
}

.card-ai span {
  color: var(--accent-2);
}

.specs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.spec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 500;
  color: #b3bdd8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.spec svg {
  width: 11px;
  height: 11px;
  color: var(--dim);
}

.card-why {
  position: relative;
  padding-left: 9px;
  border-left: 2px solid rgba(124, 107, 255, 0.55);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.price {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  white-space: nowrap;
}

.price small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 3px;
}

.btn-card {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #cdd6ee;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  transition: 0.18s;
}

.btn-card:hover {
  color: #fff;
  border-color: rgba(124, 107, 255, 0.55);
  background: rgba(124, 107, 255, 0.14);
}

.btn-card svg {
  width: 12px;
  height: 12px;
}

/* ============ Скелетоны и пустое состояние ============ */
.card.skeleton {
  min-height: 300px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.025) 30%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.025) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s infinite linear;
  border-color: rgba(150, 165, 210, 0.08);
}

.card.skeleton::before {
  display: none;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 64px 24px;
  border-radius: 18px;
  border: 1px dashed rgba(150, 165, 210, 0.2);
  background: rgba(255, 255, 255, 0.015);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--accent-2);
  background: rgba(72, 214, 255, 0.08);
  border: 1px solid rgba(72, 214, 255, 0.2);
  margin-bottom: 14px;
}

.empty h3 {
  font-size: 17px;
  font-weight: 800;
}

.empty p {
  max-width: 380px;
  margin: 7px 0 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* ============ Чат ============ */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(3, 5, 11, 0.6);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease;
}

.chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(430px, 100vw);
  background: linear-gradient(180deg, #0a0f1e, #070a14);
  border-left: 1px solid var(--stroke-strong);
  box-shadow: -30px 0 80px -40px rgba(0, 0, 0, 0.9);
  transform: translateX(103%);
  transition: transform 0.32s cubic-bezier(0.22, 0.7, 0.25, 1);
  visibility: hidden;
}

.chat-drawer.open {
  transform: none;
  visibility: visible;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(150, 165, 210, 0.12);
  background: rgba(255, 255, 255, 0.015);
}

.chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 165, 210, 0.22) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(150, 165, 210, 0.22);
  border-radius: 10px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
  animation: fadeUp 0.25s ease both;
}

.msg.user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg.bot {
  align-self: flex-start;
}

.bubble {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #dfe5f6;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(150, 165, 210, 0.12);
  border-top-left-radius: 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg.user .bubble {
  color: #0a0714;
  font-weight: 600;
  background: var(--grad-btn);
  border: 0;
  border-top-left-radius: 14px;
  border-top-right-radius: 5px;
}

.bubble strong {
  color: #fff;
  font-weight: 800;
}

.msg-time {
  font-size: 9.5px;
  color: #5c6784;
  padding: 0 4px;
}

.chat-products {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.chat-product {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke);
  text-align: left;
  transition: 0.15s;
}

.chat-product:hover {
  border-color: rgba(124, 107, 255, 0.5);
  background: rgba(124, 107, 255, 0.08);
}

.chat-product .brand-tile {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
}

.chat-product-info {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-product-name {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-product-price {
  font-size: 10.5px;
  color: var(--accent-2);
  font-weight: 700;
  margin-top: 1px;
}

.chat-product svg {
  flex: 0 0 auto;
  color: var(--dim);
  width: 12px;
  height: 12px;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9d93d8;
  animation: blink 1.3s infinite;
}

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

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

.chat-status-line {
  font-size: 11px;
  color: var(--dim);
  padding: 2px 4px;
}

.chat-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
}

.chat-suggest button {
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #b9c3de;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  transition: 0.15s;
}

.chat-suggest button:hover {
  color: #fff;
  border-color: rgba(124, 107, 255, 0.5);
  background: rgba(124, 107, 255, 0.1);
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(150, 165, 210, 0.12);
  background: rgba(255, 255, 255, 0.015);
}

.chat-form textarea {
  flex: 1 1 auto;
  max-height: 120px;
  min-height: 40px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 11px;
  outline: none;
  resize: none;
  scrollbar-width: thin;
}

.chat-form textarea:focus {
  border-color: rgba(124, 107, 255, 0.6);
}

.chat-form textarea::placeholder {
  color: #626e8b;
}

.send {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #08060f;
  background: var(--grad-btn);
  transition: 0.18s;
}

.send:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -14px rgba(124, 107, 255, 0.9);
}

.send:disabled {
  opacity: 0.55;
  cursor: progress;
  transform: none;
}

.chat-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 14px 12px;
  font-size: 9.5px;
  color: #59647f;
}

/* ============ Модальное окно ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 11, 0.72);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  overflow-y: auto;
  padding: 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, #0d1324, #080b16);
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(124, 107, 255, 0.08);
  animation: modalIn 0.28s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 165, 210, 0.25) transparent;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.05);
}

.m-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-right: 36px;
}

.m-head .brand-tile {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 14px;
  font-size: 19px;
}

.m-brand {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.m-title {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.m-sub {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.m-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(124, 107, 255, 0.12), rgba(72, 214, 255, 0.05));
  border: 1px solid rgba(124, 107, 255, 0.22);
}

.m-price {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.m-price small {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.m-price-note {
  font-size: 11px;
  color: var(--dim);
}

.m-desc {
  margin-top: 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #b9c3de;
}

.m-section-title {
  margin-top: 20px;
  margin-bottom: 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.m-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: var(--stroke);
}

.m-spec {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #0b1020;
  font-size: 12px;
}

.m-spec span {
  color: var(--dim);
}

.m-spec b {
  text-align: right;
  font-weight: 600;
  color: #dbe2f4;
}

.m-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 16px;
}

.m-tag {
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: #b9c3de;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
}

.m-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.m-actions .btn-primary {
  flex: 1 1 auto;
}

.m-ai {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 12px;
  background: rgba(124, 107, 255, 0.07);
  border: 1px solid rgba(124, 107, 255, 0.22);
}

.m-ai-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #cfc7ff;
}

.m-ai p {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #c4cce5;
}

/* ============ Тост ============ */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.5;
  color: #dfe5f6;
  background: #101728;
  border: 1px solid var(--stroke-strong);
  border-left: 2px solid var(--accent-2);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.9);
  animation: toastIn 0.3s ease both;
}

.toast.error {
  border-left-color: var(--danger);
}

.toast.warn {
  border-left-color: var(--warn);
}

.toast.leaving {
  animation: toastOut 0.25s ease forwards;
}

/* ============ Футер ============ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(150, 165, 210, 0.1);
  background: rgba(5, 7, 15, 0.6);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 24px;
  font-size: 11px;
  color: var(--dim);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #c9d1e6;
}

.footer-brand svg {
  color: var(--accent-2);
}

.footer-tech {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ============ Анимации ============ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(40px, 50px, 0) scale(1.12);
  }
}

@keyframes orbPulse {
  0%, 100% {
    transform: scale(0.85);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

@keyframes blink {
  0%, 60%, 100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

/* ============ Адаптив ============ */
@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 96;
    width: min(340px, 88vw);
    height: 100dvh;
    max-height: none;
    border-radius: 0 18px 18px 0;
    border-left: 0;
    background: #0a0e1b;
    transform: translateX(-102%);
    transition: transform 0.3s cubic-bezier(0.22, 0.7, 0.25, 1);
    visibility: hidden;
    padding-top: 20px;
  }

  .sidebar.open {
    transform: none;
    visibility: visible;
  }

  .sidebar-close {
    display: grid;
  }

  .filter-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
  }
}

@media (max-width: 860px) {
  .hero {
    padding-top: 48px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .step-detail {
    -webkit-line-clamp: 3;
  }

  .topbar {
    padding: 0 18px;
    gap: 14px;
  }

  .status-pill {
    display: none;
  }

  .picks {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 38px 18px 16px;
  }

  .hero-lead {
    font-size: 14px;
    margin-top: 14px;
  }

  h1 {
    font-size: clamp(31px, 9.2vw, 42px);
  }

  .searchbar {
    flex-wrap: wrap;
    padding: 9px;
    margin-top: 24px;
  }

  .searchbar-icon {
    margin-left: 5px;
  }

  .searchbar input {
    font-size: 14px;
  }

  .btn-ai {
    flex: 1 1 100%;
    padding: 13px;
  }

  /* 16px не даёт iOS зумить поле при фокусе */
  .searchbar input,
  .chat-form textarea {
    font-size: 16px;
  }

  .chips {
    justify-content: flex-start;
  }

  .chips-label {
    width: 100%;
    text-align: left;
  }

  .hero-stats {
    gap: 9px;
    font-size: 11px;
  }

  .agent-shell {
    padding: 0 14px;
    margin-top: 22px;
  }

  .agent-inner {
    padding: 17px 15px 15px;
  }

  .agent-actions .agent-mode {
    display: none;
  }

  .workspace {
    padding: 22px 14px 50px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: flex-start;
  }

  .sort > span:first-child {
    display: none;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .sort {
    margin-left: auto;
  }

  .chat-drawer {
    width: 100%;
    border-left: 0;
  }

  .modal {
    padding: 10px;
  }

  .modal-card {
    padding: 20px;
    max-height: 90vh;
  }

  .m-head .brand-tile {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    font-size: 16px;
  }

  .m-title {
    font-size: 18px;
  }

  .m-specs {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    padding: 16px 18px;
  }
}

@media (max-width: 420px) {
  .btn-chat span {
    display: none;
  }

  .btn-chat {
    padding: 9px 10px;
  }

  .card-foot {
    align-items: center;
  }

  .price {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
