/* Live recreation of the Assistant view shown on the security page. It
   replaces the screen-asistente.png capture with DOM, following the
   hero-panel pattern from inicio.css: the mock is laid out exactly once at
   its fixed 1060px design width and the frame scales that finished layout
   proportionally via scale: tan(atan2(100cqw, 1060px)) — it never reflows.

   The frame's aspect ratio is the mock's measured natural size, and every
   animation phase preserves it: the conversation replays inside a
   fixed-height, bottom-anchored, clipped viewport (.as-view), the typed
   question lives in a fixed-height composer slot, and everything else only
   animates transform/opacity. If content changes, re-measure and update
   the ratio.

   Decorative (aria-hidden, described by .as-sr): nothing inside is
   focusable, and its type may run smaller than the page's body-text floor —
   an illustration of a UI, not UI. */

.as-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.as-frame {
  aspect-ratio: 1060 / 596;
  container-type: inline-size;
  overflow: hidden;
  background: #fbfbfb;
}

.as-demo {
  --as-ink: #17172a;
  --as-mut: #6d6d80;
  --as-dim: #9a9aa8;
  --as-line: #ececf1;
  --as-indigo: #5d63f7;
  --as-lav: #edeffe;
  width: 1060px;
  /* Fixed like the width: the conversations rail holds more content than
     fits (it clips, like the capture), so the panel's height must be
     declared, not derived — otherwise the rail would stretch the layout. */
  height: 596px;
  transform-origin: top left;
  scale: tan(atan2(100cqw, 1060px));
  display: flex;
  background: #fbfbfb;
  color: var(--as-ink);
  line-height: 1.35;
  cursor: default;
  user-select: none;
}

.as-demo * {
  min-width: 0;
}

/* The mock is laid out in px by design; the page's default paragraph margins
   (1em of each paragraph's own size) would inflate it unpredictably. */
.as-demo p {
  margin: 0;
}

/* ---------- sidebar (same product chrome as the other mocks) ---------- */

.as-side {
  display: flex;
  flex-direction: column;
  flex: 0 0 190px;
  padding: 12px 10px 12px;
  border-right: 1px solid var(--as-line);
  background: #f4f4f6;
}

.as-brand {
  padding: 2px 8px 8px;
}

.as-brand img {
  display: block;
  width: auto;
  height: 18px;
}

.as-label {
  margin: 8px 8px 3px;
  color: var(--as-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.as-item {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 4.5px 8px;
  border-radius: 8px;
  color: var(--as-mut);
  font-size: 12px;
  font-weight: 500;
}

.as-item svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.as-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-item.is-active {
  background: #e8e8ec;
  color: var(--as-ink);
  font-weight: 600;
}

.as-item.is-active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #45b0f5;
}

.as-badge {
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  background: #ececf1;
  color: var(--as-mut);
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.as-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 9px 8px 0;
  border-top: 1px solid var(--as-line);
}

.as-ava {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #23233c;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}

.as-user-name {
  font-size: 11.5px;
  font-weight: 600;
}

.as-user-role {
  color: var(--as-dim);
  font-size: 10px;
}

.as-chev {
  margin-left: auto;
  color: var(--as-dim);
}

/* ---------- right of the sidebar ---------- */

.as-rest {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.as-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--as-line);
  background: #fff;
}

.as-top svg {
  width: 15px;
  height: 15px;
  color: var(--as-dim);
}

.as-top-title {
  font-size: 13px;
  font-weight: 700;
}

.as-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 240px;
  padding: 4px 10px;
  border: 1px solid var(--as-line);
  border-radius: 9px;
  background: #fff;
  color: var(--as-dim);
  font-size: 11px;
}

.as-search span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-kbd {
  margin-left: auto;
  padding: 1px 5px;
  border: 1px solid var(--as-line);
  border-radius: 5px;
  background: #f2f2f6;
  font-size: 9px;
}

.as-top-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.as-bell {
  position: relative;
}

.as-bell-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e23c4f;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.5;
}

