/* 22570424: переписка с ботом мастерской кофемашин «Пенка». Своя сцена (works/22570424/stage.html).
   Без скрипта: два чата и журнал списком. В режиме истории: телефон, сообщения по одному, журнал сбоку. */

#w22570424 .pk {
  --pk-esp: #2a1c14;
  --pk-cream: #f3ebe1;
  --pk-bub: #fffdfa;
  --pk-me: #f3dcbd;
  --pk-ink: #2b1d14;
  --pk-meta: #9c8572;
  --pk-acc: #a9592a;
  --pk-acc2: #c0662a;
  --pk-own: #2f5a4f;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  font-family: var(--text);
}
#w22570424 .pk-phone { width: min(100%, 400px); }
#w22570424 .pk-sb, #w22570424 .pk-input, #w22570424 .pk-typing, #w22570424 .pk-st-ty, #w22570424 .pk-st-sc, #w22570424 .pk-seg { display: none; }
#w22570424 .pk-track { display: grid; gap: 18px; }
#w22570424 .pk-chat {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: var(--pk-cream);
  color: var(--pk-ink);
  box-shadow: 0 0 0 1px rgba(60, 35, 15, 0.1), 0 30px 60px -36px rgba(40, 20, 5, 0.5);
}

/* шапка чата */
#w22570424 .pk-head {
  flex: none;
  display: grid;
  grid-template-columns: 22px 40px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px 8px;
  background: var(--pk-esp);
  color: #fbf3e8;
  position: relative;
  z-index: 2;
}
#w22570424 .pk-back { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
#w22570424 .pk-more { width: 22px; height: 22px; fill: currentColor; opacity: 0.7; }
#w22570424 .pk-ava {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 26%, #e9ac70, #b0602c 58%, #7c3d17);
  color: #fff7ec;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
#w22570424 .pk-ava svg { width: 30px; height: 30px; fill: currentColor; }
#w22570424 .pk-ava-o { background: radial-gradient(circle at 32% 26%, #7fa596, #3b6a5d 58%, #234238); }
#w22570424 .pk-who { min-width: 0; line-height: 1.25; }
#w22570424 .pk-who b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#w22570424 .pk-who small { display: block; font-size: 12.5px; color: rgba(251, 243, 232, 0.6); }
#w22570424 .pk-st-ty, #w22570424 .pk-st-sc { color: #f3b77c; }
#w22570424 .pk-who small i { display: inline-block; width: 0; overflow: hidden; vertical-align: bottom; animation: w22570424-dots 1.2s steps(4, jump-none) infinite; }
#w22570424 .pk-who small i::after { content: "..."; }

/* лента */
#w22570424 .pk-view {
  position: relative;
  padding: 0 10px;
  background-color: var(--pk-cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' viewBox='0 0 132 132'%3E%3Cg fill='none' stroke='%237a4f2c' stroke-opacity='.1' stroke-width='1.4' stroke-linecap='round'%3E%3Cg transform='translate(22 26) rotate(-28)'%3E%3Cellipse rx='6' ry='8.5'/%3E%3Cpath d='M0-7.6c-2.6 3.4-2.6 11.8 0 15.2'/%3E%3C/g%3E%3Cg transform='translate(96 18) rotate(34)'%3E%3Cellipse rx='5' ry='7'/%3E%3Cpath d='M0-6.2c-2.2 2.8-2.2 9.6 0 12.4'/%3E%3C/g%3E%3Cg transform='translate(70 74) rotate(-60)'%3E%3Cellipse rx='6' ry='8.5'/%3E%3Cpath d='M0-7.6c-2.6 3.4-2.6 11.8 0 15.2'/%3E%3C/g%3E%3Cg transform='translate(18 104) rotate(12)'%3E%3Cellipse rx='5' ry='7'/%3E%3Cpath d='M0-6.2c-2.2 2.8-2.2 9.6 0 12.4'/%3E%3C/g%3E%3Cg transform='translate(112 108) rotate(-14)'%3E%3Cpath d='M-7-3h12v4a6 6 0 0 1-12 0z'/%3E%3Cpath d='M5-1.6h1.6a2.3 2.3 0 0 1 0 4.6H4.4'/%3E%3C/g%3E%3Cg transform='translate(44 48)'%3E%3Cpath d='M-2-3q2-2 0-4M2-3q2-2 0-4'/%3E%3C/g%3E%3C/g%3E%3Cg fill='%237a4f2c' fill-opacity='.08'%3E%3Ccircle cx='60' cy='12' r='1.6'/%3E%3Ccircle cx='120' cy='60' r='1.6'/%3E%3Ccircle cx='38' cy='76' r='1.4'/%3E%3Ccircle cx='84' cy='120' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 132px 132px;
}
#w22570424 .pk-list { display: flex; flex-direction: column; gap: 6px; padding: 10px 0 12px; }
#w22570424 .pk-chip {
  align-self: center;
  margin: 4px 0;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(84, 52, 28, 0.13);
  color: #6a5040;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
