/* CubeFem Chat Finder – uses CubeFem Pixel theme tokens (with fallbacks, so it also works on other themes). */
.cfchat {
	--c-bg: var(--px-bg, #FFF7FB);
	--c-card: var(--px-card, #ffffff);
	--c-line: var(--px-card-border, #1A1821);
	--c-text: var(--px-text, #1A1821);
	--c-body: var(--px-body, #3b3947);
	--c-meta: var(--px-meta, #7a7788);
	--c-pink: var(--px-pink, #F8A2D2);
	--c-cyan: var(--px-cyan, #5EE5E6);
	--c-on: #1A1821;
	--c-ink: #1A1821;
	--c-edge: var(--px-border-strong, #1A1821);
	--c-shadow: var(--px-shadow, rgba(26,24,33,.9));
	position: fixed; bottom: 1.25rem; z-index: 99990; font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
	display: flex; flex-direction: column; align-items: flex-end; gap: .75rem;
}
.cfchat-right { right: 1.25rem; }
.cfchat-left { left: 1.25rem; align-items: flex-start; }
.cfchat *, .cfchat *::before, .cfchat *::after { box-sizing: border-box; }
.cfchat [hidden] { display: none !important; }

/* Bubble button */
.cfchat-fab { width: 3.8rem; height: 3.8rem; display: grid; place-items: center; background: var(--c-pink); border: 3px solid var(--c-ink); border-radius: 8px; box-shadow: 4px 4px 0 var(--c-shadow); cursor: pointer; padding: 0; transition: transform .1s, box-shadow .1s; }
.cfchat-fab:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--c-shadow); }
.cfchat-fab:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--c-shadow); }
.cfchat-fab:focus-visible, .cfchat button:focus-visible, .cfchat a:focus-visible, .cfchat input:focus-visible { outline: 3px solid var(--c-cyan); outline-offset: 2px; }
.cfchat.is-open .cfchat-fab { background: var(--c-cyan); }

/* Teaser pop-up */
.cfchat-teaser { max-width: 15rem; padding: .6rem .85rem; background: var(--c-card); color: var(--c-text); border: 3px solid var(--c-edge); border-radius: 8px 8px 2px 8px; box-shadow: 4px 4px 0 var(--c-pink); font: 600 .85rem/1.35 'Inter', sans-serif; text-align: left; cursor: pointer; animation: cfpop .25s steps(4); }
.cfchat-left .cfchat-teaser { border-radius: 8px 8px 8px 2px; }
@keyframes cfpop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Panel */
.cfchat-panel { width: min(22rem, calc(100vw - 2rem)); height: min(34rem, calc(100vh - 8rem)); display: flex; flex-direction: column; background: var(--c-bg); border: 4px solid var(--c-edge); border-radius: 12px; box-shadow: 8px 8px 0 var(--c-shadow); overflow: hidden; animation: cfpop .2s steps(5); }
.cfchat-head { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; background: linear-gradient(90deg, var(--c-pink), var(--c-cyan)); border-bottom: 4px solid var(--c-edge); color: var(--c-on); }
.cfchat-av { width: 2.3rem; height: 2.3rem; display: grid; place-items: center; background: #fff; color: var(--c-on); border: 3px solid var(--c-ink); border-radius: 6px; box-shadow: 2px 2px 0 var(--c-ink); font: 700 1rem 'Silkscreen', cursive; }
.cfchat-who { flex: 1; min-width: 0; line-height: 1.2; }
.cfchat-who b { display: block; font: 700 .85rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .06em; }
.cfchat-who small { font: 400 .62rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .05em; }
.cfchat-close { width: 2rem; height: 2rem; background: #fff; color: var(--c-on); border: 3px solid var(--c-ink); border-radius: 6px; font: 700 1.1rem/1 'Silkscreen', cursive; cursor: pointer; padding: 0; }
.cfchat-close:hover { background: var(--c-on); color: #fff; }

/* Messages */
.cfchat-log { flex: 1; overflow-y: auto; padding: 1rem .9rem; display: flex; flex-direction: column; gap: .7rem; scroll-behavior: smooth; }
.cfchat-row { display: flex; }
.cfchat-me { justify-content: flex-end; }
.cfchat-bubble { max-width: 88%; padding: .6rem .8rem; border: 2px solid var(--c-line); border-radius: 8px 8px 8px 2px; background: var(--c-card); color: var(--c-body); font: 400 .88rem/1.5 'Inter', sans-serif; box-shadow: 2px 2px 0 var(--c-line); }
.cfchat-bubble p { margin: 0; }
.cfchat-me .cfchat-bubble { background: var(--c-cyan); color: var(--c-on); border-color: var(--c-ink); border-radius: 8px 8px 2px 8px; box-shadow: 2px 2px 0 var(--c-shadow); font-weight: 600; }

.cfchat-typing .cfchat-bubble { display: flex; gap: .3rem; padding: .75rem .9rem; }
.cfchat-typing i { width: .5rem; height: .5rem; background: var(--c-pink); border: 2px solid var(--c-ink); animation: cfdot 1s steps(2) infinite; }
.cfchat-typing i:nth-child(2) { animation-delay: .15s; background: var(--c-cyan); }
.cfchat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cfdot { 50% { transform: translateY(-4px); } }

/* Result cards + buttons */
.cfchat-card { display: block; margin-top: .55rem; padding: .55rem .7rem; background: var(--c-bg); border: 2px solid var(--c-edge); border-radius: 6px; text-decoration: none; color: var(--c-text); transition: transform .1s, box-shadow .1s; }
.cfchat-card:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--c-pink); }
.cfchat-card b { display: block; font: 700 .85rem/1.3 'Inter', sans-serif; color: var(--c-text); }
.cfchat-card small { display: block; margin-top: .15rem; font: 400 .74rem/1.4 'Inter', sans-serif; color: var(--c-meta); }
.cfchat-card span { display: inline-block; margin-top: .3rem; font: 700 .6rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .06em; color: var(--px-pink-dark, #c4528f); }
.cfchat-actions { margin-top: .6rem; }
.cfchat-btn { display: inline-block; padding: .5rem .9rem; background: var(--c-cyan); color: var(--c-on); border: 3px solid var(--c-ink); border-radius: 4px; box-shadow: 3px 3px 0 var(--c-shadow); text-decoration: none; font: 700 .62rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .06em; }
.cfchat-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--c-shadow); }

/* Quick chips */
.cfchat-chips { display: flex; gap: .45rem; padding: .6rem .9rem; overflow-x: auto; border-top: 2px dashed var(--c-line); scrollbar-width: thin; }
.cfchat-chips:empty { display: none; }
.cfchat-chip { flex: none; padding: .35rem .7rem; background: var(--c-card); color: var(--c-text); border: 2px solid var(--c-edge); border-radius: 999px; font: 700 .58rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.cfchat-chip:hover { background: var(--c-pink); color: var(--c-on); }

/* Input */
.cfchat-form { display: flex; gap: .5rem; padding: .7rem .9rem .9rem; border-top: 4px solid var(--c-edge); background: var(--c-card); }
.cfchat-input { flex: 1; min-width: 0; padding: .6rem .75rem; background: var(--px-input-bg, var(--c-bg)); color: var(--c-text); border: 3px solid var(--c-line); border-radius: 6px; font: 500 .88rem 'Inter', sans-serif; }
.cfchat-input:focus { border-color: var(--c-pink); outline: none; box-shadow: 3px 3px 0 var(--c-cyan); }
.cfchat-send { padding: 0 .9rem; background: var(--c-pink); color: var(--c-on); border: 3px solid var(--c-ink); border-radius: 6px; box-shadow: 3px 3px 0 var(--c-shadow); font: 700 .62rem 'Silkscreen', cursive; text-transform: uppercase; cursor: pointer; }
.cfchat-send:hover { background: var(--c-cyan); }
.cfchat-send:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c-shadow); }

@media (max-width: 520px) {
	.cfchat { bottom: .75rem; }
	.cfchat-right { right: .75rem; } .cfchat-left { left: .75rem; }
	.cfchat-panel { width: calc(100vw - 1.5rem); height: min(34rem, calc(100vh - 6.5rem)); }
}
@media (prefers-reduced-motion: reduce) { .cfchat * { animation: none !important; transition: none !important; } }

/* "Not a live chat" notice + footer hint */
.cfchat-notice { position: relative; display: flex; gap: .65rem; align-items: flex-start; margin: .7rem .9rem 0; padding: .6rem 2rem .6rem .65rem; background: repeating-linear-gradient(135deg, rgba(255,217,102,.22) 0 8px, rgba(255,217,102,.12) 8px 16px); border: 2px dashed #E0A800; border-radius: 8px; }
.cfchat-notice p { margin: 0; font: 500 .76rem/1.45 'Inter', sans-serif; color: var(--c-text); }
.cfchat-notice-i { flex: none; width: 1.3rem; height: 1.3rem; display: grid; place-items: center; background: #FFD966; color: var(--c-on); border: 2px solid var(--c-ink); border-radius: 4px; font: 700 .7rem 'Silkscreen', cursive; }
.cfchat-notice-x { position: absolute; top: .3rem; right: .35rem; width: 1.3rem; height: 1.3rem; padding: 0; background: transparent; color: var(--c-text); border: 0; font: 700 1rem/1 'Silkscreen', cursive; cursor: pointer; border-radius: 4px; }
.cfchat-notice-x:hover { background: rgba(0,0,0,.12); }
.cfchat-foot { padding: .35rem .9rem .55rem; background: var(--c-card); text-align: center; font: 400 .55rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .08em; color: var(--c-meta); }
.cfchat-form { padding-bottom: .4rem; }

/* Reply extras */
.cfchat-did { font: 600 .74rem 'Inter', sans-serif; color: var(--c-meta); margin: 0 0 .35rem !important; }
.cfchat-used { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .5rem; }
.cfchat-used span { font: 400 .55rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .06em; color: var(--c-meta); }
.cfchat-used em { font: 700 .56rem 'Silkscreen', cursive; text-transform: uppercase; font-style: normal; padding: .1rem .4rem; border-radius: 3px; background: rgba(248,162,210,.25); color: var(--c-text); border: 1px solid var(--c-pink); }
.cfchat-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.cfchat-panel { height: min(36rem, calc(100vh - 8rem)); }

.cfchat-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .6rem; }
.cfchat-suggest span { font: 400 .55rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .06em; color: var(--c-meta); }

/* Clear button in header */
.cfchat-clear { width: 2rem; height: 2rem; display: grid; place-items: center; background: #fff; color: var(--c-on); border: 3px solid var(--c-ink); border-radius: 6px; padding: 0; cursor: pointer; }
.cfchat-clear:hover { background: var(--c-on); color: #fff; }

/* Confirm modal (inside the panel) */
.cfchat-panel { position: relative; }
.cfchat-modal { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 1rem; background-color: rgba(26,24,33,.55); background-image: linear-gradient(45deg, rgba(0,0,0,.25) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.25) 75%), linear-gradient(45deg, rgba(0,0,0,.25) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.25) 75%); background-size: 6px 6px; background-position: 0 0, 3px 3px; animation: cfpop .15s steps(3); }
.cfchat-dialog { width: 100%; max-width: 17rem; background: var(--c-card); border: 4px solid var(--c-ink); border-radius: 10px; box-shadow: 6px 6px 0 var(--c-shadow); overflow: hidden; }
.cfchat-dialog-bar { padding: .6rem .9rem; background: var(--c-pink); color: var(--c-on); border-bottom: 4px solid var(--c-ink); font: 700 .75rem 'Silkscreen', cursive; text-transform: uppercase; letter-spacing: .08em; }
.cfchat-dialog-body { padding: .9rem; }
.cfchat-dialog-body p { margin: 0 0 1rem; font: 400 .85rem/1.5 'Inter', sans-serif; color: var(--c-body); }
.cfchat-dialog-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.cfchat-dialog .cfchat-btn { cursor: pointer; font-family: 'Silkscreen', cursive; }
.cfchat-btn-ghost { background: var(--c-card); color: var(--c-text); }
.cfchat-btn-pink { background: var(--c-pink); }
.cfchat-btn-ghost { border-color: var(--c-edge); box-shadow: 3px 3px 0 var(--c-edge); }

/* Pixel scrollbars */
.cfchat-log, .cfchat-chips { scrollbar-width: thin; scrollbar-color: var(--c-pink) transparent; }
.cfchat-log::-webkit-scrollbar { width: 10px; }
.cfchat-chips::-webkit-scrollbar { height: 10px; }
.cfchat-log::-webkit-scrollbar-track, .cfchat-chips::-webkit-scrollbar-track { background: repeating-conic-gradient(rgba(248,162,210,.18) 0% 25%, transparent 0% 50%) 0 0 / 6px 6px; border: 2px solid var(--c-edge); border-radius: 0; }
.cfchat-log::-webkit-scrollbar-thumb, .cfchat-chips::-webkit-scrollbar-thumb { background: var(--c-pink); border: 2px solid var(--c-ink); border-radius: 0; }
.cfchat-log::-webkit-scrollbar-thumb:hover, .cfchat-chips::-webkit-scrollbar-thumb:hover { background: var(--c-cyan); }
.cfchat-log::-webkit-scrollbar-button, .cfchat-chips::-webkit-scrollbar-button { display: none; }
.cfchat-log::-webkit-scrollbar-corner, .cfchat-chips::-webkit-scrollbar-corner { background: transparent; }
