/* WOW · общий слой витрины, v2 (09.10.2026).
   Один экран на продукт: заголовок → слева переписка, справа результат собирается на глазах → сетка готовых работ.
   Продукт переопределяет цвета в своём app.css (:root { --brand … }) и стилизует только свой результат. */
:root {
  --brand: #0b6e99; --brand-2: #0d84b8; --brand-ink: #08506f; --brand-soft: #e7f2f8; --brand-line: #cde3ef;
  --accent: #f5b400; --accent-soft: #fff5d6; --accent-ink: #8a6400;
  --page: #f3f5f4; --surface: #ffffff; --ink: #111816; --ink-2: #3c4743; --muted: #77827d;
  --line: #e1e6e3; --line-2: #eef1ef;
  --good: #16a34a; --good-ink: #0f6b33; --good-soft: #e8f7ee;
  --warn: #d48806; --warn-ink: #8a5a00; --warn-soft: #fdf4e1;
  --bad: #d23c3c; --bad-ink: #a12828; --bad-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17, 24, 22, .05), 0 8px 24px rgba(17, 24, 22, .06);
  --shadow-lg: 0 2px 6px rgba(17, 24, 22, .06), 0 22px 50px rgba(17, 24, 22, .13);
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--page); min-height: 100vh; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.w-ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- шапка ---------- */
.w-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 12px 32px;
  background: rgba(255, 255, 255, .9); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px);
}
.w-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.w-mark { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--brand); display: grid; place-items: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14); }
.w-mark svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.w-mark svg .o { stroke: var(--accent); }
.w-mark svg .f { fill: #fff; stroke: none; }
.w-mark svg .fo { fill: var(--accent); stroke: none; }
.w-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.w-name b { font-size: 18px; letter-spacing: -.01em; }
.w-name small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-status { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.w-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.w-chip b { color: var(--ink); font-weight: 650; }
.w-live { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: w-pulse 2s infinite; }
@keyframes w-pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); } 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

