/* TRIANGLE - the RCS emulator's face (design/starters/triangle/rcs.css). Contract version 1.

   Sharp and directional: arrow-shaped answers, chevron cards, a sawtooth header, a launcher pointing at the page.

   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: #111111;
  --cv-color-ink: #111111;
  --cv-color-paper: #fbfbf8;
  --cv-font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cv-font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cv-radius-s: 0px;
  --cv-radius-m: 0px;
  --cv-radius-l: 0px;
  --cv-shadow-1: 2px 2px 0 #111111;
  --cv-shadow-2: 4px 4px 0 #111111;
  --cv-shadow-3: 0 24px 50px rgba(17, 17, 17, .25);
  --cv-motion-fast: 120ms;
  --cv-motion-slow: 240ms;
  /* semantic */
  --cv-surface: #ffffff;
  --cv-on-surface: var(--cv-color-ink);
  --cv-accent: #111111;
  --cv-on-accent: #ffd400;
  --cv-muted: #4a4a4a;
  --cv-danger: #c4161c;
  --cv-focus: #ffb800;
  --cv-bubble-me-bg: #ffd400;
  --cv-bubble-me-ink: #111111;
  --cv-bubble-them-bg: #ffffff;
  --cv-bubble-them-ink: #111111;
  --cv-field-font-size: 16px;
  /* component */
  --cv-header-bg: #ffd400;
  --cv-header-ink: #111111;
  --cv-header-line: color-mix(in srgb, var(--cv-on-surface) 12%, transparent);
  --cv-header-shadow: none;
  --cv-avatar-bg: var(--cv-accent);
  --cv-bubble-radius: var(--cv-radius-l);
  --cv-bubble-tail-radius: 0px;
  --cv-bubble-font-size: 14.5px;
  --cv-bubble-them-shadow: none;
  --cv-typing-dot: var(--cv-muted);
  --cv-card-radius: var(--cv-radius-l);
  --cv-chip-bg: #ffd400;
  --cv-chip-ink: #111111;
  --cv-chip-border: transparent;
  --cv-chip-radius: 0px;
  --cv-chip-hover-bg: #ffe14d;
  --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: #f3f3ee;
  --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: none;
  --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: a hard black box, every reply ending in an arrow */
  --cv-reply-list-radius: 0px;
  --cv-reply-list-border: #111111;
  --cv-reply-list-border-width: 2px;
  --cv-reply-list-shadow: none;
  --cv-reply-list-ink: #111111;
  --cv-reply-list-line: #111111;
  --cv-reply-list-line-width: 2px;
  --cv-reply-list-font-size: 12.5px;
  --cv-reply-list-font-weight: 800;
  --cv-reply-list-align: left;
  --cv-reply-list-row-padding: 12px 34px 12px 14px;
  --cv-reply-list-hover-bg: #ffd400;
  --cv-reply-list-selected-bg: #111111;
  --cv-reply-list-selected-ink: #ffd400;
  --cv-reply-list-chevron: "\25B6";
  --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(135deg, #111111 0 50%, #2a2a2a 50%);
  --cv-device-shadow: 0 0 0 2px #ffd400, 0 36px 70px -24px rgba(17, 17, 17, .6);
}

/* ── Triangle ─────────────────────────────────────────────────────────────────────────────────────── */

/* A sawtooth under the header: the bar ends in teeth (a mask of tiled conic-gradients). */
[data-cv-part="header"] { padding-bottom: 10px; -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom / 16px 8px repeat-x; mask: linear-gradient(#000 0 0) top / 100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) bottom / 16px 8px repeat-x; }
[data-cv-part="brand-name"] { font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
[data-cv-part="brand-logo"] { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }

/* Bubbles with sharp triangular tails. */
[data-cv-screen="thread"] [data-cv-part="bubble-them"] { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), 26px calc(100% - 10px), 12px 100%, 12px calc(100% - 10px), 0 calc(100% - 10px)); padding-bottom: 18px; border: 0; box-shadow: none; }
[data-cv-screen="thread"] [data-cv-part="bubble-me"] { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 12px) calc(100% - 10px), calc(100% - 12px) 100%, calc(100% - 26px) calc(100% - 10px), 0 calc(100% - 10px)); padding-bottom: 18px; font-weight: 700; }

/* Cards point down at what comes next. */
[data-cv-screen="thread"] [data-cv-part="card"] { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), 50% 100%, 0 calc(100% - 18px)); padding-bottom: 20px; }
[data-cv-screen="thread"] [data-cv-part="card-button"] { font-weight: 800; text-transform: uppercase; }

/* Answers are arrows, and they nudge forward when pointed at. */
[data-cv-screen="thread"] [data-cv-part="chip"] { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); padding-right: 26px; font-weight: 800; text-transform: uppercase; font-size: 12.5px; }
@media (prefers-reduced-motion: no-preference) {
  [data-cv-screen="thread"] [data-cv-part="chip"] { transition: transform var(--cv-motion-fast) ease-out; }
  [data-cv-screen="thread"] [data-cv-part="chip"]:hover { transform: translateX(4px); }
}
[data-cv-screen="thread"] [data-cv-part="composer"] { border-radius: 0; box-shadow: inset 0 0 0 2px #111111; }
[data-cv-screen="thread"] [data-cv-part="send"] { clip-path: polygon(0 0, 100% 50%, 0 100%); border-radius: 0; }

/* The list: uppercase rows whose arrows nudge forward when pointed at. */
[data-cv-screen="thread"] [data-cv-part="reply-list-row"] { text-transform: uppercase; }
[data-cv-screen="thread"] [data-cv-part="reply-list-row"]::after { font-size: 9px; }
@media (prefers-reduced-motion: no-preference) {
  [data-cv-screen="thread"] [data-cv-part="reply-list-row"]::after { transition: inset-inline-end var(--cv-motion-fast) ease-out; }
  [data-cv-screen="thread"] [data-cv-part="reply-list-row"]:hover::after { inset-inline-end: 8px; }
}

/* ── 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: 0; box-shadow: inset 4px 0 0 #ffd400; }
[data-cv-screen="thread"] [data-cv-part="heard-pill"] { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); padding-right: 20px; border-radius: 0; }
[data-cv-screen="thread"] [data-cv-part="saved-receipt"] { border-radius: 0; box-shadow: inset 4px 0 0 #ffd400; }
