/* Movectus chat: the launcher and the message panel on public pages and in the dashboard (built by app.js).
   Live Edit look: an ink panel with paper type and the brand gradient only on the active control.
   Colours come from --chat-* tokens; the defaults are ink, and the dashboard sets them per theme. */
.movectus-chat-launcher, .movectus-chat-panel {
  --c-bg: var(--chat-bg, #111014);
  --c-fg: var(--chat-fg, #f5f3ee);
  --c-mute: var(--chat-mute, rgba(245, 243, 238, .6));
  --c-line: var(--chat-line, rgba(245, 243, 238, .12));
  --c-fill: var(--chat-fill, rgba(245, 243, 238, .06));
  --c-mine: var(--chat-mine, rgba(245, 243, 238, .14));
  --c-font: var(--chat-font, "Mona Sans", "Mona Sans Fallback", "Helvetica Neue", Arial, sans-serif);
  --c-grad: linear-gradient(100deg, #ff5c1c 0%, #f2311f 30%, #ac2470 64%, #6424b2 100%);
  --c-ease: cubic-bezier(.16, 1, .3, 1);
}
.movectus-chat-launcher { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 170; display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 50%; background: var(--c-bg); color: var(--c-fg); box-shadow: 0 14px 34px -12px rgba(17, 16, 20, .55), inset 0 0 0 1px var(--c-line); cursor: pointer; isolation: isolate; overflow: visible; transition: transform 300ms var(--c-ease), box-shadow 300ms var(--c-ease); }
.movectus-chat-launcher::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--c-grad); opacity: 0; transform: scale(.6); transition: opacity 300ms var(--c-ease), transform 400ms var(--c-ease); }
.movectus-chat-launcher:hover { transform: translateY(-2px); }
.movectus-chat-launcher:hover::before, .movectus-chat-launcher[aria-expanded="true"]::before { opacity: 1; transform: none; }
.movectus-chat-launcher:hover, .movectus-chat-launcher[aria-expanded="true"] { color: #fff; }
.movectus-chat-launcher svg { display: block; width: 21px; height: 21px; }
.movectus-chat-launcher b { position: absolute; right: -3px; top: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--c-grad); color: #fff; font: 600 10.5px/19px var(--c-font); text-align: center; box-shadow: 0 0 0 2px var(--c-bg); }
.movectus-chat-launcher:focus-visible { outline: 2px solid #f2311f; outline-offset: 3px; }

.movectus-chat-panel { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 62px); z-index: 171; display: flex; flex-direction: column; width: min(380px, calc(100vw - 32px)); height: min(580px, calc(100dvh - 120px)); overflow: hidden; border-radius: 24px; background: var(--c-bg); color: var(--c-fg); box-shadow: 0 30px 80px -24px rgba(17, 16, 20, .6), inset 0 0 0 1px var(--c-line); font-family: var(--c-font); transform-origin: bottom right; opacity: 0; transform: translateY(8px) scale(.985); pointer-events: none; transition: opacity 220ms var(--c-ease), transform 260ms var(--c-ease); }
.movectus-chat-panel.open { opacity: 1; transform: none; pointer-events: auto; }
.movectus-chat-panel .chat-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 18px 16px; border-bottom: 1px solid var(--c-line); }
.movectus-chat-panel .chat-panel-head > div { min-width: 0; }
.movectus-chat-panel .chat-panel-head strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.movectus-chat-panel .chat-panel-head small { display: block; margin-top: 2px; color: var(--c-mute); font: 500 10.5px/1.3 "DM Mono", ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }
.movectus-chat-panel .chat-close { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 0; border-radius: 50%; background: var(--c-fill); color: inherit; font-size: 19px; line-height: 1; cursor: pointer; transition: background-color 200ms var(--c-ease); }
.movectus-chat-panel .chat-close:hover { background: var(--c-mine); }
.movectus-chat-panel .chat-panel-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.movectus-chat-panel .chat-start-copy { margin: 0 0 14px; color: var(--c-mute); font-size: 14px; line-height: 1.55; }
.movectus-chat-panel .chat-account-gate { display: grid; gap: 12px; padding: 18px; border-radius: 18px; background: var(--c-fill); }
.movectus-chat-panel .chat-account-gate > strong { font-size: 18px; line-height: 1.25; letter-spacing: -.015em; }
.movectus-chat-panel .chat-account-gate > p { margin: 0; color: var(--c-mute); font-size: 14px; line-height: 1.55; }
.movectus-chat-panel .chat-account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.movectus-chat-panel .chat-account-gate.compact { margin-top: 12px; }
.movectus-chat-panel .chat-start-form { display: grid; gap: 10px; }
.movectus-chat-panel :is(.chat-start-form input, .chat-start-form textarea, .chat-inline-composer textarea) { width: 100%; padding: 12px 13px; border: 0; border-radius: 14px; background: var(--c-fill); color: inherit; font: 400 15px/1.45 var(--c-font); resize: none; outline: none; box-shadow: inset 0 0 0 1px var(--c-line); transition: box-shadow 200ms var(--c-ease), background-color 200ms var(--c-ease); }
.movectus-chat-panel .chat-start-form textarea { min-height: 116px; }
.movectus-chat-panel :is(input, textarea)::placeholder { color: var(--c-mute); opacity: 1; }
.movectus-chat-panel :is(input, textarea):focus-visible { box-shadow: inset 0 0 0 1.5px var(--c-fg), 0 0 0 4px rgba(242, 49, 31, .18); }
.movectus-chat-panel .chat-history { display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; min-height: 100%; }
.movectus-chat-panel .chat-message-row { display: flex; }
.movectus-chat-panel .chat-message-row.mine { justify-content: flex-end; }
.movectus-chat-panel .chat-message { max-width: 84%; padding: 10px 13px; border-radius: 18px 18px 18px 6px; background: var(--c-fill); }
.movectus-chat-panel .chat-message-row.mine .chat-message { border-radius: 18px 18px 6px 18px; background: var(--c-mine); }
.movectus-chat-panel .chat-message p { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.movectus-chat-panel .chat-message small { display: block; margin-top: 5px; color: var(--c-mute); font-size: 11px; }
.movectus-chat-panel .chat-inline-composer { display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--c-line); }
.movectus-chat-panel .chat-inline-composer textarea { min-height: 44px; max-height: 110px; padding: 11px 12px; }
.movectus-chat-panel .chat-inline-composer button { flex: 0 0 auto; align-self: flex-end; min-width: 72px; }
.movectus-chat-panel .chat-error { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: rgba(242, 49, 31, .16); font-size: 13px; }
.movectus-chat-panel .chat-empty { padding: 30px 8px; color: var(--c-mute); text-align: center; }
.movectus-chat-panel .chat-owner-list { display: grid; gap: 8px; }
.movectus-chat-panel .chat-owner-thread { display: block; width: 100%; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--c-fill); color: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background-color 200ms var(--c-ease); }
.movectus-chat-panel .chat-owner-thread:hover { background: var(--c-mine); }
.movectus-chat-panel .chat-owner-thread span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.movectus-chat-panel .chat-owner-thread strong { font-size: 14px; }
.movectus-chat-panel .chat-owner-thread b { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--c-grad); color: #fff; font-size: 10.5px; }
.movectus-chat-panel .chat-owner-thread :is(small, p) { display: block; margin: 4px 0 0; overflow: hidden; color: var(--c-mute); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.movectus-chat-panel .chat-owner-open { margin-top: 12px; }
/* buttons inside the panel (app.js uses the shared .button classes) */
.movectus-chat-panel .button { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; overflow: hidden; border: 0; border-radius: 999px; background: transparent; color: var(--c-fg); box-shadow: inset 0 0 0 1.5px var(--c-line); font: 620 14px/1 var(--c-font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: color 250ms, box-shadow 250ms; }
.movectus-chat-panel .button::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--c-grad); transform: scaleX(0); transform-origin: 0 50%; transition: transform 450ms cubic-bezier(.65, .05, 0, 1); }
.movectus-chat-panel .button:hover::before, .movectus-chat-panel .button:focus-visible::before { transform: scaleX(1); }
.movectus-chat-panel .button:hover, .movectus-chat-panel .button:focus-visible { color: #fff; box-shadow: none; }
.movectus-chat-panel .button-primary { background: var(--c-fg); color: var(--c-bg); box-shadow: none; }
.movectus-chat-panel .button-full { width: 100%; }
.movectus-chat-panel .button:disabled { opacity: .6; cursor: wait; }
.movectus-chat-panel .button:disabled::before { display: none; }
.movectus-chat-panel :focus-visible { outline: 2px solid #f2311f; outline-offset: 3px; }

/* motion (skipped when animations are off) */
html:not(.reduce-motion) .movectus-chat-panel[data-motion-state="opening"] { animation: movectus-chat-open 300ms cubic-bezier(.22, 1, .36, 1) both; }
html:not(.reduce-motion) .movectus-chat-panel[data-motion-state="closing"] { pointer-events: none; animation: movectus-chat-close 190ms cubic-bezier(.4, 0, .2, 1) both; }
html:not(.reduce-motion) .movectus-chat-panel[data-motion-state="opening"] :is(.chat-panel-head, .chat-panel-body, .chat-inline-composer) { animation: movectus-chat-piece-in 300ms 50ms cubic-bezier(.22, 1, .36, 1) both; }
.notification-button b.badge-pop, .movectus-chat-launcher b.badge-pop { animation: movectus-badge-pop 340ms cubic-bezier(.22, 1, .36, 1) both; }
@keyframes movectus-chat-open { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes movectus-chat-close { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes movectus-chat-piece-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes movectus-badge-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@media (max-width: 640px) {
  .movectus-chat-launcher { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 48px; height: 48px; }
  .movectus-chat-panel { right: 8px; left: 8px; width: auto; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px); height: min(560px, calc(100dvh - 96px)); border-radius: 22px; }
}
.reduce-motion .movectus-chat-panel, .reduce-motion .movectus-chat-launcher { transition: none; }
