:root {
  --bg: #DCDCE0;
  --text: #34343A;
  --muted: #5C5C66;
  --soft: #8E8E98;
  --glow: #B28CFF;
  --primary: #6A4AE0;
  --primary-ink: #2A2242;
  --tint: #EFEAFF;
  --screen: #2B2B31;
  --raise: -8px -8px 18px rgba(255,255,255,.8), 10px 12px 26px rgba(70,66,90,.2);
  --raise-sm: -4px -4px 10px rgba(255,255,255,.82), 5px 6px 13px rgba(70,66,90,.2);
  --inset: inset 5px 5px 11px rgba(70,66,90,.16), inset -5px -5px 11px rgba(255,255,255,.85);
  --inset-sm: inset 3px 3px 7px rgba(70,66,90,.16), inset -3px -3px 7px rgba(255,255,255,.88);
  --ring: 0 0 0 1.5px var(--glow), 0 0 22px rgba(160,110,255,.38);
  --primary-glow: 0 8px 20px rgba(110,70,230,.38), 0 0 24px rgba(160,110,255,.4);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 'Manrope', system-ui, sans-serif; }
a { color: #5B3FD1; }
a:hover { color: #3F2A9E; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.page { min-height: 100vh; padding: 22px 26px 32px; display: flex; flex-direction: column; gap: 24px; }

/* шапка */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; text-decoration: none; color: var(--text); }
.logo-dot { width: 14px; height: 14px; border-radius: 50%; background: #F4EEFF; box-shadow: 0 0 0 1.5px var(--glow), 0 0 16px 3px rgba(160,110,255,.55); }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a { height: 42px; padding: 0 18px; display: flex; align-items: center; border-radius: 999px; text-decoration: none; color: #4A4A52; font-weight: 600; }
.nav a[aria-current="page"] { color: var(--primary-ink); font-weight: 700; box-shadow: var(--inset-sm); }
.grow { flex: 1 1 0; }

/* поверхности */
.raised { background: var(--bg); box-shadow: var(--raise); }
.raised-sm { background: var(--bg); box-shadow: var(--raise-sm); }
.inset { box-shadow: var(--inset); }
.glow { background: var(--tint); box-shadow: var(--ring); }
.card { border-radius: 28px; padding: 22px; }

/* кнопки */
.btn { height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--bg); font-weight: 600; box-shadow: var(--raise-sm); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:active { box-shadow: var(--inset-sm); }
.btn-primary { background: var(--primary); color: #fff; font-weight: 700; box-shadow: var(--primary-glow); }
.btn-primary:hover { color: #fff; filter: brightness(1.06); }
.btn-primary:disabled { opacity: .5; cursor: default; filter: none; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; }
.btn-round { width: 44px; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; box-shadow: var(--inset-sm); font-size: 13px; color: #4A4A52; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 8px var(--glow); }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge-ready { background: var(--tint); color: #3D2A99; box-shadow: 0 0 0 1.5px var(--glow); }
.badge-muted { color: #4A4A52; box-shadow: var(--inset-sm); }
.badge-error { color: #8F272C; background: #F4D9D6; }

.field { width: 100%; border: 0; outline: none; border-radius: 20px; padding: 14px 16px; background: var(--bg); box-shadow: var(--inset); }
.field:focus { box-shadow: var(--inset), 0 0 0 2px var(--glow); }
label.lbl, .lbl { font-weight: 800; font-size: 15px; display: block; margin-bottom: 8px; }

.bar { height: 8px; border-radius: 4px; display: flex; box-shadow: inset 2px 2px 4px rgba(70,66,90,.2), inset -2px -2px 4px rgba(255,255,255,.8); }
.bar > i { border-radius: 4px; background: var(--primary); box-shadow: 0 0 10px rgba(160,110,255,.6); transition: width .3s; }
.bar-dark { background: #44444C; box-shadow: none; height: 6px; }
.bar-dark > i { background: var(--glow); }

/* вход */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login form { width: 380px; max-width: 100%; display: flex; flex-direction: column; gap: 18px; }

/* проекты */
.h1 { margin: 0; font-size: 52px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 26px; }
.pcard { text-decoration: none; color: inherit; border-radius: 28px; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.pcard:hover { color: inherit; transform: translateY(-2px); transition: transform .2s; }
.pthumb { height: 260px; border-radius: 20px; background: var(--screen); position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 22px; color: #EDEDF0; font-size: 13px; text-align: center; }
.pthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pthumb .dur { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 11px; background: rgba(0,0,0,.5); padding: 3px 8px; border-radius: 999px; }
.orb { width: 54px; height: 54px; border-radius: 50%; background: #F4F1FF; box-shadow: 0 0 0 2px var(--glow), 0 0 30px 6px rgba(160,110,255,.55); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px var(--glow), 0 0 44px 12px rgba(160,110,255,.35); } }
.pnew { text-decoration: none; color: #4A4A52; border-radius: 28px; min-height: 350px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; box-shadow: var(--inset); border: 0; background: transparent; }

/* новый проект */
.cols { display: flex; flex-wrap: wrap; gap: 26px; align-items: flex-start; }
.drop { min-height: 220px; border-radius: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; box-shadow: var(--inset); text-align: center; }
.drop.over { box-shadow: var(--inset), 0 0 0 2px var(--glow), 0 0 30px rgba(160,110,255,.35); }
.orb-up { width: 72px; height: 72px; border-radius: 50%; background: #F4F1FF; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--glow), 0 0 34px 6px rgba(160,110,255,.45); }
.frow { padding: 14px 16px; border-radius: 22px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--raise-sm); }
.frow-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.seg { display: flex; gap: 6px; padding: 6px; border-radius: 999px; box-shadow: var(--inset-sm); }
.seg button { flex: 1 1 0; height: 42px; border-radius: 999px; border: 0; background: transparent; color: #4A4A52; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--tint); color: var(--primary-ink); font-weight: 700; box-shadow: var(--ring); }
.mode { flex: 1 1 200px; border-radius: 22px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--raise-sm); cursor: pointer; }
.mode.on { background: var(--tint); box-shadow: var(--ring); }
.mode[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.select { height: 48px; border: 0; border-radius: 999px; padding: 0 18px; background: var(--bg); box-shadow: var(--raise-sm); width: 100%; }

/* редактор */
.editor { display: flex; flex-wrap: wrap; gap: 22px; align-items: stretch; }
.chat { flex: 1 1 360px; max-width: 460px; min-width: 0; border-radius: 30px; padding: 22px; display: flex; flex-direction: column; gap: 14px; min-height: 640px; max-height: calc(100vh - 120px); }
.feed { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px 14px; border-radius: 24px; background: #E4E4E8; box-shadow: inset 4px 4px 10px rgba(70,66,90,.12), inset -4px -4px 10px rgba(255,255,255,.7); }
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 86%; }
.msg time { font-size: 11px; color: var(--muted); }
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-user .bub { background: var(--primary); color: #fff; border-radius: 20px 20px 6px 20px; padding: 11px 15px; box-shadow: 0 6px 18px rgba(110,70,230,.35), 0 0 22px rgba(160,110,255,.35); white-space: pre-wrap; word-break: break-word; }
.msg-bot { align-self: flex-start; flex-direction: row; align-items: flex-end; gap: 8px; max-width: 92%; }
.ava { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: #F4F1FF; box-shadow: 0 0 0 1.5px var(--glow), 0 0 10px rgba(160,110,255,.5); }
.msg-bot .bub { background: #FAFAFC; color: #2F2F36; border-radius: 20px 20px 20px 6px; padding: 11px 15px; box-shadow: 0 4px 14px rgba(70,66,90,.14); display: flex; flex-direction: column; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.msg-sys { align-self: center; font-size: 12px; color: var(--muted); text-align: center; max-width: 90%; }
.msg-sys.err { color: #8F272C; }
.change { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: #F1ECFF; box-shadow: 0 0 0 1.5px var(--glow); font-size: 13px; white-space: normal; }
.vlink { font-size: 13px; font-weight: 700; border: 0; background: none; padding: 0; color: #5B3FD1; text-align: left; }
.typing { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #F1ECFF; box-shadow: 0 0 0 1.5px var(--glow); font-size: 13px; }
.typing .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 8px var(--glow); animation: pulse 1.4s infinite; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.quick button { height: 38px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--raise-sm); }
.compose { display: flex; gap: 8px; align-items: flex-end; padding: 6px 6px 6px 16px; border-radius: 26px; background: #FAFAFC; box-shadow: 0 4px 16px rgba(70,66,90,.16); }
.compose textarea { flex: 1 1 auto; min-width: 0; border: 0; outline: none; background: transparent; resize: none; padding: 11px 0; max-height: 160px; }
.send { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; border: 0; background: var(--primary); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(110,70,230,.4), 0 0 20px rgba(160,110,255,.45); }
.send:disabled { opacity: .5; cursor: default; }

.stage { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 10px 0; }
.phone { width: 300px; max-width: 100%; aspect-ratio: 9 / 16; border-radius: 36px; padding: 12px; box-shadow: -12px -12px 26px rgba(255,255,255,.85), 14px 18px 36px rgba(70,66,90,.26); }
.screen { width: 100%; height: 100%; border-radius: 26px; background: var(--screen); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #EDEDF0; text-align: center; padding: 20px; }
.screen video { width: 100%; height: 100%; object-fit: cover; display: block; }
.screen.has-video { padding: 0; }
.vtabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.vtabs button { height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--raise-sm); }
.vtabs button[aria-pressed="true"] { background: var(--tint); color: var(--primary-ink); box-shadow: var(--ring); }

.side { flex: 1 1 280px; max-width: 340px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.src { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 22px; box-shadow: var(--raise-sm); }
.src .th { width: 44px; height: 66px; border-radius: 12px; background: var(--screen); flex: 0 0 44px; overflow: hidden; }
.src .th img { width: 100%; height: 100%; object-fit: cover; }
.src .meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.src .name { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src .x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; }

.timeline { border-radius: 30px; padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.tl { display: flex; gap: 10px; min-height: 60px; }
.tl > div { border-radius: 22px; display: flex; align-items: center; padding: 0 14px; font-size: 13px; font-weight: 600; box-shadow: var(--raise-sm); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dots { display: flex; justify-content: space-between; align-items: center; flex: 1 1 auto; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: #A9A3C8; }
.dots i.on { width: 7px; height: 7px; background: #fff; box-shadow: 0 0 8px var(--glow); }

/* бренд */
.swatch { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.swatch input[type=color] { width: 52px; height: 52px; border-radius: 50%; border: 0; padding: 0; background: none; box-shadow: 4px 5px 12px rgba(70,66,90,.32), -3px -3px 8px rgba(255,255,255,.8); cursor: pointer; }
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; }
.switch { width: 66px; height: 36px; flex: 0 0 66px; border-radius: 999px; border: 0; padding: 4px; display: flex; justify-content: flex-start; background: var(--bg); box-shadow: inset 3px 3px 7px rgba(70,66,90,.2), inset -3px -3px 7px rgba(255,255,255,.9); transition: all .22s cubic-bezier(.2,.8,.2,1); }
.switch span { width: 28px; height: 28px; border-radius: 50%; background: #E9E9EC; box-shadow: 2px 3px 6px rgba(70,66,90,.28), -2px -2px 5px rgba(255,255,255,.9); transition: all .22s cubic-bezier(.2,.8,.2,1); }
.switch[aria-checked="true"] { justify-content: flex-end; background: #E6E2F1; box-shadow: 0 0 0 1.5px var(--glow), var(--inset-sm), 0 0 16px rgba(160,110,255,.35); }
.switch[aria-checked="true"] span { background: #fff; box-shadow: 0 0 10px var(--glow), 2px 3px 6px rgba(70,66,90,.25); }
.styles { display: flex; gap: 18px; flex-wrap: wrap; }
.styles button { flex: 1 1 180px; height: 108px; border-radius: 22px; border: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; box-shadow: var(--raise-sm); }
.styles button[aria-pressed="true"] { background: var(--tint); box-shadow: var(--ring); }
.cap { font-family: 'Bebas Neue', 'Manrope', sans-serif; font-size: 22px; letter-spacing: .02em; padding: 2px 10px; line-height: 1.25; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2F2F36; color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 10; max-width: calc(100% - 32px); }

@media (max-width: 760px) {
  .page { padding: 16px 16px 24px; gap: 18px; }
  .h1 { font-size: 38px; }
  .chat { max-height: none; min-height: 520px; order: 2; }
  .stage { order: 1; }
  .side { max-width: none; order: 3; }
  .timeline { order: 4; }
  .tl { overflow-x: auto; }
  .tl > div { flex: 0 0 auto !important; }
  .phone { width: 260px; }
}

/* ход монтажа */
.progress-bub { min-width: 260px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.st { display: flex; gap: 10px; align-items: flex-start; }
.st-mark { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; box-shadow: var(--inset-sm); color: #3D2A99; }
.st-done .st-mark { background: var(--tint); box-shadow: 0 0 0 1.5px var(--glow); }
.st-now .st-mark { background: #F4F1FF; box-shadow: 0 0 0 1.5px var(--glow), 0 0 12px rgba(160,110,255,.5); }
.st-now .st-mark .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--glow); animation: pulse 1.4s infinite; }
.st-title { font-weight: 700; font-size: 14px; }
.st-todo .st-title { color: var(--soft); font-weight: 600; }
.st-done .st-title { color: var(--muted); }
.st-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* кликабельный таймлайн */
.seg-btn { border: 0; border-radius: 22px; background: var(--bg); padding: 0 14px; font-size: 13px; font-weight: 600; box-shadow: var(--raise-sm); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; min-height: 60px; transition: box-shadow .2s, background .2s; }
.seg-btn:hover { box-shadow: var(--raise-sm), 0 0 0 1.5px var(--glow); }
.seg-btn[aria-current="true"] { background: var(--tint); color: var(--primary-ink); box-shadow: var(--ring), var(--inset-sm); }

/* админка */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi-v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.tbl-wrap { overflow-x: auto; border-radius: 18px; box-shadow: var(--inset-sm); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 700; color: var(--muted); padding: 12px 14px; white-space: nowrap; border-bottom: 1px solid #C9C8D0; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid #D2D2D8; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .err { color: #8F272C; font-weight: 700; }
.winbar { display: inline-flex; width: 60px; height: 6px; border-radius: 3px; background: #C9C8D0; vertical-align: middle; margin-right: 6px; }
.winbar i { background: var(--primary); border-radius: 3px; }

/* два варианта рядом */
.duo { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; }
.duo-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.duo-label { font-weight: 800; font-size: 18px; }
.duo-phone { width: 240px; }
