/* PERFECT CIRCLE - the RCS emulator's face (design/starters/perfect-circle/rcs.css). Contract version 1.

   Everything round: pill bubbles, a ring of round answers, round pictures, a round launcher with a ring.

   A STARTER DESIGN (designer-css-plan section 2.6): ours, read-only, loaded and changed and saved as a workspace's own
   design. Written ONLY against the --cv-* tokens and the data-cv-* parts, moments, turns, states and screens of
   design/contract.json - never a class name, never an !important. A design's CSS lands in the cascade layer cv.design (the
   server wraps it; on the go site's stage, Tests/Design/ShotCases.Starters.cs does), so it beats our default bundle
   without a specificity war. url() reaches only this package's own files.

   1. THE TOKENS - on :root (the page around the phone - the bezel, the toast), the phone's screen and the bottom
      sheet: the screen and the sheet declare their own tokens, so a token set on :root alone never reaches the
      phone. They equal manifest.json's tokens, value for value (Tests/Design/StarterLibraryTests).
   2. THE LOOK - every shape, glow, picture and motion is scoped to the conversation's own screen
      ([data-cv-screen="thread"]). A protected screen (confirm, consent, payment, sign-in) and a protected part (the
      verified note, Powered by, a signature, an action's confirm) take COLOURS ONLY, inside the contrast floor - so when
      the locked layer lands (P1) nothing here has to move. Motion runs only when the reader has not asked for less. */

:root,
[data-cv-part="screen"],
[data-cv-part="sheet"] {
  /* reference */
  --cv-color-brand: #6a4cf0;
  --cv-color-ink: #241c3a;
  --cv-color-paper: #fbf9ff;
  --cv-font-body: "Circle Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cv-font-display: "Circle Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cv-radius-s: 999px;
  --cv-radius-m: 999px;
  --cv-radius-l: 28px;
  --cv-shadow-1: 0 2px 6px rgba(106, 76, 240, .12);
  --cv-shadow-2: 0 8px 22px rgba(106, 76, 240, .16);
  --cv-shadow-3: 0 24px 60px rgba(36, 28, 58, .18);
  --cv-motion-fast: 120ms;
  --cv-motion-slow: 240ms;
  /* semantic */
  --cv-surface: #ffffff;
  --cv-on-surface: var(--cv-color-ink);
  --cv-accent: #6a4cf0;
  --cv-on-accent: #ffffff;
  --cv-muted: #5d5578;
  --cv-danger: #c4253a;
  --cv-focus: var(--cv-accent);
  --cv-bubble-me-bg: #6a4cf0;
  --cv-bubble-me-ink: #ffffff;
  --cv-bubble-them-bg: #ffffff;
  --cv-bubble-them-ink: #241c3a;
  --cv-field-font-size: 16px;
  /* component */
  --cv-header-bg: var(--cv-surface);
  --cv-header-ink: var(--cv-on-surface);
  --cv-header-line: color-mix(in srgb, var(--cv-on-surface) 12%, transparent);
  --cv-header-shadow: var(--cv-shadow-1);
  --cv-avatar-bg: var(--cv-accent);
  --cv-bubble-radius: 28px;
  --cv-bubble-tail-radius: 28px;
  --cv-bubble-font-size: 15px;
  --cv-bubble-them-shadow: var(--cv-shadow-1);
  --cv-typing-dot: var(--cv-muted);
  --cv-card-radius: 32px;
  --cv-chip-bg: #ffffff;
  --cv-chip-ink: var(--cv-accent);
  --cv-chip-border: rgba(106, 76, 240, .45);
  --cv-chip-radius: 999px;
  --cv-chip-hover-bg: color-mix(in srgb, var(--cv-accent) 10%, var(--cv-surface));
  --cv-composer-bg: var(--cv-surface);
  --cv-composer-ink: var(--cv-on-surface);
  --cv-composer-placeholder-ink: var(--cv-muted);
  --cv-composer-line: color-mix(in srgb, var(--cv-on-surface) 16%, transparent);
  --cv-send-bg: var(--cv-accent);
  --cv-send-ink: var(--cv-on-accent);
  --cv-sheet-bg: var(--cv-surface);
  --cv-sheet-backdrop: rgba(0, 0, 0, .45);
  --cv-verified-bg: color-mix(in srgb, var(--cv-accent) 9%, transparent);
  --cv-verified-ink: var(--cv-muted);
  --cv-verified-icon: var(--cv-accent);
  --cv-verified-shield: var(--cv-accent);
  --cv-daymark-bg: color-mix(in srgb, var(--cv-on-surface) 7%, transparent);
  --cv-daymark-ink: var(--cv-muted);
  --cv-receipt-ink: var(--cv-muted);
  --cv-thread-bg: #f4f0ff;
  --cv-card-bg: var(--cv-bubble-them-bg);
  --cv-card-title-ink: var(--cv-bubble-them-ink);
  --cv-card-text-ink: var(--cv-muted);
  --cv-card-line: color-mix(in srgb, var(--cv-on-surface) 12%, transparent);
  --cv-card-shadow: var(--cv-shadow-2);
  --cv-card-button-hover-bg: color-mix(in srgb, var(--cv-accent) 8%, transparent);
  --cv-tile-ink: var(--cv-muted);
  --cv-chip-hover-shadow: var(--cv-shadow-1);
  /* the answers as a list of pills - every reply its own round button, the picked one filled */
  --cv-reply-list-bg: transparent;
  --cv-reply-list-shadow: none;
  --cv-reply-list-gap: 8px;
  --cv-reply-list-line-width: 0px;
  --cv-reply-list-row-bg: #ffffff;
  --cv-reply-list-row-radius: 999px;
  --cv-reply-list-font-weight: 600;
  --cv-reply-list-selected-bg: var(--cv-accent);
  --cv-reply-list-selected-ink: var(--cv-on-accent);
  --cv-composer-icon-ink: var(--cv-muted);
  --cv-composer-icon-hover-bg: color-mix(in srgb, var(--cv-on-surface) 6%, transparent);
  --cv-composer-shadow: var(--cv-shadow-1);
  --cv-home-bar: color-mix(in srgb, var(--cv-on-surface) 30%, transparent);
  --cv-sheet-ink: var(--cv-on-surface);
  --cv-sheet-muted: var(--cv-muted);
  --cv-sheet-line: color-mix(in srgb, var(--cv-on-surface) 12%, transparent);
  --cv-sheet-row-line: color-mix(in srgb, var(--cv-on-surface) 7%, transparent);
  --cv-sheet-row-hover: color-mix(in srgb, var(--cv-accent) 7%, var(--cv-surface));
  --cv-sheet-field: color-mix(in srgb, var(--cv-on-surface) 22%, transparent);
  --cv-toast-bg: var(--cv-on-surface);
  --cv-toast-ink: var(--cv-surface);
  --cv-toast-line: transparent;
  --cv-toast-shadow: var(--cv-shadow-3);
  --cv-device-bezel: linear-gradient(150deg, #cfc4ff 0%, #8b77f5 40%, #6a4cf0 60%, #b9acff 100%);
  --cv-device-shadow: 0 0 0 1px rgba(255, 255, 255, .4), 0 40px 80px -24px rgba(36, 28, 58, .55);
}

/* ── Perfect Circle ─────────────────────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Circle Figtree";
  src: url("assets/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

[data-cv-part="brand-name"] { font-family: var(--cv-font-display); font-weight: 700; }
[data-cv-part="brand-logo"] { box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px #6a4cf0; }

/* The thread: faint circles behind it. */
[data-cv-part="thread"] {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(106, 76, 240, .10) 0 60px, transparent 61px),
    radial-gradient(circle at 92% 62%, rgba(255, 122, 198, .10) 0 90px, transparent 91px);
}

