/* proto-kit – панель прототипа и служебные слои. Всё под префиксом pk-,
   собственная нейтральная палитра, от токенов прототипа не зависит. */
:root {
  --pk-bg: rgba(16, 17, 20, .94);
  --pk-fg: #f5f5f4;
  --pk-mu: #a1a1aa;
  --pk-line: rgba(255, 255, 255, .12);
  --pk-hi: #3b82f6;
  --pk-cap: #ff4d8d;
  --pk-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.pk-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* панель */
.pk-bar {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 2147483000;
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 999px;
  background: var(--pk-bg); color: var(--pk-fg); font: 500 13px/1 var(--pk-font); letter-spacing: 0;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35), 0 0 0 1px var(--pk-line); backdrop-filter: blur(10px);
  max-width: calc(100vw - 32px); overflow-x: auto; scrollbar-width: none;
}
.pk-bar::-webkit-scrollbar { display: none; }
.pk-bar a, .pk-bar button {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px;
  border-radius: 999px; cursor: pointer; color: var(--pk-fg); white-space: nowrap; font: inherit;
}
.pk-bar a:hover, .pk-bar button:hover { background: rgba(255, 255, 255, .1); }
.pk-bar button.on { background: var(--pk-fg); color: #111; }
.pk-bar .pk-tag { font-weight: 650; padding-right: 13px; }
.pk-bar .pk-tag em { font-style: normal; color: var(--pk-mu); font-weight: 500; }
.pk-pos { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--pk-mu); padding: 0 2px; min-width: 38px; text-align: center; }
.pk-sep { width: 1px; height: 20px; background: var(--pk-line); margin: 0 4px; flex: none; }

