/* Studio Chat (/chat/, page 516). Built by site-audit/studio-chat-2026-12-01/tools/port-css.py
   from the approved mock (studio-chat-mock/boxed.html + chat-dark.css). Edit the mock, then rebuild.
   Every rule is scoped to .ws-chat; the page frame is the Elementor header + the chat card. */

/* Page frame: header on top, the chat card fills the rest. No footer. */
body.ws-chat-page { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; background: var(--ws-surface-page); }
body.ws-chat-page.admin-bar { height: calc(100dvh - 32px); }
@media (max-width: 782px) { body.ws-chat-page.admin-bar { height: calc(100dvh - 46px); } }
body.ws-chat-page > header, body.ws-chat-page > .elementor-location-header { flex: none; }
.ws-chat-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.ws-chat, .ws-chat *, .ws-chat *::before, .ws-chat *::after { box-sizing: border-box; }
.ws-chat [hidden] { display: none !important; }
.ws-chat { color: var(--ws-text); font: 400 var(--ws-text-body)/var(--ws-leading-body) var(--ws-font-sans); -webkit-font-smoothing: antialiased; }
.ws-chat h1, .ws-chat h2, .ws-chat h3, .ws-chat p { margin: 0; }
.ws-chat button, .ws-chat textarea { font: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
.ws-chat :focus-visible { outline: 2px solid var(--ws-focus); outline-offset: 2px; }
.ws-chat .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ws-chat svg { flex: none; }

/* The boxed card (founder's pick) */
.ws-chat-app {
	width: min(var(--ws-container), 100% - 2 * var(--ws-gutter));
	margin: var(--ws-space-5) auto;
	background: var(--ws-white);
	border: 1px solid var(--ws-gray-200);
	border-radius: var(--ws-radius-lg);
	overflow: hidden;
}
.ws-chat-app .topbar .side-toggle { display: none; margin-left: -8px; }
.ws-chat-app .topbar { gap: 8px; }
.ws-chat-app .topbar .chat-title { flex: 1; min-width: 0; }
@media (max-width: 960px) { .ws-chat-app { margin: var(--ws-space-4) auto; } .ws-chat-app .topbar .side-toggle { display: inline-grid; }
	/* The drawer and its scrim cover the site header (its bar sits at z-index 99-100). */
	body.ws-chat-page .ws-chat-app .side { z-index: 1001; } body.ws-chat-page .ws-chat-app .scrim { z-index: 1000; } }
@media (max-width: 640px) { .ws-chat-app { width: 100%; margin: 0; border: 0; border-radius: 0; } body.ws-chat-page { background: var(--ws-white); } }

/* Banner above the composer (10-chat limit, timed-out session) */
.ws-chat-app .banner { max-width: 712px; margin: 0 auto 10px; padding: 10px 14px; border-radius: var(--ws-radius-md); background: var(--ws-gray-100); font-size: var(--ws-text-small); color: var(--ws-gray-800); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ws-chat-app .banner button { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: var(--ws-radius-md); background: var(--ws-gray-900); color: #fff; font-weight: 700; font-size: var(--ws-text-small); cursor: pointer; }
.ws-chat-app .error-box { padding: 16px 20px; border-radius: var(--ws-radius-lg); background: var(--ws-gray-900); color: var(--ws-gray-300); font-size: var(--ws-text-small); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ws-chat-app .error-box button { height: 34px; padding: 0 14px; border: 0; border-radius: var(--ws-radius-md); background: #fff; color: var(--ws-gray-900); font-weight: 700; cursor: pointer; }
.ws-chat-app .prose pre { margin: 0; padding: 12px 14px; border-radius: var(--ws-radius-md); background: #18181A; color: #fff; overflow-x: auto; font-size: .875rem; }
.ws-chat-app .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.ws-chat-app .prose :not(pre) > code { padding: 1px 5px; border-radius: 4px; background: var(--ws-gray-100); }

/* Log-in and Pro panels */
.ws-chat-panel { flex: 1; display: grid; place-items: center; padding: var(--ws-space-6) var(--ws-gutter); }
.ws-chat-panel-box { max-width: 440px; text-align: center; }
.ws-chat-panel-mark { display: block; margin: 0 auto 18px; width: 14px; height: auto; filter: invert(1); }
.ws-chat-panel h1 { font: 400 var(--ws-text-display-m)/1.2 var(--ws-font-display); color: var(--ws-gray-900); }
.ws-chat-panel p { margin-top: 12px; color: var(--ws-gray-600); }
.ws-chat-panel-actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.ws-chat-btn { display: inline-flex; align-items: center; height: var(--ws-control-h); padding: 0 22px; border-radius: var(--ws-radius-md); font-weight: 700; text-decoration: none; border: 1.5px solid var(--ws-gray-900); transition: background var(--ws-dur-fast), color var(--ws-dur-fast); }
.ws-chat-btn-primary { background: var(--ws-gray-900); color: #fff; }
.ws-chat-btn-primary:hover { background: var(--ws-black); color: #fff; }
.ws-chat-btn-secondary { background: transparent; color: var(--ws-gray-900); }
.ws-chat-btn-secondary:hover { background: var(--ws-gray-900); color: #fff; }

/* Dark page background (the card's colors come from the dark block at the end) */
html[data-theme="dark"] body.ws-chat-page { background: radial-gradient(ellipse 70% 55% at 50% 0%, #252525 0%, #000 70%) #000; color-scheme: dark; }
html[data-theme="dark"] .ws-chat-app { border-color: rgb(255 255 255 / .08); }
html[data-theme="dark"] .ws-chat-panel h1 { color: #F8F7FA; }
html[data-theme="dark"] .ws-chat-panel p { color: #A3A0AB; }
html[data-theme="dark"] .ws-chat-panel-mark { filter: none; }
html[data-theme="dark"] .ws-chat-btn-primary { background: #fff; color: #18181A; border-color: #fff; }
html[data-theme="dark"] .ws-chat-btn-secondary { color: #fff; border-color: rgb(255 255 255 / .4); }
html[data-theme="dark"] .ws-chat-app .banner { background: #26262A; color: #E4E2E9; }
html[data-theme="dark"] .ws-chat-app .banner button { background: #fff; color: #18181A; }
html[data-theme="dark"] .ws-chat-app .error-box { background: #2D2C30; color: #BEBBC2; }

/* ---- From the mock ---------------------------------------------------- */
/* Icon button ---------------------------------------------------------- */
.ws-chat-app .icon-btn {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px; padding: 0;
	border: 0; border-radius: var(--ws-radius-md); background: none;
	color: var(--ws-gray-600); cursor: pointer;
	transition: background var(--ws-dur-fast), color var(--ws-dur-fast);
}
.ws-chat-app .icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ws-chat-app .icon-btn:hover { background: var(--ws-gray-100); color: var(--ws-gray-900); }
.ws-chat-app .icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.ws-chat-app .icon-btn.on-dark { color: #fff; }
.ws-chat-app .icon-btn.on-dark:hover { background: rgb(255 255 255 / .1); }

/* App shell ------------------------------------------------------------ */
.ws-chat-app { flex: 1; min-height: 0; display: grid; grid-template-columns: 272px 1fr; }

/* Sidebar */
.ws-chat-app .side {
	display: flex; flex-direction: column; min-height: 0;
	padding: 16px 12px 16px;
	background: var(--ws-gray-50);
	border-right: 1px solid var(--ws-gray-200);
}
.ws-chat-app .new-chat {
	display: flex; align-items: center; gap: 10px;
	height: 44px; padding: 0 14px; margin-bottom: 20px;
	background: var(--ws-white); border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius-md);
	font-weight: 700; font-size: var(--ws-text-small); color: var(--ws-gray-900);
	cursor: pointer; transition: border-color var(--ws-dur-fast), box-shadow var(--ws-dur-fast);
}
.ws-chat-app .new-chat:hover { border-color: var(--ws-gray-300); box-shadow: var(--ws-shadow-hover); }
.ws-chat-app .new-chat svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ws-chat-app .side-label { padding: 0 10px 6px; font-size: var(--ws-text-meta); font-weight: 600; color: var(--ws-gray-600); }
.ws-chat-app .chat-list { list-style: none; margin: 0; padding: 0; overflow: auto; min-height: 0; flex: 0 1 auto; }
.ws-chat-app .chat-list .chat-open {
	display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--ws-radius-md);
	background: none; text-align: left; cursor: pointer;
	transition: background var(--ws-dur-fast);
}
.ws-chat-app .chat-list .chat-open:hover { background: none; }

.ws-chat-app .chat-list .t { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--ws-text-small); font-weight: 600; color: var(--ws-gray-800); }
.ws-chat-app .chat-list .m { display: block; font-size: 12px; color: var(--ws-gray-600); }
.ws-chat-app .side-hint { margin: 10px 10px 0; font-size: 12px; line-height: 1.5; color: var(--ws-gray-600); }

.ws-chat-app .side-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--ws-gray-200); }
.ws-chat-app .allow-row { display: flex; justify-content: space-between; font-size: var(--ws-text-meta); font-weight: 600; color: var(--ws-gray-700); }
.ws-chat-app .allow-row strong { color: var(--ws-gray-900); }
.ws-chat-app .allow-bar { height: 4px; margin: 8px 0 6px; border-radius: var(--ws-radius-pill); background: var(--ws-gray-200); overflow: hidden; }
.ws-chat-app .allow-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ws-gray-900); transition: width var(--ws-dur-slow) var(--ws-ease-out); }
.ws-chat-app .allow-note { font-size: 12px; color: var(--ws-gray-600); }
.ws-chat-app .privacy { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 12px; color: var(--ws-gray-600); }
.ws-chat-app .privacy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.ws-chat-app .scrim { display: none; }

/* Main column ---------------------------------------------------------- */
.ws-chat-app .main { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }

.ws-chat-app .topbar { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 24px; }
.ws-chat-app .chat-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .9375rem; font-weight: 700; letter-spacing: -0.01em; color: var(--ws-gray-900); }
.ws-chat-app .is-empty .chat-title { visibility: hidden; }
.ws-chat-app .note-btn {
	display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
	border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius-pill); background: var(--ws-white);
	font-size: var(--ws-text-meta); font-weight: 600; color: var(--ws-gray-700); cursor: pointer;
	transition: border-color var(--ws-dur-fast), color var(--ws-dur-fast);
}
.ws-chat-app .note-btn:hover,
.ws-chat-app .note-btn[aria-expanded="true"] { border-color: var(--ws-gray-900); color: var(--ws-gray-900); }
.ws-chat-app .note-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.ws-chat-app .note-pop {
	position: absolute; top: 50px; right: 24px; z-index: 20; width: min(360px, calc(100% - 48px));
	padding: 16px; background: var(--ws-white); border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius-lg);
	box-shadow: var(--ws-shadow-float);
	animation: pop var(--ws-dur) var(--ws-ease-out);
}
.ws-chat-app .note-head { font-size: var(--ws-text-meta); font-weight: 700; color: var(--ws-gray-900); }
.ws-chat-app .note-body { margin: 8px 0 12px; padding: 12px; border-radius: var(--ws-radius-md); background: var(--ws-gray-100); font-size: var(--ws-text-small); line-height: 1.55; color: var(--ws-gray-800); }
.ws-chat-app .note-meta { font-size: 12px; line-height: 1.5; color: var(--ws-gray-600); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

/* Scroller + thread */
.ws-chat-app .scroller {
	flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
	scrollbar-gutter: stable both-edges;
}
.ws-chat-app .is-empty .scroller { flex: 0 0 0; }
.ws-chat-app .thread { max-width: 760px; margin: 0 auto; padding: 8px 24px 32px; display: flex; flex-direction: column; gap: 28px; }

.ws-chat-app .msg { display: flex; gap: 14px; animation: rise 420ms var(--ws-ease-out); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.ws-chat-app .msg-user { justify-content: flex-end; }
.ws-chat-app .bubble {
	max-width: min(80%, 560px); padding: 10px 16px;
	background: var(--ws-gray-900); color: #fff;
	border-radius: 16px 16px 6px 16px;
	white-space: pre-wrap; overflow-wrap: anywhere;
}
.ws-chat-app .bubble-img { display: grid; gap: 6px; justify-items: end; margin-bottom: 8px; }
.ws-chat-app .bubble-img img { width: 200px; max-height: 220px; object-fit: cover; border-radius: 12px; }
.ws-chat-app .bubble-img span,
.ws-chat-app .img-gone { font-size: 12px; color: var(--ws-gray-300); }
.ws-chat-app .img-gone { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; padding: 6px 10px; border: 1px dashed rgb(255 255 255 / .3); border-radius: 8px; }

.ws-chat-app .avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; margin-top: 2px; border-radius: 50%; background: var(--ws-gray-900); }
.ws-chat-app .avatar img { width: 8px; height: auto; filter: invert(0); }
.ws-chat-app .bot-body { min-width: 0; max-width: var(--ws-measure); }
.ws-chat-app .prose { color: var(--ws-gray-800); }
.ws-chat-app .prose > * + * { margin-top: 12px; }
.ws-chat-app .prose p,
.ws-chat-app .prose ul,
.ws-chat-app .prose ol { margin-bottom: 0; }
.ws-chat-app .prose ul,
.ws-chat-app .prose ol { padding-left: 1.3em; }
.ws-chat-app .prose li + li { margin-top: 4px; }
.ws-chat-app .prose strong { color: var(--ws-gray-900); font-weight: 700; }
.ws-chat-app .prose .lyric { padding: 14px 18px; background: var(--ws-gray-50); border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius-md); font-family: var(--ws-font-display); font-size: .9375rem; line-height: 1.75; white-space: pre-line; }
.ws-chat-app .w { opacity: 0; transition: opacity 260ms linear; }
.ws-chat-app .w.on { opacity: 1; }

.ws-chat-app .thinking {
	display: inline-block; padding-top: 4px; font-size: var(--ws-text-small); font-weight: 600;
	background: linear-gradient(90deg, var(--ws-gray-400) 0%, var(--ws-gray-400) 40%, var(--ws-gray-900) 50%, var(--ws-gray-400) 60%, var(--ws-gray-400) 100%);
	background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
	animation: shimmer 1.8s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

.ws-chat-app .actions { display: flex; gap: 2px; margin-top: 8px; margin-left: -10px; opacity: 0; transition: opacity var(--ws-dur); }
.ws-chat-app .msg-bot:hover .actions,
.ws-chat-app .actions:focus-within { opacity: 1; }
@media (hover: none) { .ws-chat-app .actions { opacity: 1; } }
.ws-chat-app .actions .icon-btn { width: 34px; height: 34px; }
.ws-chat-app .actions .icon-btn svg { width: 18px; height: 18px; }

/* Memory fold: messages above this line are summarized into the note */
.ws-chat-app .fold { display: flex; align-items: center; gap: 12px; color: var(--ws-gray-600); font-size: 12px; font-weight: 600; }
.ws-chat-app .fold::before,
.ws-chat-app .fold::after { content: ""; flex: 1; height: 1px; background: var(--ws-gray-200); }
.ws-chat-app .fold button { padding: 0; border: 0; background: none; font: inherit; color: var(--ws-gray-900); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ws-chat-app .msg.folded { opacity: .7; }

/* Limit box (same Ink surface as the site's limit wall) */
.ws-chat-app .limit-box {
	padding: 24px; border-radius: var(--ws-radius-lg); background: var(--ws-gray-900); color: var(--ws-gray-300);
	animation: wall 560ms var(--ws-ease-out);
}
.ws-chat-app .limit-box h3 { margin: 0 0 8px; color: #fff; font-size: var(--ws-text-h3); font-weight: 800; letter-spacing: -0.02em; }
.ws-chat-app .limit-box p { font-size: var(--ws-text-small); }
.ws-chat-app .limit-box .when { margin-top: 14px; display: inline-flex; padding: 8px 14px; border-radius: var(--ws-radius-md); background: #fff; color: var(--ws-gray-900); font-weight: 700; font-size: var(--ws-text-small); }
@keyframes wall { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }

/* Welcome (new chat) */
.ws-chat-app .welcome { display: none; }
.ws-chat-app .is-empty .welcome { display: block; padding: 0 24px 28px; text-align: center; margin-top: auto; animation: rise 600ms var(--ws-ease-out); }
.ws-chat-app .welcome-title { font: 400 var(--ws-text-display-m)/1.2 var(--ws-font-display); color: var(--ws-gray-900); letter-spacing: var(--ws-tracking-display); }
.ws-chat-app .welcome-sub { margin-top: 10px; font-size: var(--ws-text-small); color: var(--ws-gray-600); }

/* Dock: composer pinned to the bottom ---------------------------------- */
.ws-chat-app .dock { position: relative; flex: none; padding: 0 24px max(16px, env(safe-area-inset-bottom)); }
.ws-chat-app .is-empty .dock { margin-bottom: auto; padding-bottom: 12vh; }
.ws-chat-app .dock::before { /* text slides under a soft fade instead of a hard edge */
	content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 28px; pointer-events: none;
	background: linear-gradient(to bottom, rgb(255 255 255 / 0), #fff);
}
.ws-chat-app .is-empty .dock::before { display: none; }
.ws-chat-app .composer,
.ws-chat-app .starters,
.ws-chat-app .dock-meta { max-width: 712px; margin-left: auto; margin-right: auto; }

.ws-chat-app .composer {
	position: relative; padding: 10px 10px 8px 16px;
	background: var(--ws-white); border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius-lg);
	box-shadow: 0 1px 2px rgb(24 24 26 / .04), 0 8px 24px -12px rgb(24 24 26 / .12);
	transition: border-color var(--ws-dur-fast), box-shadow var(--ws-dur-fast);
}
.ws-chat-app .composer:focus-within { border-color: var(--ws-gray-900); box-shadow: 0 0 0 4px rgb(24 24 26 / .08), 0 8px 24px -12px rgb(24 24 26 / .18); }
.ws-chat-app .composer textarea {
	display: block; width: 100%; max-height: 220px; padding: 6px 0 4px; resize: none;
	border: 0; outline: 0; background: none;
	font-size: 16px; line-height: 1.55; color: var(--ws-gray-900);
}
.ws-chat-app .composer textarea::placeholder { color: var(--ws-gray-500); }
.ws-chat-app .composer.is-locked { background: var(--ws-gray-50); }
.ws-chat-app .composer-row { display: flex; align-items: center; gap: 8px; margin-left: -8px; }
.ws-chat-app .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ws-gray-600); font-variant-numeric: tabular-nums; }
.ws-chat-app .count.over { color: var(--ws-error); }
.ws-chat-app .send {
	display: grid; place-items: center; width: 40px; height: 40px; margin-left: auto; padding: 0;
	border: 0; border-radius: var(--ws-radius-md);
	background: var(--ws-gray-900); color: #fff; cursor: pointer;
	transition: background var(--ws-dur-fast), transform var(--ws-dur-fast), box-shadow var(--ws-dur-fast);
}
.ws-chat-app .count:not([hidden]) + .send { margin-left: 4px; }
.ws-chat-app .send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ws-chat-app .send:hover:not(:disabled) { background: var(--ws-black); transform: translateY(-1px); box-shadow: var(--ws-shadow-press); }
.ws-chat-app .send:disabled { background: var(--ws-gray-700); color: rgb(255 255 255 / .55); cursor: default; }
.ws-chat-app .send.is-stop svg { stroke-width: 0; fill: currentColor; }


.ws-chat-app .chip-img { width: 44px; height: 44px; border-radius: 8px; background: var(--ws-gray-200) center / cover no-repeat; }
.ws-chat-app .chip-x { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--ws-gray-600); cursor: pointer; }
.ws-chat-app .chip-x:hover { background: var(--ws-gray-200); color: var(--ws-gray-900); }
.ws-chat-app .chip-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.ws-chat-app .starters { display: none; }
.ws-chat-app .is-empty .starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.ws-chat-app .starters button {
	height: 36px; padding: 0 14px; border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius-pill);
	background: var(--ws-white); font-size: var(--ws-text-small); font-weight: 600; color: var(--ws-gray-700); cursor: pointer;
	transition: border-color var(--ws-dur-fast), color var(--ws-dur-fast);
}
.ws-chat-app .starters button:hover { border-color: var(--ws-gray-900); color: var(--ws-gray-900); }
.ws-chat-app .dock-meta { margin-top: 8px; text-align: center; font-size: 12px; color: var(--ws-gray-600); }
.ws-chat-app .is-empty .dock-meta { margin-top: 20px; }

.ws-chat-app .jump {
	position: absolute; left: 50%; bottom: calc(100% + 12px); z-index: 2; transform: translateX(-50%);
	display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
	border: 1px solid var(--ws-gray-200); border-radius: 50%; background: var(--ws-white); color: var(--ws-gray-900);
	box-shadow: var(--ws-shadow-float); cursor: pointer; animation: pop var(--ws-dur) var(--ws-ease-out);
}
.ws-chat-app .jump svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Tablet / phone ------------------------------------------------------- */
@media (max-width: 960px) {
	.ws-chat-app { grid-template-columns: 1fr; }
	.ws-chat-app .side-toggle { display: inline-grid; }
	.ws-chat-app .side {
		position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: min(300px, 86vw);
		transform: translateX(-100%); transition: transform 280ms var(--ws-ease-out);
	}
	.ws-chat-app .side.is-open { transform: none; box-shadow: var(--ws-shadow-float); }
	.ws-chat-app .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgb(0 0 0 / .32); }
	.ws-chat-app .scrim[hidden] { display: none !important; }
}
@media (max-width: 640px) {
	.ws-chat-app .topbar { height: 48px; padding: 0 16px; }
	.ws-chat-app .thread { padding: 4px 16px 24px; gap: 24px; }
	.ws-chat-app .avatar { display: none; }
	.ws-chat-app .bubble { max-width: 86%; }
	.ws-chat-app .dock { padding: 0 12px max(10px, env(safe-area-inset-bottom)); }
	.ws-chat-app .is-empty .dock { padding-bottom: 6vh; }
	.ws-chat-app .dock-meta { font-size: 11px; }
	.ws-chat-app .is-empty .starters { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-left: -12px; margin-right: -12px; padding: 0 12px; scrollbar-width: none; }
	.ws-chat-app .starters button { flex: none; }
	.ws-chat-app .note-btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ws-chat-app *,
.ws-chat-app *::before,
.ws-chat-app *::after { animation: none !important; transition: none !important; }
	.ws-chat-app .w { opacity: 1; }
}


/* Deleting chats ------------------------------------------------------- */
.ws-chat-app .chat-list li { display: flex; align-items: center; border-radius: var(--ws-radius-md); }
.ws-chat-app .chat-list .chat-open { flex: 1; min-width: 0; }
.ws-chat-app .chat-list li:has(.chat-open[aria-current="true"]) { background: var(--ws-gray-200); }

.ws-chat-app .chat-list li:hover { background: var(--ws-gray-100); }
.ws-chat-app .chat-list li:has(.chat-open[aria-current="true"]):hover { background: var(--ws-gray-200); }
.ws-chat-app .chat-list .chat-open:hover { background: none; }
.ws-chat-app .chat-del { width: 32px; height: 32px; margin-right: 4px; opacity: 0; }
.ws-chat-app .chat-del svg { width: 17px; height: 17px; }
.ws-chat-app .chat-list li:hover .chat-del,
.ws-chat-app .chat-del:focus-visible { opacity: 1; }
.ws-chat-app .chat-del:hover { background: var(--ws-gray-300); color: var(--ws-gray-900); }
@media (hover: none) { .ws-chat-app .chat-del { opacity: 1; } }
.ws-chat-app .list-empty { padding: 9px 10px; font-size: var(--ws-text-small); color: var(--ws-gray-600); }
.ws-chat-app .chat-list li.is-confirming,
.ws-chat-app .chat-list li.is-confirming:hover { background: none; }

.ws-chat-app .row-confirm { width: 100%; margin: 2px 0; padding: 12px; background: var(--ws-white); border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius-md); animation: pop var(--ws-dur) var(--ws-ease-out); }
.ws-chat-app .row-confirm p { font-size: var(--ws-text-small); line-height: 1.45; color: var(--ws-gray-800); }
.ws-chat-app .row-confirm strong { font-weight: 700; color: var(--ws-gray-900); overflow-wrap: anywhere; }
.ws-chat-app .del-row { display: flex; gap: 8px; margin-top: 10px; }
.ws-chat-app .del-yes,
.ws-chat-app .del-no { height: 34px; padding: 0 14px; border-radius: var(--ws-radius-md); font-size: var(--ws-text-small); font-weight: 700; cursor: pointer; transition: background var(--ws-dur-fast), border-color var(--ws-dur-fast); }
.ws-chat-app .del-yes { border: 0; background: var(--ws-gray-900); color: #fff; }
.ws-chat-app .del-yes:hover { background: var(--ws-black); }
.ws-chat-app .del-no { border: 1.5px solid var(--ws-gray-200); background: var(--ws-white); color: var(--ws-gray-900); }
.ws-chat-app .del-no:hover { border-color: var(--ws-gray-900); }

.ws-chat-app .del-all { margin: 6px 10px 0; }
.ws-chat-app .del-all .row-confirm { margin: 8px -10px 0; width: auto; }
.ws-chat-app .del-all-btn { padding: 0; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--ws-gray-600); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ws-chat-app .del-all-btn:hover { color: var(--ws-gray-900); }

.ws-chat-app .top-actions { display: flex; align-items: center; gap: 4px; }
.ws-chat-app .top-actions .icon-btn { width: 36px; height: 36px; }
.ws-chat-app .top-actions .icon-btn svg { width: 19px; height: 19px; }
.ws-chat-app .del-pop {
	position: absolute; top: 50px; right: 24px; z-index: 20; width: min(300px, calc(100% - 48px));
	padding: 16px; background: var(--ws-white); border: 1px solid var(--ws-gray-200); border-radius: var(--ws-radius-lg);
	box-shadow: var(--ws-shadow-float); animation: pop var(--ws-dur) var(--ws-ease-out);
}
.ws-chat-app .del-q { font-weight: 700; color: var(--ws-gray-900); }
.ws-chat-app .del-sub { margin-top: 4px; font-size: var(--ws-text-small); line-height: 1.45; color: var(--ws-gray-600); }
@media (max-width: 640px) { .ws-chat-app .del-pop { right: 16px; } }

/* Several images per message ------------------------------------------- */
.ws-chat-app .attach-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 8px; }
.ws-chat-app .chip { position: relative; display: block; }
.ws-chat-app .chip .chip-img { display: block; width: 56px; height: 56px; border-radius: 10px; border: 1px solid var(--ws-gray-200); }
.ws-chat-app .chip .chip-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ws-gray-900); color: #fff; box-shadow: 0 0 0 2px #fff; }
.ws-chat-app .chip .chip-x:hover { background: var(--ws-black); color: #fff; }
.ws-chat-app .chip .chip-x svg { width: 11px; height: 11px; stroke-width: 2.4; }
.ws-chat-app .chip-note { margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--ws-gray-600); }
.ws-chat-app .bubble-thumbs { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ws-chat-app .bubble-img.is-many .bubble-thumbs img { width: 120px; height: 120px; max-height: none; object-fit: cover; }

/* Dark mode switch ------------------------------------------------------ */
.ws-chat-app .theme-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: var(--ws-text-meta); font-weight: 600; color: var(--ws-gray-700); }
.ws-chat-app .switch { position: relative; width: 38px; height: 22px; padding: 0; border: 0; border-radius: var(--ws-radius-pill); background: var(--ws-gray-300); cursor: pointer; transition: background var(--ws-dur) var(--ws-ease-out); }
.ws-chat-app .switch .knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ws-white); box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform var(--ws-dur) var(--ws-ease-out); }
.ws-chat-app .switch[aria-checked="true"] { background: var(--ws-gray-900); }
.ws-chat-app .switch[aria-checked="true"] .knob { transform: translateX(16px); }

/* Light/dark change: a slower, soft cross-fade (default was ~250ms) */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 650ms; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
.ws-chat-app .switch,
.ws-chat-app .switch .knob { transition-duration: 400ms; }
/* Browsers without view transitions: fade colors instead of snapping */
html.is-theming,
html.is-theming * { transition: background-color 650ms ease, color 650ms ease, border-color 650ms ease, box-shadow 650ms ease !important; }

/* ---- Dark mode (from the mock) ---- */
html[data-theme="dark"] .ws-chat {
	color-scheme: dark;
	--ws-white:    #18181A;  /* Ink: cards, popovers */
	--ws-gray-50:  #1F1F22;  /* raised: lyric blocks */
	--ws-gray-100: #26262A;  /* hover fill, note box */
	--ws-gray-200: #2E2E33;  /* hairlines, selected row */
	--ws-gray-300: #3D3D43;  /* hover edges, switch track */
	--ws-gray-400: #6F6C77;
	--ws-gray-500: #8E8A97;  /* placeholder */
	--ws-gray-600: #A3A0AB;  /* muted text, 7:1 on Ink */
	--ws-gray-700: #BEBBC2;
	--ws-gray-800: #E4E2E9;  /* body */
	--ws-gray-900: #F8F7FA;  /* headings, strong */
	--ws-black:    #FFFFFF;  /* hover of "ink" buttons, now light */
	--ws-surface-page: #000;
	--ws-shadow-float: 0 16px 40px -10px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .08);
	--ws-shadow-hover: 0 8px 20px -10px rgb(0 0 0 / .8);
	--ws-shadow-press: 0 10px 28px -10px rgb(255 255 255 / .28);
	--ws-error: #F97066;
}


/* Sidebar sits a step darker than the conversation */
html[data-theme="dark"] .ws-chat-app .side { background: #121214; border-right-color: rgb(255 255 255 / .08); }

/* Your messages: Gray 800 bubble, light text */
html[data-theme="dark"] .ws-chat-app .bubble { background: #2D2C30; color: #F8F7FA; }
html[data-theme="dark"] .ws-chat-app .bubble-img span { color: #A3A0AB; }
html[data-theme="dark"] .ws-chat-app .img-gone { color: #A3A0AB; border-color: rgb(255 255 255 / .24); }
html[data-theme="dark"] .ws-chat-app .avatar { background: #2D2C30; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }

/* Message box: Black field, white text, white focus edge */
html[data-theme="dark"] .ws-chat-app .composer { background: #0B0B0C; border-color: rgb(255 255 255 / .12); box-shadow: none; }
html[data-theme="dark"] .ws-chat-app .composer:focus-within { border-color: rgb(255 255 255 / .6); box-shadow: 0 0 0 4px rgb(255 255 255 / .08); }
html[data-theme="dark"] .ws-chat-app .composer.is-locked { background: #141416; }
html[data-theme="dark"] .ws-chat-app .dock::before { background: linear-gradient(to bottom, rgb(24 24 26 / 0), #18181A); }

/* Send: white "lit from above" like Get Access; waiting stays quiet */
html[data-theme="dark"] .ws-chat-app .send { background: var(--ws-glow-fill); color: #18181A; box-shadow: var(--ws-glow-rest); }
html[data-theme="dark"] .ws-chat-app .send:hover:not(:disabled) { background: #fff; box-shadow: var(--ws-glow-hover); }
html[data-theme="dark"] .ws-chat-app .send:disabled { background: #2E2E33; color: rgb(255 255 255 / .38); box-shadow: none; }

/* Ink buttons turn white with Ink text */
html[data-theme="dark"] .ws-chat-app .del-yes { color: #18181A; }
html[data-theme="dark"] .ws-chat-app .chip .chip-x { color: #18181A; box-shadow: 0 0 0 2px #0B0B0C; }
html[data-theme="dark"] .ws-chat-app .chip .chip-x:hover { color: #18181A; }

/* Limit box: Gray 800 so it reads as raised (as on image tools) */
html[data-theme="dark"] .ws-chat-app .limit-box { background: #2D2C30; color: #BEBBC2; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
html[data-theme="dark"] .ws-chat-app .limit-box .when { color: #18181A; }

/* Popovers and confirm boxes: a step up from the card, faint edge */
html[data-theme="dark"] .ws-chat-app .note-pop,
html[data-theme="dark"] .ws-chat-app .del-pop,
html[data-theme="dark"] .ws-chat-app .ws-none { background: #1F1F22; border-color: rgb(255 255 255 / .1); }
html[data-theme="dark"] .ws-chat-app .row-confirm { background: #1F1F22; border-color: rgb(255 255 255 / .1); }
html[data-theme="dark"] .ws-chat-app .note-body { background: #121214; }

/* Faint edges on outlined controls */
html[data-theme="dark"] .ws-chat-app .new-chat,
html[data-theme="dark"] .ws-chat-app .note-btn,
html[data-theme="dark"] .ws-chat-app .starters button,
html[data-theme="dark"] .ws-chat-app .del-no,
html[data-theme="dark"] .ws-chat-app .jump { border-color: rgb(255 255 255 / .12); }
html[data-theme="dark"] .ws-chat-app .new-chat:hover,
html[data-theme="dark"] .ws-chat-app .starters button:hover,
html[data-theme="dark"] .ws-chat-app .note-btn:hover,
html[data-theme="dark"] .ws-chat-app .del-no:hover { border-color: rgb(255 255 255 / .4); }
html[data-theme="dark"] .ws-chat-app .prose .lyric { border-color: rgb(255 255 255 / .08); }
html[data-theme="dark"] .ws-chat-app .switch .knob { background: #18181A; }
html[data-theme="dark"] .ws-chat-app .switch[aria-checked="false"] .knob { background: #F8F7FA; }

