/* Echo on the person's screen (15.1156: «сама же страница переливается по контуру, как при управлении клодом»; 15.1157:
   «и плашка внизу "Под управлением Echo" и кнопка остановки») - `/kit/echocontrol.js` */
@property --echo-spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes echo-spin { to { --echo-spin: 360deg; } }
@keyframes echo-breath { from { opacity: .55; } to { opacity: 1; } }
@keyframes echo-rise { from { opacity: 0; translate: -50% var(--sp-200); } }

/* the page's outline: Echo's colours as light translucent waves running round a rounded edge, a thin line on it
   (15.1435: «свечение… незаметное на большом экране»; 15.1436: «Должны были быть лёгкие волны полупрозрачные»,
   «скруглённая обязательно»); the waves grow with the screen - a share of its smaller side */
.echo-frame { position: fixed; inset: 0; z-index: 9000; pointer-events: none; border-radius: var(--r-xl);
  animation: echo-breath 2.4s ease-in-out infinite alternate; transition: opacity var(--dur-fold) var(--ease-out); }
.echo-frame::before, .echo-waves::before { content: ""; position: absolute; inset: 0; border-radius: inherit;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.echo-frame::before { padding: var(--bw-sel); opacity: .6;
  background: conic-gradient(from var(--echo-spin), var(--echo-1), var(--echo-2), var(--echo-3), var(--echo-1));
  animation: echo-spin 6s linear infinite; }
/* the waves: patches of colour with gaps between, blurred into soft light - the blur on their holder, since on the
   ring itself it would come before the ring is cut */
.echo-waves { position: absolute; inset: 0; border-radius: inherit; opacity: .6;
  filter: blur(calc(var(--sp-150) + .5vmin + .8vmax)); }
.echo-waves::before { padding: calc(var(--sp-150) + 1vmin + 1vmax);
  background: conic-gradient(from var(--echo-spin), var(--echo-1), transparent 18%, var(--echo-2) 34%,
    transparent 52%, var(--echo-3) 68%, transparent 86%, var(--echo-1));
  animation: echo-spin 9s linear infinite; }

/* Echo's pointer: comes to the control it presses */
.echo-pointer { position: fixed; z-index: 9002; left: 50%; top: 50%; width: var(--sp-250); height: var(--sp-250);
  margin: calc(var(--sp-250) / -2) 0 0 calc(var(--sp-250) / -2); border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 35% 30%, var(--echo-1), var(--echo-2) 60%, var(--echo-3));
  box-shadow: 0 0 0 var(--sp-075) color-mix(in srgb, var(--echo-2) 28%, transparent), var(--sh-raised);
  transition: left .5s var(--ease-out), top .5s var(--ease-out), opacity var(--dur-pop), scale var(--dur-pop); }
.echo-pointer.on { opacity: 1; }
.echo-pointer.press { scale: .75; }
.echo-touched { outline: var(--bw-sel) solid var(--echo-2); outline-offset: var(--sp-025); }

/* the bar at the foot: who is acting, what for, and «Остановить» */
.echo-bar { position: fixed; z-index: 9001; left: 50%; bottom: calc(var(--sp-300) + env(safe-area-inset-bottom, 0px));
  translate: -50% 0; display: flex; align-items: center; gap: var(--sp-150); width: max-content;
  max-width: min(640px, calc(100vw - var(--sp-400)));
  padding: var(--sp-100) var(--sp-100) var(--sp-100) var(--sp-200); border-radius: var(--r-xl); background: var(--card);
  box-shadow: var(--sh-overlay), inset 0 0 0 var(--bw) color-mix(in srgb, var(--echo-2) 40%, var(--line));
  animation: echo-rise var(--dur-fold) var(--ease-out); transition: opacity var(--dur-fold) var(--ease-out); }
.echo-bar b { flex: none; font-weight: var(--fw-semi); }
.echo-bar-say { flex: 0 1 auto; min-width: 0; color: var(--ink2); font-size: var(--fs-s); }
.echo-bar-say:empty { display: none; }
.echo-bar-dot { flex: none; width: var(--sp-100); height: var(--sp-100); border-radius: 50%;
  background: linear-gradient(135deg, var(--echo-1), var(--echo-3)); animation: echo-breath 1.2s ease-in-out infinite alternate; }
.echo-frame.leaving, .echo-bar.leaving { opacity: 0; }
/* 15.1437 («на телефоне пусть просто иконка будет тогда»): on a phone «Остановить» is its icon alone, a square */
@media (max-width: 700px) {
  .echo-stop.btn.small { width: var(--h-btn-sm); padding: 0; justify-content: center; }
  .echo-stop-word { display: none; }
  /* 15.2477: the step Echo takes is read whole - the bar's title over it, across the bar */
  .echo-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--sp-150); row-gap: 0;
    width: calc(100vw - var(--sp-400)); }
  .echo-bar-dot { grid-row: 1 / span 2; }
  .echo-bar b { grid-column: 2; grid-row: 1; }
  .echo-bar-say { grid-column: 2; grid-row: 2; }
  .echo-stop.btn.small { grid-column: 3; grid-row: 1 / span 2; }
}

/* Echo's buttons into DEOS under its answer (15.1054) are a message's buttons of messenger.css (.msgr-keys, .msgr-key) */

/* 15.2024 («шаги с точками и линией в одном месте»): one task on the screen is one message - its steps one under
   another, a dot each joined to the next by a line, as Claude's own steps are drawn; the step going now breathes; what a
   step did in the quiet ink under it */
.msgr-trail { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.msgr-step { position: relative; display: grid; grid-template-columns: var(--sp-200) minmax(0, 1fr);
  column-gap: var(--sp-100); padding-bottom: var(--sp-150); }
.msgr-step:last-child { padding-bottom: 0; }
.msgr-step:not(:last-child)::before { content: ""; position: absolute; left: calc((var(--sp-200) - var(--bw)) / 2);
  top: calc(var(--lh) / 2); bottom: calc(var(--lh) / -2); width: var(--bw); background: var(--line); }
.msgr-step-dot { position: relative; z-index: 1; width: var(--sp-100); height: var(--sp-100);
  margin: calc((var(--lh) - var(--sp-100)) / 2) auto 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--echo-1), var(--echo-3)); }
.msgr-step.live .msgr-step-dot { animation: echo-breath 1.2s ease-in-out infinite alternate;
  box-shadow: 0 0 0 var(--sp-050) color-mix(in srgb, var(--echo-2) 24%, transparent); }
.msgr-step-say { min-width: 0; overflow-wrap: anywhere; }
.msgr-step-did { grid-column: 2; min-width: 0; margin-top: var(--sp-025); color: var(--ink3); font-size: var(--fs-s);
  line-height: var(--lh-s); overflow-wrap: anywhere; }


@media (prefers-reduced-motion: reduce) {
  .echo-frame, .echo-frame::before, .echo-waves::before, .echo-bar-dot, .echo-bar, .msgr-step.live .msgr-step-dot { animation: none; }
  .echo-pointer { transition: opacity var(--dur-pop); }
}
