/* 对话输入框 · 参考豆包：一张大圆角卡片，左相机、右语音和＋；有字时三个按钮收起，只留发送键。
   Only the main chat's input card; colours stay 拾日's own. Loaded after the theme files. */
body .composer.db-composer { border-radius: 24px; padding: 7px 8px 7px 10px; background: var(--surface-2); box-shadow: 0 0 0 0.5px var(--line-strong), 0 4px 18px rgba(0, 0, 0, 0.06); }
body .composer.db-composer:focus-within { box-shadow: 0 0 0 0.5px var(--line-strong), 0 4px 18px rgba(0, 0, 0, 0.06); }
body .db-composer .composer-row { align-items: center; gap: 4px; }
body .db-composer textarea { font-size: 16px; line-height: 1.5; min-height: 36px; padding: 6px 4px; }
body .db-composer .icon-button { width: 38px; height: 38px; border-radius: 50%; background: none; box-shadow: none; color: var(--ink); display: grid; place-items: center; flex: none; }
body .db-composer .icon-button svg { width: 25px; height: 25px; stroke-width: 1.6; }
body .db-composer .send-button { display: none; width: 34px; height: 34px; border-radius: 50%; flex: none; }
body .db-composer .send-button svg { width: 18px; height: 18px; stroke-width: 2.2; }
body .db-composer.has-text .send-button { display: grid; place-items: center; }
body .db-composer.has-text .icon-button { display: none; }
body .db-composer .icon-button:hover, body .db-composer .icon-button:active { background: none; }
@media (hover: hover) { body .db-composer .icon-button:hover { background: var(--line-soft); } }
@media (max-width: 760px) {
  body.chat-typing .mobile-nav { display: none; }
  body.chat-typing .main { padding-bottom: 0; }
}

/* phone input: the text area doubles as hold-to-talk until it has focus or text */
.composer-field { position: relative; flex: 1; min-width: 0; display: flex; }
.composer-field textarea { flex: 1; }
.hold-zone { position: absolute; inset: 0; z-index: 2; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.db-composer.typing .hold-zone, .db-composer.has-text .hold-zone { display: none; }
.db-composer.holding { box-shadow: 0 0 0 1.5px var(--accent), 0 4px 18px rgba(0, 0, 0, 0.08); }
.hold-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 20px calc(118px + env(safe-area-inset-bottom)); pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg) 85%, transparent) 30%, var(--bg) 100%); animation: hold-in 0.16s ease-out; }
.hold-words { max-width: 88%; min-height: 24px; padding: 11px 16px; border-radius: 18px; background: var(--accent); color: #fff; font-size: 16px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); }
.hold-wave { display: flex; align-items: center; gap: 4px; height: 30px; }
.hold-wave i { width: 4px; height: 8px; border-radius: 2px; background: var(--accent); animation: hold-wave 0.9s ease-in-out infinite; }
.hold-wave i:nth-child(2n) { animation-delay: 0.12s; } .hold-wave i:nth-child(3n) { animation-delay: 0.27s; } .hold-wave i:nth-child(5n) { animation-delay: 0.4s; }
.hold-hint { font-size: 13px; color: var(--ink-3); }
.hold-sheet.cancel .hold-words, .hold-sheet.cancel .hold-wave i { background: var(--bad); }
.hold-sheet.cancel .hold-hint { color: var(--bad); }
@keyframes hold-wave { 0%, 100% { height: 8px; } 50% { height: 28px; } }
@keyframes hold-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* photos waiting in the input card */
.attachment-photo { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; flex: none; background: var(--sunken); }
.attachment-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attachment-remove { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 13px; line-height: 20px; box-shadow: none; }
.attachment-chip .attachment-remove { position: static; background: none; color: inherit; }
.db-composer .attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.db-composer .attachments:not(:empty) { padding: 4px 2px 8px; }
/* No attachments: no row at all (it left 8px above the input, so the card sat off-centre). */
.db-composer .attachments:empty { display: none; }

/* photos in his messages */
.msg-photos { display: grid; gap: 4px; margin-bottom: 6px; max-width: 260px; }
.msg-photos.n1 { grid-template-columns: 1fr; }
.msg-photos.n2, .msg-photos.n4 { grid-template-columns: repeat(2, 1fr); }
.msg-photos.n3 { grid-template-columns: repeat(3, 1fr); max-width: 300px; }
.msg-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; background: var(--sunken); cursor: zoom-in; }
.msg-photos.n1 img { aspect-ratio: auto; max-height: 320px; }
.msg-photos img.loading { min-height: 120px; }
.msg-photos img.missing { min-height: 80px; opacity: 0.5; }
.msg-file { margin-bottom: 6px; }
.photo-view { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.92); display: grid; place-items: center; animation: hold-in 0.16s ease-out; }
.photo-view img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* sending: his message slides in at once; replies fade in */
.message.appear { animation: msg-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.message.user.appear { transform-origin: bottom right; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.photo-missing { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 1; min-height: 96px; border-radius: 14px; background: var(--sunken); color: var(--ink-3); font-size: 12px; }
.photo-missing svg { width: 22px; height: 22px; }
.msg-photos.n1 .photo-missing { width: 120px; }

/* input card, refined: one calm row — a soft round camera, the text, the send button — all on one centre line */
body .composer.db-composer { border-radius: 26px; padding: 6px 6px 6px 6px; min-height: 52px; }
body .db-composer .composer-row { align-items: center; gap: 6px; min-height: 40px; }
body .db-composer textarea { padding: 8px 4px; font-size: 16px; line-height: 1.45; min-height: 38px; }
body .db-composer .icon-button.db-cam { width: 40px; height: 40px; border-radius: 50%; background: rgba(120, 124, 150, 0.09); color: var(--ink-2); }
body .db-composer .icon-button.db-cam svg { width: 21px; height: 21px; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
body .db-composer .icon-button.db-cam:active { background: rgba(120, 124, 150, 0.18); }
body .db-composer.has-text .icon-button.db-cam { display: none; }
body .db-composer.has-text textarea { padding-left: 12px; }
body .db-composer .send-button { width: 40px; height: 40px; }
body .db-composer .send-button svg { width: 19px; height: 19px; }
@media (hover: hover) { body .db-composer .icon-button.db-cam:hover { background: rgba(120, 124, 150, 0.15); } }