.as-cols {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ---------- chat column ---------- */

.as-chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  background: #fdfdfe;
  /* Header, viewport, and composer are all fixed-design blocks; any stray
     pixel of excess clips at the bottom instead of squashing a block. */
  overflow: hidden;
}

.as-chat-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--as-line);
  background: #fff;
}

.as-spark {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1effe;
  color: var(--as-indigo);
}

.as-spark svg,
.as-ava-spark svg {
  width: 14px;
  height: 14px;
}

.as-head-name {
  font-size: 12.5px;
  font-weight: 700;
}

.as-conn {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--as-mut);
  font-size: 10px;
}

.as-conn i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #27a25c;
}

.as-modes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.as-mode-label {
  color: var(--as-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.as-mode-rail {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #f1f1f4;
}

.as-mode {
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--as-mut);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.as-mode.is-active {
  background: #fff;
  box-shadow: 0 1px 4px rgb(14 14 26 / 10%);
  color: var(--as-ink);
}

/* ---------- conversation viewport ----------
   Fixed height, clipped, content anchored to the bottom: turns appearing or
   streaming grow the content upward past the clip — the outer size promised
   by the frame's aspect ratio never moves, exactly like a scrolled chat. */

.as-view {
  position: relative;
  flex: 0 0 auto;
  height: 336px;
  overflow: hidden;
}

.as-scroll {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0 16px 10px;
}

.as-msg-card {
  padding: 12px 14px;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  background: #fff;
  font-size: 11.5px;
  line-height: 1.55;
}

.as-bullet {
  padding-left: 4px;
}

.as-bullet-sub {
  padding-left: 18px;
}

.as-hr {
  height: 1px;
  margin: 9px 0;
  border: 0;
  background: var(--as-line);
}

.as-code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f2f2f6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.as-cite {
  max-height: 70px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.as-cite.is-off {
  max-height: 0;
  opacity: 0;
}

.as-cite-label {
  margin-top: 9px;
  color: var(--as-dim);
  font-size: 10.5px;
}

.as-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 11px;
  border: 1px solid var(--as-line);
  border-radius: 999px;
  color: var(--as-mut);
  font-size: 10.5px;
}

.as-doc-chip svg {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
}

.as-doc-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-actions {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  padding-left: 6px;
  color: var(--as-mut);
  font-size: 10.5px;
}

.as-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.as-action svg {
  width: 11px;
  height: 11px;
}

/* Turns staged by asistente-demo.js: hidden ends are explicit classes so a
   turn cannot half-exist, and the entrance animates max-height/opacity
   inside the clipped viewport only. */
.as-turn {
  max-height: 170px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.as-turn.is-off {
  max-height: 0;
  opacity: 0;
}

.as-turn-user {
  padding-top: 12px;
  text-align: right;
}

.as-bubble {
  display: inline-block;
  max-width: 82%;
  padding: 8px 13px;
  border-radius: 13px;
  background: #e6e6fb;
  font-size: 11.5px;
  text-align: left;
}

.as-time {
  margin-top: 4px;
  color: var(--as-dim);
  font-size: 9.5px;
}

.as-turn-bot {
  padding-top: 12px;
}

.as-bot-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.as-ava-spark {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #5865ef;
  color: #fff;
}

.as-bot-row .as-msg-card {
  flex: 1;
}

.as-turn-bot .as-actions {
  padding-left: 41px;
}

/* ---------- typing dots ---------- */

.as-dots {
  display: none;
  align-items: center;
  gap: 9px;
  padding-top: 12px;
}

.as-dots.is-on {
  display: flex;
}

.as-dots-card {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  background: #fff;
}

.as-dots-card i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--as-dim);
  animation: as-bounce 1s ease-in-out infinite;
}

.as-dots-card i:nth-child(2) { animation-delay: 0.15s; }
.as-dots-card i:nth-child(3) { animation-delay: 0.3s; }

/* ---------- streamed words ---------- */

.as-typed .w,
.as-stream .w {
  transition: opacity 0.15s ease;
}

.as-typed.is-armed .w,
.as-stream.is-armed .w {
  opacity: 0;
}

.as-typed.is-armed .w.is-on,
.as-stream.is-armed .w.is-on {
  opacity: 1;
}

/* ---------- composer ---------- */

.as-composer {
  flex: 0 0 auto;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--as-line);
  background: #fdfdfe;
  transition: opacity 0.22s ease;
}

