/* =========================================================
   CodePulse — Telegram Web App
   Дизайн-токены: тёмная тема по умолчанию, электрик-фиолетовый + неоновый циан
   ========================================================= */
:root {
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Unbounded', 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* палитра (dark) */
  --bg: #08080f;
  --bg-glow: rgba(124, 58, 237, .16);
  --surface: #12121e;
  --surface-2: #1a1a2a;
  --surface-3: #232338;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f4f4fb;
  --muted: #a6a6c0;
  --faint: #8a8aa6;

  --violet: #8b5cf6;
  --violet-strong: #7c3aed;
  --indigo: #4f46e5;
  --cyan: #22d3ee;
  --accent-text: #67e8f9;      /* циан для текста на тёмном */
  --accent-soft: rgba(139, 92, 246, .16);
  --accent-line: rgba(139, 92, 246, .45);
  --success: #34d399;
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, .12);
  --warn: #fbbf24;

  --grad-cta: linear-gradient(135deg, #7c3aed 0%, #5b4bf0 55%, #4f46e5 100%);
  --grad-brand: linear-gradient(135deg, #8b5cf6 0%, #6d5dfc 55%, #22d3ee 100%);

  /* размеры */
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --pad: 16px;
  --tabbar-h: 64px;
  --cta-h: 80px;
  --maxw: 480px;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-cta: 0 10px 30px rgba(109, 93, 252, .45);

  /* safe area (дополняются из Telegram в app.js) */
  --tg-sa-top: 0px;
  --tg-sa-bottom: 0px;
  --tg-csa-top: 0px;
  --safe-top: calc(max(env(safe-area-inset-top, 0px), var(--tg-sa-top)) + var(--tg-csa-top));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-sa-bottom));
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f2f2f8;
  --bg-glow: rgba(124, 58, 237, .10);
  --surface: #ffffff;
  --surface-2: #f0f0f7;
  --surface-3: #e6e6f1;
  --line: rgba(20, 20, 50, .09);
  --line-strong: rgba(20, 20, 50, .18);
  --text: #13131f;
  --muted: #565670;
  --faint: #6b6b85;
  --accent-text: #0e7490;
  --accent-soft: rgba(124, 58, 237, .10);
  --accent-line: rgba(124, 58, 237, .40);
  --success: #059669;
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, .08);
  --shadow-card: 0 1px 2px rgba(20, 20, 50, .06), 0 8px 24px rgba(20, 20, 50, .06);
  --shadow-cta: 0 10px 24px rgba(109, 93, 252, .30);
  color-scheme: light;
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: var(--tg-viewport-height, 100dvh);
  background:
    radial-gradient(600px 380px at 85% -60px, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent-text); }

.ic {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 18px; height: 18px; }
.ic-lg { width: 30px; height: 30px; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 8px;
}
html[data-theme="light"] :focus-visible { outline-color: var(--violet-strong); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text);
}
.skip-link:focus { top: calc(12px + var(--safe-top)); }

.noscript { padding: 24px; text-align: center; }

/* ---------- каркас ---------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding:
    calc(12px + var(--safe-top))
    calc(var(--pad) + var(--safe-right))
    calc(var(--tabbar-h) + var(--safe-bottom) + 28px)
    calc(var(--pad) + var(--safe-left));
}
body.has-cta .app { padding-bottom: calc(var(--tabbar-h) + var(--cta-h) + var(--safe-bottom) + 28px); }
.view { outline: none; }

.screen { display: flex; flex-direction: column; gap: 22px; animation: screen-in .28s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- заголовки экранов ---------- */
.topbar { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.topbar-logo { width: 40px; height: 40px; border-radius: 12px; }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: .01em; line-height: 1.2; }
.topbar-sub { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }

.page-head { display: flex; flex-direction: column; gap: 6px; }
.page-title { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.page-sub { color: var(--muted); font-size: 15px; }

.detail-bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 14px 0 8px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 15px;
}
.back-btn:active { transform: scale(.97); }

.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.25; }
.link-btn {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 4px 0 10px;
  background: none; border: 0; color: var(--accent-text); font-weight: 700; font-size: 15px;
}