#w22570424 .pk-intro {
  align-self: center;
  margin: auto 0 10px;
  max-width: 84%;
  text-align: center;
  background: rgba(255, 251, 246, 0.86);
  border-radius: 18px;
  padding: 16px 16px 14px;
  box-shadow: 0 1px 2px rgba(70, 40, 15, 0.1);
}
#w22570424 .pk-ava-l { width: 56px; height: 56px; margin: 0 auto 8px; }
#w22570424 .pk-ava-l svg { width: 42px; height: 42px; }
#w22570424 .pk-intro b { display: block; font-size: 14.5px; }
#w22570424 .pk-intro p { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: #7c6654; }
#w22570424 .pk-cmd { display: flex; justify-content: center; gap: 6px; margin-top: 10px !important; }
#w22570424 .pk-cmd code, #w22570424 .pk-cmdtx { font: 600 12.5px/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
#w22570424 .pk-cmd code { background: #ece2d6; color: #5a3a24; padding: 4px 7px; border-radius: 6px; }
#w22570424 .pk-cmdtx { color: #7a3f17; font-size: 14px; }

/* сообщения */
#w22570424 .pk-b {
  position: relative;
  align-self: flex-start;
  max-width: 84%;
  padding: 7px 11px 7px;
  border-radius: 17px 17px 17px 6px;
  background: var(--pk-bub);
  color: var(--pk-ink);
  box-shadow: 0 1px 1.5px rgba(70, 40, 15, 0.15);
  font-size: 14px;
  line-height: 1.4;
  transform-origin: 0 100%;
}
#w22570424 .pk-me { align-self: flex-end; background: var(--pk-me); border-radius: 17px 17px 6px 17px; transform-origin: 100% 100%; }
#w22570424 .pk-b p { margin: 0; }
#w22570424 .pk-time {
  float: right;
  position: relative;
  top: 7px;
  margin: 0 -4px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 400;
  color: #ab9582;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#w22570424 .pk-me .pk-time { color: #9a7550; }
#w22570424 .pk-time-b { float: none; display: flex; justify-content: flex-end; top: 0; margin: 4px 0 0; }
#w22570424 .pk-tk { display: inline-flex; color: var(--pk-acc2); }
#w22570424 .pk-tk svg { width: 16px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* кнопки под сообщением */
#w22570424 .pk-kb { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px -5px -1px; clear: both; }
#w22570424 .pk-kb-2 { display: grid; grid-template-columns: 1fr 1fr; }
#w22570424 .pk-btn {
  position: relative;
  flex: 1 1 auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 11px;
  background: #f8eee2;
  color: #94501f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  box-shadow: inset 0 0 0 1px #efdcc6;
  overflow: hidden;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.25s;
}
#w22570424 .pk-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
#w22570424 .pk-btn.tap { background: var(--pk-acc); color: #fff; box-shadow: none; }

