/* ==========================================================================
   Композер
   ========================================================================== */
.cmp-dock { position: fixed; right: 20px; bottom: 0; z-index: 600; display: flex; align-items: flex-end; gap: 12px; pointer-events: none; flex-direction: row-reverse; }
.cmp-scrim { position: fixed; inset: 0; z-index: 590; background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity 0.35s; }
.cmp-scrim.is-on { opacity: 1; pointer-events: auto; }
.cmp {
	pointer-events: auto;
	position: relative;
	width: 560px;
	height: min(640px, calc(100vh - 90px));
	display: flex;
	flex-direction: column;
	border-radius: 26px 26px 0 0;
	border: 1px solid transparent;
	border-bottom: 0;
	background: linear-gradient(var(--bg-float), var(--bg-float)) padding-box, var(--rim) border-box;
	box-shadow: var(--shadow-float), 0 0 90px -40px var(--accent);
	overflow: hidden;
	transform-origin: bottom right;
	animation: cmp-in 0.55s var(--e-spring);
	transition: width 0.45s var(--e-out), height 0.45s var(--e-out), border-radius 0.45s var(--e-out), transform 0.45s var(--e-out);
}
@keyframes cmp-in { from { opacity: 0; transform: translateY(60px) scale(0.9); } }
.cmp.is-out { animation: cmp-out 0.3s var(--e-io) forwards; }
@keyframes cmp-out { to { opacity: 0; transform: translateY(40px) scale(0.94); } }
.cmp.is-folding { animation: cmp-fold 0.4s var(--e-io) forwards; }
@keyframes cmp-fold { 50% { transform: scale(0.6, 0.3) rotate(-4deg); border-radius: 30px; opacity: 0.8; } 100% { transform: scale(0.1) rotate(-20deg); opacity: 0; } }
.cmp.is-min { height: 54px; width: 300px; }
.cmp.is-min .cmp-body { visibility: hidden; }
.cmp.is-min .cmp-head { cursor: pointer; }
.cmp.is-max { position: fixed; left: 50%; top: 50%; width: min(980px, calc(100vw - 48px)); height: min(820px, calc(100vh - 48px)); transform: translate(-50%, -50%); border-radius: 30px; border-bottom: 1px solid transparent; z-index: 5; }
.cmp-head { display: flex; align-items: center; gap: 2px; height: 54px; padding: 0 10px 0 20px; flex: none; border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--bg-float), var(--text) 2.5%); }
.cmp-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 650; font-size: 14px; }
.cmp-title-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex: none; animation: pulse 2.4s infinite; }
.cmp-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cmp-row { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 16px 4px 20px; border-bottom: 1px solid var(--line); flex: none; }
.cmp-row.is-shake { animation: shake 0.45s var(--e-out); }
.cmp-label { font-size: 13px; color: var(--text-3); width: 56px; flex: none; }
.cmp-from { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px; font-size: 14px; color: var(--text); transition: background-color 0.15s; }
.cmp-from:hover { background: var(--bg-hover); }
.cmp-cc { position: absolute; right: 14px; font-size: 12.5px; font-weight: 650; color: var(--text-3); padding: 5px 9px; border-radius: 8px; }
.cmp-cc:hover { color: var(--text); background: var(--bg-hover); }
.rcpt-tokens { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; padding: 4px 60px 4px 0; }
.rcpt-input { flex: 1; min-width: 140px; height: 32px; border: 0; outline: 0; background: none; font-size: 14.5px; color: var(--text); }
.rcpt-token { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 4px 0 5px; border-radius: 10px; font-size: 13.5px; font-weight: 550; background: var(--bg-active); animation: token-in 0.35s var(--e-pop); max-width: 260px; }
.rcpt-token > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcpt-token .orb { font-size: 10px; color: rgba(0, 0, 0, 0.7); }
.rcpt-token button { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--text-3); }
.rcpt-token button:hover { color: var(--text); background: var(--bg-hover); }
.rcpt-token.is-bad { background: color-mix(in oklab, var(--danger) 16%, transparent); color: var(--danger); }
.rcpt-token.is-armed { box-shadow: 0 0 0 1.5px var(--danger); }
.rcpt-token.is-out { animation: token-out 0.18s forwards; }
@keyframes token-in { from { transform: scale(0.6); opacity: 0; } }
@keyframes token-out { to { transform: scale(0.6); opacity: 0; } }
.rcpt-suggest { position: absolute; left: 70px; top: calc(100% - 2px); z-index: 10; width: min(380px, calc(100% - 80px)); padding: 6px; border-radius: 16px; background: var(--bg-float); border: 1px solid var(--line-strong); box-shadow: var(--shadow-float); animation: menu-in 0.25s var(--e-spring); }
.rcpt-opt { width: 100%; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 11px; text-align: left; }
.rcpt-opt.is-active, .rcpt-opt:hover { background: var(--bg-active); }
.rcpt-opt-text { display: flex; flex-direction: column; min-width: 0; }
.rcpt-opt-text b { font-size: 13.5px; font-weight: 600; }
.rcpt-opt-text span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; }
.cmp-subject { flex: 1; height: 40px; border: 0; outline: 0; background: none; font-size: 16px; font-weight: 650; color: var(--text); letter-spacing: -0.01em; }
.cmp-subject::placeholder { color: var(--text-3); font-weight: 500; }
.cmp-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.cmp-editor { min-height: 100%; padding: 18px 22px 24px; outline: none; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.cmp-editor.is-empty::before { content: attr(data-placeholder); position: absolute; color: var(--text-3); pointer-events: none; }
.cmp-editor blockquote { margin: 10px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent-line); color: var(--text-2); }
.cmp-editor .nm-fwd { color: var(--text-2); padding-left: 14px; border-left: 3px solid var(--line-strong); }
.cmp-editor .nm-sig { color: var(--text-2); }
.cmp-editor img { max-width: 100%; border-radius: 10px; }
.cmp-editor img.is-uploading { opacity: 0.5; filter: blur(2px); }
.cmp-editor a { color: var(--accent-text); }
.cmp-editor ul, .cmp-editor ol { padding-left: 24px; }
.cmp-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 14px; }
.cmp-atts:empty { display: none; }
.cmp-att { position: relative; display: flex; align-items: center; gap: 10px; width: 230px; padding: 8px; border-radius: 14px; background: var(--bg-hover); border: 1px solid var(--line); overflow: hidden; animation: token-in 0.35s var(--e-pop); }
.cmp-att .att-kind { width: 34px; height: 34px; font-size: 9.5px; border-radius: 10px; background: var(--kc, var(--text-3)); }
.cmp-att-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; transition: transform 0.2s; }
.cmp-tools { display: flex; align-items: center; gap: 1px; margin: 0 14px 6px; padding: 4px; border-radius: 14px; background: var(--bg-well); border: 1px solid var(--line); animation: rise 0.3s var(--e-out); flex-wrap: wrap; }
.cmp-tools-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 5px; }
.cmp-foot { display: flex; align-items: center; gap: 2px; padding: 10px 12px 12px 14px; flex: none; }
.cmp-send-group { display: flex; margin-right: 8px; }
.cmp-send { height: 44px; border-radius: 15px 5px 5px 15px; padding: 0 18px 0 16px; opacity: 0.55; transition: opacity 0.3s, transform 0.25s var(--e-spring), box-shadow 0.3s; }
.cmp-send.is-ready { opacity: 1; }
.cmp-send svg { transition: transform 0.4s var(--e-spring); }
.cmp-send:hover svg { transform: translate(3px, -3px) rotate(-8deg); }
.cmp-send-more { height: 44px; width: 38px; padding: 0; border-radius: 5px 15px 15px 5px; margin-left: 2px; }
.cmp-saved { font-size: 12px; color: var(--text-3); margin-right: 6px; transition: opacity 0.3s; }
.cmp-saved.is-busy { opacity: 0.6; }
.cmp-drop { position: absolute; inset: 54px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--accent-text); background: color-mix(in oklab, var(--bg-float) 85%, var(--accent)); border: 2px dashed var(--accent-line); border-radius: 0 0 26px 26px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.cmp.is-drop .cmp-drop { opacity: 1; }
.cmp-drop svg { animation: nori-bob 1.4s ease-in-out infinite; }

@media (max-width: 860px) {
	.cmp-dock { right: 0; left: 0; }
	.cmp, .cmp.is-max { position: fixed; inset: 0; width: 100%; height: 100%; transform: none; border-radius: 0; left: 0; top: 0; animation: sheet-in 0.5s var(--e-out); padding-bottom: env(safe-area-inset-bottom); }
	@keyframes sheet-in { from { transform: translateY(100%); } }
	.cmp.is-min { inset: auto 12px calc(16px + env(safe-area-inset-bottom)) 12px; width: auto; height: 54px; border-radius: 18px; border-bottom: 1px solid transparent; }
	.cmp-head { padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); }
	.cmp-max { display: none; }
	.cmp-label { width: 48px; }
}