/* поповеры */
.pk-pop {
  position: fixed; left: 16px; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 2147483001;
  width: 360px; max-width: calc(100vw - 32px); max-height: 72vh; overflow: auto; padding: 10px;
  background: #fff; color: #18181b; border-radius: 18px; font: 14px/1.4 var(--pk-font);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .06);
}
.pk-pop h5 { margin: 12px 10px 6px; font: 700 11px/1 var(--pk-font); letter-spacing: .08em; text-transform: uppercase; color: #71717a; }
.pk-pop h5:first-child { margin-top: 6px; }
.pk-pop a { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.pk-pop a span { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: #a1a1aa; min-width: 20px; }
.pk-pop a:hover { background: #f4f4f5; }
.pk-pop a.on { background: #18181b; color: #fff; }
.pk-pop a.on span { color: #a1a1aa; }
.pk-v { all: unset; box-sizing: border-box; display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px; border-radius: 12px; cursor: pointer; }
.pk-v:hover { background: #f4f4f5; }
.pk-v.on { background: #18181b; color: #fff; }
.pk-v b { display: block; font-weight: 650; }
.pk-v small { display: block; color: #71717a; font-size: 12px; margin-top: 2px; }
.pk-v.on small { color: #a1a1aa; }
.pk-sw { display: flex; flex: none; }
.pk-sw i { width: 22px; height: 22px; border-radius: 999px; margin-right: -7px; box-shadow: 0 0 0 2px #fff; }
.pk-v.on .pk-sw i { box-shadow: 0 0 0 2px #18181b; }
.pk-foot { margin: 10px; color: #71717a; font-size: 12px; line-height: 1.45; }

/* зоны: подсветка кликабельного – только по кнопке «Зоны», только обводкой (фон и тени элементов не трогаем) */
.pk-hot #app :is(a[href], button, [data-act], input, select, textarea, label, summary, [role=button]) {
  outline: 2px solid var(--pk-hi) !important; outline-offset: 2px;
}

/* возможности */
.pk-cap-dot {
  all: unset; position: absolute; z-index: 2147482990; width: 24px; height: 24px; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; background: var(--pk-cap); color: #fff; font: 700 12px/1 var(--pk-font);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 6px 16px rgba(0, 0, 0, .3); animation: pk-pop .25s ease-out;
}
.pk-cap-dot.on, .pk-cap-dot:hover { transform: scale(1.18); background: #111; }
@keyframes pk-pop { from { transform: scale(0); } to { transform: scale(1); } }
.pk-caps #app [data-cap] { outline: 2px dashed color-mix(in srgb, var(--pk-cap) 70%, transparent); outline-offset: 3px; }
.pk-cap-flash { animation: pk-capflash 1.2s ease-out; }
@keyframes pk-capflash { 0%, 40% { outline: 4px solid var(--pk-cap); outline-offset: 6px; } 100% { outline-offset: 3px; } }
.pk-caplist {
  position: fixed; right: 16px; top: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 2147482995; width: 330px;
  display: flex; flex-direction: column; background: #fff; color: #18181b; border-radius: 18px; font: 13px/1.45 var(--pk-font);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .06); overflow: hidden;
}
.pk-caplist header { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 18px; border-bottom: 1px solid #eee; }
.pk-caplist header b { font-size: 14px; }
.pk-caplist header button { all: unset; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.pk-caplist header button:hover { background: #f4f4f5; }
.pk-caplist-b { overflow: auto; padding: 8px; }
.pk-caplist-b button { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; }
.pk-caplist-b button:hover { background: #f4f4f5; }
.pk-caplist-b button.on { background: #fff0f5; }
.pk-caplist-b button span { flex: none; width: 22px; height: 22px; border-radius: 999px; background: var(--pk-cap); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 11px; }
.pk-caplist-b button b { display: block; margin-bottom: 2px; }
@media (max-width: 760px) {
  .pk-caplist { left: 10px; right: 10px; top: auto; width: auto; height: 42vh; }
  .pk-bar .pk-lbl { display: none; }
  .pk-bar .pk-tag em { display: none; }
}

/* мобильный предпросмотр */
.pk-device {
  position: fixed; inset: 0; z-index: 2147482999; background: rgba(10, 10, 12, .72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; gap: 28px; padding: 20px 20px 80px;
}
.pk-phone { width: 414px; height: min(876px, calc(100vh - 110px)); padding: 12px; border-radius: 54px; background: #111; box-shadow: 0 0 0 2px #333, 0 40px 90px rgba(0, 0, 0, .6); flex: none; }
.pk-phone iframe { width: 390px; height: 100%; border: 0; border-radius: 42px; background: #fff; display: block; }
.pk-device-side { color: #fff; font: 14px/1.45 var(--pk-font); max-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.pk-device-side small { color: #a1a1aa; }
.pk-device-side button { all: unset; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; margin-top: 8px; padding: 9px 14px; border-radius: 999px; background: #fff; color: #111; font-weight: 600; width: max-content; }
@media (max-width: 760px) { .pk-device { padding: 0; } .pk-phone { width: 100%; height: 100%; border-radius: 0; padding: 0; box-shadow: none; } .pk-phone iframe { width: 100%; border-radius: 0; } .pk-device-side { position: absolute; top: 10px; right: 10px; } .pk-device-side b, .pk-device-side small { display: none; } }

/* тост */
.pk-toast {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 2147482998; max-width: min(420px, calc(100vw - 32px));
  animation: pk-up .3s ease-out;
}
@keyframes pk-up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* карта экранов по умолчанию */
.pk-map { max-width: 1240px; margin: 0 auto; padding: 56px 24px 120px; font-family: var(--pk-font); }
.pk-map-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.pk-map-h small { text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: 12px; opacity: .6; }
.pk-map-h h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1; margin: 12px 0; letter-spacing: -.02em; }
.pk-map-h p { max-width: 640px; opacity: .75; margin: 0; }
.pk-map-go { display: inline-flex; gap: 8px; align-items: center; padding: 14px 22px; border-radius: 999px; background: currentColor; text-decoration: none; }
.pk-map-go, .pk-map-go * { color: #fff; mix-blend-mode: normal; }
.pk-lane { margin-top: 28px; }
.pk-lane h3 { font-size: 20px; margin: 0 0 14px; }
.pk-lane h3 small { font-weight: 400; opacity: .6; font-size: 14px; margin-left: 8px; }
.pk-flow { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.pk-node { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; border: 1px solid rgba(127, 127, 127, .3); text-decoration: none; color: inherit; }
.pk-node:hover { border-color: currentColor; }
.pk-node span { font: 600 12px/1 ui-monospace, Menlo, monospace; opacity: .5; }
.pk-node small { opacity: .7; font-size: 13px; line-height: 1.4; }

/* режимы */
.pk-embed .pk-bar, .pk-shot .pk-bar { display: none !important; }
.pk-shot *, .pk-shot *::before, .pk-shot *::after { animation: none !important; transition: none !important; caret-color: transparent !important; }

.pk-x { display: contents; }
/* стрелка, которая сейчас двигает сценарий экрана, а не листает экраны */
.pk-bar button.pk-step { background: #FF5A1F; color: #fff; }
.pk-bar button.pk-step:hover { background: #ff7440; }
.pk-bar .pk-tagb { font-weight: 650; }