/* ---------- пилюли ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; line-height: 1.2;
  background: rgba(255, 255, 255, .10); color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.pill .ic { width: 15px; height: 15px; }
.pill-accent { background: rgba(34, 211, 238, .14); border-color: rgba(34, 211, 238, .38); color: #a5f3fc; }
.pill-soft { background: var(--surface-2); border-color: var(--line); color: var(--text); backdrop-filter: none; }
.pill-violet { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); backdrop-filter: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--r-xl);
  padding: 196px 20px 22px;
  color: #fff;
  background:
    radial-gradient(120% 70% at 105% -5%, rgba(34, 211, 238, .55), transparent 55%),
    radial-gradient(90% 80% at -10% 110%, rgba(139, 92, 246, .85), transparent 60%),
    linear-gradient(160deg, #1d1140 0%, #110c26 55%, #0b0a1a 100%);
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 24px 60px rgba(76, 29, 149, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 14px;
}
.hero::before { /* сетка-шум */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(80% 70% at 70% 20%, #000, transparent);
  mask-image: radial-gradient(80% 70% at 70% 20%, #000, transparent);
}
.hero-top { position: absolute; left: 20px; top: 20px; right: 20px; z-index: 2; }
.hero-title { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.08; letter-spacing: -.01em; position: relative; z-index: 2; }
.hero-title .grad { background: linear-gradient(90deg, #c4b5fd, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-text { font-size: 16px; color: rgba(255, 255, 255, .84); max-width: 34ch; position: relative; z-index: 2; }

/* 3D-арт в hero */
.hero-art {
  position: absolute; right: -6px; top: 44px; width: 190px; height: 170px;
  perspective: 700px; z-index: 1; pointer-events: none;
}
.art-window, .art-bubble, .art-orb { position: absolute; will-change: transform; }
.art-window {
  right: 18px; top: 4px; width: 150px; height: 104px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.22), rgba(255,255,255,.06));
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 24px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255,255,255,.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transform: rotateY(-24deg) rotateX(14deg) rotateZ(4deg);
  animation: float-a 6s ease-in-out infinite;
  padding: 12px;
}
.art-window i { display: block; height: 7px; border-radius: 4px; background: rgba(255,255,255,.55); margin-bottom: 7px; }
.art-window i:nth-child(1) { width: 34px; height: 6px; background: rgba(255,255,255,.4); margin-bottom: 12px; box-shadow: 10px 0 0 transparent; }
.art-window i:nth-child(2) { width: 90%; }
.art-window i:nth-child(3) { width: 62%; background: rgba(255,255,255,.35); }
.art-window i:nth-child(4) { width: 46px; height: 16px; border-radius: 8px; margin-top: 10px; background: linear-gradient(90deg, #a78bfa, #22d3ee); }
.art-bubble {
  left: 6px; top: 92px; width: 104px; height: 60px; border-radius: 20px 20px 20px 6px;
  background: var(--grad-brand);
  box-shadow: 0 6px 0 rgba(46, 16, 101, .9), 0 22px 36px rgba(34, 211, 238, .35), inset 0 1px 0 rgba(255,255,255,.45);
  transform: rotateY(-20deg) rotateX(10deg) rotateZ(-6deg) translateZ(40px);
  animation: float-b 7s ease-in-out infinite;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.art-bubble b { width: 9px; height: 9px; border-radius: 50%; background: #fff; opacity: .95; }
.art-orb {
  right: 0; top: 104px; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffffff 0 6%, #a5f3fc 14%, #22d3ee 34%, #7c3aed 72%, #2e1065 100%);
  box-shadow: 0 0 40px rgba(34, 211, 238, .55), 0 14px 24px rgba(0,0,0,.4);
  animation: float-c 5s ease-in-out infinite;
}
@keyframes float-a { 0%,100% { transform: rotateY(-24deg) rotateX(14deg) rotateZ(4deg) translateY(0); } 50% { transform: rotateY(-20deg) rotateX(12deg) rotateZ(3deg) translateY(-6px); } }
@keyframes float-b { 0%,100% { transform: rotateY(-20deg) rotateX(10deg) rotateZ(-6deg) translateZ(40px) translateY(0); } 50% { transform: rotateY(-16deg) rotateX(8deg) rotateZ(-4deg) translateZ(40px) translateY(5px); } }
@keyframes float-c { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- заметка про цену ---------- */
.price-note {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  font-size: 14px; font-weight: 600; line-height: 1.4;
}
.price-note .ic { color: var(--accent-text); width: 20px; height: 20px; margin-top: 0; }

/* ---------- карточки ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.tap { transition: transform .15s ease, border-color .15s ease, background-color .15s ease; }
.tap:active { transform: scale(.98); }
@media (hover: hover) { .tap:hover { border-color: var(--line-strong); } }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick {
  position: relative; overflow: hidden; text-align: left;
  display: flex; flex-direction: column; gap: 10px; min-height: 150px;
  padding: 16px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-card);
}
.quick::after {
  content: ""; position: absolute; right: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, .35), transparent 70%);
}
.quick.is-bot::after { background: radial-gradient(circle, rgba(34, 211, 238, .30), transparent 70%); }
.quick-title { font-weight: 800; font-size: 17px; line-height: 1.2; }
.quick-price { font-size: 14px; color: var(--accent-text); font-weight: 700; }
.quick-text { font-size: 13px; color: var(--muted); line-height: 1.35; }
.quick .go { position: absolute; right: 12px; top: 12px; color: var(--muted); }

/* 3D-плашка иконки */
.tile3d {
  width: 48px; height: 48px; border-radius: 15px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #a78bfa 0%, #7c3aed 55%, #5b21b6 100%);
  box-shadow: 0 4px 0 #3b1a86, 0 12px 20px rgba(124, 58, 237, .35), inset 0 1px 0 rgba(255,255,255,.4);
  transform: perspective(300px) rotateX(10deg);
}
.tile3d.cyan {
  background: linear-gradient(145deg, #67e8f9 0%, #06b6d4 55%, #0e7490 100%);
  box-shadow: 0 4px 0 #0b5465, 0 12px 20px rgba(6, 182, 212, .35), inset 0 1px 0 rgba(255,255,255,.45);
}
.tile3d.pink {
  background: linear-gradient(145deg, #f0abfc 0%, #c026d3 55%, #86198f 100%);
  box-shadow: 0 4px 0 #5b0f60, 0 12px 20px rgba(192, 38, 211, .35), inset 0 1px 0 rgba(255,255,255,.4);
}
.tile3d .ic { width: 24px; height: 24px; stroke-width: 2; }
.tile3d.xl { width: 96px; height: 96px; border-radius: 28px; transform: perspective(500px) rotateX(16deg) rotateZ(-8deg); }
.tile3d.xl .ic { width: 46px; height: 46px; stroke-width: 1.7; }
.tile3d.xl { box-shadow: 0 8px 0 #3b1a86, 0 26px 40px rgba(124, 58, 237, .5), inset 0 2px 0 rgba(255,255,255,.4); }
.tile3d.xl.cyan { box-shadow: 0 8px 0 #0b5465, 0 26px 40px rgba(6, 182, 212, .45), inset 0 2px 0 rgba(255,255,255,.45); }
.tile3d.xl.pink { box-shadow: 0 8px 0 #5b0f60, 0 26px 40px rgba(192, 38, 211, .45), inset 0 2px 0 rgba(255,255,255,.4); }

/* гарантии */
.guarantees { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.guarantee { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.guarantee .g-ic {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.guarantee .g-ic .ic { width: 20px; height: 20px; }
.guarantee-title { font-weight: 800; font-size: 15px; line-height: 1.25; }
.guarantee-text { font-size: 13px; color: var(--muted); line-height: 1.35; }

/* шаги */
.steps { display: flex; flex-direction: column; gap: 0; padding: 6px 16px; }
.step { display: flex; gap: 14px; padding: 12px 0; position: relative; }
.step + .step { border-top: 1px solid var(--line); }
.step-num {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff; background: var(--grad-cta);
}
.step-title { font-weight: 800; font-size: 15px; }
.step-text { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* карусель работ */
.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad) 6px;
  scroll-padding: 0 var(--pad); scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; display: flex; }
.carousel .work-card { height: 100%; }

/* ---------- чипы ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad); scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-height: 44px; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 15px; font-weight: 600; line-height: 1.2; text-align: center;
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease, color .15s ease;
}
.chip:active { transform: scale(.96); }
.chip .ic { width: 16px; height: 16px; stroke-width: 2.4; display: none; }
.chip[aria-pressed="true"] {
  background: var(--accent-soft); border-color: var(--violet); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--violet), 0 6px 18px rgba(124, 58, 237, .22);
}
.chip[aria-pressed="true"] .ic { display: block; color: var(--accent-text); }
.chip-group.has-error .chip { border-color: var(--danger); }
.chip-count { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ---------- услуги (каталог) ---------- */
.service-list { display: flex; flex-direction: column; gap: 12px; }
.service-card {
  width: 100%; text-align: left; display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; color: var(--text);
}
.service-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.service-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.service-title { font-weight: 800; font-size: 17px; line-height: 1.25; }
.service-price { font-weight: 800; font-size: 16px; color: var(--accent-text); white-space: nowrap; max-width: 100%; }
.service-short { font-size: 14px; color: var(--muted); line-height: 1.4; }
.service-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.mini-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--text);
}
.mini-pill .ic { width: 13px; height: 13px; color: var(--accent-text); }
.incl { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.incl li { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.35; }
.incl .ic { width: 14px; height: 14px; color: var(--success); margin-top: 2px; stroke-width: 2.4; }
.service-card .chev { color: var(--faint); margin-top: 12px; }

/* ---------- экран услуги ---------- */
.s-hero { padding-top: 170px; justify-content: flex-end; }
.s-sub { position: relative; z-index: 2; color: rgba(255, 255, 255, .84); font-size: 15px; }
.s-hero .tile3d.xl { position: absolute; right: 26px; top: 46px; z-index: 1; }
.s-hero .s-glow { position: absolute; right: 0; top: 10px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(34,211,238,.35), transparent 65%); z-index: 0; }
.s-hero .pills { position: absolute; left: 20px; top: 20px; right: 140px; z-index: 2; }
.s-title { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.12; position: relative; z-index: 2; }

.price-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.price-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
/* «по договорённости» длинное — переносим, а не вылезаем за карточку */
.price-big .val { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.1; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.price-big .lbl { font-size: 14px; color: var(--muted); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-val { font-weight: 800; font-size: 15px; line-height: 1.2; }
.stat-lbl { font-size: 12px; color: var(--muted); line-height: 1.25; }

.variant-hint { font-size: 14px; color: var(--muted); line-height: 1.4; min-height: 1.4em; }

/* раскрывашки */
.acc { overflow: hidden; }
.acc summary {
  list-style: none; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 12px 16px; cursor: pointer; font-weight: 800; font-size: 16px;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .a-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.acc summary .a-ic .ic { width: 18px; height: 18px; }
.acc summary .chev { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
.acc[open] summary .chev { transform: rotate(180deg); }
.acc-body { padding: 0 16px 16px; }
.acc-body p { color: var(--muted); font-size: 15px; }
.bullets { display: flex; flex-direction: column; gap: 10px; }
.bullets li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.bullets .b-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(52, 211, 153, .14); color: var(--success); margin-top: 1px; }
.bullets .b-ic .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.bullets.info .b-ic { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- работы ---------- */
.works-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.work-card {
  width: 100%; padding: 0; overflow: hidden; text-align: left; color: var(--text);
  display: flex; flex-direction: column;
}
.work-cover { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.work-cover img { width: 100%; height: 100%; object-fit: cover; }
.work-badge {
  position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .02em; color: #fff;
  background: rgba(8, 8, 15, .62); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.work-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.work-title { font-weight: 800; font-size: 14px; line-height: 1.3; }
.work-short { font-size: 13px; color: var(--muted); line-height: 1.35; }
.carousel .work-title { font-size: 15px; }

.work-hero { overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0,0,0,.35); position: relative; }
.work-hero img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.w-title { font-family: var(--font-display); font-weight: 700; font-size: 23px; line-height: 1.18; }
.w-text { font-size: 16px; color: var(--muted); }
.concept-note { font-size: 13px; color: var(--faint); }

/* ---------- отзывы ---------- */
.empty {
  padding: 28px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
  position: relative; overflow: hidden;
}
.empty::before { content: ""; position: absolute; left: 50%; top: -60px; width: 260px; height: 200px; transform: translateX(-50%); background: radial-gradient(circle, rgba(139, 92, 246, .28), transparent 70%); pointer-events: none; }
.empty-stars { display: flex; gap: 6px; position: relative; }
.empty-stars .ic { width: 30px; height: 30px; color: var(--violet); stroke-width: 1.6; }
.empty-stars .ic:nth-child(3) { width: 40px; height: 40px; color: var(--cyan); fill: rgba(34, 211, 238, .18); transform: translateY(-6px); }
.empty-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.25; position: relative; }
.empty-text { color: var(--muted); font-size: 15px; max-width: 32ch; position: relative; }

.rating-card { padding: 16px; display: flex; align-items: center; gap: 16px; }
.rating-val { font-family: var(--font-display); font-weight: 700; font-size: 36px; line-height: 1; }
.stars { display: inline-flex; gap: 2px; }
.stars .ic { width: 16px; height: 16px; color: var(--faint); }
.stars .ic.on { color: #fbbf24; fill: #fbbf24; }
.review { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.review-head { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad-cta); }
.review-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.review-meta { font-size: 13px; color: var(--muted); }
.review-text { font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- бриф ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field-label, .field legend { font-weight: 800; font-size: 15px; padding: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.req { color: var(--danger); font-weight: 800; }
.opt { color: var(--muted); font-weight: 600; font-size: 13px; }
.field-hint { font-size: 13px; color: var(--muted); line-height: 1.4; }
.input, .textarea {
  width: 100%; min-height: 50px; padding: 13px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 16px; line-height: 1.45; transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 112px; resize: vertical; }
.textarea.tall { min-height: 160px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); opacity: 1; }
.input:focus, .textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .25); outline: none; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-foot { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; min-height: 18px; }
.counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.counter.warn { color: var(--warn); }
.counter.full { color: var(--danger); }
html[data-theme="light"] .counter.warn { color: #b45309; }
.error { font-size: 13px; color: var(--danger); font-weight: 700; display: flex; gap: 6px; align-items: flex-start; line-height: 1.35; }
.error .ic { width: 16px; height: 16px; margin-top: 1px; }
.error:empty { display: none; }

.form-card { padding: 16px; display: flex; flex-direction: column; gap: 18px; }

.err-summary {
  padding: 14px 16px; border-radius: var(--r-md); background: var(--danger-soft); border: 1px solid var(--danger);
  display: flex; flex-direction: column; gap: 6px;
}
.err-summary-title { font-weight: 800; display: flex; gap: 8px; align-items: center; color: var(--danger); }
.err-summary ul { display: flex; flex-direction: column; gap: 2px; }
.err-summary button { background: none; border: 0; padding: 6px 0; min-height: 44px; text-align: left; color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }

/* «Восстановить последний бриф?» — ненавязчивая плашка над формой */
.restore-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px dashed var(--line-strong);
}
.restore-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.restore-ic .ic { width: 18px; height: 18px; }
.restore-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.restore-title { font-weight: 800; font-size: 15px; line-height: 1.3; }
.restore-text { font-size: 13px; color: var(--muted); line-height: 1.4; }
.restore-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 6px; }
.restore-actions .link-btn { min-height: 44px; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; border-radius: 14px; }

.size-meter { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.size-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.size-bar > i { display: block; height: 100%; width: 0; background: var(--grad-brand); border-radius: inherit; transition: width .2s ease; }
.size-meter.over { color: var(--danger); font-weight: 700; }
.size-meter.over .size-bar > i { background: var(--danger); }

.send-note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.send-note .ic { color: var(--warn); width: 20px; height: 20px; }
.send-note b { color: var(--text); }

.success { padding: 28px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.success .tile3d.xl { transform: none; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border-radius: 16px; border: 1px solid transparent;
  font-weight: 800; font-size: 16px; line-height: 1.2; text-decoration: none;
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad-cta); color: #fff; box-shadow: var(--shadow-cta), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:disabled { filter: grayscale(.6) brightness(.8); cursor: not-allowed; }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn-block { width: 100%; }
.btn-xl { min-height: 56px; font-size: 17px; border-radius: 18px; width: 100%; }

/* липкая CTA */
.cta {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  width: 100%; max-width: var(--maxw);
  padding: 12px calc(var(--pad) + var(--safe-right)) 12px calc(var(--pad) + var(--safe-left));
  background: linear-gradient(to top, var(--bg) 55%, transparent);
}
.cta[hidden] { display: none; }

/* плавающая кнопка чата */
.fab {
  position: fixed; z-index: 31;
  right: max(calc(50% - var(--maxw) / 2 + 16px), calc(16px + var(--safe-right)));
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2);
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, #a5f3fc 0, #22d3ee 30%, #0891b2 100%);
  box-shadow: 0 4px 0 #0b5465, 0 14px 30px rgba(6, 182, 212, .45);
  transition: transform .15s ease, bottom .2s ease;
}
.fab .ic { width: 26px; height: 26px; stroke-width: 2; color: #052e38; }
.fab:active { transform: scale(.94); }
body.has-cta .fab { bottom: calc(var(--tabbar-h) + var(--cta-h) + var(--safe-bottom) + 8px); }

/* таб-бар */
.tabbar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: var(--maxw);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px calc(6px + var(--safe-right)) calc(6px + var(--safe-bottom)) calc(6px + var(--safe-left));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .tabbar { background: var(--surface); }
}
.tab {
  min-height: 52px; border: 0; background: none; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 12px; font-weight: 700; line-height: 1.1; padding: 4px 2px;
  position: relative;
}
.tab .ic { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] .ic { color: var(--accent-text); filter: drop-shadow(0 0 8px rgba(34, 211, 238, .55)); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: -6px; left: 50%; width: 28px; height: 3px; border-radius: 0 0 3px 3px;
  transform: translateX(-50%); background: var(--grad-brand);
}
html[data-theme="light"] .tab[aria-current="page"] .ic { color: var(--violet-strong); filter: none; }

/* клавиатура открыта — прячем нижние плавающие элементы */
body.kbd .tabbar, body.kbd .cta, body.kbd .fab { display: none; }
body.kbd .app { padding-bottom: 32px; }

/* ---------- шит (диалог) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(4, 4, 10, .62);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .2s ease both;
}
.sheet {
  width: 100%; max-width: var(--maxw); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-bottom: 0;
  border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(20px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px;
  animation: sheet-up .26s cubic-bezier(.2, .8, .2, 1) both;
}
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); align-self: center; }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; }
.sheet-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; line-height: 1.25; flex: 1; padding-top: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; color: var(--text); flex: none; }
.sheet-text { color: var(--muted); font-size: 15px; }
.sheet-text b { color: var(--text); }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* тост */
.toast {
  position: fixed; z-index: 70; left: 50%; top: calc(16px + var(--safe-top)); transform: translate(-50%, -20px);
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-strong);
  font-size: 14px; font-weight: 700; box-shadow: 0 12px 30px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- адаптив ---------- */
@media (max-width: 359px) {
  :root { --pad: 12px; }
  .hero-title { font-size: 26px; }
  .page-title { font-size: 23px; }
  .hero-art { transform: scale(.85); transform-origin: top right; }
  .quick { min-height: 140px; padding: 14px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: span 2; }
  .tab { font-size: 12px; } /* меньше 12px не опускаемся — читаемость */
  .chip { padding: 8px 13px; font-size: 14px; }
  .price-big .val { font-size: 22px; }
  .service-price { white-space: normal; overflow-wrap: anywhere; }
}
@media (min-width: 420px) {
  .hero { padding-top: 206px; }
  .hero-art { right: 6px; transform: scale(1.08); transform-origin: top right; }
  .carousel { grid-auto-columns: 70%; }
}

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