/* The agent canvas (canvas.js), the built-in fields (secretfield.js) and big
   emoji (expression.js). Colours come from tokens.css. */

.bubble.has-canvas { padding: 0; overflow: hidden; width: min(360px, 86vw); max-width: 86vw; }
.canvas { display: flex; flex-direction: column; }
.canvas-strip {
  display: flex; gap: 8px; align-items: baseline; flex: none;
  padding: 6px 10px; font-size: 12px; line-height: 1.3;
  color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--line);
}
.canvas-title { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.canvas-box { position: relative; overflow: hidden; contain: strict; background: var(--surface); }
.canvas-frame { display: block; width: 100%; height: 100%; border: 0; }
.canvas-run {
  position: absolute; inset: 0; margin: auto; width: max-content; height: max-content;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--theirs); color: var(--theirs-text); font: inherit;
}
.bubble.has-canvas .time { padding: 0 10px 6px; }

.bubble.has-secret { width: min(340px, 86vw); }
.secret-card p { margin: 0 0 6px; }
.secret-title { font-weight: 600; }
/* Who asked: in the bubble's own text colour (not the muted one), so it keeps the bubble's contrast; an unknown asker is said in words and bold, never by colour alone. */
.secret-unknown { font-weight: 600; }
.secret-note, .secret-status, .secret-msg { font-size: 13px; color: var(--theirs-muted); }
.secret-open, .secret-send, .secret-row button {
  font: inherit; min-height: 44px; padding: 8px 14px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
}
.secret-open, .secret-send { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.secret-open:disabled { opacity: 0.5; }

.secret-dialog {
  width: min(360px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 16px;
  background: var(--surface); color: var(--text);
}
.secret-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.secret-dialog p { margin: 0 0 10px; }
.secret-mark {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 10px;
  border-radius: 10px; border: 2px solid var(--mark); font-weight: 600;
}
.secret-mark-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--mark); flex: none; }
.secret-input {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 10px 12px;
  font: inherit; font-size: 18px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text);
}
.secret-row { display: flex; gap: 8px; justify-content: flex-end; }

.bubble.big-emoji { background: transparent; box-shadow: none; }
.bubble.big-emoji p { font-size: 44px; line-height: 1.15; }
/* No bubble behind it, so the time and ticks sit on the page: page colours, not the bubble's white. */
.bubble.big-emoji, .bubble.big-emoji .time, .bubble.big-emoji .meta { color: var(--muted); }
.bubble.big-emoji .time { opacity: 1; }
