/* The comparison as two chat windows (2026-09-02; restyled the same day on
   John's review: it has to read as a real messaging window at a glance).
   The windows sit inside the demo app-window exception (rounded window,
   soft shadow, chat bubbles, a composer), the way the sample suite draws
   Outlook and Teams; the page around them stays on the paper rules. The
   memory window's avatar is the view's one signal mark. */

.cc { --cc-h: 540px; }
.cc-strip { margin-bottom: 18px; }
.cc-q { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cc-strip .cc-k {
  width: 100%; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: var(--text-small); color: var(--slate-500); margin-bottom: 4px;
}
.cc-state .cc-dot {
  display: inline-block; width: 7px; height: 7px; background: var(--slate-400);
  margin-right: 7px; vertical-align: 1px;
}
.cc-strip button {
  font: inherit; font-size: var(--text-small); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line-strong);
  padding: 7px 12px; cursor: pointer; text-align: left;
}
.cc-strip button:hover { background: var(--paper-alt); border-color: var(--slate-300); }
.cc-strip button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cc-strip button.cc-more { border-style: dashed; color: var(--slate-500); }

/* ---- the two windows ---- */
.cc-wins { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: stretch; }
.cc-win {
  display: flex; flex-direction: column; height: var(--cc-h); min-width: 0;
  background: #FFFFFF; border: 1px solid #D6D6D6; border-radius: 10px;
  box-shadow: 0 10px 28px rgba(30, 38, 46, 0.12); overflow: hidden;
  contain: layout paint;   /* typing repaints stay inside the window */
}
.cc-bar {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 11px 14px; background: #F4F5F6; border-bottom: 1px solid #E3E6E8;
}
.cc-av {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  background: var(--slate-600); color: #FFFFFF;
}
.cc-win.mem .cc-bar .cc-av, .cc-win.mem .cc-row .cc-av { background: var(--signal-500); color: var(--ink); }
.cc-id { min-width: 0; flex: 1; line-height: 1.3; }
.cc-id b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-id .cc-sub { display: block; font-size: 12px; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-id .cc-sub::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--positive); margin-right: 6px; vertical-align: 1px;
}
.cc-win.bare .cc-id .cc-sub::before { background: var(--slate-400); }
.cc-glyphs { flex: none; display: flex; gap: 6px; }
.cc-glyphs i { display: block; width: 9px; height: 9px; border-radius: 50%; background: #D3D7DA; }

/* ---- the log ---- */
.cc-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 16px 12px; display: flex; flex-direction: column; gap: 4px;
  scrollbar-width: thin; background: #FFFFFF; contain: layout paint;
}
.cc-row { display: flex; align-items: flex-end; gap: 10px; max-width: 100%; }
.cc-row.user { justify-content: flex-end; margin-top: 2px; }
.cc-row.ai { justify-content: flex-start; margin-top: 12px; }
.cc-row .cc-av { width: 28px; height: 28px; font-size: 11px; }
.cc-meta { font-size: 12px; color: var(--slate-500); margin: 6px 4px 2px; }
.cc-meta.user { text-align: right; }
.cc-msg {
  max-width: 82%; padding: 10px 14px; line-height: 1.5; font-size: 15px;
  white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 18px; margin: 0;
}
.cc-msg.user { background: var(--ink); color: #FFFFFF; border-bottom-right-radius: 5px; }
.cc-msg.ai { background: #F1F3F4; color: var(--ink); border-bottom-left-radius: 5px; }
.cc-typing { display: inline-flex; gap: 5px; align-items: center; height: 1.2em; }
.cc-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--slate-400);
  animation: cc-bounce 1.1s infinite ease-in-out;
}
.cc-typing i:nth-child(2) { animation-delay: 0.15s; }
.cc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .55; } 30% { transform: translateY(-4px); opacity: 1; } }
.cc-sys {
  align-self: center; text-align: center; max-width: 92%;
  font-size: 12px; color: var(--slate-500); margin: 12px 0 4px;
}
.cc-sys .y { color: var(--ink); font-weight: 600; }
.cc-sys .f { color: var(--ink); overflow-wrap: anywhere; }
.cc-sys .g { color: var(--ink); font-weight: 600; white-space: nowrap; }
.cc-sys .g.wrong { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.cc-cite {
  font: inherit; font-size: 12px; line-height: 1.4; color: var(--ink); background: #FFFFFF;
  border: 1px solid #D6DADD; border-radius: 6px; padding: 0 6px; margin: 0 2px;
  cursor: pointer; white-space: nowrap; vertical-align: baseline;
}
.cc-cite:hover { border-color: var(--ink); }
.cc-caret {
  display: inline-block; width: 1px; height: 1em; background: var(--ink);
  vertical-align: text-bottom; animation: cc-blink 1s steps(1) infinite;
}
@keyframes cc-blink { 50% { opacity: 0; } }
.cc-inspect {
  flex: none; font-size: 12px; color: var(--slate-500);
  padding: 8px 14px 10px; border-top: 1px solid #E3E6E8; display: none;
}
.cc-inspect.on { display: block; }
.cc-inspect b { color: var(--ink); font-weight: 600; }

/* ---- the composer: it is a replay, so the field is quiet, but the shape
   is what says "chat" before a word is read ---- */
.cc-compose {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-top: 1px solid #E3E6E8; background: #FFFFFF;
}
.cc-input {
  flex: 1; min-width: 0; height: 38px; display: flex; align-items: center;
  padding: 0 14px; border: 1px solid #D6DADD; border-radius: 19px;
  font-size: 14px; color: var(--slate-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cc-send {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink);
  position: relative;
}
.cc-send::before {
  content: ""; position: absolute; left: 12px; top: 11px; width: 9px; height: 9px;
  border-top: 2px solid #FFFFFF; border-right: 2px solid #FFFFFF; transform: rotate(-45deg);
}
.cc-send::after {
  content: ""; position: absolute; left: 16px; top: 12px; width: 2px; height: 12px; background: #FFFFFF;
}

/* ---- the foot: skip while typing ---- */
.cc-foot {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: var(--text-small); color: var(--slate-500); margin-top: 16px;
}
.cc-foot .cc-skip {
  font: inherit; font-size: var(--text-small); color: var(--slate-500);
  background: none; border: none; border-bottom: 1px solid var(--link-underline);
  padding: 0 0 1px; cursor: pointer; display: none;
}
.cc-foot .cc-skip.on { display: inline; }
.cc-foot .cc-skip:hover { color: var(--ink); border-bottom-color: var(--ink); }
.cc-foot a { border-bottom: 1px solid var(--link-underline); white-space: nowrap; }
.cc-foot a:hover { border-bottom-color: var(--link-underline-hover); }

@media (max-width: 900px) {
  .cc { --cc-h: 460px; }
  .cc-wins { grid-template-columns: 1fr; gap: 18px; }
  .cc-msg { max-width: 90%; }
}
@media (max-width: 600px) {
  /* one scrolling row of questions, so the windows sit near the top */
  .cc-q { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .cc-q::-webkit-scrollbar { display: none; }
  .cc-q button { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-caret, .cc-typing i { animation: none; }
}