/* фото от клиента */
#w22570424 .pk-photo { width: 72%; padding: 4px 4px 7px; }
#w22570424 .pk-shot { position: relative; display: block; overflow: hidden; border-radius: 14px 14px 6px 6px; }
#w22570424 .pk-shot img { display: block; width: 100%; height: auto; }
#w22570424 .pk-photo p { padding: 6px 7px 0; }

/* файл выгрузки */
#w22570424 .pk-file { width: 80%; }
#w22570424 .pk-doc { display: flex; align-items: center; gap: 10px; margin: 2px 0 7px; padding: 8px 9px; border-radius: 12px; background: #f4ede4; }
#w22570424 .pk-doc-i { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #2f7a55; color: #fff; }
#w22570424 .pk-doc-i svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
#w22570424 .pk-doc-t { min-width: 0; line-height: 1.25; }
#w22570424 .pk-doc-t b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#w22570424 .pk-doc-t small { display: block; font-size: 11.5px; color: #8a7462; margin-top: 2px; }

/* уведомление владельцу поверх экрана */
#w22570424 .pk-push { display: none; }

/* диагноз по фото */
#w22570424 .pk-diag { width: 86%; }
#w22570424 .pk-lead { font-weight: 600; }
#w22570424 .pk-crop { position: relative; height: 138px; margin: 7px -5px 9px; border-radius: 10px; overflow: hidden; background: #d9cfc4; }
#w22570424 .pk-crop-in { position: absolute; left: 0; right: 0; top: 50%; aspect-ratio: 4 / 3; transform: translateY(-61%); }
#w22570424 .pk-crop img { display: block; width: 100%; height: 100%; }
#w22570424 .pk-mark {
  position: absolute;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--pk-acc2), 0 0 0 999px rgba(30, 15, 5, 0);
  font-size: 0;
}
#w22570424 .pk-mark:first-of-type { width: 92px; height: 34px; margin: -17px 0 0 -46px; }
#w22570424 .pk-mark::before {
  content: attr(data-n);
  position: absolute;
  right: -8px;
  top: -9px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--pk-acc2);
  color: #fff;
  font: 800 11px/19px var(--text);
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
#w22570424 .pk-mark:first-of-type::before { right: -4px; top: -11px; }
#w22570424 .pk-dx { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 5px; align-items: center; margin-top: 7px; }
#w22570424 .pk-n { width: 20px; height: 20px; border-radius: 50%; background: var(--pk-acc2); color: #fff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; }
#w22570424 .pk-dx-2 .pk-n { background: #cf9a6c; }
#w22570424 .pk-dx-t { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
#w22570424 .pk-dx em { font-style: normal; font-size: 13.5px; font-weight: 800; color: #9a4c1a; font-variant-numeric: tabular-nums; }
#w22570424 .pk-meter { grid-column: 2 / 4; height: 6px; border-radius: 3px; background: #efe3d5; overflow: hidden; }
#w22570424 .pk-meter i { display: block; height: 100%; width: calc(var(--v) * 100%); border-radius: 3px; background: linear-gradient(90deg, #dc8f4e, var(--pk-acc)); transform-origin: 0 50%; }
#w22570424 .pk-dx-2 .pk-meter i { background: linear-gradient(90deg, #e6bd96, #cf9a6c); }
#w22570424 .pk-fine { margin-top: 9px !important; font-size: 12.5px; color: #8a7462; }

