/* Хлів — клікабельний прототип панелі (не робочий). Токени ті самі, що в ../style.css */
:root {
  --milk: #fff9ec;
  --paper: #fffdf7;
  --butter: #f6d980;
  --butter-soft: #fcefc4;
  --ink: #2a211c;
  --ink-soft: #66574d;
  --peri: #5b5fef;
  --peri-ink: #4347c9;
  --peri-soft: #e7e8ff;
  --blush-soft: #fde4ea;
  --rose: #9c3553;
  --sage: #d6eedf;
  --green: #23634a;
  --sand: #f1ebe0;
  --shadow: 0 2px 0 rgba(160, 120, 60, .12), 0 12px 20px -14px rgba(110, 80, 40, .4);
  --stitch: 2px dashed rgba(42, 33, 28, .2);
  --display: "Unbounded", "Manrope", sans-serif;
  --side: #fbf2dc;      /* другий, тепліший шар для меню */
  --line: #efe6d6;
  --knit: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='22'><rect width='26' height='22' fill='%23efcb62'/><g fill='%23f8df92' stroke='%23d4ad40' stroke-width='1.2'><ellipse cx='7.5' cy='11' rx='5' ry='9.5' transform='rotate(-28 7.5 11)'/><ellipse cx='18.5' cy='11' rx='5' ry='9.5' transform='rotate(28 18.5 11)'/></g></svg>");
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --ease: cubic-bezier(.2, .9, .3, 1);
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; } /* інакше display:flex у .drop/.found перебиває hidden */
body { font-family: "Manrope", system-ui, sans-serif; color: var(--ink); background: var(--milk); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
a { color: var(--peri-ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
:focus-visible { outline: 3px solid var(--peri); outline-offset: 3px; }

.proto-badge { position: fixed; right: 16px; bottom: 16px; z-index: 10; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; font-size: .8rem; }

/* ---------- каркас ---------- */
.shell { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.side { flex: 1 1 220px; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; border-radius: 30px 26px 32px 24px; background: var(--paper); box-shadow: var(--shadow); outline: var(--stitch); outline-offset: -8px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.yarn { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c8, var(--butter)); box-shadow: inset -3px -3px 0 rgba(160, 110, 20, .3); }
.tag { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--peri-soft); color: var(--peri-ink); font: 800 .7rem "Manrope", sans-serif; }
.side a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 14px; color: var(--ink-soft); font-weight: 700; text-decoration: none; transition: background .2s; }
.side a:hover { background: #fff; color: var(--ink); }
.side a[aria-current="page"] { background: var(--butter-soft); color: var(--ink); font-weight: 800; }
.side svg, .ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.peek { margin-top: 18px; padding: 14px; border-radius: 18px; background: var(--peri-soft); font-size: .85rem; }
.peek b { display: block; }
.side .peek a { display: inline; min-height: 0; padding: 0; color: var(--peri-ink); }

main { flex: 999 1 560px; min-width: 0; }
.screen { display: flex; flex-direction: column; gap: 22px; animation: in .35s cubic-bezier(.2, .9, .3, 1); }
.screen[hidden] { display: none; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
.screen { animation-duration: .22s; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head h1 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); }
.sub { margin-top: 6px; color: var(--ink-soft); font-weight: 600; }
.back { font-weight: 700; font-size: .9rem; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; background: var(--peri-ink); color: #fff; font-weight: 800; text-decoration: none; box-shadow: 0 14px 26px -14px var(--peri-ink); transition: background .2s, transform .3s cubic-bezier(.2, .9, .3, 1); }
.btn:hover { background: var(--peri); }
.btn:active { transform: scale(.97); }
.btn-light { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.btn-light:hover { background: var(--butter-soft); }
.btn-soft { background: var(--butter-soft); color: var(--ink); box-shadow: none; }
.btn-soft:hover { background: #fbe39b; }
.btn-butter { background: var(--butter); color: var(--ink); box-shadow: none; }
.btn-butter:hover { background: #fbe39b; }
.btn-danger { background: var(--rose); box-shadow: none; }
.btn-danger:hover { background: #b0405e; }
.btn-big { min-height: 56px; padding: 0 34px; font-size: 1.05rem; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- картки ---------- */
.card { padding: 26px; border-radius: 30px 26px 32px 24px; background: var(--paper); box-shadow: var(--shadow); outline: var(--stitch); outline-offset: -10px; }
.card h2 { font-size: 1.2rem; margin-bottom: 4px; }
.card > p.muted { margin-bottom: 16px; }
.muted { color: var(--ink-soft); font-size: .9rem; }
.dark { padding: 28px 30px; border-radius: 40px 34px 38px 32px; background: var(--ink); color: #fff; }
.dark .muted { color: #d8cdc4; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.row-wrap > * { flex: 1 1 300px; min-width: 0; }

.stats { display: flex; flex-wrap: wrap; gap: 14px; }
.stat { flex: 1 1 170px; padding: 20px 22px; border-radius: 26px; background: var(--c, var(--sand)); }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: 2.3rem; line-height: 1; }
.stat b.small { font-size: 1.3rem; line-height: 1.3; }
.stat span { display: block; margin-top: 6px; font-weight: 700; color: var(--k, var(--ink-soft)); }

/* ---------- список ботів / сайтів ---------- */
.list { padding: 10px; border-radius: 32px 26px 30px 28px; background: var(--paper); box-shadow: var(--shadow); outline: var(--stitch); outline-offset: -8px; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 18px 20px; }
.item + .item { border-top: 1px solid var(--sand); }
.ava { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--a); color: #fff; font-family: var(--display); font-weight: 800; }
.ava.sq { border-radius: 14px; }
.ava.big { width: 64px; height: 64px; font-size: 1.5rem; }
.who { flex: 1 1 220px; min-width: 0; }
.who b { display: block; font-size: 1rem; }
.who span { color: var(--ink-soft); font-size: .9rem; }
.note { flex: 0 1 200px; color: var(--ink-soft); font-size: .82rem; font-weight: 600; }
.acts { display: flex; gap: 8px; margin-left: auto; }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .82rem; background: var(--sand); color: var(--ink-soft); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.up { background: var(--sage); color: var(--green); }
.pill.down { background: var(--blush-soft); color: var(--rose); }
.pill.wait { background: var(--butter-soft); color: #7a5410; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- сервер ---------- */
.server { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.server > div { flex: 1 1 250px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--butter); color: var(--ink); font-weight: 800; font-size: .75rem; }
.server h2 { margin: 12px 0 6px; font-size: 1.35rem; }
.meter + .meter { margin-top: 14px; }
.meter div { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 700; }
.meter div span:last-child { color: #d8cdc4; }
.bar { margin-top: 6px; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.bar i { display: block; width: 100%; height: 100%; border-radius: 999px; background: var(--butter); transform: scaleX(var(--w)); transform-origin: left; transition: transform .8s cubic-bezier(.2, .9, .3, 1); }

/* ---------- кроки (новий бот / сайт) ---------- */
.step-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.num { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c8, var(--butter)); color: var(--ink); font-family: var(--display); font-weight: 800; }
.step-head h2 { margin: 0; font-size: 1.2rem; }
.drop { width: 100%; padding: 36px 20px; border: 2px dashed rgba(67, 71, 201, .45); border-radius: 24px; background: var(--peri-soft); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transition: background .2s; }
.drop:hover, .drop.over { background: #d9dbff; }
.drop svg { width: 40px; height: 40px; fill: none; stroke: var(--peri-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop b { font-size: 1.05rem; }
.drop.rose { border-color: rgba(176, 64, 94, .4); background: #fffafb; }
.drop.rose:hover { background: var(--blush-soft); }
.drop.rose svg { stroke: var(--rose); }
.found { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 22px; background: var(--sage); }
.found > div { flex: 1 1 200px; }
.found span { display: block; color: var(--green); font-size: .9rem; font-weight: 700; }
.fields { display: flex; flex-wrap: wrap; gap: 16px; }
.fields label { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: .9rem; }
.fields label.full { flex-basis: 100%; }
.fields input, .fields select { min-height: 48px; padding: 0 16px; border: 2px solid #ece3d6; border-radius: 16px; background: #fff; font-size: .95rem; font-weight: 600; }
.fields input:focus, .fields select:focus { border-color: var(--peri); outline: none; }
.fields small { font-weight: 600; color: var(--ink-soft); font-size: .82rem; }
.fields code { padding: 1px 6px; border-radius: 6px; background: var(--butter-soft); color: var(--ink); font-weight: 800; }
.launch { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.launch > * { flex: 1 1 280px; }
.checks { list-style: none; padding: 0; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #a3978c; transition: color .3s; }
.checks li::before { content: ""; flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: var(--ink); font-size: .8rem; font-weight: 800; transition: background .3s; }
.checks li.now { color: #fff; }
.checks li.now::before { content: "•"; background: var(--butter); }
.checks li.ok { color: #fff; }
.checks li.ok::before { content: "✓"; background: #9fd6b8; }
.done-box { padding: 18px 20px; border-radius: 22px; background: var(--sage); color: var(--ink); animation: in .4s cubic-bezier(.2, .9, .3, 1); }
.done-box b { display: block; font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.done-box span { color: var(--green); font-weight: 700; font-size: .9rem; }
.launch-side { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.launch-side .muted { color: #d8cdc4; font-size: .82rem; font-weight: 600; }
.dark a { color: var(--butter); font-weight: 800; }
.dark a.btn { color: var(--ink); }
.dark .btn { box-shadow: none; } /* кольорова тінь на темному — як світіння, прибираємо */

/* ---------- сторінка бота ---------- */
.bot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.bot-head > div { flex: 1 1 240px; }
.bot-head h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.events { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.events li { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #f7f3ea; font-size: .9rem; font-weight: 600; }
.events li.hi { background: var(--butter-soft); }
.events time { flex: none; width: 96px; color: var(--ink-soft); font-size: .8rem; font-weight: 700; }
.code { border-radius: 26px; overflow: hidden; background: var(--ink); color: #fff; box-shadow: 0 34px 50px -32px rgba(42, 33, 28, .6); }
.code-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; background: #3a2f28; }
.code-bar b { font-size: .9rem; }
.code-bar span { color: #d8cdc4; font-size: .82rem; }
.code-bar .btn { margin-left: auto; }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font: 400 .82rem/1.7 "JetBrains Mono", ui-monospace, monospace; color: #f4ece2; outline: none; }
.code pre[contenteditable="true"] { background: #33291f; box-shadow: inset 0 0 0 2px var(--butter); }
.code p { padding: 0 20px 18px; color: #d8cdc4; font-size: .82rem; }
.c-cm { color: #a3978c; } .c-dec { color: #f6b9c6; } .c-kw { color: #a9acff; } .c-str { color: #9fd6b8; }
.access { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; transition: background .3s; }
.access > div { flex: 1 1 280px; }
.access.off { background: var(--blush-soft); }

/* ---------- вікно клієнта ---------- */
body.client .side { display: none; }
.c-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 999px; background: rgba(255, 249, 236, .8); box-shadow: var(--shadow); }
.c-logo { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; }
.c-logo .yarn { width: 26px; height: 26px; }
.c-logo b { color: var(--peri-ink); font-weight: inherit; }
.c-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 40px; border-radius: 46px 38px 48px 36px; box-shadow: var(--shadow); outline: 2px dashed rgba(47, 122, 88, .3); outline-offset: -13px;
  background: radial-gradient(rgba(255, 255, 255, .55) 1px, transparent 1.5px) 0 0 / 7px 7px, var(--sage); transition: background-color .4s; }
.c-hero.paused { background-color: var(--butter-soft); outline-color: rgba(122, 84, 16, .3); }
.c-hero > div:first-child { flex: 1 1 320px; }
.c-hero h1 { margin: 14px 0 8px; font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.c-hero p { font-weight: 600; max-width: 38ch; }
.c-hero .pill { background: #fff; }
.c-side { flex: 0 1 280px; display: flex; flex-direction: column; gap: 10px; }
.texts { display: flex; flex-direction: column; gap: 10px; }
.text-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--peri-soft); }
.text-row > div { flex: 1 1 220px; }
.text-row small { display: block; font-size: .75rem; font-weight: 800; color: var(--peri-ink); }
.text-row p { font-weight: 600; border-radius: 8px; outline: 2px dashed transparent; outline-offset: 4px; transition: outline-color .2s; }
.text-row p[contenteditable="true"] { outline-color: var(--peri); background: #fff; padding: 2px 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; translate: -50% 0; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: .9rem; opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .c-hero { padding: 28px 22px; }
  .card, .dark { padding: 22px 20px; }
  .acts { margin-left: 0; }
  .proto-badge { right: 50%; translate: 50% 0; bottom: 10px; }
}
/* ---------- конструктор ботів (блоки як у Scratch) ---------- */
body.builder .side { display: none; }
body.builder .shell { max-width: 1480px; }
.b-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.b-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.plats, .tpls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.plat, .tpl { min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 800; font-size: .85rem; }
.plat { background: #fff; color: var(--ink-soft); box-shadow: var(--shadow); }
.plat[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tpl { background: var(--butter-soft); }
.tpl:hover { background: #fbe39b; }
.tpl-gallery { border-radius: 22px; background: var(--butter-soft); }
.tpl-gallery summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; cursor: pointer; font-family: var(--display); font-weight: 600; }
.tpl-gallery summary .muted { font-family: "Manrope", sans-serif; font-weight: 600; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 4px 16px 16px; }
.tpl-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 18px; background: #fff; text-align: left; box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2, .9, .3, 1); }
.tpl-card:hover { transform: translateY(-3px); }
.tpl-card b { font-size: .95rem; }
.tpl-card span { color: var(--ink-soft); font-size: .8rem; font-weight: 600; line-height: 1.4; }
.b-notes { list-style: none; padding: 12px 16px; border-radius: 18px; background: var(--peri-soft); display: grid; gap: 4px; font-size: .84rem; font-weight: 600; }
.b-notes b { color: var(--peri-ink); }

.b-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.palette { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); outline: var(--stitch); outline-offset: -7px; }
.pal-search { min-height: 44px; padding: 0 14px; border: 2px solid #ece3d6; border-radius: 14px; background: #fff; font-weight: 600; }
.pal-search:focus { border-color: var(--peri); outline: none; }
.cats { display: flex; flex-wrap: wrap; gap: 5px; }
.cat { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border-radius: 999px; background: #fff; font-weight: 700; font-size: .76rem; box-shadow: inset 0 0 0 1px #ece3d6; }
.cat i { width: 10px; height: 10px; border-radius: 50%; background: var(--bc); }
.cat[aria-pressed="true"] { background: var(--bc); color: #fff; box-shadow: none; }
.cat[aria-pressed="true"] i { background: #fff; }
.pal-list { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow-y: auto; padding: 2px; }
.pal-item { min-height: 40px; padding: 8px 12px; border-radius: 12px; background: var(--bc); color: #fff; text-align: left; font-weight: 700; font-size: .84rem; cursor: grab; box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.pal-item.hat { border-radius: 20px 20px 12px 12px; }
.pal-item.c { border-radius: 12px 12px 12px 4px; }
.pal-item:hover { filter: brightness(1.08); }
.pal-group { margin: 6px 0 0 4px; font-size: .72rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }

.scen-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.scen-tab { min-height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; font-weight: 800; font-size: .85rem; box-shadow: var(--shadow); }
.scen-tab[aria-selected="true"] { background: var(--peri-ink); color: #fff; }
.scen-tab.add { background: transparent; box-shadow: inset 0 0 0 2px rgba(67, 71, 201, .35); color: var(--peri-ink); }
.stack { min-height: 520px; padding: 20px; border-radius: 26px; background: radial-gradient(rgba(42, 33, 28, .1) 1px, transparent 1.4px) 0 0 / 18px 18px, var(--paper); box-shadow: var(--shadow); }

.blk { --bc: #444; }
.blk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 8px 8px 6px; border-radius: 12px; background: var(--bc); color: #fff; font-weight: 700; font-size: .86rem; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.blk.hat > .blk-head { border-radius: 24px 24px 12px 12px; padding-top: 14px; }
.blk.c > .blk-head { border-radius: 12px 12px 12px 0; }
.blk input, .blk select { min-height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); font: 700 .84rem "Manrope", sans-serif; max-width: 100%; }
.blk input.v { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.blk input:focus, .blk select:focus { outline: 3px solid var(--butter); outline-offset: 1px; }
.grip { display: grid; place-items: center; width: 22px; height: 30px; border-radius: 8px; cursor: grab; opacity: .8; }
.grip svg { width: 14px; height: 14px; fill: currentColor; }
.grip:hover { background: rgba(255, 255, 255, .18); opacity: 1; }
.x { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; font-weight: 800; }
.x:hover { background: rgba(255, 255, 255, .32); }
.arm { padding: 2px 0 2px 18px; background: linear-gradient(var(--bc), var(--bc)) 0 0 / 14px 100% no-repeat; }
.blk-mid { display: inline-block; padding: 5px 14px; border-radius: 0 12px 12px 0; background: var(--bc); color: #fff; font-weight: 800; font-size: .8rem; }
.blk-foot { width: 120px; height: 14px; border-radius: 0 12px 12px 12px; background: var(--bc); box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.warn { display: inline-block; margin: 5px 0 2px 8px; padding: 3px 10px; border-radius: 999px; background: var(--butter-soft); color: #7a5410; font-size: .74rem; font-weight: 700; }
.blk.dragging { opacity: .4; }
.dz { height: 8px; border-radius: 8px; transition: height .15s, background .15s; }
.dz.over { height: 36px; background: rgba(91, 95, 239, .15); box-shadow: inset 0 0 0 2px var(--peri); }
.dz.empty { height: 38px; display: grid; place-items: center; margin: 4px 0; border-radius: 12px; background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 2px rgba(42, 33, 28, .15); color: var(--ink-soft); font-size: .76rem; font-weight: 700; }
.dz.empty.over { box-shadow: inset 0 0 0 2px var(--peri); background: rgba(91, 95, 239, .15); }

.b-phone { position: sticky; top: 16px; }
.sim { width: 100%; max-width: 320px; margin: 0 auto; padding: 9px; border-radius: 42px; background: var(--ink); box-shadow: 0 34px 50px -30px rgba(42, 33, 28, .75); }
.sim-top { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; border-radius: 34px 34px 0 0; background: #fff; border-bottom: 1px solid #ece9f7; }
.sim-top .ava { width: 38px; height: 38px; font-size: .9rem; }
.sim-top b { display: block; font-size: .88rem; line-height: 1.3; }
.sim-top small { color: var(--peri-ink); font-weight: 700; font-size: .74rem; }
.sim-chat { height: 380px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: radial-gradient(rgba(67, 71, 201, .11) 1px, transparent 1.6px) 0 0 / 14px 14px, #e9eafc; }
.bub { max-width: 86%; padding: 8px 12px; border-radius: 16px; font-size: .84rem; line-height: 1.42; white-space: pre-line; overflow-wrap: anywhere; animation: in .3s cubic-bezier(.2, .9, .3, 1); }
.bub.b { align-self: flex-start; background: #fff; border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(40, 40, 90, .12); }
.bub.u { align-self: flex-end; background: var(--peri-ink); color: #fff; border-bottom-right-radius: 5px; }
.bub.s { align-self: center; max-width: 94%; padding: 4px 12px; border-radius: 999px; background: rgba(42, 33, 28, .08); color: var(--ink-soft); font-size: .74rem; font-weight: 700; text-align: center; }
.bub.err { background: var(--blush-soft); }
.bub.typing { display: flex; gap: 4px; padding: 12px 14px; }
.bub.typing i { width: 6px; height: 6px; border-radius: 50%; background: #b5a596; animation: blink 1s infinite; }
.sim-choices, .sim-menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px; background: #e9eafc; }
.sim-choices:not(:empty) { padding: 8px 10px; }
.sim-menu { background: #fff; }
.sim-menu:not(:empty) { padding: 8px 10px 0; }
.sim-choices button, .sim-menu button { flex: 1 1 40%; min-height: 40px; padding: 6px 8px; border-radius: 12px; background: #fff; color: var(--peri-ink); font-weight: 700; font-size: .8rem; box-shadow: 0 1px 2px rgba(40, 40, 90, .15); }
.sim-menu button { background: var(--peri-soft); box-shadow: none; }
.sim-form { display: flex; gap: 6px; padding: 8px 10px 16px; border-radius: 0 0 34px 34px; background: #fff; }
.sim-form input { flex: 1; min-width: 0; min-height: 42px; padding: 0 14px; border: 2px solid #ece3d6; border-radius: 999px; font-weight: 600; font-size: .86rem; }
.sim-form input:focus { border-color: var(--peri); outline: none; }
.sim-form button { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--peri-ink); color: #fff; }
.sim-form button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1180px) {
  .b-grid { grid-template-columns: 240px minmax(0, 1fr); }
  .b-phone { grid-column: 1 / -1; position: static; }
}
@media (max-width: 760px) {
  .b-grid { grid-template-columns: 1fr; }
  .palette { position: static; }
  .pal-list { max-height: 260px; }
  .stack { padding: 12px; min-height: 300px; }
}

/* ---------- рівень вище: оболонка, стани, деталі ---------- */
html { scrollbar-color: #e2c470 var(--milk); caret-color: var(--peri-ink); }
::selection { background: var(--butter); color: var(--ink); }
::placeholder { color: #7a6b60; opacity: 1; }
body::after { content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none; background: var(--noise); opacity: .06; mix-blend-mode: multiply; }
.col-num, .stat b, .meter, .tally-legend b, #sideMem { font-variant-numeric: tabular-nums; }

.yarn-ic { width: 30px; height: 30px; flex: none; overflow: visible; filter: drop-shadow(0 3px 4px rgba(160, 110, 30, .25)); }
.c-logo .yarn-ic { width: 26px; height: 26px; }
.side { background: var(--side); gap: 2px; }
.side a { position: relative; }
.side a[aria-current="page"] { background: #fff; box-shadow: var(--shadow); }
.side a[aria-current="page"]::after { content: ""; position: absolute; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c8, var(--butter)); box-shadow: inset -1px -1px 0 rgba(160, 110, 20, .4); }
.side-mem { flex-direction: column; align-items: stretch !important; gap: 6px !important; min-height: 0 !important; margin-top: 14px; padding: 12px !important; border-radius: 16px !important; background: rgba(255, 255, 255, .55); }
.side-mem > span:first-child { display: flex; justify-content: space-between; font-size: .8rem; }
.side-mem b { color: var(--ink); }
.side-mem .bar { margin: 0; height: 8px; background: rgba(42, 33, 28, .08); }

/* в'язана смужка — як стрічка на сайті */
.bar i { background: var(--knit) 0 0 / 13px 11px; box-shadow: inset 0 -1px 0 rgba(120, 80, 10, .25); }

.btn-ghost { background: transparent; color: var(--ink); box-shadow: none; padding-right: 10px; }
.btn-ghost:hover { background: #fff; box-shadow: var(--shadow); }
.btn-ghost .ic { width: 16px; height: 16px; }
.btn { transition: background .18s, box-shadow .18s, transform .3s var(--ease); }
.btn:focus-visible { outline: 3px solid var(--peri); outline-offset: 3px; }

.pill { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent); }

/* банер уваги */
.health { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; padding: 18px 20px; border-radius: 24px; }
.health > .ic { width: 28px; height: 28px; stroke-width: 1.8; }
.health > div { flex: 1 1 260px; }
.health b { display: block; font-size: 1.02rem; }
.health span { font-size: .9rem; font-weight: 600; }
.health.bad { background: var(--blush-soft); color: var(--rose); box-shadow: inset 0 0 0 2px rgba(156, 53, 83, .18); }
.health.bad b { color: var(--ink); }
.health.bad span { color: #7d2c44; }
.health.good { background: var(--sage); color: var(--green); }
.health.good b { color: var(--ink); }
.health .btn { background: var(--rose); box-shadow: none; }
.health .btn:hover { background: #b0405e; }

/* пряжа статусів: одна смужка замість чотирьох карток */
.tally { display: flex; flex-direction: column; gap: 10px; }
.tally-bar { display: flex; gap: 4px; height: 14px; }
.tally-bar i { border-radius: 999px; transition: flex .5s var(--ease); }
.tally-bar .up { background: var(--knit) 0 0 / 13px 11px; filter: hue-rotate(80deg) saturate(1.1) brightness(.92); }
.tally-bar .down { background: #d97a92; }
.tally-bar .off { background: #d9cfc2; }
.tally-legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.tally-legend li { display: flex; align-items: center; gap: 7px; }
.tally-legend li > i { width: 10px; height: 10px; border-radius: 50%; }
.tally-legend i.up { background: #4fae7f; } .tally-legend i.down { background: #d97a92; } .tally-legend i.off { background: #c9bdaf; }
.tally-legend b { color: var(--ink); }
.tally-backup { margin-left: auto; }
.tally-backup .ic { width: 16px; height: 16px; }

/* таблиця ботів */
.list.table { padding: 6px 10px; }
.list-head, .row-bot { display: grid; grid-template-columns: 46px minmax(170px, 2.2fr) minmax(120px, 1.3fr) 124px 96px 70px 236px; align-items: center; gap: 14px; }
.list-head span:first-child { grid-column: span 2; }
.list-head { padding: 10px 20px 8px; font-size: .74rem; font-weight: 800; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.row-bot { padding: 14px 20px; border-radius: 18px; transition: background .18s; }
.row-bot + .row-bot { border-top: 0; }
.row-bot:hover { background: rgba(252, 239, 196, .55); }
.row-bot .who { flex: none; }
.row-bot .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-client { font-size: .88rem; font-weight: 600; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-num { font-size: .9rem; font-weight: 700; }
.row-bot .acts { margin-left: 0; justify-content: flex-end; }
.ava.ring { position: relative; }
.ava.ring::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--paper); background: #c9bdaf; }
.ava.ring.up::after { background: #3cbf86; }
.ava.ring.down::after { background: #d9455f; }

/* нитка між кроками запуску: заповнюється, коли крок готовий */
.checks li { position: relative; }
.checks li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 24px; bottom: -12px; width: 2px; border-radius: 2px; background: repeating-linear-gradient(rgba(255, 255, 255, .25) 0 4px, transparent 4px 8px); transition: background .4s; }
.checks li.ok:not(:last-child)::after { background: var(--butter); }

@media (max-width: 1000px) {
  .list-head { display: none; }
  .row-bot { grid-template-columns: auto 1fr auto; grid-template-areas: "ava who status" "ava client client" "acts acts acts"; row-gap: 6px; }
  .row-bot .ava { grid-area: ava; align-self: start; }
  .row-bot .who { grid-area: who; min-width: 0; }
  .row-bot .col-status { grid-area: status; }
  .row-bot .col-client { grid-area: client; }
  .row-bot .col-num { display: none; }
  .row-bot .acts { grid-area: acts; justify-content: flex-start; }
}
@media (max-width: 760px) {
  /* меню на телефоні: компактна стрічка, що гортається вбік */
  .side { flex: 1 1 100%; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px; border-radius: 22px; scrollbar-width: none; }
  .side .brand { padding: 0 8px 0 4px; }
  .side .brand .tag, .side .peek, .side .side-mem { display: none; }
  .side a { flex: none; white-space: nowrap; }
  .side a[aria-current="page"]::after { display: none; }
  .tally-backup { margin-left: 0; }
}

/* ---------- справжня панель: вхід, демо-позначки, помилки ---------- */
body.login .side { display: none; }
.screen.login { min-height: 70vh; align-items: center; justify-content: center; }
.login-card { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(380px, 100%); padding: 36px 30px; border-radius: 32px; background: var(--paper); box-shadow: var(--shadow); outline: var(--stitch); outline-offset: -10px; text-align: center; }
.login-card .yarn-ic { width: 56px; height: 56px; }
.login-card .fields { width: 100%; text-align: left; }
.login-card .btn { width: 100%; }
.login-err { min-height: 1.4em; color: var(--rose); font-weight: 700; font-size: .9rem; }
.demo-note { align-self: flex-start; padding: 8px 16px; border-radius: 999px; background: var(--peri-soft); color: var(--peri-ink); font-weight: 800; font-size: .82rem; }
.err-box { padding: 16px 18px; border-radius: 20px; background: var(--blush-soft); color: var(--ink); }
.err-box b { display: block; color: var(--rose); }
.err-box span { display: block; white-space: pre-line; font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; }
.raw-log { max-height: 320px; overflow: auto; margin-top: 12px; padding: 14px; border-radius: 16px; background: var(--ink); color: #f4ece2; font: .78rem/1.55 "JetBrains Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.new-client { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 16px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.new-client .fields { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: .88rem; }
.new-client select { min-height: 48px; padding: 0 14px; border: 2px solid #ece3d6; border-radius: 16px; background: #fff; font-weight: 600; }
.fields input { width: 100%; }

/* ---------- етап 2: вхід через Telegram, люди клієнта, вікно клієнта ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tg-widget { min-height: 48px; display: grid; place-items: center; }
.pass-login { width: 100%; text-align: left; }
.pass-login summary { cursor: pointer; color: var(--ink-soft); font-weight: 700; font-size: .88rem; text-align: center; padding: 6px; }
.pass-login[open] { display: flex; flex-direction: column; gap: 10px; }
.people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .86rem; }
.x-mini { margin-left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--blush-soft); color: var(--rose); font-weight: 800; line-height: 1; }
.x-mini:hover { background: #f6c9d4; }
.invite-url { padding: 12px 14px; border-radius: 16px; background: var(--peri-soft); font-size: .84rem; font-weight: 600; overflow-wrap: anywhere; }
.invite-url code { font-size: .8rem; color: var(--peri-ink); }
.mine-list { display: flex; flex-direction: column; gap: 16px; }
.mine-title { margin: 14px 0 8px; font-size: clamp(1.4rem, 3vw, 2rem); }
.texts-form { display: flex; flex-direction: column; gap: 10px; }
.text-field { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: .84rem; }
.text-field textarea { min-height: 48px; padding: 10px 14px; border: 2px solid #ece3d6; border-radius: 14px; background: #fff; font: 600 .95rem "Manrope", sans-serif; resize: vertical; }
.text-field textarea:focus { border-color: var(--peri); outline: none; }

/* ---------- голос ягнятка й звіт для донора ---------- */
.lamb-say { display: flex; align-items: center; gap: 12px; align-self: flex-start; max-width: 520px; padding: 12px 18px 12px 12px; border-radius: 22px 22px 22px 6px; background: #fff; box-shadow: var(--shadow); outline: var(--stitch); outline-offset: -6px; font-weight: 700; font-size: .92rem; }
.lamb-say .yarn-ic { width: 34px; height: 34px; }
.report-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; max-width: 820px; width: 100%; margin: 0 auto; }
.report { max-width: 820px; width: 100%; margin: 0 auto; padding: 48px; border-radius: 28px; background: #fff; box-shadow: 0 30px 60px -40px rgba(42, 33, 28, .5); display: flex; flex-direction: column; gap: 30px; }
.r-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; padding-bottom: 24px; border-bottom: 2px dashed var(--line); }
.r-org { font-weight: 800; color: var(--peri-ink); margin-bottom: 6px; }
.r-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 6px; }
.r-yarn { width: 64px; height: 64px; }
.r-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.r-nums div { padding: 18px; border-radius: 18px; background: var(--butter-soft); }
.r-nums b { display: block; font-family: var(--display); font-weight: 800; font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.r-nums span { color: var(--ink-soft); font-size: .88rem; font-weight: 700; }
.report h2 { font-size: 1.1rem; margin-bottom: 10px; }
.report p { max-width: 65ch; }
.r-list { padding-left: 20px; display: grid; gap: 6px; }
.r-foot { padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .8rem; font-weight: 600; }
@media (max-width: 760px) { .report { padding: 26px 20px; } }
@media print {
  body { background: #fff; }
  body::after, .side, .proto-badge, .report-bar, .toast { display: none !important; }
  .shell { padding: 0; max-width: none; }
  .report { box-shadow: none; padding: 0; max-width: none; }
  .r-nums div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- клієнти й права ---------- */
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.client-card { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; padding: 24px; border-radius: 30px 26px 32px 24px; background: var(--paper); box-shadow: var(--shadow); outline: var(--stitch); outline-offset: -10px; transition: background .3s; }
.client-card.locked { background: var(--blush-soft); }
.cc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; }
.access-sw { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: .8rem; font-weight: 800; color: var(--ink-soft); }
.owns { display: flex; flex-wrap: wrap; gap: 6px; }
.own { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; font-size: .82rem; font-weight: 700; box-shadow: inset 0 0 0 1px #ece3d6; }
.own i { width: 8px; height: 8px; border-radius: 50%; background: #a3978c; }
.own i.dot-up { background: #3cbf86; } .own i.dot-down { background: var(--rose); } .own i.dot-wait { background: #d4a72c; }
.rights { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; width: 100%; }
.right { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 16px; background: #fff; }
.right b { display: block; font-size: .88rem; }
.right small { display: block; color: var(--ink-soft); font-size: .76rem; font-weight: 600; line-height: 1.35; }
.right.dim { opacity: .55; }
.switch { flex: none; position: relative; width: 46px; height: 28px; border-radius: 999px; background: #d9cfc2; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.2, .9, .3, 1); }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch[disabled] { cursor: not-allowed; }
.peek-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800; font-size: .85rem; }
.peek-bar a { color: var(--butter); }
.c-off { padding: 14px 20px; border-radius: 20px; background: var(--blush-soft); color: var(--rose); font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.own .ic { width: 14px; height: 14px; }
