/* ==========================================================================
   Демо-телефон в стиле приложения: корпус как на lists.html,
   экран 390 × 844 pt, общие виджеты (статус-бар, навбар, подвал, модалки).
   Те же значения, что в notes.css.
   ========================================================================== */

.demo-box {
  --demo-cycle: 20s;
  --ios-blue: #007aff;
  --ink: #1f2328;
  --muted: #66707c;
  --border: #d8dade;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: 500px;
  min-height: 734px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 34px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 207, 74, 0.9), transparent 26%),
    radial-gradient(circle at 92% 90%, rgba(136, 169, 149, 0.62), transparent 32%),
    linear-gradient(145deg, #245ef2 0%, #2f6bff 52%, #1d4ed8 100%);
  box-shadow:
    0 30px 64px rgba(47, 107, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.demo-box::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 1.5px, transparent 2px);
  background-size: 26px 26px;
  content: "";
  mask-image: linear-gradient(165deg, rgba(0, 0, 0, 0.9), transparent 74%);
}

.app-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Корпус — как на lists.html ---------- */

.demo-phone {
  position: absolute;
  z-index: 2;
  top: 48px;
  left: 50%;
  width: 274px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 15.7% / 7.4%;
  background: linear-gradient(110deg, #343842 0%, #0a0b0f 28%, #1d2027 69%, #050608 100%);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.8),
    inset 0 0 0 2px rgba(255, 255, 255, 0.07),
    0 34px 46px rgba(8, 28, 80, 0.42);
  transform: translateX(-50%);
  animation: demo-phone-float 5s ease-in-out infinite;
}

.demo-screen {
  position: relative;
  overflow: hidden;
  width: 262px;
  height: 567px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14.1% / 6.5%;
  background: #fff;
  clip-path: inset(0 round 14.1% / 6.5%);
}

.demo-phone-button {
  position: absolute;
  top: 22.75%;
  right: -2.5px;
  width: 2.5px;
  height: 12.1%;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, #3d424d, #111319);
}

/* ==========================================================================
   Приложение: холст 390 × 844 pt
   ========================================================================== */

.app {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  width: 390px;
  height: 844px;
  color: #000;
  font-family: "Inter", -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.25;
  transform: scale(0.6718);
  transform-origin: 0 0;
  -webkit-font-smoothing: antialiased;
}

.app svg {
  display: block;
  flex: none;
}

.app svg:not([fill]) {
  fill: currentColor;
}

/* Статус-бар iOS */
.app-statusbar {
  position: absolute;
  z-index: 50;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 30px 0 52px;
  color: #000;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.app-statusbar-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-battery {
  position: relative;
  display: grid;
  width: 27px;
  height: 13px;
  place-items: center;
  border-radius: 4px;
  background: #000;
  color: #fff;
  font-style: normal;
}

.app-battery::after {
  position: absolute;
  top: 4px;
  right: -3px;
  width: 1.5px;
  height: 5px;
  border-radius: 0 1px 1px 0;
  background: rgba(0, 0, 0, 0.4);
  content: "";
}

.app-battery b {
  font-size: 10px;
  font-weight: 800;
}

/* Сцены */
.app-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
}

/* AppPageBackground.blueGold */
.app-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #dfeaff 0%, #eff4ff 52%, #d6e4ff 100%);
}

.app-bg::before,
.app-bg::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.app-bg::before {
  top: 82px;
  right: -142px;
  width: 330px;
  height: 330px;
  background: rgba(79, 128, 238, 0.16);
}

.app-bg::after {
  top: 520px;
  left: -96px;
  width: 210px;
  height: 210px;
  background: rgba(255, 211, 90, 0.28);
}

/* CupertinoNavigationBar */
.app-navbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 110px;
  height: 98px;
  align-items: center;
  padding: 54px 8px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.16);
  background: rgba(249, 249, 249, 0.94);
  color: var(--ios-blue);
}

.app-navbar-tinted {
  border-bottom: 0;
  background: #dfeaff;
}

.app-navbar > b {
  overflow: hidden;
  color: #000;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-navbar-side {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 8px;
}

.app-navbar-right {
  justify-content: flex-end;
}

.app-back {
  gap: 6px;
  padding-left: 2px;
  font-size: 17px;
}

/* Сегменты (ListsFamilyFilterBar, _KnowledgeNoteScopeSelector) */
.app-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border: 0.6px solid rgba(60, 60, 67, 0.05);
  border-radius: 16px;
  background: rgba(242, 242, 247, 0.6);
}

.app-segment > span {
  margin: 0 2px;
  padding: 10px 0;
  border: 0.6px solid transparent;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.app-segment .is-yellow,
.voice-scope-family {
  color: #ffcf4a;
}

.app-segment .is-blue,
.voice-scope-personal {
  color: var(--ios-blue);
}

.app-segment .is-on.is-yellow {
  border-color: rgba(255, 207, 74, 0.28);
  background: rgba(255, 207, 74, 0.18);
}

.app-segment .is-on.is-blue {
  border-color: rgba(0, 122, 255, 0.28);
  background: rgba(0, 122, 255, 0.18);
}

/* BottomActionsBar */
.app-bottombar {
  position: absolute;
  z-index: 6;
  right: 12px;
  bottom: 30px;
  left: 12px;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-around;
  padding: 6px 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.13);
  color: var(--ios-blue);
}

.app-tab {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 60px;
}

