/* Shop chat. Inherits the shop's font; colours can be tuned with the --ostc-* variables. */
.ostc { --ostc-ink: #0b0b0b; --ostc-ink2: #4a4745; --ostc-ink3: #6f6a66; --ostc-paper: #fff; --ostc-paper2: #f6f3f0; --ostc-line: #e6e2de; --ostc-ease: cubic-bezier(.16, 1, .3, 1); font: inherit; color: var(--ostc-ink); }
.ostc *, .ostc *::before, .ostc *::after { box-sizing: border-box; }
/* Low specificity, so the chat's own button colours always win. */
.ostc :where(button, input, textarea) { font: inherit; color: inherit; letter-spacing: inherit; }

.ostc-btn { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--ostc-ink); color: #fff; font-size: 14px; font-weight: 500; letter-spacing: -.01em; cursor: pointer; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22), 0 12px 30px rgba(0, 0, 0, .22); transition: transform .5s var(--ostc-ease), opacity .3s, bottom .4s var(--ostc-ease); animation: ostc-in .8s var(--ostc-ease) 1.2s both; }
.ostc-btn:hover { transform: translateY(-2px); }
.ostc-btn:focus-visible { outline: 2px solid var(--ostc-ink); outline-offset: 3px; }
.ostc-btn svg { width: 20px; height: 20px; flex: none; }
.ostc-btn__dot { position: absolute; top: 9px; left: 31px; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--ostc-ink); animation: ostc-pulse 1.6s ease-in-out infinite; }
@media (max-width: 600px) { .ostc-btn { width: 52px; height: 52px; padding: 0; justify-content: center; right: 16px; bottom: 16px; } .ostc-btn span:not(.ostc-btn__dot) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .ostc-btn__dot { top: 12px; left: 30px; } }
.ostc.is-open .ostc-btn { opacity: 0; pointer-events: none; transform: scale(.9); }
.has-sticky-buy .ostc-btn { bottom: 88px; }
@keyframes ostc-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes ostc-pulse { 50% { opacity: .35; } }

.ostc-panel { position: fixed; right: 20px; bottom: 20px; z-index: 95; display: flex; flex-direction: column; width: min(390px, calc(100vw - 24px)); height: min(600px, calc(100svh - 40px)); background: var(--ostc-paper); border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .22), 0 0 0 1px var(--ostc-line); overflow: hidden; transform-origin: bottom right; animation: ostc-open .55s var(--ostc-ease) both; }
.ostc-panel[hidden] { display: none; }
@keyframes ostc-open { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@media (max-width: 600px) {
	.ostc-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; height: 100dvh; }
	html.ostc-locked, html.ostc-locked body { overflow: hidden; }
}

.ostc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--ostc-line); }
.ostc-head strong { display: block; font-size: 16px; font-weight: 500; letter-spacing: -.03em; }
.ostc-head small { display: block; font-size: 12px; color: var(--ostc-ink3); }
.ostc-close { border: 0; background: none; padding: 8px 4px; font-size: 13px; cursor: pointer; position: relative; }
.ostc-close::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 6px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ostc-ease); }
.ostc-close:hover::after { transform: scaleX(1); transform-origin: left; }

.ostc-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 18px; scrollbar-width: none; }
.ostc-log::-webkit-scrollbar { display: none; }
.ostc-msg { max-width: 84%; animation: ostc-rise .45s var(--ostc-ease) both; }
@keyframes ostc-rise { from { opacity: 0; transform: translateY(8px); } }
.ostc-msg p { margin: 0; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ostc-msg small { display: block; margin: 0 0 3px 6px; font-size: 11px; color: var(--ostc-ink3); }
.ostc-msg--them { align-self: flex-start; }
.ostc-msg--them p { background: var(--ostc-paper2); border-bottom-left-radius: 6px; }
.ostc-msg--me { align-self: flex-end; }
.ostc-msg--me p { background: var(--ostc-ink); color: #fff; border-bottom-right-radius: 6px; }
.ostc-msg--me[data-tmp] p { opacity: .7; }
.ostc-msg a { text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.ostc-msg--sys { align-self: center; max-width: 100%; font-size: 11px; color: var(--ostc-ink3); text-align: center; }
.ostc-typing p { display: inline-flex; gap: 4px; padding: 14px; }
.ostc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ostc-ink3); animation: ostc-dot 1.2s infinite; }
.ostc-typing i:nth-child(2) { animation-delay: .15s; }
.ostc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ostc-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.ostc-card { align-self: stretch; padding: 14px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--ostc-line); animation: ostc-rise .45s var(--ostc-ease) both; }
.ostc-card p { margin: 0 0 10px; font-size: 13px; }
.ostc-card form { display: grid; gap: 8px; margin: 0; }
.ostc-card input, .ostc-card textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--ostc-line); border-radius: 10px; background: var(--ostc-paper); font-size: 14px; outline: 0; resize: none; }
.ostc-card input:focus, .ostc-card textarea:focus { border-color: var(--ostc-ink); }
.ostc-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ostc-row a { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; color: var(--ostc-ink2); }
.ostc-primary { height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--ostc-ink); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; }
.ostc-err { color: #5c1424; font-size: 12px; margin: 6px 0 0 !important; }

.ostc-chips { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none; }
.ostc-chips::-webkit-scrollbar { display: none; }
.ostc-chips > * { flex: none; height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border: 0; border-radius: 999px; background: var(--ostc-paper); box-shadow: inset 0 0 0 1px var(--ostc-line); font-size: 12px; color: var(--ostc-ink2); text-decoration: none; cursor: pointer; transition: box-shadow .25s, color .25s; }
.ostc-chips > *:hover { box-shadow: inset 0 0 0 1px var(--ostc-ink); color: var(--ostc-ink); }

.ostc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--ostc-line); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.ostc-form textarea { flex: 1; min-height: 42px; max-height: 120px; padding: 10px 14px; border: 1px solid var(--ostc-line); border-radius: 21px; background: var(--ostc-paper2); font-size: 14px; line-height: 1.4; resize: none; outline: 0; transition: border-color .25s; }
.ostc-form textarea:focus { border-color: var(--ostc-ink); background: var(--ostc-paper); }
.ostc-form button { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--ostc-ink); color: #fff; cursor: pointer; transition: transform .3s var(--ostc-ease); }
.ostc-form button:hover { transform: translateX(2px); }
.ostc-form svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .ostc *, .ostc *::before { animation: none !important; transition: none !important; } }
@media (max-width: 600px) { .admin-bar .ostc-panel { top: 46px; height: calc(100dvh - 46px); } }

/* Optional line under the box (filter fxst_chat_credit) */
.ostc-credit { margin: 0; padding: 0 12px max(10px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; color: var(--ostc-ink3); }
.ostc-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ostc-credit a:hover { color: var(--ostc-ink); }
.ostc-form:has(+ .ostc-credit) { padding-bottom: 6px; }