/* Pills: no tail, the same curve all round. */
[data-cv-screen="thread"] :is([data-cv-part="bubble-me"], [data-cv-part="bubble-them"]) { padding-inline: 18px; }

/* A ring of round answers: every quick reply a circle, the words wrapped inside. */
[data-cv-screen="thread"] [data-cv-part="chip"] {
  width: 84px; aspect-ratio: 1; border-radius: 50%; padding: 6px;
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  white-space: normal; line-height: 1.15; font-size: 12.5px; font-weight: 600;
  border-width: 2px; box-shadow: var(--cv-shadow-1);
}

/* Round cards with round pictures. */
[data-cv-screen="thread"] [data-cv-part="card"] { text-align: center; }
[data-cv-screen="thread"] [data-cv-part="card-media"] {
  display: block; width: 74%; height: auto; aspect-ratio: 1; margin: 14px auto 2px;
  object-fit: cover; clip-path: circle(50%); border-radius: 50%;
}
[data-cv-screen="thread"] [data-cv-part="card-button"] { border-radius: 999px; }
[data-cv-screen="thread"] :is([data-cv-part="send"], [data-cv-part="attach"], [data-cv-part="camera"]) { border-radius: 50%; }

/* The list: a stack of pills - each reply ringed like the round answers, none of them clipped by a panel. */
[data-cv-screen="thread"] [data-cv-part="reply-list"] { overflow: visible; }
[data-cv-screen="thread"] [data-cv-part="reply-list-row"] { border: 2px solid rgba(106, 76, 240, .45); box-shadow: var(--cv-shadow-1); }

/* ── The heard and saved cards (docs/claude/BOT-CONCIERGE.md section 0k) - heard-card, heard-pill, saved-receipt ──── */

[data-cv-screen="thread"] [data-cv-part="heard-card"] { border-radius: 28px; padding-inline: 16px; }
[data-cv-screen="thread"] [data-cv-part="saved-receipt"] { border-radius: 999px; padding-inline: 18px; }