.app-tab small {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.app-mic {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  margin: -4px 0;
  place-items: center;
  border-radius: 50%;
}

.app-mic-sparkle {
  position: absolute;
  right: 0;
  bottom: 2px;
}

.app-badge-wrap {
  position: relative;
}

.app-badge-wrap i {
  position: absolute;
  top: -7px;
  right: -9px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border: 1.5px solid #fff;
  border-radius: 999px;
  background: var(--ios-blue);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

/* Модалки */
.app-dim {
  position: absolute;
  z-index: 20;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
}

.app-alert {
  position: absolute;
  z-index: 30;
  top: 50%;
  left: 50%;
  width: 290px;
  padding: 20px 16px 14px;
  border-radius: 14px;
  background: rgba(242, 242, 247, 0.97);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.08);
}

.app-alert > b {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

.app-spinner {
  display: block;
  width: 22px;
  height: 22px;
  margin: 18px auto 8px;
  border: 2.5px solid rgba(60, 60, 67, 0.18);
  border-top-color: rgba(60, 60, 67, 0.7);
  border-radius: 50%;
  animation: app-spin 0.8s linear infinite;
}

/* collectionSurfaceDecoration */
.app-surface {
  border: 0.9px solid rgba(216, 218, 222, 0.82);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 242, 244, 0.94));
  box-shadow:
    0 5px 16px rgba(0, 0, 0, 0.055),
    0 1px 4px rgba(0, 0, 0, 0.02);
}

.app-icon-btn {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.09);
  color: var(--ios-blue);
}

.app-primary {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 16px;
  background: var(--ios-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.app-filled {
  display: grid;
  min-height: 50px;
  place-items: center;
  border-radius: 8px;
  background: var(--ios-blue);
  color: #fff;
  font-size: 17px;
}

.sheet-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
}

.sheet-header b {
  font-size: 19px;
  font-weight: 700;
  text-align: center;
}

.demo-float {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.93);
  color: #111827;
  box-shadow: 0 18px 38px rgba(16, 39, 105, 0.28);
  backdrop-filter: blur(18px);
  opacity: 0;
}

.demo-float > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 12px;
  background: rgba(47, 107, 255, 0.11);
  font-size: 16px;
}

.demo-float small {
  display: block;
  color: #245ef2;
  font-size: 9px;
  font-weight: 700;
}

.demo-float strong {
  display: block;
  font-size: 11px;
  font-weight: 750;
}

.demo-steps {
  position: absolute;
  z-index: 5;
  right: 16px;
  bottom: 15px;
  left: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(16, 39, 105, 0.5);
  color: rgba(255, 255, 255, 0.76);
  font-size: 9px;
  font-weight: 650;
  box-shadow: 0 14px 30px rgba(16, 39, 105, 0.24);
  backdrop-filter: blur(18px);
}

.demo-step {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  white-space: nowrap;
}

.demo-step i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

@keyframes demo-phone-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes app-spin { to { transform: rotate(360deg); } }
@keyframes app-blink { to { opacity: 0; } }
@keyframes app-wave {
  0%, 100% { height: 22%; }
  50% { height: 100%; }
}


/* Как это работает: три шага с «линией времени» */
.notes-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 48px;
}

.notes-flow-card {
  position: relative;
  padding: 25px;
  border: 1px solid rgba(47, 107, 255, 0.11);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(26, 36, 67, 0.045);
}

.notes-flow-card time {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 10px;
  font-weight: 750;
}

.notes-flow-card:nth-child(2) time {
  background: var(--warm-sage-soft);
  color: var(--warm-sage-deep);
}

.notes-flow-card:nth-child(3) time {
  background: rgba(255, 207, 74, 0.24);
  color: #8b6810;
}

.notes-flow-card h3 {
  margin: 26px 0 9px;
  color: var(--warm-ink);
  font-family: "Onest", "Inter", sans-serif;
  font-size: 22px;
  font-weight: 680;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.notes-flow-card p {
  margin: 0;
  color: var(--warm-muted);
  font-size: 13px;
  line-height: 1.58;
}

.notes-flow-quote {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f2f2f7;
  color: var(--warm-ink-soft);
  font-size: 12px;
  font-style: italic;
  line-height: 1.5;
}

/* Одна заметка — восемь вариантов: бенто-сетка.
   Арт раздела — фон в правом нижнем углу, частично срезан краем;
   широкие и узкие карточки чередуются в шахматном порядке. */
.notes-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 250px;
  gap: 12px;
  margin-top: 48px;
}