.as-demo.is-reset .as-composer,
.as-demo.is-reset .as-scroll {
  opacity: 0.3;
}

.as-sugs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.as-sug {
  padding: 4px 11px;
  border: 1px solid var(--as-line);
  border-radius: 999px;
  background: #fff;
  color: var(--as-mut);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}

.as-input {
  margin-top: 8px;
  border: 1px solid var(--as-line);
  border-radius: 13px;
  background: #fff;
}

.as-input-text {
  position: relative;
  height: 46px;
  padding: 10px 14px;
  font-size: 11.5px;
}

.as-ph {
  color: var(--as-dim);
}

.as-demo.is-typing .as-ph {
  display: none;
}

.as-typed {
  display: none;
}

.as-demo.is-typing .as-typed {
  display: block;
}

.as-caret {
  display: inline-block;
  width: 1.5px;
  height: 12px;
  margin-left: 2px;
  background: var(--as-indigo);
  vertical-align: -2px;
  animation: as-blink 1s steps(1) infinite;
}

.as-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid #f3f3f6;
}

.as-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f2f2f6;
  color: var(--as-mut);
  font-size: 11px;
  font-weight: 600;
}

.as-tool svg {
  width: 12px;
  height: 12px;
}

.as-hint {
  margin-left: auto;
  color: var(--as-dim);
  font-size: 10px;
  white-space: nowrap;
}

.as-ask {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: #9ba1f7;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.25s ease;
}

.as-demo.is-typing .as-ask {
  background: var(--as-indigo);
}

.as-ask svg {
  width: 11px;
  height: 11px;
}

.as-note {
  margin-top: 7px;
  color: var(--as-dim);
  font-size: 10px;
  text-align: center;
}

/* ---------- conversations rail ---------- */

.as-rail {
  display: flex;
  flex: 0 0 250px;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--as-line);
  background: #fff;
}

.as-rail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
}

.as-rail-title {
  font-size: 12.5px;
  font-weight: 700;
}

.as-new {
  margin-left: auto;
  padding: 3px 11px;
  border-radius: 8px;
  background: #e6e9ff;
  color: #4d5cf5;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.as-rail-search {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 12px 4px;
  padding: 5px 10px;
  border: 1px solid var(--as-line);
  border-radius: 9px;
  color: var(--as-dim);
  font-size: 10.5px;
}

.as-rail-search svg {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
}

.as-convos {
  flex: 1;
  min-height: 0;
  padding: 0 8px;
  overflow: hidden;
}

.as-rail-label {
  margin: 8px 6px 3px;
  color: var(--as-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.as-convo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 9px;
}

.as-convo-icon {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #f2f2f5;
  color: var(--as-dim);
}

.as-convo-icon svg {
  width: 11px;
  height: 11px;
}

.as-convo-text {
  overflow: hidden;
}

.as-convo-title {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.as-convo-time {
  color: var(--as-dim);
  font-size: 9.5px;
}

.as-convo.is-active {
  background: var(--as-lav);
}

.as-convo.is-ping {
  animation: as-ping 1.1s ease-out;
}

.as-archived {
  padding: 5px 6px 7px;
  color: var(--as-mut);
  font-size: 10.5px;
  text-align: center;
}

.as-rail-acts {
  padding: 8px 12px 12px;
  border-top: 1px solid var(--as-line);
}

.as-acts-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.as-acts-title {
  color: var(--as-dim);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.as-ver {
  margin-left: auto;
  color: #4d5cf5;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

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

.as-act-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: #f0f0f3;
  color: #55555e;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
}

.as-rail-note {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #f6f6f8;
  color: var(--as-mut);
  font-size: 9.5px;
  line-height: 1.5;
}

/* ---------- motion ---------- */

@keyframes as-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes as-bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-3px); }
}

@keyframes as-ping {
  0% { background: #dfe3ff; }
  100% { background: var(--as-lav); }
}