/* смета */
#w22570424 .pk-card, #w22570424 .pk-stats, #w22570424 .pk-ticket { width: 88%; padding: 0 0 7px; overflow: hidden; }
#w22570424 .pk-card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 9px;
  background: linear-gradient(100deg, #3a2519, #77421f);
  color: #fbf1e4;
}
#w22570424 .pk-card-h b { font-size: 14.5px; }
#w22570424 .pk-card-h span { font-size: 11px; font-weight: 700; line-height: 1; padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.15); color: #f6d6b2; }
#w22570424 .pk-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 12px 0; }
#w22570424 .pk-row span { font-size: 13.5px; line-height: 1.25; }
#w22570424 .pk-row small { display: block; font-size: 11.5px; color: #a08a77; margin-top: 1px; }
#w22570424 .pk-row b, #w22570424 .pk-sum b { font-variant-numeric: tabular-nums; white-space: nowrap; }
#w22570424 .pk-row b { font-size: 13.5px; }
#w22570424 .pk-sum { display: flex; justify-content: space-between; align-items: baseline; margin: 9px 12px 0; padding-top: 8px; border-top: 1.5px dashed #e6d6c4; font-size: 16px; font-weight: 800; color: #6d3c1d; }
#w22570424 .pk-note { display: flex; align-items: center; gap: 5px; margin: 6px 12px 0 !important; font-size: 11.5px; color: #8a7462; }
#w22570424 .pk-note svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#w22570424 :is(.pk-card, .pk-stats, .pk-ticket) .pk-kb { margin: 10px 7px 0; }
#w22570424 :is(.pk-card, .pk-stats, .pk-ticket) .pk-time-b { margin: 5px 11px 0; }

/* заявка-билет */
#w22570424 .pk-tk-h {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 12px;
  background: #faeddd;
  border-bottom: 2px dashed #e6cfb4;
}
#w22570424 .pk-tk-h::before, #w22570424 .pk-tk-h::after { content: ""; position: absolute; bottom: -8px; width: 14px; height: 14px; border-radius: 50%; background: var(--pk-cream); }
#w22570424 .pk-tk-h::before { left: -7px; }
#w22570424 .pk-tk-h::after { right: -7px; }
#w22570424 .pk-tk-h small { display: block; font-size: 11.5px; font-weight: 700; color: #a2703f; }
#w22570424 .pk-tk-h b { font-size: 17px; letter-spacing: -0.01em; }
#w22570424 .pk-when { text-align: center; background: var(--pk-acc); color: #fff; border-radius: 10px; padding: 5px 10px 4px; line-height: 1.1; }
#w22570424 .pk-when b { display: block; font-size: 16px; }
#w22570424 .pk-when small { color: #ffe2c4; font-weight: 600; font-size: 11px; }
#w22570424 .pk-ticket dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 11px 12px 0; font-size: 13px; line-height: 1.3; }
#w22570424 .pk-ticket dt { color: #a08a77; }
#w22570424 .pk-ticket dd { margin: 0; font-weight: 600; }
#w22570424 .pk-arch { display: flex; align-items: center; gap: 6px; margin: 9px 12px 0 !important; font-size: 12px; font-weight: 600; color: #46754f; }
#w22570424 .pk-arch svg { width: 15px; height: 15px; flex: none; fill: #dcefd9; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* напоминание и склад */
#w22570424 .pk-remind { box-shadow: inset 3px 0 0 var(--pk-acc2), 0 1px 1.5px rgba(70, 40, 15, 0.15); padding-left: 13px; }
#w22570424 .pk-tag { display: flex; align-items: center; gap: 5px; margin-bottom: 3px !important; font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #b05a22; }
#w22570424 .pk-tag svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
#w22570424 .pk-alert .pk-tag { color: var(--pk-own); }
#w22570424 .pk-alert { box-shadow: inset 3px 0 0 #4f8a78, 0 1px 1.5px rgba(70, 40, 15, 0.15); padding-left: 13px; }

