/* receipt.css - Verify drawer for AI answer receipts.
   Design direction 2026-10-13: neutral surfaces, one accent, no gradients/glows/
   coloured edges, 4px grid, radius 10, control height 32, 150-200ms motion,
   type 12/13/14/16/20, weights 400/500/600. Existing tokens only. */

/* One language at a time. html[data-lang] (shell) wins; otherwise the verifier
   picks from navigator.language and writes data-rlang on its own root. */
html[data-lang="en"] .rcpt span[lang="zh"],
html[data-lang="zh"] .rcpt span[lang="en"],
.rcpt[data-rlang="en"] span[lang="zh"],
.rcpt[data-rlang="zh"] span[lang="en"] { display: none; }
html[data-lang="en"] .rcpt[data-rlang] span[lang="en"],
html[data-lang="zh"] .rcpt[data-rlang] span[lang="zh"] { display: inline; }

.rcpt { font-family: var(--font-ui); font-size: 13px; line-height: 20px; font-weight: 400; color: var(--text-primary); }
.rcpt :lang(zh), .rcpt span[lang="zh"] { font-family: var(--font-cn); }

/* ── the one-click affordance under an AI answer ── */
.rcpt-bar { margin-top: 8px; display: flex; }
.rcpt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 32px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-light); background: transparent; color: var(--text-primary);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color 160ms cubic-bezier(.2,.8,.2,1), border-color 160ms cubic-bezier(.2,.8,.2,1);
}
.rcpt-btn:hover { background: var(--bg-hover); }
.rcpt-btn:focus-visible, .rcpt-input:focus-visible, .rcpt-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rcpt-btn[disabled] { opacity: .5; cursor: not-allowed; }
.rcpt-btn-ghost { border-color: transparent; color: var(--text-secondary); }
.rcpt-btn-ghost:hover { color: var(--text-primary); }
.rcpt-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.rcpt-btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.rcpt-open { padding: 0 8px; margin-left: -8px; }
.rcpt-open::before {
  content: ""; width: 4px; height: 8px; margin: -2px 6px 0 2px; flex: none;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: .8;
}

/* ── drawer ── */
.rcpt-overlay { position: fixed; inset: 0; z-index: 1200; display: flex; justify-content: flex-end; }
.rcpt-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); animation: rcpt-fade 160ms cubic-bezier(.2,.8,.2,1); }
.rcpt-panel {
  position: relative; width: min(480px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-secondary); border-left: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  animation: rcpt-slide 200ms cubic-bezier(.2,.8,.2,1);
}
.rcpt-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; padding: 0 16px 0 24px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.rcpt-h { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.rcpt-close { width: 32px; padding: 0; font-size: 20px; line-height: 1; }
.rcpt-body { padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.rcpt-section { display: flex; flex-direction: column; gap: 8px; }
.rcpt-h3 { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.rcpt-h3 :lang(zh), .rcpt-h3 span[lang="zh"] { letter-spacing: 0; text-transform: none; }

/* verdict: plain sentence first, reason second */
.rcpt-verdict { padding: 16px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg-tertiary); }
.rcpt-verdict-head { display: flex; align-items: flex-start; gap: 12px; }
.rcpt-verdict-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; word-break: break-word; }
.rcpt-verdict-sub { margin: 8px 0 0 20px; color: var(--text-secondary); font-size: 13px; line-height: 20px; }
.rcpt-note { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 20px; }
.rcpt-hint { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 16px; }
.rcpt-empty { margin: 0; color: var(--text-secondary); }
.rcpt-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.rcpt-input {
  width: 100%; box-sizing: border-box; min-height: 32px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-light); background: var(--bg-input); color: var(--text-primary);
  font-family: var(--font-mono); font-size: 12px;
}
.rcpt-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* status dot: the only coloured thing, and only for status */
.rcpt-dot { flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--text-muted); }
.rcpt-dot-ok { background: var(--green); }
.rcpt-dot-warn { background: var(--orange); }
.rcpt-dot-bad { background: var(--red); }
.rcpt-dot-skip { background: transparent; border: 1.5px solid var(--text-muted); box-sizing: border-box; }
.rcpt-verdict[data-state="failed"] { border-color: var(--red); }

.rcpt-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rcpt-check { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0; }
.rcpt-check .rcpt-dot { margin-top: 6px; }
.rcpt-check-skip { margin-left: auto; color: var(--text-muted); font-size: 12px; }

.rcpt-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.rcpt-facts dt { color: var(--text-muted); font-size: 12px; }
.rcpt-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-feature-settings: "tnum"; }
.rcpt-mono { font-family: var(--font-mono); font-size: 12px; }

.rcpt-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rcpt-source { padding: 12px; border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.rcpt-source-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; width: 100%; }
.rcpt-source-name { font-weight: 500; overflow-wrap: anywhere; }
.rcpt-source-note, .rcpt-source-bad { margin: 0; font-size: 13px; color: var(--text-secondary); }
.rcpt-source-leaf { color: var(--text-secondary); font-size: 12px; }
.rcpt-chip { flex: none; padding: 0 8px; border-radius: 9999px; font-size: 12px; line-height: 20px; font-weight: 500; border: 1px solid var(--border-light); color: var(--text-secondary); }
.rcpt-chip-ok { color: var(--green); border-color: var(--green); }
.rcpt-chip-warn { color: var(--orange); border-color: var(--orange); }
.rcpt-pre {
  margin: 0; padding: 12px; width: 100%; box-sizing: border-box; max-height: 240px; overflow: auto;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; white-space: pre-wrap; overflow-wrap: anywhere;
}

.rcpt-skeleton { height: 16px; border-radius: 4px; background: var(--bg-hover); animation: rcpt-pulse 1.2s ease-in-out infinite; }
.rcpt-skeleton + .rcpt-skeleton { margin-top: 8px; }
.rcpt-skeleton-short { width: 60%; }

@keyframes rcpt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rcpt-slide { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rcpt-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* mobile: full-width sheet, 44px targets, nothing wider than the viewport */
@media (max-width: 768px) {
  .rcpt-panel { width: 100%; border-left: 0; }
  .rcpt-head { padding: 0 8px 0 16px; }
  .rcpt-body { padding: 16px; gap: 24px; }
  .rcpt-btn { min-height: 44px; }
  .rcpt-close { width: 44px; }
  .rcpt-input { min-height: 44px; font-size: 16px; }
  .rcpt-open { min-width: 44px; }
  .rcpt-facts { grid-template-columns: 1fr; gap: 0; }
  .rcpt-facts dd { margin-bottom: 8px; }
  .rcpt-source-top { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .rcpt-scrim, .rcpt-panel, .rcpt-skeleton { animation: none; }
  .rcpt-btn { transition: none; }
}
