/* OUTBOX · shared components (round 4): bots, the receipt sentence, the deck. */

/* ── Agent bots (Grok Bots Studio clay, characters.js) ─────── */
.blob { --s: 48px; display: inline-block; width: var(--s); height: var(--s); flex: none; position: relative; }
.blob svg { display: block; width: 100%; height: 100%; overflow: visible; }
.blob .bt-body { transform-box: fill-box; transform-origin: 50% 100%; animation: bot-breathe 4.6s ease-in-out infinite; }
.blob .bt-shadow { transform-box: fill-box; transform-origin: 50% 50%; }
.blob.cheer .bt-body { animation: bot-cheer .82s var(--ease-out); }
.blob.cheer .bt-shadow { animation: bot-cheer-shadow .82s var(--ease-out); }
@keyframes bot-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.018, .982); } }
/* squash, stretch up, settle: one small hop */
@keyframes bot-cheer { 0% { transform: scale(1,1); } 20% { transform: scale(1.1,.88); } 46% { transform: translateY(-9%) scale(.95,1.06); } 74% { transform: translateY(0) scale(1.04,.96); } 100% { transform: scale(1,1); } }
@keyframes bot-cheer-shadow { 0%, 100% { transform: scale(1); } 46% { transform: scale(.82); opacity: .05; } }
/* Braille bots (shared/braille.js): one canvas per bot, dots in the bot's colour */
.blob canvas.bt-dots { display: block; width: 100%; height: 100%; transform-origin: 50% 100%; animation: bot-breathe 4.6s ease-in-out infinite; }
.blob.cheer canvas.bt-dots { animation: bot-cheer .82s var(--ease-out); }

/* ── Receipt sentence (Receipt.mount) ───────────────────────── */
.rs { display: block; font-family: var(--display); font-weight: 900; letter-spacing: -.028em; line-height: 1.34; color: var(--ink); }
.rs-line { display: block; white-space: nowrap; }
.rs-w, .rs-vt { color: var(--g500); }
.rs .rs-pl { overflow: hidden; vertical-align: baseline; }
.rs .rs-lead { display: inline-grid; flex: none; }
.rs .rs-clip { display: inline-grid; overflow: hidden; }
.rs .rs-clip > * { grid-area: 1 / 1; white-space: pre; transition: transform .52s var(--ease-drawer), opacity .3s var(--ease-out); }
/* Old label leaves fast and fully; new label enters a beat later, so the two never sit on top of each other. */
.rs .rs-old.rs-out { transition: transform .34s var(--ease-out), opacity .18s var(--ease-out); }
.rs .rs-new.rs-in { transition-delay: .1s; }
.rs .rs-verb { display: inline-flex; overflow: hidden; vertical-align: baseline; padding: 0 .06em; }
.rs .rs-new { transform: translateY(110%); opacity: 0; }
.rs .rs-new.rs-in { transform: translateY(0); opacity: 1; }
.rs .rs-old.rs-out { transform: translateY(-110%); opacity: 0; }

