← back to Wallco Ai
public/css/chat.css
259 lines
/* wallco.ai chat panel — matches site design tokens (--bg, --ink, --serif, --sans, --gold).
Dark-mode aware. Inherits the page's theme. */
/* ── floating button (FAB) ───────────────────────────────────────── */
/* Bottom-right per Steve directive 2026-05-21 (reverses the 2026-05-20
upper-right pinning that was covering the hamburger). Stacks with
Big Red — wallco's design-AI pill is IN the corner; Big Red moves up
via the override at the bottom of this file. */
#wallco-chat-fab {
position: fixed;
bottom: 22px;
right: 22px;
z-index: 9998;
background: var(--accent, #0d0d0d);
color: var(--bg, #faf7f2);
border: 0;
border-radius: 999px;
padding: 14px 22px 14px 18px;
font-family: var(--sans);
font-size: 13px;
font-weight: 500;
letter-spacing: 0.02em;
cursor: pointer;
box-shadow: 0 10px 30px -8px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.18);
transition: transform .18s ease, box-shadow .18s ease;
display: inline-flex; align-items: center; gap: 8px;
}
#wallco-chat-fab:hover { transform: translateY(-1px); box-shadow: 0 14px 40px -8px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.22); }
#wallco-chat-fab .fab-spark { font-family: var(--serif); font-size: 17px; color: var(--gold, #c9a14b); line-height: 1; }
/* ── panel ───────────────────────────────────────────────────────── */
/* Anchored above the FAB (bottom-right) — slides UP from below the FAB. */
#wallco-chat-panel {
position: fixed;
bottom: 78px;
right: 22px;
width: 400px; max-width: calc(100vw - 32px);
height: 600px; max-height: calc(100vh - 100px);
background: var(--card-bg, #fff);
color: var(--ink, #1a1714);
border: 1px solid var(--line, #d8cec0);
border-radius: 16px;
box-shadow: 0 30px 80px -16px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.18);
z-index: 9999;
display: none;
flex-direction: column;
overflow: hidden;
font-family: var(--sans);
/* Slides UP from below the FAB anchor (bottom-right). */
transform: translateY(8px); opacity: 0;
transition: transform .22s ease, opacity .22s ease;
}
#wallco-chat-panel.is-open { display: flex; transform: translateY(0); opacity: 1; }
#wallco-chat-panel > header {
padding: 18px 20px 14px;
border-bottom: 1px solid var(--line);
background: linear-gradient(180deg, var(--header-bg, #faf7f2), transparent);
display: flex; align-items: flex-start; gap: 12px;
}
#wallco-chat-panel .h-title {
font-family: var(--serif);
font-weight: 400;
font-size: 19px;
line-height: 1.1;
letter-spacing: 0.01em;
color: var(--ink);
margin: 0;
}
#wallco-chat-panel .h-sub {
font-size: 11px;
color: var(--ink-faint, #9a8e82);
margin-top: 4px;
letter-spacing: 0.05em;
text-transform: uppercase;
}
#wallco-chat-panel .h-close {
margin-left: auto; background: transparent; border: 0; cursor: pointer;
color: var(--ink-faint);
width: 28px; height: 28px; border-radius: 6px;
font-size: 20px; line-height: 1;
display: inline-flex; align-items: center; justify-content: center;
transition: background .12s, color .12s;
}
#wallco-chat-panel .h-close:hover { background: var(--bg); color: var(--ink); }
/* ── log / messages ──────────────────────────────────────────────── */
#wallco-chat-log {
flex: 1; overflow-y: auto; padding: 18px 20px;
display: flex; flex-direction: column; gap: 12px;
background: var(--bg);
}
#wallco-chat-log::-webkit-scrollbar { width: 6px; }
#wallco-chat-log::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.wc-msg {
max-width: 86%;
padding: 10px 13px;
border-radius: 14px;
font-size: 13.5px;
line-height: 1.5;
white-space: pre-wrap;
word-wrap: break-word;
animation: wc-fade .16s ease;
}
@keyframes wc-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.wc-msg.user { background: var(--accent); color: var(--bg); align-self: flex-end; border-bottom-right-radius: 4px; }
.wc-msg.assistant { background: var(--card-bg); color: var(--ink); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.wc-msg.thinking { background: transparent; color: var(--ink-faint); align-self: flex-start; font-style: italic; padding-left: 4px; }
.wc-msg.thinking::after { content: ''; display: inline-block; width: 24px; }
.wc-msg.thinking .dot { display: inline-block; width: 6px; height: 6px; margin: 0 1px; background: var(--ink-faint); border-radius: 50%; opacity: 0.5; animation: wc-bounce 1s infinite; }
.wc-msg.thinking .dot:nth-child(2) { animation-delay: .15s; }
.wc-msg.thinking .dot:nth-child(3) { animation-delay: .3s; }
@keyframes wc-bounce { 0%,100% { transform: translateY(0); opacity: .3; } 50% { transform: translateY(-3px); opacity: 1; } }
.wc-msg.error { background: #fde6e1; color: #7a2118; align-self: flex-start; border: 1px solid #f3c2b6; }
/* ── search result grid (existing designs) ───────────────────────── */
.wc-actions {
align-self: stretch;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
margin-top: 2px;
}
.wc-card {
background: var(--card-bg);
border: 1px solid var(--line);
border-radius: 8px;
overflow: hidden;
cursor: pointer;
text-decoration: none;
color: inherit;
transition: transform .18s, border-color .18s, box-shadow .18s;
}
.wc-card:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: 0 8px 24px -8px rgba(0,0,0,.18); }
.wc-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--bg); }
.wc-card .cap { padding: 6px 8px 8px; font-size: 11px; color: var(--ink-soft); line-height: 1.3; }
/* ── new / variant design (full-width card) ──────────────────────── */
.wc-new {
align-self: stretch;
background: var(--card-bg);
border: 1px solid var(--gold);
border-radius: 12px;
padding: 14px;
display: flex; gap: 14px;
box-shadow: 0 8px 24px -10px rgba(201, 161, 75, .35);
position: relative;
overflow: hidden;
}
.wc-new::before {
content: 'NEW';
position: absolute; top: 0; right: 0;
background: var(--gold); color: var(--accent);
font-family: var(--sans); font-size: 9px; font-weight: 600;
letter-spacing: 0.12em;
padding: 3px 10px;
border-bottom-left-radius: 8px;
}
.wc-new img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.wc-new .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wc-new .meta .title { font-family: var(--serif); font-size: 16px; font-weight: 400; line-height: 1.2; color: var(--ink); }
.wc-new .meta .swatch { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-soft); }
.wc-new .meta .swatch .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }
.wc-new .meta .link { font-size: 12px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--gold); padding-bottom: 1px; align-self: flex-start; margin-top: auto; font-weight: 500; }
.wc-new .meta .link:hover { color: var(--gold); }
/* ── suggestions ──────────────────────────────────────────────────── */
.wc-suggest {
display: flex; gap: 6px; flex-wrap: wrap;
padding: 0 16px 12px;
background: var(--card-bg);
border-top: 1px solid var(--line);
padding-top: 10px;
}
.wc-suggest button {
font-family: var(--sans);
font-size: 11px;
color: var(--ink-soft);
background: transparent;
border: 1px solid var(--line);
padding: 6px 11px;
border-radius: 999px;
cursor: pointer;
transition: background .15s, color .15s, border-color .15s;
}
.wc-suggest button:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
/* ── input form ───────────────────────────────────────────────────── */
#wallco-chat-form {
padding: 12px 14px 14px;
background: var(--card-bg);
border-top: 1px solid var(--line);
display: flex; gap: 8px; align-items: flex-end;
}
#wallco-chat-form textarea {
flex: 1;
border: 1px solid var(--line);
border-radius: 10px;
padding: 10px 12px;
font-family: var(--sans);
font-size: 13.5px;
line-height: 1.4;
color: var(--ink);
background: var(--bg);
resize: none;
min-height: 40px;
max-height: 120px;
transition: border-color .15s, box-shadow .15s;
}
#wallco-chat-form textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,161,75,.15); }
#wallco-chat-form textarea::placeholder { color: var(--ink-faint); }
#wallco-chat-form button {
background: var(--accent);
color: var(--bg);
border: 0; border-radius: 10px;
padding: 0 16px; height: 42px;
font-family: var(--sans); font-size: 13px; font-weight: 500;
cursor: pointer;
transition: background .15s, transform .12s;
}
#wallco-chat-form button:hover:not(:disabled) { transform: translateY(-1px); }
#wallco-chat-form button:disabled { background: var(--ink-faint); cursor: wait; opacity: 0.7; }
/* ── mobile ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
#wallco-chat-panel { right: 8px; left: 8px; width: auto; bottom: 8px; height: calc(100vh - 16px); border-radius: 12px; }
/* FAB respects iOS home-indicator safe-area + leaves clearance above
content. Four-horsemen Canva flag: was overlapping the texture grid
on /studio without inset. */
#wallco-chat-fab {
bottom: calc(14px + env(safe-area-inset-bottom, 0px));
right: 14px;
padding: 12px 18px;
max-width: calc(100vw - 28px);
}
.wc-actions { grid-template-columns: repeat(2, 1fr); }
}
/* ── Big Red stack offset (2026-05-21) ─────────────────────────────
Both wallco's design-AI pill and Big Red's circular launcher want
the bottom-right corner. The wallco pill stays IN the corner (Steve's
explicit directive); Big Red moves UP so they're stacked with the
wallco pill closer to the hamburger-free corner.
The wallco-chat-fab is 45px tall + 22px bottom = ~67px ceiling, plus
a 14px gap → Big Red at bottom:88px. Same for its .live state. */
.bigred-launcher,
.bigred-launcher.live {
bottom: 88px !important;
}
@media (max-width: 640px) {
/* On mobile the wallco-chat-fab is killed by chat.js (≤768px bail-out),
so Big Red can return to the corner. */
.bigred-launcher,
.bigred-launcher.live {
bottom: 16px !important;
}
}