/* сводка владельцу */
#w22570424 .pk-stats .pk-card-h { background: linear-gradient(100deg, #1f3a33, #3d6d5f); }
#w22570424 .pk-stats .pk-card-h .pk-up { background: #d8f1dc; color: #1f5a33; }
#w22570424 .pk-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 9px 10px 0; }
#w22570424 .pk-kpi span { background: #f6efe6; border-radius: 10px; padding: 7px 9px 6px; line-height: 1.2; }
#w22570424 .pk-kpi b { display: block; font-size: 15.5px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
#w22570424 .pk-kpi small { font-size: 11.5px; color: #8a7462; }
#w22570424 .pk-sub { margin: 10px 12px 4px !important; font-size: 11px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #9c8572; }
#w22570424 .pk-bars { display: grid; grid-template-columns: 62px minmax(0, 1fr) 20px; align-items: center; gap: 5px 8px; padding: 0 12px; }
#w22570424 .pk-bars span { font-size: 12.5px; color: #5c4635; }
#w22570424 .pk-bars i { height: 9px; border-radius: 5px; width: calc(var(--v) * 100%); background: #ddc8b0; transform-origin: 0 50%; }
#w22570424 .pk-bars i:first-of-type { background: linear-gradient(90deg, #dc8f4e, var(--pk-acc)); }
#w22570424 .pk-bars em { font-style: normal; font-size: 12.5px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }

/* поле ввода */
#w22570424 .pk-input { flex: none; align-items: center; gap: 8px; padding: 7px 8px 9px 11px; background: #fffaf4; border-top: 1px solid #ecdfd0; position: relative; z-index: 2; }
#w22570424 .pk-clip { width: 22px; height: 22px; flex: none; fill: none; stroke: #a3876f; stroke-width: 1.9; stroke-linecap: round; }
#w22570424 .pk-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px 0 14px;
  background: #f4ebe0;
  border-radius: 18px;
  font-size: 14px;
  color: var(--pk-ink);
  white-space: nowrap;
  overflow: hidden;
}
#w22570424 .pk-ph { color: #ad9886; }
#w22570424 .pk-input.has-text .pk-ph { display: none; }
#w22570424 .pk-tx { overflow: hidden; text-overflow: clip; }
#w22570424 .pk-input.has-text .pk-tx::after { content: ""; display: inline-block; width: 1.6px; height: 1.15em; margin-left: 1px; vertical-align: -0.22em; background: var(--pk-acc); animation: w22570424-caret 1s steps(1) infinite; }
#w22570424 .pk-att { display: none; width: 30px; height: 24px; margin-left: -8px; border-radius: 6px; overflow: hidden; flex: none; }
#w22570424 .pk-input.has-att .pk-att { display: block; }
#w22570424 .pk-att img { display: block; width: 100%; height: 100%; object-fit: cover; }
#w22570424 .pk-send { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #a3876f; transition: background 0.2s, color 0.2s; }
#w22570424 .pk-send svg { grid-area: 1 / 1; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#w22570424 .pk-go { display: none; }
#w22570424 .pk-input.has-text .pk-send { background: var(--pk-acc); color: #fff; }
#w22570424 .pk-input.has-text .pk-mic { display: none; }
#w22570424 .pk-input.has-text .pk-go { display: block; }

/* журнал: что бот сделал сам */
#w22570424 .pk-side { flex: 1 1 260px; max-width: 340px; color: var(--ink); }
#w22570424 .pk-side-h { margin: 0 0 12px; font: 800 28px/1 var(--display); }
#w22570424 .pk-log { list-style: none; margin: 0; padding: 0; position: relative; display: grid; }
#w22570424 .pk-log::before { content: ""; position: absolute; left: 63px; top: 18px; bottom: 18px; width: 2px; border-radius: 1px; background: var(--line); }
#w22570424 .pk-log li { position: relative; display: grid; grid-template-columns: 40px 28px minmax(0, 1fr); align-items: start; gap: 10px; padding: 5px 0; transition: opacity 0.4s; }
#w22570424 .pk-log time { font-size: 12.5px; line-height: 1.5; font-weight: 600; color: var(--meta); font-variant-numeric: tabular-nums; padding-top: 4px; }
#w22570424 .pk-ic { position: relative; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; transition: background 0.3s, color 0.3s, box-shadow 0.3s; }
#w22570424 .pk-ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
#w22570424 .pk-log span { font-size: 14.5px; line-height: 1.3; font-weight: 600; padding-top: 3px; }
#w22570424 .pk-log small { display: block; margin-top: 1px; font-size: 13px; font-weight: 400; color: var(--meta); }
#w22570424 .pk-side-f { margin: 14px 0 0; padding: 12px 0 0 50px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.35; color: var(--meta); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
#w22570424 .pk-side-f b { display: block; font: 800 24px/1.05 var(--display); color: var(--ink); }