/* ── Deck (Deck.mount) ──────────────────────────────────────── */
.dk { --cw: min(460px, calc(100vw - 40px)); display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.dk-head { width: var(--cw); display: flex; justify-content: center; align-items: center; font-size: 14px; color: var(--g500); font-variant-numeric: tabular-nums; }
.dk-stage { position: relative; width: var(--cw); height: clamp(420px, 56svh, 500px); overflow: visible; }
.dk-stack { position: absolute; inset: 0; }
.dk-card { position: absolute; inset: 0; background: #fff; border-radius: var(--r-card); padding: 0 0 18px; overflow: hidden;
  box-shadow: var(--ring), 0 4px 0 0 var(--ac), var(--lift-2); transform-origin: 50% 50%;
  transition: transform .5s var(--ease-drawer), opacity .4s, filter .4s; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.dk-card[data-depth="1"] { transform: translateY(14px) scale(.955); filter: brightness(.985); }
.dk-card[data-depth="2"] { transform: translateY(26px) scale(.91); filter: brightness(.97); }
.dk-card[data-depth="3"] { transform: translateY(34px) scale(.88); opacity: 0; }
.dk-card[data-depth="1"] > *, .dk-card[data-depth="2"] > *, .dk-card[data-depth="3"] > * { opacity: .0; transition: opacity .3s; }
.dk-card[data-depth="0"] > * { transition: opacity .35s .1s; }
.dk-card.dk-drag { transition: none; cursor: grabbing; box-shadow: var(--ring), 0 4px 0 0 var(--ac), var(--lift-3); }
.dk-card.dk-spring { transition: transform .42s cubic-bezier(.3,1.35,.5,1); }
.dk-card.dk-flying { transition: none; pointer-events: none; }
.dk-src { background: var(--g50); border-bottom: 1px solid var(--line); padding: 14px 18px 12px; }
.dk-src-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--g700); min-width: 0; }
.dk-src-top .mail-ava { width: 22px; height: 22px; font-size: 10.5px; background: #fff; box-shadow: var(--ring); }
.dk-from { font-weight: 500; color: var(--ink); flex: none; }
.dk-subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dk-time { margin-left: auto; color: var(--g500); flex: none; font-variant-numeric: tabular-nums; }
.dk-quote { margin: 8px 0 0; font-size: 14.5px; line-height: 1.4; color: var(--ink); padding: 2px 0 2px 10px; border-left: 3px solid var(--ac); }
.dk-join { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 12px 18px 0; font-size: 14px; color: var(--g700); }
.dk-join b { color: var(--ink); font-weight: 500; }
.dk-join .blob { margin: -4px 0; }
.dk-line { position: absolute; left: 30px; top: -2px; width: 2px; height: 14px; background: var(--ac); border-radius: 2px; opacity: .5; }
.dk-of { margin-left: auto; font-size: 12.5px; color: var(--g500); }
.dk-urgent { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--butler); }
.dk-urgent .ic { width: 14px; height: 14px; }
.dk-title { display: flex; gap: 10px; align-items: flex-start; margin: 10px 18px 0; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.18; letter-spacing: -.015em; }
.dk-kic { width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--ac); color: var(--on); display: grid; place-items: center; margin-top: -2px; }
.dk-kic .ic { width: 16px; height: 16px; }
.dk-to { margin: 10px 18px 0; font-size: 13px; color: var(--g500); }
.dk-body { margin: 6px 18px 0; font-size: 15px; line-height: 1.5; color: var(--g700); border-radius: 12px; padding: 2px 0; transition: background-color .2s, box-shadow .2s, padding .2s; }
.dk-editing .dk-body { background: var(--g50); box-shadow: inset 0 0 0 1.5px var(--cobalt); padding: 8px 10px; color: var(--ink); outline: 0; user-select: text; -webkit-user-select: text; cursor: text; }
.dk-fields { list-style: none; margin: 14px 18px 0; padding: 0; display: grid; gap: 10px; font-size: 15.5px; }
.dk-fields li { display: flex; gap: 10px; align-items: center; }
.dk-fields .ic { width: 18px; height: 18px; color: var(--g500); }
.dk-tool { margin: 14px 18px 0; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--g500); }
.dk-tool .ic { width: 14px; height: 14px; }
.dk-why { margin: 10px 18px 0; font-size: 15px; color: var(--g700); }
.dk-opts { display: grid; gap: 8px; margin: 14px 18px 0; }
.dk-opt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 16px; border: 0; background: var(--g100); color: var(--ink); font-size: 15.5px; font-weight: 500; text-align: left; transition: background-color .2s, transform .15s; }
.dk-opt:hover { background: var(--cobalt-wash); }
.dk-opt:active { transform: scale(.98); }
.dk-key { width: 22px; height: 22px; border-radius: 7px; background: #fff; box-shadow: var(--ring); display: grid; place-items: center; font-size: 12px; color: var(--g500); }
.dk-opts.dk-nudge { animation: dk-nudge .5s var(--ease-out); }
@keyframes dk-nudge { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.dk-stamp { position: absolute; top: 16px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.dk-stamp .ic { width: 16px; height: 16px; }
.dk-yes { right: 16px; background: var(--cobalt); color: #fff; opacity: var(--yes, 0); transform: rotate(4deg); }
.dk-no { left: 16px; background: var(--ink); color: #fff; opacity: var(--no, 0); transform: rotate(-4deg); }
.dk-card.dk-hinting .dk-yes { animation: dk-hint-yes 1.8s var(--ease-io); }
.dk-card.dk-hinting .dk-no { animation: dk-hint-no 1.8s var(--ease-io); }
@keyframes dk-hint-yes { 0%, 44%, 100% { opacity: 0; } 18%, 26% { opacity: 1; } }
@keyframes dk-hint-no { 0%, 50%, 100% { opacity: 0; } 66%, 74% { opacity: 1; } }

.dk-bar { display: flex; gap: 8px; justify-content: center; align-items: center; width: var(--cw); }
.dk-btn { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 999px; border: 0; background: var(--g100); color: var(--ink); font-weight: 500; font-size: 15.5px; transition: background-color .2s, transform .15s, opacity .2s; }
.dk-btn .ic { width: 18px; height: 18px; }
.dk-btn:active { transform: scale(.96); }
.dk-btn:hover { background: #EBEBEE; }
.dk-b-yes { background: var(--cobalt); color: #fff; padding: 0 26px; } .dk-b-yes:hover { background: var(--cobalt-press); }
.dk-b-yes:disabled { opacity: .35; cursor: default; }
.dk-b-undo { background: transparent; } .dk-b-undo:disabled { opacity: .3; cursor: default; }
.dk-btn[hidden] { display: none; }
.dk-cons { margin: 0; min-height: 1.5em; font-size: 14.5px; color: var(--g700); text-align: center; max-width: var(--cw); }
.dk-cons.dk-flash { animation: dk-flash .6s var(--ease-out); }
@keyframes dk-flash { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dk-crew { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(640px, calc(100vw - 32px)); }
.dk-crew li { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font-size: 13px; color: var(--g500); }
.dk-crew li .blob { margin-bottom: 4px; }
.dk-cn { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); }
.dk-ch { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.dk-cs { display: inline-flex; align-items: center; gap: 4px; min-height: 18px; }
.dk-cs .ic { width: 13px; height: 13px; }
.dk-crew li.dk-has .dk-cs { color: var(--ink); }
.dk-crew li.dk-got { animation: dk-got .7s var(--ease-out); }
@keyframes dk-got { 0% { transform: none; } 30% { transform: translateY(-4px); } 100% { transform: none; } }
.dk-done { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px; border-radius: var(--r-card); background: var(--g50); box-shadow: inset 0 0 0 1px var(--line); }
.dk-done[hidden] { display: none; }
.dk-done h3 { font-family: var(--display); font-weight: 900; font-size: 30px; letter-spacing: -.02em; margin: 0; }
.dk-done p { margin: 0 0 8px; color: var(--g700); max-width: 32ch; }
.dk-done-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--cobalt); color: #fff; display: grid; place-items: center; }
.dk-done-ic .ic { width: 26px; height: 26px; }

@media (max-width: 560px) {
  .dk { gap: 10px; }
  .dk-stage { height: min(460px, 54svh); }
  .dk-title { font-size: 20px; }
  .dk-btn span { display: none; } .dk-b-yes span { display: inline; }
  .dk-btn { height: 52px; min-width: 52px; justify-content: center; padding: 0 16px; }
  .dk-crew li .blob { --s: 44px !important; }
  .dk-ch { display: none; }
  .dk-cs { font-size: 11.5px; }
  .dk-hint { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .blob .bt-body, .blob.cheer .bt-body, .blob.cheer .bt-shadow, .blob canvas.bt-dots { animation: none !important; } }