.notes-bento-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(47, 107, 255, 0.08);
  border-radius: 26px;
  background: linear-gradient(160deg, #fff 0%, #fff 38%, var(--tint) 100%);
  box-shadow: 0 12px 30px rgba(26, 36, 67, 0.05);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.notes-bento-card.is-wide {
  grid-column: span 2;
}

.notes-bento-text {
  position: relative;
  z-index: 1;
}

.notes-bento-card h3 {
  margin: 0 0 8px;
  color: var(--warm-ink);
  font-family: "Onest", "Inter", sans-serif;
  font-size: 21px;
  font-weight: 680;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.notes-bento-card p {
  margin: 0;
  color: var(--warm-muted);
  font-size: 13px;
  line-height: 1.55;
}

.notes-bento-card img {
  position: absolute;
  right: -18px;
  bottom: -22px;
  width: 118px;
  height: 118px;
  object-fit: contain;
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.notes-bento-card.is-wide .notes-bento-text {
  max-width: 55%;
}

.notes-bento-card.is-wide h3 {
  font-size: 28px;
}

.notes-bento-card.is-wide p {
  font-size: 14px;
}

.notes-bento-card.is-wide img {
  right: -6px;
  bottom: -34px;
  width: 220px;
  height: 220px;
}

@media (hover: hover) and (pointer: fine) {
  .notes-bento-card:hover {
    box-shadow: 0 24px 52px rgba(26, 36, 67, 0.12);
    transform: translateY(-4px);
  }

  .notes-bento-card:hover img {
    transform: translate(-4px, -6px) rotate(-3deg) scale(1.04);
  }
}

@media (max-width: 1100px) {
  .notes-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: dense;
  }
}

@media (max-width: 680px) {
  .notes-bento {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    margin-top: 34px;
  }

  .notes-bento-card,
  .notes-bento-card.is-wide {
    grid-column: auto;
    min-height: 168px;
    padding: 22px 132px 22px 22px;
  }

  .notes-bento-card.is-wide .notes-bento-text {
    max-width: none;
  }

  .notes-bento-card.is-wide h3 {
    font-size: 22px;
  }

  .notes-bento-card.is-wide p {
    font-size: 13px;
  }

  .notes-bento-card img,
  .notes-bento-card.is-wide img {
    right: -14px;
    bottom: -18px;
    width: 128px;
    height: 128px;
  }
}

/* Сценарии из жизни: фраза → результат */








/* Появление при прокрутке (включается scripts в notes.html) */
.js-reveal .notes-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js-reveal .notes-reveal.is-visible {
  opacity: 1;
  transform: none;
}



/* Фильтр-бар и бейдж семьи — как в приложении */
.ov-filter {
  display: flex;
  align-items: center;
  margin: 0 8px;
  padding: 2px;
  border: 0.6px solid rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.ov-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 6px 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.ov-dropdown svg {
  color: rgba(60, 60, 67, 0.6);
}

.ov-filter-sep {
  width: 1px;
  height: 22px;
  margin: 0 8px;
  background: rgba(60, 60, 67, 0.15);
}

.ov-filter .app-segment {
  flex: 1;
}

.family-badge,
.personal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.family-badge {
  border: 0.8px solid #e1e3e6;
  background: linear-gradient(135deg, #fff, #f0f2f4);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
  color: #9a6400;
}

.family-badge img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.personal-badge {
  gap: 4px;
  padding: 4px 7px;
  background: #eef5fe;
  color: var(--ios-blue);
}



/* ==========================================================================
   tasks.html — «Дела и события»: виджеты демо-телефона
   Источник: lib/pages/family_tasks/family_tasks_page.dart
     • _TaskSticker: CollectionCard, чекбокс CupertinoCompletionCheckbox,
       арт 102×102 справа (opacity .74), заголовок 16/600,
       CardParticipantsRow, _TaskMetaChip, FamilyBadge
     • _AssignmentResponsePanel: «{имя} просит вас», «Ждёт ответа»,
       «Принять» / «Не могу»
     • Диктовка: VoiceDictationPanel «Что нужно сделать?»
     • _FamilyTaskFormPage: «Новое дело», умная строка, ДАТА И ВРЕМЯ,
       «Кому поручить?», напоминания, «Добавить дело»
   Сценарий (--demo-cycle: 20s):
     0–28%    Доска Лены → «Диктовать» → фраза → «Готово» → «Продолжить»
     28–46%   «Новое дело»: поля подсвечиваются по мере распознавания
     46–100%  Доска Антона: просьба → «Принять» → напоминание → выполнено
   ========================================================================== */

.tk-demo {
  --demo-cycle: 20s;
}

.tk-scope {
  position: relative;
  z-index: 2;
  height: 74px;
  padding: 12px 12px 0;
  background: #e8f0ff;
}

.tk-scope .ov-filter {
  margin: 0 8px;
}

.tk-scope .app-segment > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tk-viewmode {
  display: grid;
  width: 40px;
  height: 40px;
  margin-right: 2px;
  place-items: center;
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.09);
  color: var(--ios-blue);
}

.tk-list {
  position: relative;
  padding: 4px 12px 0;
}

.tk-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 4px 6px;
}

.tk-section b {
  font-size: 15px;
  font-weight: 600;
}

.tk-section small {
  color: #8e8e93;
  font-size: 13px;
  font-weight: 600;
}

/* _TaskSticker */
.tk-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  padding: 13px 7px 12px 8px;
  border: 0.9px solid rgba(255, 165, 58, 0.28);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 242, 244, 0.94));
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.055), 0 1px 4px rgba(0, 0, 0, 0.02);
}

.tk-card-new {
  border-color: rgba(155, 123, 229, 0.28);
}

.tk-art {
  position: absolute;
  top: 1px;
  right: 36px;
  width: 102px;
  height: 102px;
  object-fit: contain;
  opacity: 0.74;
}

.tk-row {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 38px;
  gap: 4px;
  align-items: start;
}

.tk-check {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
}

.tk-check img {
  grid-area: 1 / 1;
  width: 26px;
  height: 26px;
}

.tk-check-on {
  opacity: 0;
}

.tk-title {
  display: block;
  max-width: 190px;
  padding-top: 9px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.tk-people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 7px;
}

.tk-pill {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border-radius: 999px;
}

.tk-pill.is-blue {
  background: #eef5fe;
  color: var(--ios-blue);
}

.tk-pill.is-muted {
  background: #f0f1f2;
  color: var(--muted);
}