/* ——— режим истории ——— */
#w22570424:where(.story *) .stage { container: pk / size; }
#w22570424:where(.story *) .pk { position: absolute; inset: 0; flex-wrap: nowrap; align-items: center; justify-content: center; gap: clamp(28px, 5cqw, 64px); }
#w22570424:where(.story *) .pk-phone {
  flex: none;
  height: min(100cqh, 880px);
  width: clamp(352px, min(100cqh, 880px) * 0.5, 410px);
  max-width: 100cqw;
  padding: 10px;
  border-radius: 52px;
  background: linear-gradient(160deg, #3a332e, #15110e 45%, #241e1a);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.1), inset 0 0 0 4px #0d0a08, 0 60px 90px -50px rgba(40, 20, 5, 0.6), 0 24px 40px -28px rgba(40, 20, 5, 0.45);
}
#w22570424:where(.story *) .pk-screen { position: relative; height: 100%; display: flex; flex-direction: column; border-radius: 42px; overflow: hidden; clip-path: inset(0 round 42px); background: var(--pk-esp); isolation: isolate; }
#w22570424:where(.story *) .pk-sb { flex: none; display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 2px 24px 0 30px; background: var(--pk-esp); color: #f8ecdd; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; z-index: 3; }
#w22570424:where(.story *) .pk-cam { position: absolute; left: 50%; top: 11px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%; background: #070505; box-shadow: inset 0 0 0 2.5px #1c1714; }
#w22570424:where(.story *) .pk-sb-i svg { display: block; width: 54px; height: 12px; }
#w22570424:where(.story *) .pk-track { display: block; position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 0 0 42px 42px; }
#w22570424:where(.story *) .pk-chat { position: absolute; inset: 0; border-radius: 0 0 42px 42px; box-shadow: none; }
#w22570424:where(.story *) .pk-c2 { visibility: hidden; transform: translate3d(100%, 0, 0); box-shadow: -18px 0 36px -18px rgba(20, 10, 4, 0.5); }
#w22570424:where(.story *) .pk-chat::after { content: ""; position: absolute; inset: 0; z-index: 6; background: #140b05; opacity: var(--dim, 0); pointer-events: none; }
#w22570424:where(.story *) .pk-view { flex: 1; min-height: 0; overflow: hidden; }
#w22570424:where(.story *) .pk-list { min-height: 100%; transition: transform 0.55s var(--ease); }
#w22570424:where(.story *) .pk-input { display: flex; }
#w22570424:where(.story *) .pk-b[data-at]:not(.on) { display: none; }
#w22570424:where(.story *) .pk-b.on { animation: w22570424-in 0.45s var(--ease) both; }
#w22570424:where(.story *) .is-typing .pk-typing { display: inline-flex; gap: 4px; padding: 12px 14px; animation: w22570424-in 0.3s var(--ease) both; }
#w22570424:where(.story *) .pk-typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9a28d; animation: w22570424-dot 1.1s infinite; }
#w22570424:where(.story *) .pk-typing i:nth-child(2) { animation-delay: 0.15s; }
#w22570424:where(.story *) .pk-typing i:nth-child(3) { animation-delay: 0.3s; }
#w22570424:where(.story *) .is-typing .pk-head .pk-st { display: none; }
#w22570424:where(.story *) .is-typing .pk-head .pk-st-ty { display: inline; }
#w22570424:where(.story *) .pk-me:not(.pk-read) .pk-tk { color: currentColor; }
#w22570424:where(.story *) .pk-me:not(.pk-read) .pk-tk2 { opacity: 0; }
#w22570424:where(.story *) .pk-btn.tap::after { content: ""; position: absolute; left: 50%; top: 50%; width: 140%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, 0.35); transform: translate(-50%, -50%) scale(0); animation: w22570424-ripple 0.6s ease-out both; }
#w22570424:where(.story *) .pk-diag.on .pk-mark { animation: w22570424-pop 0.55s 0.35s var(--ease) both; }
#w22570424:where(.story *) .pk-diag.on .pk-mark-2 { animation-delay: 0.6s; }
#w22570424:where(.story *) .pk-diag.on .pk-meter i { animation: w22570424-grow 0.9s 0.5s var(--ease) both; }
#w22570424:where(.story *) .pk-diag.on .pk-dx-2 .pk-meter i { animation-delay: 0.7s; }
#w22570424:where(.story *) .pk-stats.on .pk-bars i { animation: w22570424-grow 0.8s 0.25s var(--ease) both; }
#w22570424:where(.story *) .pk-stats.on .pk-bars i:nth-of-type(2) { animation-delay: 0.33s; }
#w22570424:where(.story *) .pk-stats.on .pk-bars i:nth-of-type(3) { animation-delay: 0.41s; }
#w22570424:where(.story *) .pk-stats.on .pk-bars i:nth-of-type(4) { animation-delay: 0.49s; }
#w22570424:where(.story *) .pk-stats.on .pk-bars i:nth-of-type(5) { animation-delay: 0.57s; }

