/* Crump Vision — Chats screen (1.0)
 * Calm, warm workspace styling laid over the real chat engine. The treatment
 * favors legibility, clear hierarchy, and restrained brand accents.
 */

:root {
  --cv-bg: #0d1015;
  --cv-panel: #15191f;
  --cv-hairline: rgba(255, 255, 255, 0.09);
  --cv-gold: #dec57e;
  --cv-deep-gold: #c6a95f;
  --cv-text: #f7f4ec;
  --cv-muted: #adb3bb;
}

/* Shared eyebrow used by the chats components and shell helpers. */
.cv-eyebrow {
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cv-gold);
  margin: 0;
}

.cv-mascot {
  display: none !important;
}

/* ---------------------------------------------------------------------------
 * Message identity: a quiet nameplate. Character artwork is on hold.
 * ------------------------------------------------------------------------- */

.cv-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  margin: 0 0 10px 0;
}

.cv-identity .crump-message-avatar,
body.crump-v1 .cv-identity .crump-message-avatar,
body.crump-v1-body .cv-identity .crump-message-avatar {
  display: none !important;
}

.cv-identity .crump-message-name {
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--cv-gold);
}

/* Thinking uses status dots rather than character artwork. */
.cv-thinking .crump-message-avatar,
body.crump-v1 .cv-thinking .crump-message-avatar,
body.crump-v1-body .cv-thinking .crump-message-avatar {
  display: none !important;
}

/* ---------------------------------------------------------------------------
 * Thinking state: three calm gold dots + one cycling warm verb.
 * Ease transitions stay inside 200–300ms; the dots breathe on a slow loop.
 * ------------------------------------------------------------------------- */

.cv-thinking.presence-message .presence-bubble {
  background: transparent;
  border: 0;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cv-thinking.presence-message .typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cv-thinking.presence-message .typing-dots i {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50%;
  background: var(--cv-gold) !important;
  opacity: 0.35;
  animation: cv-dot-calm 1.8s ease-in-out infinite !important;
  transition: opacity 250ms ease;
}

.cv-thinking.presence-message .typing-dots i:nth-child(2) {
  animation-delay: 0.25s !important;
}

.cv-thinking.presence-message .typing-dots i:nth-child(3) {
  animation-delay: 0.5s !important;
}

@keyframes cv-dot-calm {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

/* The engine's own label is hidden while the vision label owns the verbs,
 * so two rotations never fight over the same sentence. */
.cv-thinking .presence-label {
  display: none;
}

.cv-thinking .cv-thinking-label {
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--cv-muted);
  transition: opacity 240ms ease;
}

.cv-thinking .cv-thinking-label.cv-fade {
  opacity: 0;
}

/* ---------------------------------------------------------------------------
 * Plan card: visible plan with animated checkpoints.
 * ------------------------------------------------------------------------- */

.cv-plan {
  background: var(--cv-panel);
  border: 1px solid var(--cv-hairline);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 14px 0;
  max-width: 560px;
}

.cv-plan-steps {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cv-plan-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--cv-muted);
  transition: color 250ms ease;
}

.cv-plan-dot {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(222, 197, 126, 0.4);
  font-size: 11px;
  line-height: 1;
  color: var(--cv-gold);
  transition: background-color 250ms ease, border-color 250ms ease, color 250ms ease;
}

.cv-plan-label {
  line-height: 1.45;
}

.cv-plan-step.cv-plan-active {
  color: var(--cv-text);
}

.cv-plan-step.cv-plan-active .cv-plan-dot {
  border-color: var(--cv-gold);
  animation: cv-dot-calm 1.8s ease-in-out infinite;
}

.cv-plan-step.cv-plan-done {
  color: var(--cv-muted);
}

.cv-plan-step.cv-plan-done .cv-plan-dot {
  background: var(--cv-gold);
  border-color: var(--cv-gold);
  color: #15120a;
  animation: none;
}

.cv-plan.cv-plan-complete {
  border-color: rgba(222, 197, 126, 0.36);
  transition: border-color 250ms ease, opacity 600ms ease;
}

.cv-plan.cv-plan-settled {
  opacity: 0.75;
}

/* ---------------------------------------------------------------------------
 * Keepsake card: the artifact that ends an answer.
 * ------------------------------------------------------------------------- */

.cv-keepsake {
  background: var(--cv-panel);
  border: 1px solid var(--cv-hairline);
  border-radius: 16px;
  padding: 22px 24px;
  margin: 16px 0;
  max-width: 560px;
}

.cv-keepsake-title {
  font-weight: 680;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--cv-text);
  margin: 12px 0 6px;
}

.cv-keepsake-meta {
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--cv-muted);
  letter-spacing: 0;
}

.cv-keepsake-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.cv-keepsake-btn {
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(222, 197, 126, 0.44);
  background: transparent;
  color: var(--cv-gold);
  cursor: pointer;
  transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease;
}

.cv-keepsake-btn:hover {
  border-color: var(--cv-gold);
  background: rgba(222, 197, 126, 0.1);
}

.cv-keepsake-btn-primary {
  background: var(--cv-gold);
  border-color: var(--cv-gold);
  color: #15120a;
}

.cv-keepsake-btn-primary:hover {
  background: var(--cv-deep-gold);
  border-color: var(--cv-deep-gold);
  color: #15120a;
}

.cv-keepsake-btn:focus-visible {
  outline: 2px solid var(--cv-gold);
  outline-offset: 2px;
}

/* Real artifact payloads (message.artifact, rendered by the engine as
 * .crump50-artifact) get the vision treatment in place. */
.crump50-artifact.cv-keepsake-real {
  background: var(--cv-panel) !important;
  border: 1px solid var(--cv-hairline) !important;
  border-radius: 14px;
  padding: 18px 20px;
}

.crump50-artifact.cv-keepsake-real::before {
  content: "Keepsake";
  display: block;
  font-family: Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cv-gold);
  margin-bottom: 10px;
}

.crump50-artifact.cv-keepsake-real .crump50-artifact-actions button {
  border: 1px solid rgba(222, 197, 126, 0.44);
  border-radius: 999px;
  background: transparent;
  color: var(--cv-gold);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 250ms ease, border-color 250ms ease;
}

.crump50-artifact.cv-keepsake-real .crump50-artifact-actions button:hover {
  border-color: var(--cv-gold);
  background: rgba(222, 197, 126, 0.1);
}

/* ---------------------------------------------------------------------------
 * Narrow screens
 * ------------------------------------------------------------------------- */

@media (max-width: 560px) {
  .cv-plan,
  .cv-keepsake {
    padding: 18px;
  }

  .cv-keepsake-title {
    font-size: 18px;
  }
}

/* ---------------------------------------------------------------------------
 * Reduced motion: stillness over animation.
 * ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .cv-thinking.presence-message .typing-dots i,
  .cv-plan-step.cv-plan-active .cv-plan-dot {
    animation: none;
    opacity: 0.8;
  }

  .cv-plan-step,
  .cv-plan-dot,
  .cv-keepsake-btn,
  .cv-thinking .cv-thinking-label {
    transition: none;
  }
}