.tk-pill img {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.tk-pill small,
.tk-pill b {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tk-pill b {
  font-size: 12px;
  font-weight: 600;
}

.tk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tk-chip.is-blue { background: #eef5fe; color: var(--ios-blue); }
.tk-chip.is-muted { background: #f2f3f4; color: var(--muted); }
.tk-chip.is-green { background: #eaf8ee; color: #34c759; }

.tk-done-chip {
  overflow: hidden;
  max-width: 0;
  padding: 4px 0;
  opacity: 0;
  animation: tk-done-chip var(--demo-cycle) ease-out infinite;
}

.tk-side {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-top: 2px;
  color: var(--ios-blue);
}

.tk-side svg:not(:first-child) {
  color: var(--muted);
}

/* _AssignmentResponsePanel */
.tk-request {
  overflow: hidden;
  max-height: 140px;
  margin: 10px 2px 0 6px;
  padding: 9px 9px 8px;
  border: 0.9px solid rgba(0, 122, 255, 0.18);
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.065);
  animation: tk-request var(--demo-cycle) ease-in-out infinite;
}

.tk-request-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.tk-request-head img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.tk-request-head b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.tk-request-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.tk-request-head em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(255, 207, 74, 0.23);
  color: #765700;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.tk-request-head em svg {
  color: #8a6500;
}

.tk-request-actions {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 8px;
  margin-top: 8px;
}

.tk-request-actions span {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  color: var(--ios-blue);
  font-size: 14px;
  font-weight: 600;
}

.tk-accept {
  border: 0.9px solid rgba(0, 122, 255, 0.24);
  background: rgba(0, 122, 255, 0.1);
  animation: tk-accept var(--demo-cycle) ease-in-out infinite;
}

/* Подвал «Дел»: пять кнопок */
.tk-bottombar {
  padding: 6px 8px;
}

.tk-bottombar .app-tab {
  min-width: 0;
}

.tk-voice-tab .app-mic {
  animation: tk-voice-press var(--demo-cycle) ease-in-out infinite;
}

/* Диктовка: VoiceDictationPanel */
.tk-voice-dim {
  animation: tk-voice-dim var(--demo-cycle) ease-in-out infinite;
}

.tk-voice {
  position: absolute;
  z-index: 21;
  right: 12px;
  bottom: 46px;
  left: 12px;
  padding: 16px;
  border-radius: 28px;
  background: #f2f2f7;
  transform: translateY(110%);
  animation: tk-voice var(--demo-cycle) cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.tk-voice-hints {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.tk-wave {
  margin-top: 14px;
  padding: 10px 12px;
  border: 0.9px solid rgba(216, 218, 222, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tk-wave span {
  display: flex;
  height: 24px;
  align-items: center;
  justify-content: space-between;
  color: #ff3b30;
  animation: tk-wave-color var(--demo-cycle) step-end infinite;
}

.tk-wave i {
  width: 2px;
  height: 25%;
  border-radius: 2px;
  background: currentColor;
  animation: app-wave 0.9s ease-in-out infinite;
}

.tk-wave i:nth-child(2n) { animation-delay: -0.2s; }
.tk-wave i:nth-child(3n) { animation-delay: -0.45s; }
.tk-wave i:nth-child(5n) { animation-delay: -0.65s; }
.tk-wave i:nth-child(7n) { animation-delay: -0.3s; }

.tk-voice-status {
  position: relative;
  height: 18px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.tk-voice-status span {
  position: absolute;
  inset: 0;
}

.tk-live { animation: tk-live var(--demo-cycle) step-end infinite; }
.tk-done { opacity: 0; animation: tk-done var(--demo-cycle) step-end infinite; }

.tk-voice-actions {
  position: relative;
  height: 50px;
  margin-top: 12px;
  animation: tk-actions-h var(--demo-cycle) step-end infinite;
}

.tk-btn-done {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  animation: tk-btn-done var(--demo-cycle) ease-in-out infinite;
}

.tk-review {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  opacity: 0;
  animation: tk-done var(--demo-cycle) step-end infinite;
}

.tk-append {
  padding: 12px 0;
  color: var(--ios-blue);
  font-size: 17px;
  text-align: center;
}

.tk-btn-continue {
  animation: tk-continue-press var(--demo-cycle) ease-in-out infinite;
}

.tk-divider {
  display: block;
  height: 1px;
  margin: 20px 0;
  background: var(--border);
}

.tk-voice h6 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
}

.tk-transcript {
  min-height: 100px;
  padding: 12px 14px;
  border: 0.9px solid rgba(0, 122, 255, 0.42);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.4;
}

.tk-transcript span {
  opacity: 0;
}

.tk-transcript span:nth-child(1) { animation: tk-w1 var(--demo-cycle) linear infinite; }
.tk-transcript span:nth-child(2) { animation: tk-w2 var(--demo-cycle) linear infinite; }
.tk-transcript span:nth-child(3) { animation: tk-w3 var(--demo-cycle) linear infinite; }
.tk-transcript span:nth-child(4) { animation: tk-w4 var(--demo-cycle) linear infinite; }

.tk-caret {
  display: inline-block;
  width: 2px;
  height: 18px;
  margin-left: 2px;
  vertical-align: -3px;
  background: var(--ios-blue);
  animation: app-blink 1s steps(2, start) infinite;
}

.tk-cancel {
  display: block;
  padding: 14px 0 2px;
  color: var(--ios-blue);
  font-size: 17px;
  text-align: center;
}

/* Новое дело: CollectionEditorSection / Choice / ActionChip */
.tk-form {
  position: relative;
  padding: 14px 16px 0;
}

.tk-form-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tk-ed-title {
  padding: 14px 16px 8px;
  color: rgba(60, 60, 67, 0.6);
  font-size: 13px;
  font-weight: 600;
}

.tk-ed {
  padding: 0 16px;
  border-radius: 18px;
  background: #fff;
}

.tk-ed-row {
  padding: 10px 0;
}

.tk-ed-row small,
.tk-ed-choice small {
  display: block;
  color: rgba(60, 60, 67, 0.6);
  font-size: 13px;
}

.tk-ed-row b {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-weight: 500;
}

.tk-ed-choice {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.29);
}

.tk-ed-choice:last-child {
  border-bottom: 0;
}

.tk-ed-choice small {
  flex: 1;
  color: #000;
  font-size: 16px;
}

.tk-ed-choice b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ios-blue);
  font-size: 16px;
  font-weight: 500;
}

.tk-chips-row {
  display: flex;
  gap: 7px;
  padding: 10px 0 12px;
}

.tk-action {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.09);
  color: var(--ios-blue);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.tk-action.is-selected {
  background: var(--ios-blue);
  color: #fff;
}

.tk-art-tile {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 0.9px solid rgba(155, 123, 229, 0.25);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.tk-art-tile > span {
  display: grid;
  width: 48px;
  height: 48px;
  flex: none;
  place-items: center;
  border-radius: 14px;
  background: rgba(155, 123, 229, 0.09);
}

.tk-art-tile img {
  width: 40px;
  height: 40px;
}

.tk-art-tile b {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.tk-art-tile small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.tk-assignees {
  display: flex;
  gap: 8px;
}

.tk-assignee {
  display: grid;
  flex: 1;
  justify-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1.5px solid transparent;
  border-radius: 16px;
  background: #fff;
}

.tk-assignee img,
.tk-avatar-letter {
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border-radius: 50%;
  object-fit: cover;
}

.tk-avatar-letter {
  display: grid;
  place-items: center;
  background: #9b7be5;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}

.tk-assignee b {
  font-size: 14px;
  font-weight: 600;
}

.tk-assignee small {
  color: var(--muted);
  font-size: 11px;
}

.tk-assignee.is-selected {
  border-color: var(--ios-blue);
  background: #eef5fe;
}

.tk-bell img {
  display: block;
  width: 26px;
  height: 26px;
}

.tk-hl {
  border-radius: 18px;
  transition: none;
}

.tk-hl-1 { animation: tk-hl-1 var(--demo-cycle) ease-in-out infinite; }
.tk-hl-2 { animation: tk-hl-2 var(--demo-cycle) ease-in-out infinite; }
.tk-hl-3 { animation: tk-hl-3 var(--demo-cycle) ease-in-out infinite; }
.tk-hl-4 { animation: tk-hl-4 var(--demo-cycle) ease-in-out infinite; }
.tk-hl-5 { animation: tk-hl-5 var(--demo-cycle) ease-in-out infinite; }

.tk-form-footer {
  position: absolute;
  right: 16px;
  bottom: 40px;
  left: 16px;
}

.tk-btn-add {
  animation: tk-add-press var(--demo-cycle) ease-in-out infinite;
}

/* Доска Антона */
.tk-toast {
  position: absolute;
  z-index: 30;
  bottom: 120px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(30, 30, 32, 0.9);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 10px);
  animation: tk-toast var(--demo-cycle) ease-out infinite;
}

.tk-toast svg {
  color: #34c759;
}

/* Пуш-напоминание iOS */
.tk-push {
  position: absolute;
  z-index: 40;
  top: 52px;
  right: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(245, 245, 247, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(-130%);
  animation: tk-push var(--demo-cycle) cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.tk-push img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.tk-push small {
  display: flex;
  justify-content: space-between;
  color: rgba(60, 60, 67, 0.6);
  font-size: 12px;
}

.tk-push small b {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tk-push small i {
  font-style: normal;
}

.tk-push > span > b {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-weight: 600;
}

.tk-push em {
  display: block;
  font-size: 14px;
  font-style: normal;
}

.tk-card-new .tk-check-on {
  animation: tk-check-on var(--demo-cycle) step-end infinite;
}

.tk-card-new .tk-check-off {
  animation: tk-check-off var(--demo-cycle) step-end infinite;
}

.tk-card-new .tk-title {
  animation: tk-strike var(--demo-cycle) step-end infinite;
}

.tk-card-new .tk-check {
  animation: tk-check-press var(--demo-cycle) ease-in-out infinite;
}

/* Сцены */
.scene-lena { animation: tk-sc-lena var(--demo-cycle) ease-in-out infinite; }
.scene-form { animation: tk-sc-form var(--demo-cycle) ease-in-out infinite; }
.scene-anton { animation: tk-sc-anton var(--demo-cycle) ease-in-out infinite; }

/* Карточки вокруг */
.demo-float > span:first-child img {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: cover;
}

.tk-float-lena {
  top: 96px;
  left: 14px;
  animation: tk-float-lena var(--demo-cycle) ease-out infinite;
}

.tk-float-anton {
  top: 96px;
  right: 14px;
  animation: tk-float-anton var(--demo-cycle) ease-out infinite;
}

.tk-float-done {
  right: 14px;
  bottom: 150px;
  animation: tk-float-done var(--demo-cycle) ease-out infinite;
}

.tk-float-done > span:first-child {
  background: rgba(52, 199, 89, 0.16);
  color: #34c759;
}

.tk-step-1 { animation: tk-step-1 var(--demo-cycle) ease-in-out infinite; }
.tk-step-2 { animation: tk-step-2 var(--demo-cycle) ease-in-out infinite; }
.tk-step-3 { animation: tk-step-3 var(--demo-cycle) ease-in-out infinite; }

/* ---------- Keyframes ---------- */


@keyframes tk-sc-lena {
  0%, 27.5% { opacity: 1; transform: none; }
  29%, 98.5% { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: none; }
}

@keyframes tk-sc-form {
  0%, 27.5% { opacity: 0; transform: translateX(40px); }
  29%, 45.5% { opacity: 1; transform: none; }
  47%, 100% { opacity: 0; transform: translateX(-30px); }
}

@keyframes tk-sc-anton {
  0%, 45.5% { opacity: 0; transform: translateX(40px); }
  47%, 97.5% { opacity: 1; transform: none; }
  99%, 100% { opacity: 0; }
}

@keyframes tk-voice-press {
  0%, 3.5% { background: transparent; color: #007aff; transform: scale(1); }
  4.5% { background: #007aff; color: #fff; transform: scale(0.88); box-shadow: 0 0 16px 3px rgba(0, 122, 255, 0.35); }
  6%, 100% { background: transparent; color: #007aff; transform: scale(1); }
}

@keyframes tk-voice-dim {
  0%, 5% { opacity: 0; }
  7%, 27.5% { opacity: 1; }
  29%, 100% { opacity: 0; }
}

@keyframes tk-voice {
  0%, 5% { transform: translateY(110%); }
  8%, 100% { transform: translateY(0); }
}

@keyframes tk-w1 { 0%, 9% { opacity: 0; } 10.5%, 100% { opacity: 1; } }
@keyframes tk-w2 { 0%, 12% { opacity: 0; } 13.5%, 100% { opacity: 1; } }
@keyframes tk-w3 { 0%, 15% { opacity: 0; } 16.5%, 100% { opacity: 1; } }
@keyframes tk-w4 { 0%, 18% { opacity: 0; } 19.5%, 100% { opacity: 1; } }

@keyframes tk-wave-color {
  0% { color: #ff3b30; }
  22% { color: #007aff; }
}

@keyframes tk-live {
  0% { opacity: 1; }
  22% { opacity: 0; }
}

@keyframes tk-done {
  0% { opacity: 0; }
  22% { opacity: 1; }
}

@keyframes tk-actions-h {
  0% { height: 50px; }
  22% { height: 98px; }
}

@keyframes tk-btn-done {
  0%, 20.5% { opacity: 1; transform: scale(1); filter: none; }
  21.3% { opacity: 1; transform: scale(0.96); filter: brightness(0.85); }
  22%, 100% { opacity: 0; transform: scale(1); filter: none; }
}

@keyframes tk-continue-press {
  0%, 25% { transform: scale(1); filter: none; }
  25.8% { transform: scale(0.96); filter: brightness(0.85); }
  26.6%, 100% { transform: scale(1); filter: none; }
}

@keyframes tk-hl-1 {
  0%, 29.5% { background: #fff; box-shadow: none; }
  30.5%, 32% { background: #eaf2ff; box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.45); }
  33%, 100% { background: #fff; box-shadow: none; }
}

@keyframes tk-hl-2 {
  0%, 31.5% { box-shadow: none; }
  32.5%, 34% { box-shadow: 0 0 0 2px rgba(155, 123, 229, 0.55); }
  35%, 100% { box-shadow: none; }
}

@keyframes tk-hl-3 {
  0%, 33.5% { background: #fff; box-shadow: none; }
  34.5%, 36.5% { background: #eaf2ff; box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.45); }
  37.5%, 100% { background: #fff; box-shadow: none; }
}

@keyframes tk-hl-4 {
  0%, 36% { box-shadow: none; }
  37%, 39% { box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.45); }
  40%, 100% { box-shadow: none; }
}

@keyframes tk-hl-5 {
  0%, 38.5% { background: #fff; box-shadow: none; }
  39.5%, 41.5% { background: #eaf2ff; box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.45); }
  42.5%, 100% { background: #fff; box-shadow: none; }
}

@keyframes tk-add-press {
  0%, 43.5% { transform: scale(1); filter: none; }
  44.3% { transform: scale(0.96); filter: brightness(0.85); }
  45%, 100% { transform: scale(1); filter: none; }
}

@keyframes tk-accept {
  0%, 56.5% { transform: scale(1); filter: none; }
  57.3% { transform: scale(0.95); filter: brightness(0.85); }
  58%, 100% { transform: scale(1); filter: none; }
}

@keyframes tk-request {
  0%, 58% { max-height: 140px; margin-top: 10px; padding-top: 9px; padding-bottom: 8px; opacity: 1; }
  60%, 99% { max-height: 0; margin-top: 0; padding-top: 0; padding-bottom: 0; opacity: 0; }
  100% { max-height: 140px; margin-top: 10px; padding-top: 9px; padding-bottom: 8px; opacity: 1; }
}

@keyframes tk-toast {
  0%, 59% { opacity: 0; transform: translate(-50%, 10px); }
  60.5%, 65% { opacity: 1; transform: translate(-50%, 0); }
  66.5%, 100% { opacity: 0; transform: translate(-50%, 10px); }
}

@keyframes tk-push {
  0%, 69% { opacity: 0; transform: translateY(-130%); }
  71%, 80% { opacity: 1; transform: none; }
  82%, 100% { opacity: 0; transform: translateY(-130%); }
}

@keyframes tk-check-press {
  0%, 84% { transform: scale(1); }
  84.8% { transform: scale(0.82); }
  85.6%, 100% { transform: scale(1); }
}

@keyframes tk-check-on {
  0% { opacity: 0; }
  85% { opacity: 1; }
}

@keyframes tk-check-off {
  0% { opacity: 1; }
  85% { opacity: 0; }
}

@keyframes tk-strike {
  0% { color: var(--ink); text-decoration: none; }
  85% { color: var(--muted); text-decoration: line-through; }
}

@keyframes tk-done-chip {
  0%, 85% { max-width: 0; padding: 4px 0; opacity: 0; }
  87%, 98% { max-width: 120px; padding: 4px 7px; opacity: 1; }
  99.5%, 100% { max-width: 0; padding: 4px 0; opacity: 0; }
}

@keyframes tk-float-lena {
  0% { opacity: 0; transform: translateX(-12px) scale(0.94); }
  1.5%, 24% { opacity: 1; transform: none; }
  26.5%, 100% { opacity: 0; transform: translateX(-12px) scale(0.94); }
}

@keyframes tk-float-anton {
  0%, 46.5% { opacity: 0; transform: translateX(12px) scale(0.94); }
  48.5%, 56% { opacity: 1; transform: none; }
  58.5%, 100% { opacity: 0; transform: translateX(12px) scale(0.94); }
}

@keyframes tk-float-done {
  0%, 86.5% { opacity: 0; transform: translateX(12px) scale(0.94); }
  88.5%, 96% { opacity: 1; transform: none; }
  98.5%, 100% { opacity: 0; transform: translateX(12px) scale(0.94); }
}

@keyframes tk-step-1 {
  0%, 28%, 99%, 100% { background: #fff; color: #245ef2; }
  29.5%, 97% { background: transparent; color: rgba(255, 255, 255, 0.76); }
}

@keyframes tk-step-2 {
  0%, 28%, 68%, 100% { background: transparent; color: rgba(255, 255, 255, 0.76); }
  29.5%, 66.5% { background: #fff; color: #245ef2; }
}

@keyframes tk-step-3 {
  0%, 66.5%, 98%, 100% { background: transparent; color: rgba(255, 255, 255, 0.76); }
  68%, 96.5% { background: #fff; color: #245ef2; }
}

@media (max-width: 480px) {
  .tk-demo {
    min-height: 680px;
  }

  .demo-float {
    scale: 0.88;
  }

  .tk-float-lena {
    left: 6px;
  }

  .tk-float-anton,
  .tk-float-done {
    right: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tk-demo *,
  .tk-demo *::before,
  .tk-demo *::after {
    animation: none !important;
  }

  .scene-anton {
    opacity: 1 !important;
    transform: none !important;
  }

  .tk-request {
    display: none;
  }

  .tk-step-3 {
    background: #fff;
    color: #245ef2;
  }

  .js-reveal .notes-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   «Сказали — поручили — сделано»: обсуждение прямо в деле
   Чат — ListDiscussionSheet (lib/widgets/discussion): заголовок «Обсуждения»,
   подпись «Дело: …», свои сообщения — синие пузыри справа (радиус 14),
   чужие — systemGrey6 слева с аватаром и именем, поле «Написать…»
   и кнопка отправки arrow_up_circle_fill.
   Сценарий (--dc-cycle: 16s):
     0–10%   просьба на доске Антона → нажатие на чат дела
     10–62%  вопрос «Во сколько у Миши заканчивается продлёнка?» → ответ Лены
     62–100% лист закрыт → «Принять» → «Дело принято»
   ========================================================================== */

.dc-layout {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  margin-top: 48px;
}

.dc-demo {
  --dc-cycle: 16s;

  min-height: 676px;
  justify-self: center;
}

/* Карточка из героя: отключаем её сценарий и задаём свой */
.dc-phone .tk-card-new .tk-check-on,
.dc-phone .tk-card-new .tk-check-off,
.dc-phone .tk-card-new .tk-title,
.dc-phone .tk-card-new .tk-check {
  animation: none;
}

.dc-phone .tk-card-new .tk-check-on {
  opacity: 0;
}

.dc-phone .tk-card-new .tk-done-chip {
  display: none;
  animation: none;
}

.dc-phone .tk-card-new .tk-request {
  animation: dc-request var(--dc-cycle) ease-in-out infinite;
}

.dc-phone .tk-card-new .tk-accept {
  animation: dc-accept var(--dc-cycle) ease-in-out infinite;
}

.dc-chat-btn {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  animation: dc-chat-btn var(--dc-cycle) ease-in-out infinite;
}

.dc-chat-btn::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.28);
  content: "";
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  animation: dc-tap var(--dc-cycle) ease-out infinite;
}

.dc-dim {
  animation: dc-dim var(--dc-cycle) ease-in-out infinite;
}

.dc-sheet {
  position: absolute;
  z-index: 21;
  top: 60px;
  right: 0;
  bottom: 10px;
  left: 0;
  display: flex;
  flex-direction: column;
  margin: 0 8px;
  border: 1px solid rgba(216, 218, 222, 0.85);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(253, 253, 254, 0.98), rgba(241, 242, 244, 0.98));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(105%);
  animation: dc-sheet var(--dc-cycle) cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.dc-grabber {
  display: block;
  width: 36px;
  height: 4px;
  margin: 6px auto 5px;
  border-radius: 999px;
  background: rgba(216, 218, 222, 0.9);
}

.dc-head {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
  padding: 4px 12px 10px 16px;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.16);
  color: var(--ios-blue);
}

.dc-head b {
  display: block;
  color: #1f2328;
  font-size: 16px;
  font-weight: 700;
}

.dc-head small {
  display: block;
  margin-top: 1px;
  color: #666d76;
  font-size: 11px;
}

.dc-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: rgba(118, 118, 128, 0.12);
  color: #666d76;
}

.dc-messages {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 12px;
}

.dc-empty {
  position: absolute;
  top: 45%;
  right: 0;
  left: 0;
  margin: 0;
  color: #8e8e93;
  font-size: 15px;
  text-align: center;
  animation: dc-empty var(--dc-cycle) step-end infinite;
}

.dc-msg {
  display: flex;
  opacity: 0;
}

.dc-msg-mine {
  justify-content: flex-end;
  animation: dc-msg-mine var(--dc-cycle) ease-out infinite;
}

.dc-msg-mine > span {
  max-width: 250px;
  padding: 8px 12px 6px;
  border-radius: 14px;
  background: var(--ios-blue);
  color: #fff;
  font-size: 16px;
  line-height: 1.3;
}

.dc-msg small {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 3px;
  font-size: 11px;
}

.dc-msg-mine small {
  color: rgba(255, 255, 255, 0.76);
}

.dc-msg-other {
  align-items: flex-end;
  gap: 8px;
  animation: dc-msg-other var(--dc-cycle) ease-out infinite;
}

.dc-msg-other img {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.dc-msg-other b {
  display: block;
  margin: 0 0 3px 4px;
  color: #c2410c;
  font-size: 12px;
  font-weight: 600;
}

.dc-msg-other div > span {
  display: block;
  max-width: 230px;
  padding: 8px 12px 6px;
  border-radius: 14px;
  background: #e9e9ee;
  color: #1c1c1e;
  font-size: 16px;
  line-height: 1.3;
}

.dc-msg-other small {
  color: #aeaeb2;
}

.dc-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px 12px 14px;
}

.dc-input {
  position: relative;
  display: block;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid rgba(216, 218, 222, 0.85);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(253, 253, 254, 0.82), rgba(253, 253, 254, 0.58));
  font-size: 17px;
  line-height: 1.3;
}

.dc-placeholder {
  position: absolute;
  top: 9px;
  left: 12px;
  color: #666d76;
  animation: dc-placeholder var(--dc-cycle) step-end infinite;
}

/* Поле ввода многострочное, как CupertinoTextField в приложении:
   фраза печатается по словам и переносится на вторую строку. */
.dc-typed {
  color: #1f2328;
}

.dc-typed span {
  font-size: 0;
  opacity: 0;
}

.dc-typed span:nth-child(1) { animation: dc-t1 var(--dc-cycle) step-end infinite; }
.dc-typed span:nth-child(2) { animation: dc-t2 var(--dc-cycle) step-end infinite; }
.dc-typed span:nth-child(3) { animation: dc-t3 var(--dc-cycle) step-end infinite; }
.dc-typed span:nth-child(4) { animation: dc-t4 var(--dc-cycle) step-end infinite; }

.dc-send {
  display: grid;
  padding: 4px 10px;
  border: 1.1px solid rgba(159, 202, 255, 0.78);
  border-radius: 18px;
  background: rgba(247, 250, 255, 0.92);
  color: var(--ios-blue);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  animation: dc-send var(--dc-cycle) ease-in-out infinite;
}

.dc-toast {
  animation: dc-toast var(--dc-cycle) ease-out infinite;
}

.dc-float-ask {
  top: 96px;
  right: 14px;
  animation: dc-float-ask var(--dc-cycle) ease-out infinite;
}

.dc-float-keep {
  top: 210px;
  left: 14px;
  animation: dc-float-keep var(--dc-cycle) ease-out infinite;
}

.dc-float-ask > span:first-child,
.dc-float-keep > span:first-child {
  color: var(--ios-blue, #007aff);
}

.dc-float-keep > span:first-child {
  background: rgba(52, 199, 89, 0.16);
  color: #34c759;
}

.dc-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dc-step {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(47, 107, 255, 0.11);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
  opacity: 0.5;
}

.dc-step > span {
  display: inline-grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 10px;
  font-weight: 800;
}

.dc-step h3 {
  margin: 4px 0 7px;
  color: var(--warm-ink);
  font-family: "Onest", "Inter", sans-serif;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.03em;
}

.dc-step p {
  margin: 0;
  color: var(--warm-muted);
  font-size: 13px;
  line-height: 1.55;
}

.dc-step-1 { animation: dc-step-1 16s ease-in-out infinite; }
.dc-step-2 { animation: dc-step-2 16s ease-in-out infinite; }
.dc-step-3 { animation: dc-step-3 16s ease-in-out infinite; }

@keyframes dc-tap {
  0%, 7.5% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  9% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  11.5%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

@keyframes dc-chat-btn {
  0%, 8% { transform: scale(1); }
  9% { transform: scale(0.85); }
  10%, 100% { transform: scale(1); }
}

@keyframes dc-dim {
  0%, 10% { opacity: 0; }
  12.5%, 60% { opacity: 1; }
  63%, 100% { opacity: 0; }
}

@keyframes dc-sheet {
  0%, 10% { transform: translateY(105%); }
  13.5%, 60% { transform: translateY(0); }
  63.5%, 100% { transform: translateY(105%); }
}

@keyframes dc-empty {
  0% { opacity: 1; }
  31% { opacity: 0; }
}

@keyframes dc-placeholder {
  0% { opacity: 1; }
  16% { opacity: 0; }
  31% { opacity: 1; }
}

@keyframes dc-t1 { 0% { opacity: 0; font-size: 0; } 17% { opacity: 1; font-size: 17px; } 31% { opacity: 0; font-size: 0; } }
@keyframes dc-t2 { 0% { opacity: 0; font-size: 0; } 20% { opacity: 1; font-size: 17px; } 31% { opacity: 0; font-size: 0; } }
@keyframes dc-t3 { 0% { opacity: 0; font-size: 0; } 23% { opacity: 1; font-size: 17px; } 31% { opacity: 0; font-size: 0; } }
@keyframes dc-t4 { 0% { opacity: 0; font-size: 0; } 26% { opacity: 1; font-size: 17px; } 31% { opacity: 0; font-size: 0; } }

@keyframes dc-send {
  0%, 29% { transform: scale(1); filter: none; }
  30% { transform: scale(0.88); filter: brightness(0.9); }
  31%, 100% { transform: scale(1); filter: none; }
}

@keyframes dc-msg-mine {
  0%, 31% { opacity: 0; transform: translateY(10px); }
  33%, 98% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

@keyframes dc-msg-other {
  0%, 41% { opacity: 0; transform: translateY(10px); }
  43.5%, 98% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

@keyframes dc-accept {
  0%, 67.5% { transform: scale(1); filter: none; }
  68.5% { transform: scale(0.95); filter: brightness(0.85); }
  69.5%, 100% { transform: scale(1); filter: none; }
}

@keyframes dc-request {
  0%, 69.5% { max-height: 140px; margin-top: 10px; padding-top: 9px; padding-bottom: 8px; opacity: 1; }
  71.5%, 98.5% { max-height: 0; margin-top: 0; padding-top: 0; padding-bottom: 0; opacity: 0; }
  100% { max-height: 140px; margin-top: 10px; padding-top: 9px; padding-bottom: 8px; opacity: 1; }
}

@keyframes dc-toast {
  0%, 71% { opacity: 0; transform: translate(-50%, 10px); }
  72.5%, 82% { opacity: 1; transform: translate(-50%, 0); }
  84%, 100% { opacity: 0; transform: translate(-50%, 10px); }
}

@keyframes dc-float-ask {
  0%, 17% { opacity: 0; transform: translateX(12px) scale(0.94); }
  19.5%, 34% { opacity: 1; transform: none; }
  37%, 100% { opacity: 0; transform: translateX(12px) scale(0.94); }
}

@keyframes dc-float-keep {
  0%, 45% { opacity: 0; transform: translateX(-12px) scale(0.94); }
  47.5%, 59% { opacity: 1; transform: none; }
  62%, 100% { opacity: 0; transform: translateX(-12px) scale(0.94); }
}

@keyframes dc-step-1 {
  0%, 10%, 100% { opacity: 1; background: #fff; border-color: rgba(47, 107, 255, 0.3); }
  13%, 97% { opacity: 0.5; background: rgba(255, 255, 255, 0.55); border-color: rgba(47, 107, 255, 0.11); }
}

@keyframes dc-step-2 {
  0%, 10%, 64%, 100% { opacity: 0.5; background: rgba(255, 255, 255, 0.55); border-color: rgba(47, 107, 255, 0.11); }
  13%, 61% { opacity: 1; background: #fff; border-color: rgba(47, 107, 255, 0.3); }
}

@keyframes dc-step-3 {
  0%, 61%, 100% { opacity: 0.5; background: rgba(255, 255, 255, 0.55); border-color: rgba(47, 107, 255, 0.11); }
  64%, 96% { opacity: 1; background: #fff; border-color: rgba(47, 107, 255, 0.3); }
}

@media (max-width: 980px) {
  .dc-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dc-demo {
    min-height: 680px;
  }

  .dc-float-ask {
    right: 6px;
  }

  .dc-float-keep {
    left: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dc-demo *,
  .dc-demo *::before,
  .dc-demo *::after {
    animation: none !important;
  }

  .dc-step {
    opacity: 1;
    animation: none;
  }
}

/* Ссылка внутри карточки бенто (как .wl-more на wishlist.html) */
.notes-bento-card .tk-more {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 10px;
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 650;
}

.notes-bento-card .tk-more:hover {
  text-decoration: underline;
}