/* ---------- заголовок и управление ---------- */
.w-main { max-width: 1440px; margin: 0 auto; padding: 26px 32px 56px; }
.w-hero { display: flex; gap: 32px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.w-hero h1 { margin: 0 0 10px; font-size: 40px; line-height: 1.08; letter-spacing: -.028em; font-weight: 750; max-width: 880px; text-wrap: balance; }
.w-hero h1 em { font-style: normal; color: var(--brand); }
.w-hero p { margin: 0; font-size: 17.5px; line-height: 1.5; color: var(--ink-2); max-width: 760px; text-wrap: pretty; }
.w-ctl { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.w-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.w-pills-l { font-size: 13.5px; color: var(--muted); margin-right: 4px; }
.w-pill { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 15px; font-size: 14.5px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.w-pill:hover { border-color: var(--brand-line); color: var(--brand-ink); }
.w-pill.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.w-run { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 13px; background: var(--brand); color: #fff;
  font-weight: 700; font-size: 16.5px; padding: 14px 22px; cursor: pointer; transition: transform .15s, filter .2s;
  box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.w-run:hover { filter: brightness(1.08); }
.w-run:active { transform: translateY(1px); }
.w-run svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }

/* ---------- сцена ---------- */
.w-stage { display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.w-pane { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.w-ph { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); min-height: 56px; flex: none; }
.w-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; }
.w-pt { font-weight: 650; font-size: 15.5px; white-space: nowrap; }
.w-src { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); padding: 4px 10px;
  border-radius: 999px; background: var(--line-2); white-space: nowrap; }
.w-src i { width: 8px; height: 8px; border-radius: 50%; background: var(--src, #94a3b8); }

/* переписка (не влияет на высоту сцены: высоту задаёт результат справа) */
.w-left { min-height: 500px; }
.w-chat { position: absolute; top: 57px; left: 0; right: 0; bottom: 0; overflow-y: auto; padding: 16px 16px 20px; display: flex;
  flex-direction: column; gap: 10px; background: linear-gradient(180deg, #f8faf9, #f1f4f2); scrollbar-width: thin; }
.w-chat::before { content: ""; flex: 1 0 0; }
.w-empty { margin: auto; text-align: center; color: var(--muted); font-size: 14px; }
.w-day { align-self: center; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.w-msg { max-width: 88%; display: flex; flex-direction: column; gap: 3px; animation: w-in .35s var(--ease) both; }
.w-msg.in { align-self: flex-start; }
.w-msg.out { align-self: flex-end; align-items: flex-end; }
.w-who { font-size: 11.5px; color: var(--muted); padding: 0 6px; display: flex; gap: 6px; align-items: center; }
.w-who .ai { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-ink); font-weight: 650; }
.w-who .ai svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.w-b { padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; }
.w-msg.in .w-b { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.w-msg.out .w-b { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.w-b.w-rich { white-space: normal; }
.w-msg.out .w-b.w-rich { background: #fff; color: var(--ink); border: 1px solid var(--brand-line); box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--brand) 40%, transparent); }
.w-typing { display: inline-flex; gap: 4px; padding: 13px 15px !important; }
.w-typing i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .4; animation: w-dot 1s infinite; }
.w-msg.in .w-typing i { background: var(--muted); }
.w-typing i:nth-child(2) { animation-delay: .15s; }
.w-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes w-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: .95; } }
@keyframes w-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.w-note { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--brand-ink); background: var(--brand-soft);
  border: 1px solid var(--brand-line); border-radius: 999px; padding: 4px 11px; animation: w-in .35s var(--ease) both; max-width: 94%; }
.w-note svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.6; flex: none; }
/* голосовое, файл, фото */
.w-voice { display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 9px 12px !important; }
.w-voice .pl { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; flex: none; }
.w-voice .pl svg { width: 13px; height: 13px; fill: #fff; stroke: none; margin-left: 2px; }
.w-msg.out .w-voice .pl { background: #fff; }
.w-msg.out .w-voice .pl svg { fill: var(--brand); }
.w-wave { display: flex; align-items: center; gap: 2px; height: 28px; flex: 1; }
.w-wave i { width: 3px; border-radius: 2px; background: currentColor; opacity: .3; transition: opacity .15s; }
.w-msg.in .w-wave i { background: var(--brand); }
.w-wave i.p { opacity: 1; }
.w-voice small { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
.w-tr { margin-top: 6px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .75); border: 1px dashed var(--line); font-size: 13.5px;
  line-height: 1.4; color: var(--ink-2); max-width: 100%; }
.w-tr b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.w-file { display: flex; align-items: center; gap: 12px; min-width: 240px; white-space: normal; }
.w-file .fi { width: 38px; height: 46px; border-radius: 7px; display: grid; place-items: end center; padding-bottom: 6px; font-size: 10.5px;
  font-weight: 800; color: #fff; background: var(--fc, #2f6fde); flex: none; position: relative; letter-spacing: .02em; }
.w-file .fi::after { content: ""; position: absolute; top: 0; right: 0; border: 7px solid transparent; border-top-color: #fff; border-right-color: #fff; opacity: .85; }
.w-file b { display: block; font-size: 14.5px; font-weight: 600; }
.w-file small { color: var(--muted); font-size: 12.5px; }
.w-msg.out .w-b:not(.w-rich) .w-file small { color: rgba(255, 255, 255, .78); }
.w-photo { padding: 5px !important; overflow: hidden; width: 280px; max-width: 100%; }
.w-photo svg, .w-photo img { display: block; width: 100%; height: auto; border-radius: 12px; }
.w-photo figcaption { font-size: 13.5px; padding: 6px 8px 3px; white-space: normal; }

/* результат справа */
.w-right { min-height: 500px; }
.w-steps { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.w-st { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--line-2); transition: background .3s var(--ease), color .3s var(--ease); white-space: nowrap; }
.w-st i { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700;
  background: #fff; color: var(--muted); border: 1.5px solid var(--line); transition: all .3s var(--ease); }
.w-st.on { color: var(--brand-ink); background: var(--brand-soft); }
.w-st.on i { border-color: var(--brand); border-right-color: transparent; color: transparent; animation: w-spin .8s linear infinite; background: transparent; }
.w-st.ok { color: var(--ink-2); background: var(--good-soft); }
.w-st.ok i { background: var(--good); border-color: var(--good); color: #fff; }
@keyframes w-spin { to { transform: rotate(360deg); } }
.w-timer { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; background: var(--line-2);
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.w-timer.run { color: var(--brand-ink); background: var(--brand-soft); }
.w-timer.fin { color: var(--good-ink); background: var(--good-soft); }
.w-art { position: relative; flex: 1; padding: 18px; container-type: inline-size; min-height: 0; }
.w-result { display: flex; align-items: center; gap: 14px; margin: 0 18px 18px; padding: 13px 18px; border-radius: 14px; background: var(--good-soft);
  border: 1px solid color-mix(in srgb, var(--good) 28%, transparent); opacity: 0; transform: translateY(10px);
  transition: opacity .45s var(--ease), transform .45s var(--ease); }
.w-result.in { opacity: 1; transform: none; }
.w-result .ok { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--good); display: grid; place-items: center; }
.w-result .ok svg { width: 20px; height: 20px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.w-result b { display: block; font-size: 17px; letter-spacing: -.01em; }
.w-result small { display: block; font-size: 14.5px; color: var(--ink-2); margin-top: 1px; }
.w-result .t { margin-left: auto; font-size: 14px; color: var(--good-ink); font-weight: 650; white-space: nowrap; }
.w-foot { display: flex; align-items: center; gap: 8px; margin: 14px 2px 0; font-size: 14px; color: var(--muted); }

/* ---------- сетка готовых работ ---------- */
.w-gal { margin-top: 40px; }
.w-gal-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; }
.w-gal h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.w-gal-h span { color: var(--muted); font-size: 15px; }
.w-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.w-card { appearance: none; text-align: left; padding: 0; cursor: pointer; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.w-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.w-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.w-th { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; border-bottom: 1px solid var(--line-2); }
.w-th-in { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; padding: 18px; container-type: inline-size; background: #fff; }
.w-th-in .w-nothumb { visibility: hidden; }
.w-badge { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 650; background: var(--good-soft); color: var(--good-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.w-badge.warn { background: var(--warn-soft); color: var(--warn-ink); }
.w-badge.bad { background: var(--bad-soft); color: var(--bad-ink); }
.w-badge.brand { background: var(--brand-soft); color: var(--brand-ink); }
.w-cb { padding: 12px 15px 14px; }
.w-cb b { display: block; font-size: 15.5px; letter-spacing: -.005em; }
.w-cb small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }

/* ---------- приёмы появления (результат собирается на глазах) ---------- */
.w-h { opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.w-h.fade { transform: none; }
.w-h.pop { transform: scale(.92); }
.w-h.slide { transform: translateX(-12px); }
.w-h.in { opacity: 1; transform: none; }
.w-d { opacity: 0; transition: opacity .25s; }
.w-d.in { opacity: 1; }
.w-stamp { opacity: 0; transform: rotate(var(--rot, -8deg)) scale(1.9); }
.w-stamp.in { opacity: 1; transform: rotate(var(--rot, -8deg)) scale(1); transition: transform .38s cubic-bezier(.3, 1.6, .5, 1), opacity .18s; }
.w-flash { animation: w-flash 1.4s var(--ease); }
@keyframes w-flash { 0%, 30% { background-color: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); } 100% { background-color: transparent; box-shadow: 0 0 0 0 transparent; } }
.w-scan { position: absolute; left: 0; right: 0; top: 0; height: 70px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--brand) 22%, transparent) 70%, color-mix(in srgb, var(--brand) 55%, transparent) 72%, transparent 74%); }
.w-scan.in { opacity: 1; animation: w-scan 1.6s linear infinite; }
@keyframes w-scan { from { transform: translateY(-70px); } to { transform: translateY(var(--scan-h, 420px)); } }
/* итог для снимков (?final=1) и миниатюры сетки: сразу конечный вид, без анимаций */
.w-final .w-h, .w-final .w-d, .w-final .w-stamp, .w-final .w-result, .w-final .w-msg, .w-final .w-note,
.w-th-in .w-h, .w-th-in .w-d, .w-th-in .w-stamp { transition: none !important; animation: none !important; }
/* бумага в клетку для чертежей */
.w-paper { background-color: #fbfdfe;
  background-image: linear-gradient(color-mix(in srgb, var(--brand) 8%, transparent) 1px, transparent 1px),
                    linear-gradient(90deg, color-mix(in srgb, var(--brand) 8%, transparent) 1px, transparent 1px);
  background-size: 20px 20px; }

/* превью 1200×630 (?og=1): шапка + экран агента во всю ширину, без заголовка, переписки и сетки */
.w-og .w-hero, .w-og .w-left, .w-og .w-foot, .w-og .w-gal { display: none !important; }
.w-og .w-main { padding: 18px 28px; }
.w-og .w-stage { grid-template-columns: minmax(0, 1fr); }
.w-og .w-top { position: static; }
.w-og .w-right .w-n { display: none; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .w-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .w-ctl { align-items: flex-start; }
  .w-pills { justify-content: flex-start; }
  .w-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .w-stage { grid-template-columns: minmax(0, 1fr); }
  .w-left { min-height: 430px; }
  .w-right { min-height: 0; }
  .w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .w-top { padding: 10px 16px; }
  .w-status .w-chip + .w-chip { display: none; }
  .w-name small { display: none; }
  .w-main { padding: 18px 16px 40px; }
  .w-hero h1 { font-size: 28px; }
  .w-hero p { font-size: 16px; }
  .w-run { width: 100%; justify-content: center; }
  .w-ctl { width: 100%; }
  .w-ph { flex-wrap: wrap; padding: 10px 14px; }
  .w-right .w-steps { order: 3; width: 100%; }
  .w-art { padding: 12px; }
  .w-result { margin: 0 12px 12px; padding: 12px 14px; flex-wrap: wrap; }
  .w-result .t { margin-left: 52px; }
  .w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .w-cb { padding: 10px 11px 12px; }
  .w-cb b { font-size: 14px; }
  .w-left { min-height: 440px; }
}