#w22570424:where(.story *) .pk-side { flex: 0 1 300px; max-width: 320px; align-self: center; }
#w22570424:where(.story *) .pk-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 26px; padding: 4px; border-radius: 999px; background: var(--wash); font-size: 13px; font-weight: 700; line-height: 1; }
#w22570424:where(.story *) .pk-seg span { position: relative; z-index: 1; padding: 9px 6px; text-align: center; color: var(--meta); transition: color 0.3s; }
#w22570424:where(.story *) .pk-seg i { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(14, 26, 58, 0.16); transform: translateX(calc(var(--s, 0) * 100%)); }
#w22570424:where(.story *) .pk-seg:not(.is-own) span:first-child, #w22570424:where(.story *) .pk-seg.is-own span:last-child { color: var(--ink); }
#w22570424:where(.story *) .pk-log li:not(.on) { opacity: 0.38; }
#w22570424:where(.story *) .pk-log li:not(.on) .pk-ic { background: #fff; color: var(--meta); box-shadow: inset 0 0 0 1.5px var(--line); }
#w22570424:where(.story *) .pk-log li.now .pk-ic { background: var(--mk); color: var(--ink); box-shadow: 0 0 0 5px rgba(205, 186, 255, 0.4); }
#w22570424:where(.story *) .pk-log li.now time { color: var(--ink); }
#w22570424:where(.story *) .pk-side:not(.is-done) .pk-side-f { opacity: 0; transform: translateY(8px); }

/* сканер над фото, пока ИИ его разбирает */
#w22570424:where(.story *) .is-scan .pk-head .pk-st, #w22570424:where(.story *) .is-scan .pk-head .pk-st-ty { display: none; }
#w22570424:where(.story *) .is-scan .pk-head .pk-st-sc { display: inline; }
#w22570424:where(.story *) .is-scan .pk-photo .pk-shot::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(255, 236, 210, 0.16), rgba(255, 236, 210, 0.16)), repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 14px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 14px); }
#w22570424:where(.story *) .is-scan .pk-photo .pk-shot::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46%; background: linear-gradient(180deg, rgba(255, 176, 96, 0), rgba(255, 176, 96, 0.38) 82%, #ffe1bd 98%, rgba(255, 225, 189, 0)); animation: w22570424-scan 1.5s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate; }

/* уведомление: сводка владельцу */
#w22570424:where(.story *) .pk-push {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  position: absolute;
  left: 8px;
  right: 8px;
  top: 42px;
  z-index: 10;
  padding: 10px 12px 11px 10px;
  border-radius: 20px;
  background: rgba(255, 250, 244, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--pk-ink);
  box-shadow: 0 18px 36px -14px rgba(20, 10, 4, 0.55), 0 0 0 1px rgba(60, 35, 15, 0.08);
  transform: translate3d(0, calc(-100% - 60px), 0);
  transition: transform 0.55s var(--ease);
}
#w22570424:where(.story *) .pk-push.on { transform: none; }
#w22570424 .pk-push .pk-ava { width: 36px; height: 36px; }
#w22570424 .pk-push .pk-ava svg { width: 26px; height: 26px; }
#w22570424 .pk-push-t { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; line-height: 1.3; }
#w22570424 .pk-push-t b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#w22570424 .pk-push-t small { font-size: 11.5px; color: var(--pk-meta); }
#w22570424 .pk-push-t span { grid-column: 1 / -1; font-size: 13px; color: #4a3626; }

@container pk (max-width: 700px) {
  #w22570424 .pk-side { display: none; }
}

@media (max-width: 899px) {
  #w22570424:where(.story *) .pk-phone { height: 100cqh; width: min(100cqw, 430px); aspect-ratio: auto; padding: 5px; border-radius: 30px; }
  #w22570424:where(.story *) .pk-screen { border-radius: 25px; clip-path: inset(0 round 25px); }
  #w22570424:where(.story *) .pk-track, #w22570424:where(.story *) .pk-chat { border-radius: 0 0 25px 25px; }
  #w22570424:where(.story *) .pk-head { border-radius: 25px 25px 0 0; }
  #w22570424:where(.story *) .pk-sb { display: none; }
  #w22570424 .pk-head { grid-template-columns: 18px 34px minmax(0, 1fr) 20px; gap: 8px; padding: 7px 10px 7px 8px; }
  #w22570424 .pk-ava { width: 34px; height: 34px; }
  #w22570424 .pk-ava svg { width: 26px; height: 26px; }
  #w22570424 .pk-back { width: 18px; height: 18px; }
  #w22570424 .pk-more { width: 20px; height: 20px; }
  #w22570424 .pk-who b { font-size: 14px; }
  #w22570424 .pk-who small { font-size: 12px; }
  #w22570424 .pk-b { font-size: 13.5px; }
  #w22570424 .pk-view { padding: 0 8px; }
  #w22570424 .pk-input { padding: 5px 6px 6px 9px; }
  #w22570424 .pk-field { height: 32px; font-size: 13.5px; }
  #w22570424 .pk-send { width: 32px; height: 32px; }
  #w22570424:where(.story *) .pk-intro { display: none; }
  #w22570424:where(.story *) .pk-push { top: 6px; left: 6px; right: 6px; }
  #w22570424 .pk-crop { height: 112px; }
}

/* очень низкая сцена (маленький телефон): меньше рамок, больше переписки */
@container pk (max-height: 300px) {
  #w22570424 .pk-input { display: none !important; }
  #w22570424 .pk-head { padding-block: 5px; }
  #w22570424 .pk-who small { display: none; }
  #w22570424 .pk-ava { width: 28px; height: 28px; }
  #w22570424 .pk-ava svg { width: 22px; height: 22px; }
}
@container pk (max-height: 200px) {
  #w22570424 .pk-head { display: none; }
}

@container pk (max-height: 660px) {
  #w22570424 .pk-log small { display: none; }
  #w22570424 .pk-log li { padding: 3px 0; }
  #w22570424 .pk-seg { margin-bottom: 16px; }
  #w22570424 .pk-side-f { margin-top: 8px; padding-top: 8px; }
}

@keyframes w22570424-in { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes w22570424-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes w22570424-dots { to { width: 0.95em; } }
@keyframes w22570424-caret { 50% { opacity: 0; } }
@keyframes w22570424-ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
@keyframes w22570424-pop { from { opacity: 0; transform: scale(1.7); } to { opacity: 1; transform: none; } }
@keyframes w22570424-grow { from { transform: scaleX(0); } }
@keyframes w22570424-scan { from { transform: translateY(-100%); } to { transform: translateY(120%); } }
